Table of Contents

Class RuleIdOrCategory

Namespace
NDepend.Issue
Assembly
NDepend.API.dll

Represents the rule-id or the rule category defined in a usage of SuppressMessageAttribute.

public sealed class RuleIdOrCategory
Inheritance
RuleIdOrCategory
Inherited Members
Extension Methods

Remarks

Such object is returned by ISuppressMessage.RuleIdOrCategory.
Only one property is returning true in IsRuleId, IsCategory, SuppressAllIssues.

Properties (4)

IsCategory

Returns true if the corresponding usage of SuppressMessageAttribute relies on a category.

public bool IsCategory { get; }

Property Value

bool

Remarks

For example [SuppressMessage("NDepend.CodeSmells", "ND1001")] relies on the NDepend category "CodeSmells". This category can be declared as the group name "Code Smells" in the rules-set since spaces are removed from group names to match categories.

IsRuleId

Returns true if the corresponding usage of SuppressMessageAttribute relies on a rule-id.

public bool IsRuleId { get; }

Property Value

bool

Remarks

For example [SuppressMessage("NDepend", "ND1001")] relies on the NDepend rule-id "ND1001".

SuppressAllIssues

Returns true if the corresponding usage of SuppressMessageAttribute suppresses all issues.

public bool SuppressAllIssues { get; }

Property Value

bool

Remarks

For example [SuppressMessage("NDepend", "")] means that all NDepend issues are suppressed.

Value

Returns the rule-id or the rule category defined in a usage of SuppressMessageAttribute.

public string Value { get; }

Property Value

string

Remarks

If an empty string is returned it means that we are in the SuppressAllIssues situation.

Methods (2)

Equals(object)

Overrides Equals() since RuleIdOrCategory objects are used to index array of ISuppressMessage in dictionaries.

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

Overrides GetHashCode() since RuleIdOrCategory objects are used to index array of ISuppressMessage in dictionaries.

public override int GetHashCode()

Returns

int