-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathICsAttribute.cs
More file actions
114 lines (102 loc) · 7.21 KB
/
ICsAttribute.cs
File metadata and controls
114 lines (102 loc) · 7.21 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
//*****************************************************************************
//* Code Factory SDK
//* Copyright (c) 2020-2022 CodeFactory, LLC
//*****************************************************************************
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using CodeFactory.Document;
using CodeFactory.SourceCode;
namespace CodeFactory.DotNet.CSharp
{
/// <summary>
/// Model definition for an attribute in a c# implementation.
/// </summary>
public interface ICsAttribute:ICsModel,IDotNetAttribute,IParent
{
/// <summary>
/// Enumeration of the parameters that are assigned to the attribute. This will be an empty list if HasParameters is false.
/// </summary>
new IReadOnlyList<CsAttributeParameter> Parameters { get; }
/// <summary>
/// The type information for the attribute itself.
/// </summary>
new CsType Type { get; }
/// <summary>
/// Adds the source code directly before the definition of the <see cref="ICsAttribute"/>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>
[Obsolete("No longer support will be removed in later edition, you no longer need to pass the source document.",false)]
Task<CsSource> AddBeforeAsync(string sourceDocument, string sourceCode);
/// <summary>
/// Adds the source code directly before the definition of the <see cref="ICsAttribute"/>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 after the definition of the <see cref="ICsAttribute"/>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>
[Obsolete("No longer support will be removed in later edition, you no longer need to pass the source document.",false)]
Task<CsSource> AddAfterAsync(string sourceDocument, string sourceCode);
/// <summary>
/// Adds the source code directly after the definition of the <see cref="ICsAttribute"/>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>
/// Deletes the definition of the attribute from the source document.
/// </summary>
/// <param name="sourceDocument">The source document that the attribute is to be removed from.</param>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the attribute has been removed from the document.</returns>
/// <exception cref="DocumentException">Error is raised when errors occur updating the source document.</exception>
[Obsolete("No longer support will be removed in later edition, you no longer need to pass the source document.",false)]
Task<CsSource> DeleteAsync(string sourceDocument);
/// <summary>
/// Deletes the definition of the attribute from the source document.
/// </summary>
/// <returns>A newly loaded copy of the <see cref="ICsSource"/> model after the attribute 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 attribute is located.
/// </summary>
/// <param name="sourceDocument">The fully qualified path to the document that has the attribute defined in.</param>
/// <returns>The source location for the attribute.</returns>
/// <exception cref="DocumentException">Raised when an error occurs getting the location from the document.</exception>
[Obsolete("No longer support will be removed in later edition, you no longer need to pass the source document.",false)]
Task<ISourceLocation> GetSourceLocationAsync(string sourceDocument);
/// <summary>
/// Gets the starting and ending locations within the document where the attribute is located.
/// </summary>
/// <returns>The source location for the attribute.</returns>
/// <exception cref="DocumentException">Raised when an error occurs getting the location from the document.</exception>
Task<ISourceLocation> GetSourceLocationAsync();
/// <summary>
/// Replaces the current attribute 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>
[Obsolete("No longer support will be removed in later edition, you no longer need to pass the source document.",false)]
Task<CsSource> ReplaceAsync(string sourceDocument, string sourceCode);
/// <summary>
/// Replaces the current attribute 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);
}
}