CommandWindow.DTE الخاصية
إحضار كائن القابلية للتوسعة من المستوى الأعلى.
مساحة الاسم: EnvDTE
التجميع: EnvDTE (في EnvDTE.dll)
بناء الجملة
'إقرار
ReadOnly Property DTE As DTE
Get
DTE DTE { get; }
property DTE^ DTE {
DTE^ get ();
}
abstract DTE : DTE
function get DTE () : DTE
قيمة الخاصية
النوع: EnvDTE.DTE
كائن DTE .
ملاحظات
في Visual Studio, the DTE كائن هو the جذر of the automation model, which غير ذلك كائن نماذج often يتصل "تطبيق."
أمثلة
public void CodeExample(DTE2 dte, AddIn addin)
{
try
{
// Get a reference to a Command window.
Window win = dte.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow);
CommandWindow cmdWin = (CommandWindow)win.Object;
// Add some text to the window.
cmdWin.OutputString("This is a line of text in the CommandWindow TextDocument");
// Return the contents of the TextDocument and display them.
TextDocument txtDoc = cmdWin.TextDocument;
TextSelection txtSel = txtDoc.Selection;
TextRanges txtRanges = txtSel.TextRanges;
// Show text in textdocument.
foreach (TextRange txtRange in txtRanges)
{
txtRange.StartPoint.StartOfDocument();
MessageBox.Show(txtRange.StartPoint.GetText(txtRange.EndPoint));
}
// Show the CommandWindow's parent object's caption property
MessageBox.Show("The Parent window's caption: " + cmdWin.Parent.Caption);
// Show the application object containing the CommandWindow.
MessageBox.Show(cmdWin.DTE.Name);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
أمن NET Framework.
- الثقة الكاملة للمتصل الفوري. يتعذر استخدام هذا العضو بواسطة التعليمات البرمجية الموثوق بها جزئيًا. لمزيد من المعلومات، راجع باستخدام مكتبات من تعليمات برمجية موثوق بها جزئي.
راجع أيضًَا
المرجع
موارد أخرى
كيفية: الترجمة وإعادة تشغيل أمثلة التعليمات البرمجية لطراز كائن التنفيذ التلقائي