Table of Contents

Interface IGroup

Namespace
NDepend.CodeQuery
Assembly
NDepend.API.dll

Represents a group of code queries and groups. A IGroup object can be created with the method IController.CreateGroup(string, bool, bool, ICollection<IQuery>, ICollection<IGroup>).

public interface IGroup : IGroupOfGroups, IControllerChild
Inherited Members
Extension Methods

Properties (8)

ChildQueries

Gets a cloned read-only list of child queries.

IReadOnlyList<IQuery> ChildQueries { get; }

Property Value

IReadOnlyList<IQuery>

Remarks

The list returned is a clone. Hence it doesn't reflect any modification in the original collection.

ChildQueriesCount

Gets the child queries count.

int ChildQueriesCount { get; }

Property Value

int

IsActive

Gets a value indicating whether this group is activated.

bool IsActive { get; }

Property Value

bool

IsExtractedFromCode

Gets a value indicating whether this group has been created for queries extracted from code, with the attribute CodeRuleAttribute.

bool IsExtractedFromCode { get; }

Property Value

bool

Remarks

When this.IsExtractedFromCode is true, the group name is the namespace that contains the code elements tagged with CodeRuleAttribute.
For anonymous namespace, the group name is the parent assembly name that contains the code elements tagged with CodeRuleAttribute.

See Also

IsGroupOfImportedRules

Gets a value indicating whether this group contains only imported rules.

bool IsGroupOfImportedRules { get; }

Property Value

bool

Remarks

When this.IsGroupOfImportedRules is true, the group name is the category of imported rules.

Name

Gets this group name.

string Name { get; }

Property Value

string

Parent

Gets the parent group. Returns null if the group has no parent group.

IGroupOfGroups Parent { get; }

Property Value

IGroupOfGroups

ShownInReport

Gets a value indicating whether this group's child queries are shown in report, in a dedicated section.

bool ShownInReport { get; }

Property Value

bool

Methods (11)

AddQuery(IQuery)

Add queryToAdd to this group child queries.

IGroup AddQuery(IQuery queryToAdd)

Parameters

queryToAdd IQuery

The query to add.

Returns

IGroup

The new group object representing this group.

Remarks

Since code query objects are immutable, the old group object have been replaced in the parent hierarchy by the new returned group object.

Exceptions

ArgumentException

queryToAdd doesn't have this as controller.

CloneDeep(IController)

Clone this group and all its child groups and child queries recursively, through controller.

IGroup CloneDeep(IController controller)

Parameters

controller IController

The queries controller used for cloning.

Returns

IGroup

This group cloned.

ContainsQuery(IQuery)

Gets a value indicating whether this group contains query.

bool ContainsQuery(IQuery query)

Parameters

query IQuery

The query to locate in this IGroup.

Returns

bool

GetQueryAt(int)

Returns the query at the index position in this.ChildQueries.

IQuery GetQueryAt(int index)

Parameters

index int

The index position.

Returns

IQuery

Exceptions

ArgumentOutOfRangeException

index must be a positive or zero integer, strictly lower than this.ChildQueriesCount.

IndexOfQuery(IQuery)

Determines the index of a specific query in this.ChildQueries.

int IndexOfQuery(IQuery query)

Parameters

query IQuery

The query to locate in this.ChildQueries.

Returns

int

Remarks

If this group of groups doesn't contain query, the value -1 is returned.

MoveQueryToIndex(int, IQuery)

Move queryToMove to the position specified by index.

IGroup MoveQueryToIndex(int index, IQuery queryToMove)

Parameters

index int

The new queryToMove position under this group child queries.

queryToMove IQuery

The query to move.

Returns

IGroup

The new group object representing this group.

Remarks

Since code query objects are immutable, the old group object have been replaced in the parent hierarchy by the new returned group object.

Exceptions

ArgumentOutOfRangeException

index must be a positive or zero integer, and index must be strictly lower than this.ChildQueriesCount.

ArgumentException

queryToMove must be a child query of this group.

RemoveQuery(IQuery)

Remove queryToRemove to this group child queries.

IGroup RemoveQuery(IQuery queryToRemove)

Parameters

queryToRemove IQuery

The query to remove.

Returns

IGroup

The new group object representing this group.

Remarks

Since code query objects are immutable, the old group object have been replaced in the parent hierarchy by the new returned group object.

Exceptions

ArgumentException

This group muts contain queryToRemove.

ReplaceQuery(IQuery, IQuery)

Replace queryToReplace with newQuery.

IGroup ReplaceQuery(IQuery queryToReplace, IQuery newQuery)

Parameters

queryToReplace IQuery

The query to replace.

newQuery IQuery

The query that replaces queryToReplace.

Returns

IGroup

The new group object representing this group.

Remarks

Since code query objects are immutable, the old group object have been replaced in the parent hierarchy by the new returned group object.

Exceptions

ArgumentException

queryToReplace must be a child query of this group and newQuery must not be a child query of this group.

ArgumentException

newQuery doesn't have this as controller.

SetIsActive(bool)

Set the group activation to newIsActive.

IGroup SetIsActive(bool newIsActive)

Parameters

newIsActive bool

The new group activation.

Returns

IGroup

The new group object representing this group.

Remarks

Since code query objects are immutable, the old group object have been replaced in the parent hierarchy by the new returned group object.

SetName(string)

Set the group name to newName.

IGroup SetName(string newName)

Parameters

newName string

The new group name.

Returns

IGroup

The new group object representing this group.

Remarks

Since code query objects are immutable, the old group object have been replaced in the parent hierarchy by the new returned group object.

SetShownInReport(bool)

Set the group ShownInReport state to newShownInReport.

IGroup SetShownInReport(bool newShownInReport)

Parameters

newShownInReport bool

The new group ShownInReport state.

Returns

IGroup

The new group object representing this group.

Remarks

Since code query objects are immutable, the old group object have been replaced in the parent hierarchy by the new returned group object.