-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathICsContainer.cs
More file actions
187 lines (163 loc) · 11.2 KB
/
ICsContainer.cs
File metadata and controls
187 lines (163 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
//*****************************************************************************
//* Code Factory SDK
//* Copyright (c) 2020-2023 CodeFactory, LLC
//*****************************************************************************
using System.Collections.Generic;
using System.Threading.Tasks;
using CodeFactory.Document;
using CodeFactory.SourceCode;
namespace CodeFactory.DotNet.CSharp
{
/// <summary>
/// The base implementation all container type models must implement in C#.
/// </summary>
public interface ICsContainer: ICsModel, ICsAttributes, ICsGeneric,IDotNetContainer,IParent
{
/// <summary>
/// The type of container model that has been implemented.
/// </summary>
new CsContainerType ContainerType { get; }
/// <summary>
/// The security scope assigned to the container.
/// </summary>
new CsSecurity Security { get; }
/// <summary>
/// List of the interfaces that are inherited by this container.
/// </summary>
new IReadOnlyList<CsInterface> InheritedInterfaces { get; }
/// <summary>
/// List of the members that are implemented in this container.
/// </summary>
new IReadOnlyList<CsMember> Members { get; }
/// <summary>
/// List of the methods that are implemented in this container.
/// </summary>
new IReadOnlyList<CsMethod> Methods { get; }
/// <summary>
/// List of the properties that are implemented in this container.
/// </summary>
new IReadOnlyList<CsProperty> Properties { get; }
/// <summary>
/// Enumeration of the events assigned to this container. If HasEvents is false this will be null.
/// </summary>
new IReadOnlyList<CsEvent> Events { get; }
/// <summary>
/// Adds the source code directly before the definition of the <see cref="ICsContainer"/>in the target document.
/// </summary>
/// <param name="sourceDocument">The fully qualified path to the source code document to be updated.</param>
/// <param name="sourceCode">The source code that is to be added to the document.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
Task<CsSource> AddBeforeAsync(string sourceDocument, string sourceCode);
/// <summary>
/// Adds the source code directly before the definition of the <see cref="ICsContainer"/>in the target document.
/// </summary>
/// <param name="sourceCode">The source code that is to be added to the document.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
Task<CsSource> AddBeforeAsync(string sourceCode);
/// <summary>
/// Adds the source code directly before the definition of the <see cref="ICsContainer"/>in the target document.
/// </summary>
/// <param name="sourceCode">The source code that is to be added to the document.</param>
/// <param name="ignoreLeadingModelsAndDocs">Changes the before entry point to the start of the container definition not before the documentation or attributes that are assigned to the member.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
Task<CsSource> AddBeforeAsync(string sourceCode,bool ignoreLeadingModelsAndDocs);
/// <summary>
/// Adds the source code directly after the definition of the <see cref="ICsContainer"/>in the target document.
/// </summary>
/// <param name="sourceDocument">The fully qualified path to the source code document to be updated.</param>
/// <param name="sourceCode">The source code that is to be added to the document.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
Task<CsSource> AddAfterAsync(string sourceDocument, string sourceCode);
/// <summary>
/// Adds the source code directly after the definition of the <see cref="ICsContainer"/>in the target document.
/// </summary>
/// <param name="sourceCode">The source code that is to be added to the document.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
Task<CsSource> AddAfterAsync(string sourceCode);
/// <summary>
/// Adds the source code inside of the container at the beginning of where members are defined in the container.
/// </summary>
/// <param name="sourceDocument">The fully qualified path to the source document to be updated.</param>
/// <param name="sourceCode">The source code that is to be added to the document.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
Task<CsSource> AddToBeginningAsync(string sourceDocument, string sourceCode);
/// <summary>
/// Adds the source code inside of the container at the beginning of where members are defined in the container.
/// </summary>
/// <param name="sourceCode">The source code that is to be added to the document.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
Task<CsSource> AddToBeginningAsync(string sourceCode);
/// <summary>
/// Adds the source code inside of the container at the end of where members are defined in the container.
/// </summary>
/// <param name="sourceDocument">The fully qualified path to the source document to be updated.</param>
/// <param name="sourceCode">The source code that is to be added to the document.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
Task<CsSource> AddToEndAsync(string sourceDocument, string sourceCode);
/// <summary>
/// Adds the source code inside of the container at the end of where members are defined in the container.
/// </summary>
/// <param name="sourceCode">The source code that is to be added to the document.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
Task<CsSource> AddToEndAsync(string sourceCode);
/// <summary>
/// Deletes the definition of the container from the source document.
/// </summary>
/// <param name="sourceDocument">The source document that the container is to be removed from.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the container has been removed from the document.</returns>
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
Task<CsSource> DeleteAsync(string sourceDocument);
/// <summary>
/// Deletes the definition of the container from the source document.
/// </summary>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the container has been removed from the document.</returns>
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
Task<CsSource> DeleteAsync();
/// <summary>
/// Gets the starting and ending locations within the document where the container is located.
/// </summary>
/// <param name="sourceDocument">The fully qualified path to the document that has the container defined in.</param>
/// <returns>The source location for the container.</returns>
/// <exception cref="DocumentException">Raised when an error occurs getting the location from the document.</exception>
Task<ISourceLocation> GetSourceLocationAsync(string sourceDocument);
/// <summary>
/// Gets the starting and ending locations within the document where the container is located.
/// </summary>
/// <returns>The source location for the container.</returns>
/// <exception cref="DocumentException">Raised when an error occurs getting the location from the document.</exception>
Task<ISourceLocation> GetSourceLocationAsync();
/// <summary>
/// Gets the starting and ending locations of the body located in the container.
/// </summary>
/// <param name="sourceDocument">The fully qualified path to the document that has the container defined in.</param>
/// <returns>The source location in the container.</returns>
/// <exception cref="DocumentException">Raised when an error occurs getting the location from the document.</exception>
Task<ISourceLocation> GetBodySourceLocationAsync(string sourceDocument);
/// <summary>
/// Gets the starting and ending locations of the body located in the container.
/// </summary>
/// <returns>The source location in the container.</returns>
/// <exception cref="DocumentException">Raised when an error occurs getting the location from the document.</exception>
Task<ISourceLocation> GetBodySourceLocationAsync();
/// <summary>
/// Replaces the current container with the provided source code.
/// </summary>
/// <param name="sourceDocument">The fully qualified path to the source code document to be updated.</param>
/// <param name="sourceCode">The source code that is to be used to replace the original definition in the document.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
Task<CsSource> ReplaceAsync(string sourceDocument, string sourceCode);
/// <summary>
/// Replaces the current container with the provided source code.
/// </summary>
/// <param name="sourceCode">The source code that is to be used to replace the original definition in the document.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the changes have been applied.</returns>
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
Task<CsSource> ReplaceAsync(string sourceCode);
}
}