11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT License.
33
4+ using System ;
45using System . Diagnostics . CodeAnalysis ;
56
67namespace Microsoft . Windows . PowerShell . ScriptAnalyzer . Generic
@@ -16,6 +17,7 @@ public class RuleInfo
1617 private SourceType sourceType ;
1718 private string sourceName ;
1819 private RuleSeverity ruleSeverity ;
20+ private Type implementingType ;
1921
2022 /// <summary>
2123 /// Name: The name of the rule.
@@ -50,7 +52,7 @@ public string Description
5052 /// <summary>
5153 /// SourceType: The source type of the rule.
5254 /// </summary>
53- ///
55+ ///
5456 [ SuppressMessage ( "Microsoft.Performance" , "CA1811:AvoidUncalledPrivateCode" ) ]
5557 public SourceType SourceType
5658 {
@@ -78,6 +80,16 @@ public RuleSeverity Severity
7880 private set { ruleSeverity = value ; }
7981 }
8082
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+
8193 /// <summary>
8294 /// Constructor for a RuleInfo.
8395 /// </summary>
@@ -93,12 +105,32 @@ public RuleInfo(string name, string commonName, string description, SourceType s
93105 Description = description ;
94106 SourceType = sourceType ;
95107 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 ;
97129 }
98130
99131 public override string ToString ( )
100132 {
101133 return RuleName ;
102- }
134+ }
103135 }
104136}
0 commit comments