Adding Output to the Result Window

Top  Previous  Next

Review operations do not modify source code or designer files, but examine their contents and generate some output in a Result window. For example, the Review Control Text Spelling operation provided as example reviews the spelling of the text of controls in forms and usercontrols, and shows the controls have a wrong spelling in a result window.

For this purpose, the OperationBase class exposes methods to do the following:

  • To add a result to the result window. For this purpose you can use the overloaded AddNodeToResultsTree method. Each result has a kind and a text. The text is the message that informs why the result was added to the output. The kind can be one of the following:
  • Solution
  • Project
  • Project Item (file)
  • Component (control)
  • Code Element (namespace, class, struct, property, function, etc.)
  • Found Text
  • To be notified when the user has located a result from the result window in the source code or designer of a file. For this purpose you use the OnAfterLocateSolutionResult, OnAfterLocateProjectResult, etc. methods.
  • To remove the selected node of the result window. For this purpose you use the RemoveSelectedNodeFromResultsTree method. Typically you use this method if the action that the operation performs after locating a result (with one of the previous methods) causes a correction and the result is no longer valid.

The Review Code Standards operation provided as example shows the usage of most of these methods.