Interface IQuery
Represents a code query. A IQuery object can be created with the method IController.CreateQuery(bool, string, bool, bool, bool, bool).
public interface IQuery : IControllerChild
- Inherited Members
- Extension Methods
Properties (10)
DisplayListInReport
Gets a value that indicates whether if the code rule is violated, the code rule matched code elements are listed into the report.
bool DisplayListInReport { get; }
Property Value
Remarks
The default value is true.
DisplaySelectionViewInReport
Gets a value that indicates whether if the code rule is violated, the code rule matched code elements are shown in a treemap picture embedded into the report.
bool DisplaySelectionViewInReport { get; }
Property Value
Remarks
The default value is false.
DisplayStatInReport
Gets a value that indicates whether if the code rule is violated, the code rule matched code elements statistics are shown into the report.
bool DisplayStatInReport { get; }
Property Value
Remarks
The default value is true.
IsActive
Gets a value that indicates whether the query is active.
bool IsActive { get; }
Property Value
Remarks
The default value is true.
IsCriticalRule
Gets a value that indicates whether the code rule is critical or not.
bool IsCriticalRule { get; }
Property Value
Remarks
The default value is false.
A critical code rule is useful to break the build process once the rule is violated.
More information at: Critical Rules and Build Failure
IsExtractedFromCode
Gets a value that indicates whether the query has been extracted from code.
bool IsExtractedFromCode { get; }
Property Value
Remarks
A code query can be extracted from code thanks to CodeRuleAttribute.
- See Also
IsImportedRule
Gets a value that indicates whether the query is an imported rule.
bool IsImportedRule { get; }
Property Value
Parent
Gets the parent group. Returns null if the query has no parent group.
IGroup Parent { get; }
Property Value
QueryString
Gets the CQLinq or CQL code rule string or query string.
string QueryString { get; }
Property Value
RootParent
Gets the root parent. Returns null if the query has no root parent.
IGroupOfGroups RootParent { get; }
Property Value
Methods (3)
Clone(IController)
Returns a new query where values for QueryString, IsActive, DisplayListInReport, DisplaySelectionViewInReport, DisplayStatInReport, IsCriticalRule have been cloned, through controller.
IQuery Clone(IController controller)
Parameters
controllerIControllerThe queries controller used for cloning.
Returns
Remarks
The state IsExtractedFromCode or IsImportedRule is not cloned.
EqualsTo(IQuery)
Returns true if this query and queryToCompareWith have same value for QueryString, IsActive, DisplayListInReport, DisplaySelectionViewInReport, DisplayStatInReport, IsCriticalRule.
bool EqualsTo(IQuery queryToCompareWith)
Parameters
queryToCompareWithIQueryThe query to compare with.
Returns
Remarks
IsExtractedFromCode and IsImportedRule is not taken account for this equality operation.
SetIsActive(bool)
Returns a new IQuery object cloned from this object, where IsActive value is set to isActive, if this value for IsActive is different than isActive. Otherwise returns this IQuery.
IQuery SetIsActive(bool isActive)
Parameters
Returns
- IQuery
The new query object representing this query.
Remarks
The default value is true.
Since the queries hierarchy is an immutable hierarchical structure, this methods changes the hierarchy of objects if this value for IsActive is different than isActive.