File tree Expand file tree Collapse file tree 3 files changed +31
-26
lines changed Expand file tree Collapse file tree 3 files changed +31
-26
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+
3
+ namespace Microsoft . Windows . PowerShell . ScriptAnalyzer . Generic
4
+ {
5
+ /// <summary>
6
+ /// The attribute class to designate if a property is configurable or not.
7
+ /// </summary>
8
+ [ AttributeUsage ( AttributeTargets . Property ) ]
9
+ public class ConfigurableRulePropertyAttribute : Attribute
10
+ {
11
+ /// <summary>
12
+ /// Default value of the property that the attribute decorates.
13
+ /// </summary>
14
+ public object DefaultValue { get ; private set ; }
15
+
16
+ /// <summary>
17
+ /// Initialize the attribute with the decorated property's default value.
18
+ /// </summary>
19
+ /// <param name="defaultValue"></param>
20
+ public ConfigurableRulePropertyAttribute ( object defaultValue )
21
+ {
22
+ if ( defaultValue == null )
23
+ {
24
+ throw new ArgumentNullException ( nameof ( defaultValue ) , Strings . ConfigurableScriptRuleNRE ) ;
25
+ }
26
+
27
+ DefaultValue = defaultValue ;
28
+ }
29
+ }
30
+ }
Original file line number Diff line number Diff line change @@ -143,30 +143,4 @@ private Object GetDefaultValue(PropertyInfo property)
143
143
return ( ( ConfigurableRulePropertyAttribute ) attr ) . DefaultValue ;
144
144
}
145
145
}
146
-
147
- /// <summary>
148
- /// The attribute class to designate if a property is configurable or not.
149
- /// </summary>
150
- [ AttributeUsage ( AttributeTargets . Property , AllowMultiple = false ) ]
151
- public class ConfigurableRulePropertyAttribute : Attribute
152
- {
153
- /// <summary>
154
- /// Default value of the property that the attribute decorates.
155
- /// </summary>
156
- public object DefaultValue { get ; private set ; }
157
-
158
- /// <summary>
159
- /// Initialize the attribute with the decorated property's default value.
160
- /// </summary>
161
- /// <param name="defaultValue"></param>
162
- public ConfigurableRulePropertyAttribute ( object defaultValue )
163
- {
164
- if ( defaultValue == null )
165
- {
166
- throw new ArgumentNullException ( nameof ( defaultValue ) , Strings . ConfigurableScriptRuleNRE ) ;
167
- }
168
-
169
- DefaultValue = defaultValue ;
170
- }
171
- }
172
146
}
Original file line number Diff line number Diff line change 70
70
<Compile Include =" Commands\InvokeScriptAnalyzerCommand.cs" />
71
71
<Compile Include =" Generic\AvoidCmdletGeneric.cs" />
72
72
<Compile Include =" Generic\AvoidParameterGeneric.cs" />
73
+ <Compile Include =" Generic\ConfigurableRuleProperty.cs" />
73
74
<Compile Include =" Generic\ConfigurableScriptRule.cs" />
74
75
<Compile Include =" Generic\ModuleDependencyHandler.cs" />
75
76
<Compile Include =" Generic\CorrectionExtent.cs" />
You can’t perform that action at this time.
0 commit comments