Skip to content

Commit 848ea0d

Browse files
committed
Updated to include new document management functions in SDK.
Cleanup of documentation.
1 parent 0bec7b2 commit 848ea0d

File tree

19 files changed

+1661
-47
lines changed

19 files changed

+1661
-47
lines changed

src/CodeFactoryVisualStudio/CodeFactory.DotNet/CSharp/CsContainer.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,33 @@ protected CsContainer(bool isLoaded, bool hasErrors, bool loadedFromSource, Sour
153153
/// </summary>
154154
public string Documentation => _documentation;
155155

156+
/// <summary>
157+
/// Adds the supplied source code directly before the documentation.
158+
/// </summary>
159+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
160+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
161+
public abstract Task<CsSource> AddBeforeDocsAsync(string sourceCode);
162+
163+
/// <summary>
164+
/// Adds the supplied source code directly after the documentation.
165+
/// </summary>
166+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
167+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
168+
public abstract Task<CsSource> AddAfterDocsAsync(string sourceCode);
169+
170+
/// <summary>
171+
/// Replaces the supplied source code directly this the documentation.
172+
/// </summary>
173+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
174+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
175+
public abstract Task<CsSource> ReplaceDocsAsync(string sourceCode);
176+
177+
/// <summary>
178+
/// Deletes the documentation from the target supporting code artifact.
179+
/// </summary>
180+
/// <returns>Updated <see cref="CsSource"/> model with the documentation removed.</returns>
181+
public abstract Task<CsSource> DeleteDocsAsync();
182+
156183
/// <summary>
157184
/// The parent to the current model. This will return null if there is no parent for this model, or the parent could not be located.
158185
/// </summary>

src/CodeFactoryVisualStudio/CodeFactory.DotNet/CSharp/CsDelegate.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,33 @@ protected CsDelegate(bool isLoaded, bool hasErrors, bool loadedFromSource, Sourc
157157
/// </summary>
158158
public string Documentation => _documentation;
159159

160+
/// <summary>
161+
/// Adds the supplied source code directly before the documentation.
162+
/// </summary>
163+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
164+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
165+
public abstract Task<CsSource> AddBeforeDocsAsync(string sourceCode);
166+
167+
/// <summary>
168+
/// Adds the supplied source code directly after the documentation.
169+
/// </summary>
170+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
171+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
172+
public abstract Task<CsSource> AddAfterDocsAsync(string sourceCode);
173+
174+
/// <summary>
175+
/// Replaces the supplied source code directly this the documentation.
176+
/// </summary>
177+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
178+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
179+
public abstract Task<CsSource> ReplaceDocsAsync(string sourceCode);
180+
181+
/// <summary>
182+
/// Deletes the documentation from the target supporting code artifact.
183+
/// </summary>
184+
/// <returns>Updated <see cref="CsSource"/> model with the documentation removed.</returns>
185+
public abstract Task<CsSource> DeleteDocsAsync();
186+
160187
/// <summary>
161188
/// The parent to the current model. This will return null if there is no parent for this model, or the parent could not be located.
162189
/// </summary>

src/CodeFactoryVisualStudio/CodeFactory.DotNet/CSharp/CsEnum.cs

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,33 @@ protected CsEnum(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCod
105105
/// </summary>
106106
public string Documentation => _documentation;
107107

108+
/// <summary>
109+
/// Adds the supplied source code directly before the documentation.
110+
/// </summary>
111+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
112+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
113+
public abstract Task<CsSource> AddBeforeDocsAsync(string sourceCode);
114+
115+
/// <summary>
116+
/// Adds the supplied source code directly after the documentation.
117+
/// </summary>
118+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
119+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
120+
public abstract Task<CsSource> AddAfterDocsAsync(string sourceCode);
121+
122+
/// <summary>
123+
/// Replaces the supplied source code directly this the documentation.
124+
/// </summary>
125+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
126+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
127+
public abstract Task<CsSource> ReplaceDocsAsync(string sourceCode);
128+
129+
/// <summary>
130+
/// Deletes the documentation from the target supporting code artifact.
131+
/// </summary>
132+
/// <returns>Updated <see cref="CsSource"/> model with the documentation removed.</returns>
133+
public abstract Task<CsSource> DeleteDocsAsync();
134+
108135
/// <summary>
109136
/// The fully qualified path for this model that can be used when searching the source for the model.
110137
/// </summary>
@@ -172,39 +199,39 @@ protected CsEnum(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCod
172199
public abstract Task<CsSource> AddAfterAsync(string sourceCode);
173200

174201
/// <summary>
175-
/// Deletes the definition of the delegate from the source document.
202+
/// Deletes the definition of the enumeration from the source document.
176203
/// </summary>
177-
/// <param name="sourceDocument">The source document that the delegate is to be removed from.</param>
178-
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the delegate has been removed from the document.</returns>
204+
/// <param name="sourceDocument">The source document that the enumeration is to be removed from.</param>
205+
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the enumeration has been removed from the document.</returns>
179206
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
180207
[Obsolete("No longer support will be removed in later edition, you no longer need to pass the source document.",false)]
181208
public abstract Task<CsSource> DeleteAsync(string sourceDocument);
182209

183210
/// <summary>
184-
/// Deletes the definition of the delegate from the source document.
211+
/// Deletes the definition of the enumeration from the source document.
185212
/// </summary>
186-
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the delegate has been removed from the document.</returns>
213+
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the enumeration has been removed from the document.</returns>
187214
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
188215
public abstract Task<CsSource> DeleteAsync();
189216

190217
/// <summary>
191-
/// Gets the starting and ending locations within the document where the delegate is located.
218+
/// Gets the starting and ending locations within the document where the enumeration is located.
192219
/// </summary>
193-
/// <param name="sourceDocument">The fully qualified path to the document that has the delegate defined in.</param>
194-
/// <returns>The source location for the delegate.</returns>
220+
/// <param name="sourceDocument">The fully qualified path to the document that has the enumeration defined in.</param>
221+
/// <returns>The source location for the enumeration.</returns>
195222
/// <exception cref="DocumentException">Raised when an error occurs getting the location from the document.</exception>
196223
[Obsolete("No longer support will be removed in later edition, you no longer need to pass the source document.",false)]
197224
public abstract Task<ISourceLocation> GetSourceLocationAsync(string sourceDocument);
198225

199226
/// <summary>
200-
/// Gets the starting and ending locations within the document where the delegate is located.
227+
/// Gets the starting and ending locations within the document where the enumeration is located.
201228
/// </summary>
202-
/// <returns>The source location for the delegate.</returns>
229+
/// <returns>The source location for the enumeration.</returns>
203230
/// <exception cref="DocumentException">Raised when an error occurs getting the location from the document.</exception>
204231
public abstract Task<ISourceLocation> GetSourceLocationAsync();
205232

206233
/// <summary>
207-
/// Replaces the current delegate with the provided source code.
234+
/// Replaces the current enumeration with the provided source code.
208235
/// </summary>
209236
/// <param name="sourceDocument">The fully qualified path to the source code document to be updated.</param>
210237
/// <param name="sourceCode">The source code that is to be used to replace the original definition in the document.</param>
@@ -214,7 +241,7 @@ protected CsEnum(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCod
214241
public abstract Task<CsSource> ReplaceAsync(string sourceDocument, string sourceCode);
215242

216243
/// <summary>
217-
/// Replaces the current delegate with the provided source code.
244+
/// Replaces the current enumeration with the provided source code.
218245
/// </summary>
219246
/// <param name="sourceCode">The source code that is to be used to replace the original definition in the document.</param>
220247
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>

src/CodeFactoryVisualStudio/CodeFactory.DotNet/CSharp/CsEnumValue.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,33 @@ protected CsEnumValue(bool isLoaded, bool hasErrors, bool loadedFromSource, Sour
104104
/// </summary>
105105
public string Documentation => _documentation;
106106

107+
/// <summary>
108+
/// Adds the supplied source code directly before the documentation.
109+
/// </summary>
110+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
111+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
112+
public abstract Task<CsSource> AddBeforeDocsAsync(string sourceCode);
113+
114+
/// <summary>
115+
/// Adds the supplied source code directly after the documentation.
116+
/// </summary>
117+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
118+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
119+
public abstract Task<CsSource> AddAfterDocsAsync(string sourceCode);
120+
121+
/// <summary>
122+
/// Replaces the supplied source code directly this the documentation.
123+
/// </summary>
124+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
125+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
126+
public abstract Task<CsSource> ReplaceDocsAsync(string sourceCode);
127+
128+
/// <summary>
129+
/// Deletes the documentation from the target supporting code artifact.
130+
/// </summary>
131+
/// <returns>Updated <see cref="CsSource"/> model with the documentation removed.</returns>
132+
public abstract Task<CsSource> DeleteDocsAsync();
133+
107134
/// <summary>
108135
/// The fully qualified path for this model that can be used when searching the source for the model.
109136
/// </summary>

src/CodeFactoryVisualStudio/CodeFactory.DotNet/CSharp/CsMember.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,33 @@ protected CsMember(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceC
9999
/// </summary>
100100
public string Documentation => _documentation;
101101

102+
/// <summary>
103+
/// Adds the supplied source code directly before the documentation.
104+
/// </summary>
105+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
106+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
107+
public abstract Task<CsSource> AddBeforeDocsAsync(string sourceCode);
108+
109+
/// <summary>
110+
/// Adds the supplied source code directly after the documentation.
111+
/// </summary>
112+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
113+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
114+
public abstract Task<CsSource> AddAfterDocsAsync(string sourceCode);
115+
116+
/// <summary>
117+
/// Replaces the supplied source code directly this the documentation.
118+
/// </summary>
119+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
120+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
121+
public abstract Task<CsSource> ReplaceDocsAsync(string sourceCode);
122+
123+
/// <summary>
124+
/// Deletes the documentation from the target supporting code artifact.
125+
/// </summary>
126+
/// <returns>Updated <see cref="CsSource"/> model with the documentation removed.</returns>
127+
public abstract Task<CsSource> DeleteDocsAsync();
128+
102129
/// <summary>
103130
/// The parent to the current model. This will return null if there is no parent for this model, or the parent could not be located.
104131
/// </summary>

src/CodeFactoryVisualStudio/CodeFactory.DotNet/CSharp/ICsEnum.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,39 +71,39 @@ public interface ICsEnum : ICsModel, ICsAttributes,IParent, IDotNetEnum
7171
Task<CsSource> AddAfterAsync(string sourceCode);
7272

7373
/// <summary>
74-
/// Deletes the definition of the delegate from the source document.
74+
/// Deletes the definition of the enumeration from the source document.
7575
/// </summary>
76-
/// <param name="sourceDocument">The source document that the delegate is to be removed from.</param>
77-
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the delegate has been removed from the document.</returns>
76+
/// <param name="sourceDocument">The source document that the enumeration is to be removed from.</param>
77+
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the enumeration has been removed from the document.</returns>
7878
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
7979
[Obsolete("No longer support will be removed in later edition, you no longer need to pass the source document.",false)]
8080
Task<CsSource> DeleteAsync(string sourceDocument);
8181

8282
/// <summary>
83-
/// Deletes the definition of the delegate from the source document.
83+
/// Deletes the definition of the enumeration from the source document.
8484
/// </summary>
85-
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the delegate has been removed from the document.</returns>
85+
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the enumeration has been removed from the document.</returns>
8686
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
8787
Task<CsSource> DeleteAsync();
8888

8989
/// <summary>
90-
/// Gets the starting and ending locations within the document where the delegate is located.
90+
/// Gets the starting and ending locations within the document where the enumeration is located.
9191
/// </summary>
92-
/// <param name="sourceDocument">The fully qualified path to the document that has the delegate defined in.</param>
93-
/// <returns>The source location for the delegate.</returns>
92+
/// <param name="sourceDocument">The fully qualified path to the document that has the enumeration defined in.</param>
93+
/// <returns>The source location for the enumeration.</returns>
9494
/// <exception cref="DocumentException">Raised when an error occurs getting the location from the document.</exception>
9595
[Obsolete("No longer support will be removed in later edition, you no longer need to pass the source document.",false)]
9696
Task<ISourceLocation> GetSourceLocationAsync(string sourceDocument);
9797

9898
/// <summary>
99-
/// Gets the starting and ending locations within the document where the delegate is located.
99+
/// Gets the starting and ending locations within the document where the enumeration is located.
100100
/// </summary>
101-
/// <returns>The source location for the delegate.</returns>
101+
/// <returns>The source location for the enumeration.</returns>
102102
/// <exception cref="DocumentException">Raised when an error occurs getting the location from the document.</exception>
103103
Task<ISourceLocation> GetSourceLocationAsync();
104104

105105
/// <summary>
106-
/// Replaces the current delegate with the provided source code.
106+
/// Replaces the current enumeration with the provided source code.
107107
/// </summary>
108108
/// <param name="sourceDocument">The fully qualified path to the source code document to be updated.</param>
109109
/// <param name="sourceCode">The source code that is to be used to replace the original definition in the document.</param>
@@ -113,7 +113,7 @@ public interface ICsEnum : ICsModel, ICsAttributes,IParent, IDotNetEnum
113113
Task<CsSource> ReplaceAsync(string sourceDocument, string sourceCode);
114114

115115
/// <summary>
116-
/// Replaces the current delegate with the provided source code.
116+
/// Replaces the current enumeration with the provided source code.
117117
/// </summary>
118118
/// <param name="sourceCode">The source code that is to be used to replace the original definition in the document.</param>
119119
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>

src/CodeFactoryVisualStudio/CodeFactory.DotNet/IDocumentation.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
//* Copyright (c) 2020 CodeFactory, LLC
44
//*****************************************************************************
55

6+
using CodeFactory.DotNet.CSharp;
7+
using System.Threading.Tasks;
8+
69
namespace CodeFactory.DotNet
710
{
811
/// <summary>
@@ -19,5 +22,32 @@ public interface IDocumentation
1922
/// Documentation that has been assigned to this model.
2023
/// </summary>
2124
string Documentation { get; }
25+
26+
/// <summary>
27+
/// Adds the supplied source code directly before the documentation.
28+
/// </summary>
29+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
30+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
31+
Task<CsSource> AddBeforeDocsAsync(string sourceCode);
32+
33+
/// <summary>
34+
/// Adds the supplied source code directly after the documentation.
35+
/// </summary>
36+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
37+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
38+
Task<CsSource> AddAfterDocsAsync(string sourceCode);
39+
40+
/// <summary>
41+
/// Replaces the supplied source code directly this the documentation.
42+
/// </summary>
43+
/// <param name="sourceCode">The target syntax to be added to the document.</param>
44+
/// <returns>Updated <see cref="CsSource"/> model with the injected source code.</returns>
45+
Task<CsSource> ReplaceDocsAsync(string sourceCode);
46+
47+
/// <summary>
48+
/// Deletes the documentation from the target supporting code artifact.
49+
/// </summary>
50+
/// <returns>Updated <see cref="CsSource"/> model with the documentation removed.</returns>
51+
Task<CsSource> DeleteDocsAsync();
2252
}
2353
}

src/CodeFactoryVisualStudio/CodeFactory.DotNet/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("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.22298.0.1")]
36+
[assembly: AssemblyFileVersion("1.22301.01")]

0 commit comments

Comments
 (0)