Skip to content

Commit 6f0cde6

Browse files
committed
SDK release 2.24361.0.1-PreRelease checkin
1 parent e63c059 commit 6f0cde6

File tree

11 files changed

+273
-75
lines changed

11 files changed

+273
-75
lines changed

Src/CodeFactoryForWindows/CodeFactory.Packager.WinVs/CodeFactoryWinVsSDK.nuspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd" >
33
<metadata>
44
<id>CodeFactory.WinVs.SDK</id>
5-
<version>2.24359.0.1-PreRelease</version>
5+
<version>2.24361.0.1-PreRelease</version>
66
<title>CodeFactory Software Development Kit for Visual Studio - Windows</title>
77
<authors>CodeFactory, LLC.</authors>
88
<owners>CodeFactory, LLC.</owners>
@@ -19,9 +19,9 @@
1919
<copyright>Copyright © 2024 CodeFactory, LLC.</copyright>
2020
<tags>Factory Automation</tags>
2121
<dependencies>
22-
<dependency id="CodeFactory" version="2.24359.0.1-PreRelease"/>
23-
<dependency id="CodeFactory.WinVs" version="2.24359.0.1-PreRelease"/>
24-
<dependency id="CodeFactory.WinVs.Wpf" version="2.24359.0.1-PreRelease"/>
22+
<dependency id="CodeFactory" version="2.24361.0.1-PreRelease"/>
23+
<dependency id="CodeFactory.WinVs" version="2.24361.0.1-PreRelease"/>
24+
<dependency id="CodeFactory.WinVs.Wpf" version="2.24361.0.1-PreRelease"/>
2525
</dependencies>
2626
<icon>CFLogo128.png</icon>
2727
</metadata>

Src/CodeFactoryForWindows/CodeFactory.Packager.WinVs/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
[assembly: AssemblyVersion("2.0.0.0")]
36-
[assembly: AssemblyFileVersion("2.24359.0.1")]
36+
[assembly: AssemblyFileVersion("2.24361.0.1")]

Src/CodeFactoryForWindows/CodeFactory.WinVs.Wpf/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
[assembly: AssemblyVersion("2.0.0.0")]
36-
[assembly: AssemblyFileVersion("2.24359.0.1")]
36+
[assembly: AssemblyFileVersion("2.24361.0.1")]

Src/CodeFactoryForWindows/CodeFactory.WinVs.Wpf/WinVsWpf.nuspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd" >
33
<metadata>
44
<id>CodeFactory.WinVs.Wpf</id>
5-
<version>2.24359.0.1-PreRelease</version>
5+
<version>2.24361.0.1-PreRelease</version>
66
<title>CodeFactory User Interface WPF for Visual Studio - Windows</title>
77
<authors>CodeFactory, LLC.</authors>
88
<owners>CodeFactory, LLC.</owners>
@@ -13,8 +13,8 @@
1313
<copyright>Copyright © 2024 CodeFactory, LLC.</copyright>
1414
<tags>Factory Automation</tags>
1515
<dependencies>
16-
<dependency id="CodeFactory" version="2.24359.0.1-PreRelease"/>
17-
<dependency id="CodeFactory.WinVs" version="2.24359.0.1-PreRelease"/>
16+
<dependency id="CodeFactory" version="2.24361.0.1-PreRelease"/>
17+
<dependency id="CodeFactory.WinVs" version="2.24361.0.1-PreRelease"/>
1818
</dependencies>
1919
<icon>CFLogo128.png</icon>
2020
</metadata>

Src/CodeFactoryForWindows/CodeFactory.WinVs/CodeFactory.WinVs.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<SignAssembly>True</SignAssembly>
66
<AssemblyOriginatorKeyFile>CFSigner.snk</AssemblyOriginatorKeyFile>
77
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
8-
<Version>2.24359.0.1-PreRelease</Version>
8+
<Version>2.24361.0.1-PreRelease</Version>
99
<Authors>CodeFactory, LLC.</Authors>
1010
<Company>CodeFactory, LLC.</Company>
1111
<Product>CodeFactory Base Library</Product>
@@ -16,10 +16,10 @@
1616
<IncludeSymbols>False</IncludeSymbols>
1717
<Title>CodeFactory API for Visual Studio - Windows </Title>
1818
<AssemblyVersion>2.0.0.0</AssemblyVersion>
19-
<FileVersion>2.24359.0.1</FileVersion>
19+
<FileVersion>2.24361.0.1</FileVersion>
2020
<PackageIcon>CFLogo128.png</PackageIcon>
2121
<PackageReleaseNotes>
22-
Release Updates for 2.24359.0.1
22+
Release Updates for 2.24361.0.1
2323

