Find2.DTE Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Ruft das Erweiterbarkeitsobjekt der obersten Ebene ab.
public:
property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };
public:
property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };
[System.Runtime.InteropServices.DispId(1)]
public EnvDTE.DTE DTE { [System.Runtime.InteropServices.DispId(1)] get; }
[<System.Runtime.InteropServices.DispId(1)>]
[<get: System.Runtime.InteropServices.DispId(1)>]
member this.DTE : EnvDTE.DTE
Public ReadOnly Property DTE As DTE
Eigenschaftswert
Ein DTE-Objekt.
Implementiert
- Attribute
Beispiele
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);
}
}
Hinweise
In Visual Studio ist das DTE Objekt der Stamm des Automatisierungs Modells, das von anderen Objekt Modellen oft als "Application" bezeichnet wird.