1
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
2
// Licensed under the MIT License.
3
3
4
+ using System ;
4
5
using System . Diagnostics . CodeAnalysis ;
5
6
6
7
namespace Microsoft . Windows . PowerShell . ScriptAnalyzer . Generic
@@ -16,6 +17,7 @@ public class RuleInfo
16
17
private SourceType sourceType ;
17
18
private string sourceName ;
18
19
private RuleSeverity ruleSeverity ;
20
+ private Type implementingType ;
19
21
20
22
/// <summary>
21
23
/// Name: The name of the rule.
@@ -50,7 +52,7 @@ public string Description
50
52
/// <summary>
51
53
/// SourceType: The source type of the rule.
52
54
/// </summary>
53
- ///
55
+ ///
54
56
[ SuppressMessage ( "Microsoft.Performance" , "CA1811:AvoidUncalledPrivateCode" ) ]
55
57
public SourceType SourceType
56
58
{
@@ -78,6 +80,16 @@ public RuleSeverity Severity
78
80
private set { ruleSeverity = value ; }
79
81
}
80
82
83
+ /// <summary>
84
+ /// ImplementingType : The type which implements the rule.
85
+ /// </summary>
86
+ [ SuppressMessage ( "Microsoft.Performance" , "CA1811:AvoidUncalledPrivateCode" ) ]
87
+ public Type ImplementingType
88
+ {
89
+ get { return implementingType ; }
90
+ private set { implementingType = value ; }
91
+ }
92
+
81
93
/// <summary>
82
94
/// Constructor for a RuleInfo.
83
95
/// </summary>
@@ -93,12 +105,32 @@ public RuleInfo(string name, string commonName, string description, SourceType s
93
105
Description = description ;
94
106
SourceType = sourceType ;
95
107
SourceName = sourceName ;
96
- Severity = severity ;
108
+ Severity = severity ;
109
+ }
110
+
111
+ /// <summary>
112
+ /// Constructor for a RuleInfo.
113
+ /// </summary>
114
+ /// <param name="name">Name of the rule.</param>
115
+ /// <param name="commonName">Common Name of the rule.</param>
116
+ /// <param name="description">Description of the rule.</param>
117
+ /// <param name="sourceType">Source type of the rule.</param>
118
+ /// <param name="sourceName">Source name of the rule.</param>
119
+ /// <param name="implementingType">The dotnet type of the rule.</param>
120
+ public RuleInfo ( string name , string commonName , string description , SourceType sourceType , string sourceName , RuleSeverity severity , Type implementingType )
121
+ {
122
+ RuleName = name ;
123
+ CommonName = commonName ;
124
+ Description = description ;
125
+ SourceType = sourceType ;
126
+ SourceName = sourceName ;
127
+ Severity = severity ;
128
+ ImplementingType = implementingType ;
97
129
}
98
130
99
131
public override string ToString ( )
100
132
{
101
133
return RuleName ;
102
- }
134
+ }
103
135
}
104
136
}
0 commit comments