2424
Execution logging for CodeFactory Commands
2525
- CommandNotifications has been added to CodeFactory commands. This allows real time logging of what happened in a command to log to the CodeFactory output window.

Src/CodeFactoryForWindows/CodeFactory.WinVs/Loader/SdkSupport.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ public static class SdkSupport
2323
/// <summary>
2424
/// The maximum version of the SDK that can be loaded and used.
2525
/// </summary>
26-
public const string MaxVersion = "2.24359.0.1";
26+
public const string MaxVersion = "2.24361.0.1";
2727

2828
/// <summary>
2929
/// The target version of the NuGet package this SDK is deployed from.
3030
/// </summary>
31-
public const string NuGetSdkVersion = "2.24359.0.1-PreRelease";
31+
public const string NuGetSdkVersion = "2.24361.0.1-PreRelease";
3232

3333
/// <summary>
3434
/// The name of the assembly type for the CodeFactory SDK version attribute.

Src/CodeFactoryForWindows/CodeFactory.WinVs/Models/CSharp/Builder/SourceClassManager.cs

Lines changed: 107 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Linq;
44
using System.Text;
55
using System.Threading.Tasks;
6+
using CodeFactory.WinVs.Stats;
67

78
namespace CodeFactory.WinVs.Models.CSharp.Builder
89
{
@@ -81,28 +82,45 @@ public override async Task AddMissingUsingStatementsAsync()
8182
/// <exception cref="ArgumentNullException">Thrown if either the source or the container is null after updating.</exception>
8283
public override async Task FieldsAddBeforeAsync(string syntax)
8384
{
84-
if (string.IsNullOrEmpty(syntax)) return;
85+
await FieldsAddBeforeTransactionAsync(syntax);
86+
}
87+
88+
/// <summary>
89+
/// Adds the provided syntax before the field definitions.
90+
/// </summary>
91+
/// <param name="syntax">Target syntax to be added.</param>
92+
/// <exception cref="ArgumentNullException">Thrown if either the source or the container is null after updating.</exception>
93+
/// <returns>The details of the updated source or null if the transaction details could not be saved.</returns>
94+
public override async Task<TransactionDetail> FieldsAddBeforeTransactionAsync(string syntax)
95+
{
96+
if (string.IsNullOrEmpty(syntax)) return null;
8597
var source = Source ?? throw new ArgumentNullException(nameof(Source));
8698
var container = Container ?? throw new ArgumentNullException(nameof(Container));
8799

88100
var sourceDoc = source.SourceDocument;
89101

102+
TransactionDetail result = null;
103+
90104
if (container.Fields.Any(f => f.ModelSourceFile == sourceDoc & f.LoadedFromSource))
91105
{
92106
var fieldData = container.Fields.First(f => f.ModelSourceFile == sourceDoc & f.LoadedFromSource);
93107

94-
var updatedSource = await fieldData.AddBeforeAsync(syntax);
108+
var updatedSource = await fieldData.AddBeforeTransactionAsync(syntax);
95109

96-
if (updatedSource == null) throw new ArgumentNullException(nameof(Source));
110+
if (updatedSource?.Source == null) throw new ArgumentNullException(nameof(Source));
97111

98-
var updatedContainer = updatedSource.GetModel<CsClass>(ContainerPath);
112+
var updatedContainer = updatedSource.Source.GetModel<CsClass>(ContainerPath);
99113

100-
UpdateSources(updatedSource, updatedContainer);
114+
UpdateSources(updatedSource.Source, updatedContainer);
115+
116+
result = updatedSource.Transaction;
101117
}
102118
else
103119
{
104-
await this.ContainerAddToBeginningAsync(syntax);
120+
result = await this.ContainerAddToBeginningTransactionAsync(syntax);
105121
}
122+
123+
return result;
106124
}
107125

108126
/// <summary>
@@ -136,35 +154,89 @@ public override async Task FieldsAddAfterAsync(string syntax)
136154
}
137155
}
138156

