annotate Source/Properties/JetBrains.Annotations.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
1 using System;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
2 using System.Collections.Generic;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
3
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
4 namespace JetBrains.Annotations
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
5 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
6 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
7 /// Indicates that marked method builds string by format pattern and (optional) arguments.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
8 /// Parameter, which contains format string, should be given in constructor.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
9 /// The format string should be in <see cref="string.Format(IFormatProvider,string,object[])"/> -like form
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
10 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
11 [AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
12 internal sealed class StringFormatMethodAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
13 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
14 private readonly string _formatParameterName;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
15
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
16 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
17 /// Initializes new instance of StringFormatMethodAttribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
18 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
19 /// <param name="formatParameterName">Specifies which parameter of an annotated method should be treated as format-string</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
20 public StringFormatMethodAttribute(string formatParameterName)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
21 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
22 _formatParameterName = formatParameterName;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
23 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
24
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
25 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
26 /// Gets format parameter name
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
27 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
28 public string FormatParameterName
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
29 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
30 get { return _formatParameterName; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
31 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
32 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
33
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
34 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
35 /// Indicates that the function argument should be string literal and match one of the parameters of the caller function.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
36 /// For example, <see cref="ArgumentNullException"/> has such parameter.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
37 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
38 [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
39 internal sealed class InvokerParameterNameAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
40 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
41 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
42
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
43 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
44 /// Indicates that the marked method is assertion method, i.e. it halts control flow if one of the conditions is satisfied.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
45 /// To set the condition, mark one of the parameters with <see cref="AssertionConditionAttribute"/> attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
46 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
47 /// <seealso cref="AssertionConditionAttribute"/>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
48 [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
49 internal sealed class AssertionMethodAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
50 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
51 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
52
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
53 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
54 /// Indicates the condition parameter of the assertion method.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
55 /// The method itself should be marked by <see cref="AssertionMethodAttribute"/> attribute.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
56 /// The mandatory argument of the attribute is the assertion type.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
57 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
58 /// <seealso cref="AssertionConditionType"/>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
59 [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
60 internal sealed class AssertionConditionAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
61 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
62 private readonly AssertionConditionType _conditionType;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
63
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
64 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
65 /// Initializes new instance of AssertionConditionAttribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
66 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
67 /// <param name="conditionType">Specifies condition type</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
68 public AssertionConditionAttribute(AssertionConditionType conditionType)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
69 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
70 _conditionType = conditionType;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
71 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
72
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
73 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
74 /// Gets condition type
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
75 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
76 public AssertionConditionType ConditionType
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
77 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
78 get { return _conditionType; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
79 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
80 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
81
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
82 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
83 /// Specifies assertion type. If the assertion method argument satisifes the condition, then the execution continues.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
84 /// Otherwise, execution is assumed to be halted
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
85 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
86 internal enum AssertionConditionType
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
87 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
88 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
89 /// Indicates that the marked parameter should be evaluated to true
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
90 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
91 IS_TRUE = 0,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
92
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
93 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
94 /// Indicates that the marked parameter should be evaluated to false
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
95 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
96 IS_FALSE = 1,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
97
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
98 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
99 /// Indicates that the marked parameter should be evaluated to null value
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
100 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
101 IS_NULL = 2,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
102
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
103 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
104 /// Indicates that the marked parameter should be evaluated to not null value
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
105 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
106 IS_NOT_NULL = 3,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
107 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
108
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
109 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
110 /// Indicates that the marked method unconditionally terminates control flow execution.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
111 /// For example, it could unconditionally throw exception
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
112 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
113 [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
114 internal sealed class TerminatesProgramAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
115 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
116 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
117
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
118 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
119 /// Indicates that the value of marked element could be <c>null</c> sometimes, so the check for <c>null</c> is necessary before its usage
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
120 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
121 [AttributeUsage(AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
122 internal sealed class CanBeNullAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
123 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
124 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
125
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
126 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
127 /// Indicates that the value of marked element could never be <c>null</c>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
128 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
129 [AttributeUsage(AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
130 internal sealed class NotNullAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
131 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
132 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
133
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
134 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
135 /// Indicates that the value of marked type (or its derivatives) cannot be compared using '==' or '!=' operators.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
136 /// There is only exception to compare with <c>null</c>, it is permitted
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
137 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
138 [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
139 internal sealed class CannotApplyEqualityOperatorAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
140 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
141 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
142
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
143 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
144 /// When applied to target attribute, specifies a requirement for any type which is marked with
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
145 /// target attribute to implement or inherit specific type or types
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
146 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
147 /// <example>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
148 /// <code>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
149 /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
150 /// public class ComponentAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
151 /// {}
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
152 ///
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
153 /// [Component] // ComponentAttribute requires implementing IComponent interface
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
154 /// public class MyComponent : IComponent
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
155 /// {}
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
156 /// </code>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
157 /// </example>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
158 [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
159 [BaseTypeRequired(typeof(Attribute))]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
160 internal sealed class BaseTypeRequiredAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
161 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
162 private readonly Type[] _baseTypes;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
163
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
164 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
165 /// Initializes new instance of BaseTypeRequiredAttribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
166 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
167 /// <param name="baseType">Specifies which types are required</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
168 public BaseTypeRequiredAttribute(Type baseType)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
169 : this(new Type[] { baseType })
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
170 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
171 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
172
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
173 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
174 /// Initializes new instance of BaseTypeRequiredAttribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
175 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
176 /// <param name="baseTypes">Specifies which types are required</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
177 public BaseTypeRequiredAttribute(params Type[] baseTypes)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
178 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
179 _baseTypes = baseTypes;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
180 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
181
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
182 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
183 /// Gets enumerations of specified base types
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
184 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
185 public IEnumerable<Type> BaseTypes
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
186 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
187 get { return _baseTypes; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
188 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
189 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
190
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
191 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
192 /// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library),
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
193 /// so this symbol will not be marked as unused (as well as by other usage inspections)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
194 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
195 [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
196 internal class UsedImplicitlyAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
197 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
198 readonly ImplicitUseFlags _flags;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
199 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
200 /// Gets value indicating what is meant to be used
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
201 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
202 [UsedImplicitly]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
203 public ImplicitUseFlags Flags
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
204 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
205 get { return _flags; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
206 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
207
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
208 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
209 /// Initializes new instance of UsedImplicitlyAttribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
210 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
211 public UsedImplicitlyAttribute()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
212 : this(ImplicitUseFlags.Default)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
213 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
214 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
215
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
216 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
217 /// Initializes new instance of UsedImplicitlyAttribute with specified flags
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
218 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
219 /// <param name="flags">Value of type <see cref="ImplicitUseFlags"/> indicating usage kind</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
220 public UsedImplicitlyAttribute(ImplicitUseFlags flags)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
221 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
222 _flags = flags;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
223 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
224 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
225
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
226 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
227 /// Should be used on attributes and causes ReSharper to not mark symbols marked with such attributes as unused (as well as by other usage inspections)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
228 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
229 [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
230 internal class MeansImplicitUseAttribute : Attribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
231 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
232 readonly ImplicitUseFlags _flags;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
233 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
234 /// Gets value indicating what is meant to be used
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
235 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
236 [UsedImplicitly]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
237 public ImplicitUseFlags Flags
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
238 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
239 get { return _flags; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
240 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
241
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
242 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
243 /// Initializes new instance of MeansImplicitUseAttribute
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
244 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
245 [UsedImplicitly]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
246 public MeansImplicitUseAttribute()
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
247 : this(ImplicitUseFlags.Default)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
248 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
249 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
250
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
251 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
252 /// Initializes new instance of MeansImplicitUseAttribute with specified flags
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
253 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
254 /// <param name="flags">Value of type <see cref="ImplicitUseFlags"/> indicating usage kind</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
255 [UsedImplicitly]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
256 public MeansImplicitUseAttribute(ImplicitUseFlags flags)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
257 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
258 _flags = flags;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
259 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
260 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
261
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
262 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
263 /// Specify what is considered used implicitly when marked with <see cref="MeansImplicitUseAttribute"/> or <see cref="UsedImplicitlyAttribute"/>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
264 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
265 [Flags]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
266 internal enum ImplicitUseFlags
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
267 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
268 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
269 /// Only entity marked with attribute considered used
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
270 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
271 Default = 0,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
272
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
273 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
274 /// Entity marked with attribute and all its members considered used
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
275 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
276 IncludeMembers = 1
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
277 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
278
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
279 [AttributeUsage(AttributeTargets.Parameter, Inherited = true)]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
280 internal sealed class InstantHandleAttribute : Attribute { }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
281 }