Interface IGroup
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
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
IsActive
Gets a value indicating whether this group is activated.
bool IsActive { get; }
Property Value
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
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
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
Parent
Gets the parent group. Returns null if the group has no parent group.
IGroupOfGroups Parent { get; }
Property Value
ShownInReport
Gets a value indicating whether this group's child queries are shown in report, in a dedicated section.
bool ShownInReport { get; }
Property Value
Methods (11)
AddQuery(IQuery)
Add queryToAdd to this group child queries.
IGroup AddQuery(IQuery queryToAdd)
Parameters
queryToAddIQueryThe 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
queryToAdddoesn'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
controllerIControllerThe 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
Returns
GetQueryAt(int)
Returns the query at the index position in this.ChildQueries.
IQuery GetQueryAt(int index)
Parameters
indexintThe index position.
Returns
Exceptions
- ArgumentOutOfRangeException
indexmust 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
queryIQueryThe query to locate in this.ChildQueries.
Returns
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
indexintThe new
queryToMoveposition under this group child queries.queryToMoveIQueryThe 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
indexmust be a positive or zero integer, andindexmust be strictly lower than this.ChildQueriesCount.- ArgumentException
queryToMovemust be a child query of this group.
RemoveQuery(IQuery)
Remove queryToRemove to this group child queries.
IGroup RemoveQuery(IQuery queryToRemove)
Parameters
queryToRemoveIQueryThe 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
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
queryToReplacemust be a child query of this group andnewQuerymust not be a child query of this group.- ArgumentException
newQuerydoesn't have this as controller.
SetIsActive(bool)
Set the group activation to newIsActive.
IGroup SetIsActive(bool newIsActive)
Parameters
newIsActiveboolThe 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
newNamestringThe 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
newShownInReportboolThe 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.