157+
/// <summary>
158+
/// Adds the provided syntax after the field definitions.
159+
/// </summary>
160+
/// <param name="syntax">Target syntax to be added.</param>
161+
/// <exception cref="ArgumentNullException">Thrown if either the source or the container is null after updating.</exception>
162+
/// <returns>The details of the updated source or null if the transaction details could not be saved.</returns>
163+
public override async Task<TransactionDetail> FieldsAddAfterTransactionAsync(string syntax)
164+
{
165+
if (string.IsNullOrEmpty(syntax)) return null;
166+
var source = Source ?? throw new ArgumentNullException(nameof(Source));
167+
var container = Container ?? throw new ArgumentNullException(nameof(Container));
168+
169+
var sourceDoc = source.SourceDocument;
170+
171+
TransactionDetail result = null;
172+
173+
if (container.Fields.Any(f => f.ModelSourceFile == sourceDoc & f.LoadedFromSource))
174+
{
175+
var fieldData = container.Fields.Last(f => f.ModelSourceFile == sourceDoc & f.LoadedFromSource);
176+
177+
var updatedSource = await fieldData.AddAfterTransactionAsync(syntax);
178+
179+
if (updatedSource?.Source == null) throw new ArgumentNullException(nameof(Source));
180+
181+
var updatedContainer = updatedSource.Source.GetModel<CsClass>(ContainerPath);
182+
183+
UpdateSources(updatedSource.Source, updatedContainer);
184+
185+
result = updatedSource.Transaction;
186+
}
187+
else
188+
{
189+
result = await this.ContainerAddToBeginningTransactionAsync(syntax);
190+
}
191+
192+
return result;
193+
}
194+
139195
/// <summary>
140196
/// Add the provided syntax before the constructor definitions.
141197
/// </summary>
142198
/// <param name="syntax">Target syntax to be added.</param>
143199
/// <exception cref="ArgumentNullException">Thrown if either the source or the container is null after updating.</exception>
144200
public override async Task ConstructorsAddBeforeAsync(string syntax)
145201
{
146-
if (string.IsNullOrEmpty(syntax)) return;
202+
await ConstructorsAddBeforeTransactionAsync(syntax);
203+
}
204+
205+
/// <summary>
206+
/// Add the provided syntax before the constructor definitions.
207+
/// </summary>
208+
/// <param name="syntax">Target syntax to be added.</param>
209+
/// <exception cref="ArgumentNullException">Thrown if either the source or the container is null after updating.</exception>
210+
/// <returns>The details of the updated source or null if the transaction details could not be saved.</returns>
211+
public override async Task<TransactionDetail> ConstructorsAddBeforeTransactionAsync(string syntax)
212+
{
213+
if (string.IsNullOrEmpty(syntax)) return null;
147214
var source = Source ?? throw new ArgumentNullException(nameof(Source));
148215
var container = Container ?? throw new ArgumentNullException(nameof(Container));
149216

150217
var sourceDoc = source.SourceDocument;
151218

219+
TransactionDetail result = null;
152220
if (container.Constructors.Any(c => c.ModelSourceFile == sourceDoc & c.LoadedFromSource))
153221
{
154222
var constData = container.Constructors.First(c => c.ModelSourceFile == sourceDoc & c.LoadedFromSource);
155223

156-
var updatedSource = await constData.AddBeforeAsync(syntax);
224+
var updatedSource = await constData.AddBeforeTransactionAsync(syntax);
157225

158-
if (updatedSource == null) throw new ArgumentNullException(nameof(Source));
226+
if (updatedSource?.Source == null) throw new ArgumentNullException(nameof(Source));
159227

160-
var updatedContainer = updatedSource.GetModel<CsClass>(ContainerPath);
228+
var updatedContainer = updatedSource.Source.GetModel<CsClass>(ContainerPath);
161229

162-
UpdateSources(updatedSource, updatedContainer);
230+
UpdateSources(updatedSource.Source, updatedContainer);
231+
232+
result = updatedSource.Transaction;
163233
}
164234
else
165235
{
166-
await this.FieldsAddAfterAsync(syntax);
236+
result = await this.FieldsAddAfterTransactionAsync(syntax);
167237
}
238+
239+
return result;
168240
}
169241

