AddNodeToResultsTree Method (Variation 6) (OperationBase)

Top  Previous  Next

This method is used to add a result line associated with a tree node of the kind 'found text' to the result window of the operation. All the parent nodes are added automatically. Typically this method is used by operations that search text in the source code. When the user locates a node of this kind (double-clicking on it), the code window of the associated project item is opened and the found text is selected in the source code.

Signature

[VB.NET]

Function AddNodeToResultsTree(ByVal projectItem As EnvDTE.ProjectItem, ByVal leafCodeElement As EnvDTE.CodeElement, ByVal resultLineText As String, ByVal foundText As String, ByVal startLineNumber As Integer, ByVal startOffset As Integer, ByVal endLineNumber As Integer, ByVal endOffset As Integer, ByVal customValue As Object) As Boolean

[C#]

bool AddNodeToResultsTree(EnvDTE.ProjectItem projectItem, EnvDTE.CodeElement leafCodeElement, string resultLineText, string foundText, int startLineNumber, int startOffset, int endLineNumber, int endOffset, object customValue)

Return Value

True if the node is added successfully or false otherwise.

Parameters

  • projectItem: the project item of the result node.
  • leafCodeElement: the code element of the result node.
  • resultLineText: the text of the result line.
  • foundText: the text that has been found.
  • startLineNumber: the number of the first line of the paragraph with the found text.
  • startOffset: the offset of the first character of the paragraph with the found text.
  • endLineNumber: the number of the last line of the paragraph with the found text.
  • endOffset: the offset of the last character of the paragraph with the found text.
  • customValue: a custom, user-defined value to store in the result node. You can retrieve it back in the OnAfterLocateFoundTextResult method.

See Also:

AddNodeToResultsTree Method (OperationBase) (Variation1)

AddNodeToResultsTree Method (OperationBase) (Variation2)

AddNodeToResultsTree Method (OperationBase) (Variation3)

AddNodeToResultsTree Method (OperationBase) (Variation4)

AddNodeToResultsTree Method (OperationBase) (Variation5)