DTE2 الواجهة
The الأعلى-المستوى كائن في the Visual Studio automation كائن model.
مساحة الاسم: EnvDTE80
التجميع: EnvDTE80 (في EnvDTE80.dll)
بناء الجملة
'إقرار
<GuidAttribute("2EE1E9FA-0AFE-4348-A89F-ED9CB45C99CF")> _
Public Interface DTE2 _
Inherits _DTE
[GuidAttribute("2EE1E9FA-0AFE-4348-A89F-ED9CB45C99CF")]
public interface DTE2 : _DTE
[GuidAttribute(L"2EE1E9FA-0AFE-4348-A89F-ED9CB45C99CF")]
public interface class DTE2 : _DTE
[<GuidAttribute("2EE1E9FA-0AFE-4348-A89F-ED9CB45C99CF")>]
type DTE2 =
interface
interface _DTE
end
public interface DTE2 extends _DTE
ملاحظات
The DTE كائن هو provided إلى you بواسطة the OnConnection أسلوب that you implement when you إنشاء an إضافة-في. The DTE كائن هو the Application كائن في Visual Basic.
للوصول إلى المشروع الخصائص الخاصة مثل كـ VBProjectsأو CSharpProjects، استخدم بناء الجملة DTE.GetObject("VBProjects").
للحصول على التفاصيل حول الرجوع إلى EnvDTEمساحة الاسم و DTEكائن، راجع التجميعات التنفيذ التلقائي المرجعي وكائن DTE2.
أمثلة
Sub DTEExample()
Dim objTextDoc As TextDocument
Dim objEP As EditPoint
'Create a new text document.
DTE2.ItemOperations.NewFile("General\Text File")
'Get a handle to the new document.
Set objTextDoc = DTE2.ActiveDocument.Object("TextDocument")
Set objEP = objTextDoc.StartPoint.CreateEditPoint
'Create an EditPoint and add some text.
objEP.Insert "A test sentence."
End Sub