Interface IRule
Represents a rule from which IIssue are inferred.
public interface IRule
- Extension Methods
Properties (6)
Category
Get the rule category.
string Category { get; }
Property Value
Remarks
For a Code query rule, returns the name of the group that contains the rule.
If several groups are involved, returns groups names with " \ " as separator.
ExplicitId
The rule explicit-id like "AvoidTypesTooBig" for example.
string ExplicitId { get; }
Property Value
Remarks
If the rule is defined like "ND1000:AvoidTypesTooBig", only explicit-id returned here.
If the rule has no explicit-id, a string empty is returned.
Id
The rule id like "ND1000" for example.
string Id { get; }
Property Value
Remarks
If the rule is defined with an explicit-id like "ND1000:AvoidTypesTooBig", the explicit-id is not returned here.
If the rule has no id, a string empty is returned.
IsCritical
Is the rule considered critical or not.
bool IsCritical { get; }
Property Value
Name
The rule name.
string Name { get; }
Property Value
Provider
The rule provider.
RuleProvider Provider { get; }
Property Value
Methods (2)
TryGetDescription(StringFormattingKind, out string)
Try get the rule description if available, formatted according to stringFormattingKind.
bool TryGetDescription(StringFormattingKind stringFormattingKind, out string ruleDescription)
Parameters
stringFormattingKindStringFormattingKindThe formatting of the returned description.
ruleDescriptionstringThe rule description formatted.
Returns
- bool
true if the rule description is available.
TryGetHowToFix(StringFormattingKind, out string)
Try get how-to-fix-rule explanation if available, formatted according to stringFormattingKind.
bool TryGetHowToFix(StringFormattingKind stringFormattingKind, out string ruleHowToFix)
Parameters
stringFormattingKindStringFormattingKindThe formatting of the returned how-to-fix-rule explanation.
ruleHowToFixstringThe rule how-to-fix-rule explanations formatted.
Returns
- bool
true if the how-to-fix-rule explanation is available.