Interface IController
Changes to a hierarchy of code query objects are made through an instance of IController.
public interface IController
- Extension Methods
Remarks
The interfaces IQuery, IGroup and IGroupOfGroups implement the interface IControllerChild, because they all depend from a IController object.
A hierarchy of queries can be gathered from IProjectCodeQueries.CodeQueriesSet or IAnalysisResult.RulesExtractedFromCode.
Property (1)
RootParent
Gets the root parent on which the controller does changes.
IGroupOfGroups RootParent { get; }
Property Value
Methods (24)
AskUserForGroupDeletion(IGroup, IntPtr, SoundPlayerState)
Ask the user through a dialog, if he really wishes to delete groupToDelete.
bool AskUserForGroupDeletion(IGroup groupToDelete, IntPtr ownerWindowHandle, SoundPlayerState soundPlayerState)
Parameters
groupToDeleteIGroupThe group to delete.
ownerWindowHandleIntPtrThe window handle of the parent window that shows the dialog.
soundPlayerStateSoundPlayerStateDetermine if a ding is played when showing the dialog.
Returns
- bool
true if the user wishes to delete the group, otherwise returns false.
AskUserForQueryDeletion(IQuery, IntPtr, SoundPlayerState)
Ask the user through a dialog, if he really wishes to delete queryToDelete.
bool AskUserForQueryDeletion(IQuery queryToDelete, IntPtr ownerWindowHandle, SoundPlayerState soundPlayerState)
Parameters
queryToDeleteIQueryThe query to delete.
ownerWindowHandleIntPtrThe window handle of the parent window that shows the dialog.
soundPlayerStateSoundPlayerStateDetermine if a ding is played when showing the dialog.
Returns
- bool
true if the user wishes to delete the query, otherwise returns false.
CanChangeGroupActivation(IGroup, out string)
Gets a value indicating whether group.IsActive can be changed.
bool CanChangeGroupActivation(IGroup group, out string failureReason)
Parameters
groupIGroupThe group on which to change the activation.
failureReasonstringIf false is returned, contains the plain-english explanation of the failure.
Returns
Remarks
If group IsExtractedFromCode or IsGroupOfImportedRules its activation cannot be changed.
CanChangeGroupName(IGroup, out string)
Gets a value indicating whether group.Name can be changed.
bool CanChangeGroupName(IGroup group, out string failureReason)
Parameters
groupIGroupThe group on which to change the name.
failureReasonstringIf false is returned, contains the plain-english explanation of the failure.
Returns
Remarks
If group IsExtractedFromCode or IsGroupOfImportedRules its name cannot be changed.
CanChangeGroupShownInReport(IGroup, out string)
Gets a value indicating whether group.ShownInReport can be changed.
bool CanChangeGroupShownInReport(IGroup group, out string failureReason)
Parameters
groupIGroupThe group on which to change the flag ShownInReport.
failureReasonstringIf false is returned, contains the plain-english explanation of the failure.
Returns
Remarks
If group IsExtractedFromCode or IsGroupOfImportedRules its value ShownInReport cannot be changed.
CanChangeQueryActivation(IQuery, out string)
Gets a value indicating whether query.IsActive can be changed.
bool CanChangeQueryActivation(IQuery query, out string failureReason)
Parameters
queryIQueryThe query on which to change the activation.
failureReasonstringIf false is returned, contains the plain-english explanation of the failure.
Returns
Remarks
If query IsExtractedFromCode or IsImportedRule its activation cannot be changed.
CanDeleteGroup(IGroup, out string)
Gets a value indicating whether groupToDelete can be deleted.
bool CanDeleteGroup(IGroup groupToDelete, out string failureReason)
Parameters
groupToDeleteIGroupThe group to delete.
failureReasonstringIf false is returned, contains the plain-english explanation of the failure.
Returns
Remarks
If groupToDelete IsExtractedFromCode or IsGroupOfImportedRules, the group cannot be deleted.
CanDeleteQuery(IQuery, out string)
Gets a value indicating whether queryToDelete can be deleted.
bool CanDeleteQuery(IQuery queryToDelete, out string failureReason)
Parameters
queryToDeleteIQueryThe query to delete.
failureReasonstringIf false is returned, contains the plain-english explanation of the failure.
Returns
Remarks
If queryToDelete.IsExtractedFromCode or IsImportedRule the query cannot be deleted.
CanInsertGroupUnder(IGroupOfGroups, out string)
Gets a value indicating whether a group can be inserted under setParent.
bool CanInsertGroupUnder(IGroupOfGroups setParent, out string failureReason)
Parameters
setParentIGroupOfGroupsThe parent set under which a group might be inserted.
failureReasonstringIf false is returned, contains the plain-english explanation of the failure.
Returns
Remarks
If setParent IsExtractedFromCode or IsGroupOfImportedRules a group cannot be inserted under it.
CanInsertQueryUnder(IGroup, out string)
Gets a value indicating whether a query can be inserted under groupParent.
bool CanInsertQueryUnder(IGroup groupParent, out string failureReason)
Parameters
groupParentIGroupThe parent group under which a query might be inserted.
failureReasonstringIf false is returned, contains the plain-english explanation of the failure.
Returns
Remarks
If groupParent.IsExtractedFromCode or IsGroupOfImportedRules a query cannot be inserted under it.
CanSetGroupName(IGroup, string, out string)
Gets a value indicating whether group name can be changed to newName.
bool CanSetGroupName(IGroup group, string newName, out string failureReason)
Parameters
groupIGroupThe group on which to change the name.
newNamestringThe new name to assign to the group.
failureReasonstringIf false is returned, contains the plain-english explanation of the failure.
Returns
Remarks
An empty newName is not accepted and if another group already has the name newName, it is not accepted neither.
CreateGroup(string, bool, bool, ICollection<IQuery>, ICollection<IGroup>)
Creates a new group object.
IGroup CreateGroup(string name, bool isActive, bool shownInReport, ICollection<IQuery> childQueries, ICollection<IGroup> childGroups)
Parameters
namestringThe group name.
isActiveboolThe group activation.
shownInReportboolA boolean value that indicates whether all child rules and queries of this group are shown in report. In Queries Explorer panel, such group is highlighted in a orange box.
childQueriesICollection<IQuery>A collection of child queries.
childGroupsICollection<IGroup>A collection of child groups.
Returns
CreateQuery(bool, string, bool, bool, bool, bool)
Create a new query object.
IQuery CreateQuery(bool isActive, string queryString, bool displayStatInReport, bool displayListInReport, bool displaySelectionViewInReport, bool isCriticalRule)
Parameters
isActiveboolThe new query activation.
queryStringstringThe query string.
displayStatInReportboolA boolean value that indicates whether the code rule is violated, the code rule matched code elements are listed into the report.
displayListInReportboolA boolean value that indicates whether the code rule is violated, the code rule matched code elements statistics are shown into the report.
displaySelectionViewInReportboolA boolean value that indicates whether the code rule is violated, the code rule matched code elements are shown in a treemap picture embedded into the report.
isCriticalRuleboolA boolean value that indicates whether the code rule is critical or not.
Returns
DoAddGroup(IGroup, IGroupOfGroups)
Add groupToAdd under oldSetParent.
void DoAddGroup(IGroup groupToAdd, IGroupOfGroups oldSetParent)
Parameters
groupToAddIGroupThe group to add.
oldSetParentIGroupOfGroupsThe parent set under which the group is added.
Exceptions
- ArgumentException
Can't perform the insertion operation on these arguments.
Please checkoldSetParentwith the method CanInsertGroupUnder(IGroupOfGroups, out string) before calling this method.- ArgumentException
oldSetParentdoesn't have this as controller.
DoAddQuery(IQuery, IGroup)
Add queryToAdd under groupParentOldObj.
void DoAddQuery(IQuery queryToAdd, IGroup groupParentOldObj)
Parameters
queryToAddIQueryThe query to add.
groupParentOldObjIGroupThe group under which the query is added.
Exceptions
- ArgumentException
Can't perform the insertion operation on these arguments.
Please checkqueryToAddwith the method CanInsertQueryUnder(IGroup, out string) before calling this method.
DoChangeGroupActivation(IGroup, bool)
Change group.IsActive to active.
IGroup DoChangeGroupActivation(IGroup group, bool active)
Parameters
groupIGroupThe group on which to change the name.
activeboolThe new activation boolean state of the group.
Returns
- IGroup
The new group object with the activation boolean state.
Exceptions
- ArgumentException
Can't perform the group activation changing operation on these arguments.
Please check arguments with the method CanChangeGroupActivation(IGroup, out string) before calling this method.
DoChangeGroupName(IGroup, string)
Change group.Name to newName.
IGroup DoChangeGroupName(IGroup group, string newName)
Parameters
groupIGroupThe group on which to change the name.
newNamestringThe new name to assign to the group.
Returns
- IGroup
The new group object with the new name.
Exceptions
- ArgumentException
Can't perform the group renaming operation on these arguments.
Please check arguments with the method CanSetGroupName(IGroup, string, out string) before calling this method.
DoChangeGroupShownInReport(IGroup, bool)
Change group.ShownInReport to shownInReport.
void DoChangeGroupShownInReport(IGroup group, bool shownInReport)
Parameters
groupIGroupThe group on which to change the flag ShownInReport.
shownInReportboolThe new ShownInReport boolean state of the group.
Exceptions
- ArgumentException
Can't perform the group flag changing operation on these arguments.
Please check arguments with the method CanChangeGroupShownInReport(IGroup, out string) before calling this method.
DoChangeQueryActivation(IQuery, bool)
Change query.IsActive to active.
void DoChangeQueryActivation(IQuery query, bool active)
Parameters
queryIQueryThe query on which to change the name.
activeboolThe new activation boolean state of the query.
Exceptions
- ArgumentException
Can't perform the query activation changing operation on these arguments.
Please check arguments with the method CanChangeQueryActivation(IQuery, out string) before calling this method.
DoDeleteGroup(IGroup)
Do delete groupToDelete.
void DoDeleteGroup(IGroup groupToDelete)
Parameters
groupToDeleteIGroupThe group to delete.
Exceptions
- ArgumentException
Can't perform the deletion operation on these arguments.
Please checkgroupToDeletewith the method CanDeleteGroup(IGroup, out string) before calling this method.
DoDeleteQuery(IQuery)
Do delete queryToDelete.
void DoDeleteQuery(IQuery queryToDelete)
Parameters
queryToDeleteIQueryThe query to delete.
Exceptions
- ArgumentException
Can't perform the deletion operation on these arguments.
Please checkqueryToDeletewith the method CanDeleteQuery(IQuery, out string) before calling this method.
DoInsertGroup(IGroup, IGroupOfGroups, int)
Insert groupToInsert under oldSetParent.
void DoInsertGroup(IGroup groupToInsert, IGroupOfGroups oldSetParent, int index)
Parameters
groupToInsertIGroupThe group to insert.
oldSetParentIGroupOfGroupsThe parent set under which the group is inserted.
indexintThe index in
oldSetParentchildren groups, at whichgroupToInsertis inserted.
Exceptions
- ArgumentException
Can't perform the insertion operation on these arguments.
Please checkoldSetParentwith the method CanInsertGroupUnder(IGroupOfGroups, out string) before calling this method.- ArgumentOutOfRangeException
indexmust be a positive or zero integer, lower or equals tooldSetParent.ChildGroupsCount.
DoInsertQuery(IQuery, IGroup, int)
Insert queryToInsert under groupParentOldObj.
void DoInsertQuery(IQuery queryToInsert, IGroup groupParentOldObj, int index)
Parameters
queryToInsertIQueryThe query to insert.
groupParentOldObjIGroupThe parent group under which the query is inserted.
indexintThe index in
groupParentOldObjchildren queries, at whichqueryToInsertis inserted.
Exceptions
- ArgumentException
Can't perform the insertion operation on these arguments.
Please checkqueryToInsertwith the method CanInsertQueryUnder(IGroup, out string) before calling this method.- ArgumentOutOfRangeException
indexmust be a positive or zero integer, lower or equals togroupParentOldObj.ChildQueriesCount.
DoUpdateQueryObject(IQuery, IQuery)
Update oldQuery object with newQuery object.
void DoUpdateQueryObject(IQuery oldQuery, IQuery newQuery)
Parameters
oldQueryIQueryThe old object representing the query.
newQueryIQueryThe new object representing the query.
Exceptions
- ArgumentException
Can't perform the query update operation on these arguments.
The exception message contains a plain-english description of the problem.