170242
/// <summary>
@@ -174,28 +246,45 @@ public override async Task ConstructorsAddBeforeAsync(string syntax)
174246
/// <exception cref="ArgumentNullException">Thrown if either the source or the container is null after updating.</exception>
175247
public override async Task ConstructorsAddAfterAsync(string syntax)
176248
{
177-
if (string.IsNullOrEmpty(syntax)) return;
249+
await ConstructorsAddAfterTransactionAsync(syntax);
250+
}
251+
252+
/// <summary>
253+
/// Add the provided syntax after the constructor definitions.
254+
/// </summary>
255+
/// <param name="syntax">Target syntax to be added.</param>
256+
/// <exception cref="ArgumentNullException">Thrown if either the source or the container is null after updating.</exception>
257+
/// <returns>The details of the updated source or null if the transaction details could not be saved.</returns>
258+
public override async Task<TransactionDetail> ConstructorsAddAfterTransactionAsync(string syntax)
259+
{
260+
if (string.IsNullOrEmpty(syntax)) return null;
178261
var source = Source ?? throw new ArgumentNullException(nameof(Source));
179262
var container = Container ?? throw new ArgumentNullException(nameof(Container));
180263

181264
var sourceDoc = source.SourceDocument;
182265

266+
TransactionDetail result = null;
267+
183268
if (container.Constructors.Any(c => c.ModelSourceFile == sourceDoc & c.LoadedFromSource))
184269
{
185270
var constData = container.Constructors.Last(c => c.ModelSourceFile == sourceDoc & c.LoadedFromSource);
186271

187-
var updatedSource = await constData.AddAfterAsync(syntax);
272+
var updatedSource = await constData.AddAfterTransactionAsync(syntax);
188273

189-
if (updatedSource == null) throw new ArgumentNullException(nameof(Source));
274+
if (updatedSource?.Source == null) throw new ArgumentNullException(nameof(Source));
190275

191-
var updatedContainer = updatedSource.GetModel<CsClass>(ContainerPath);
276+
var updatedContainer = updatedSource.Source.GetModel<CsClass>(ContainerPath);
192277

193-
UpdateSources(updatedSource, updatedContainer);
278+
UpdateSources(updatedSource.Source, updatedContainer);
279+
280+
result = updatedSource.Transaction;
194281
}
195282
else
196283
{
197-
await this.FieldsAddAfterAsync(syntax);
284+
result = await this.FieldsAddAfterTransactionAsync(syntax);
198285
}
286+
287+
return result;
199288
}
200289
}
201290
}

Src/CodeFactoryForWindows/CodeFactory.WinVs/Models/CSharp/Builder/SourceContainerManager.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,8 @@ public async Task<TransactionDetail> UsingStatementsAddAfterTransactionAsync(str
446446
/// <param name="syntax">Target syntax to be added.</param>
447447
/// <exception cref="ArgumentNullException">Thrown if either the source or the container is null after updating.</exception>
448448
/// <returns>The details of the updated source or null if the transaction details could not be saved.</returns>
449-
public async Task<TransactionDetail> FieldsAddBeforeTransactionAsync(string syntax)
450-
{
451-
throw new NotImplementedException();
452-
}
449+
public abstract Task<TransactionDetail> FieldsAddBeforeTransactionAsync(string syntax);
450+
453451

454452
/// <summary>
455453
/// Adds the provided syntax after the field definitions.
@@ -464,10 +462,8 @@ public async Task<TransactionDetail> FieldsAddBeforeTransactionAsync(string synt
464462
/// <param name="syntax">Target syntax to be added.</param>
465463
/// <exception cref="ArgumentNullException">Thrown if either the source or the container is null after updating.</exception>
466464
/// <returns>The details of the updated source or null if the transaction details could not be saved.</returns>
467-
public async Task<TransactionDetail> FieldsAddAfterTransactionAsync(string syntax)
468-
{
469-
throw new NotImplementedException();
470-
}
465+
public abstract Task<TransactionDetail> FieldsAddAfterTransactionAsync(string syntax);
466+
471467

472468
/// <summary>
473469
/// Add the provided syntax before the constructor definitions.

0 commit comments

Comments
 (0)