Find2.Parent Propriedade
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém o objeto pai imediato de um Find objeto.
public:
property EnvDTE::DTE ^ Parent { EnvDTE::DTE ^ get(); };
public:
property EnvDTE::DTE ^ Parent { EnvDTE::DTE ^ get(); };
[System.Runtime.InteropServices.DispId(2)]
public EnvDTE.DTE Parent { [System.Runtime.InteropServices.DispId(2)] get; }
[<System.Runtime.InteropServices.DispId(2)>]
[<get: System.Runtime.InteropServices.DispId(2)>]
member this.Parent : EnvDTE.DTE
Public ReadOnly Property Parent As DTE
Valor da propriedade
Um objeto DTE.
Implementações
- Atributos
Exemplos
public void Example(DTE2 dte)
{
try
{
TextDocument objTextDoc;
EditPoint objEditPoint;
Find objFind;
// Make an active text document before running this code.
objTextDoc = (TextDocument)dte.ActiveDocument.Object("TextDocument");
// Create editpoint.
objEditPoint = objTextDoc.StartPoint.CreateEditPoint();
objEditPoint.Insert("An additional line" + (Char)13);
// Create Find.
objFind = objTextDoc.DTE.Find;
// Set Find options and execute.
objFind.Action = vsFindAction.vsFindActionFind;
objFind.FindWhat = "line";
if (objFind.Execute() == vsFindResult.vsFindResultFound)
MessageBox.Show("Text found in " + objFind.Parent.FullName + " application.");
else
MessageBox.Show("Text not found" + objFind.Parent.FullName + " application.");
// Show Find object DTE property.
MessageBox.Show(objFind.DTE.Name);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Comentários
A Parent propriedade retorna o pai imediato do Find objeto.