次の方法で共有


Solution2.DTE Property

Definition

Gets the top-level extensibility object.

public:
 property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };
public:
 property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };
[System.Runtime.InteropServices.DispId(10)]
public EnvDTE.DTE DTE { [System.Runtime.InteropServices.DispId(10)] get; }
[<System.Runtime.InteropServices.DispId(10)>]
[<get: System.Runtime.InteropServices.DispId(10)>]
member this.DTE : EnvDTE.DTE
Public ReadOnly Property DTE As DTE

Property Value

DTE

A DTE object.

Implements

DTE
Attributes

Examples

Sub SolutionDTEExample(ByVal dte As DTE2)  
    ' Displays the caption of the active window,  
    ' obtained through the DTE object. Open a solution in   
    ' Visual Studio before running this example.  
    Try  
        Dim soln As Solution2 = CType(_applicationObject.Solution, _  
        Solution2)  
        MsgBox _  
        ("The caption of the active window, obtained through the DTE object, is: " & _  
        vbCr & soln.DTE.ActiveWindow.Caption)  
    Catch ex As System.Exception  
        MsgBox(ex.ToString)  
    End Try  
End Sub  
//you will need to add this reference to your project as well  
using System.Windows.Forms;  
public void SolutionCount(DTE2 dte)  
{  
    // Displays the caption of the active window,  
    // obtained through the DTE object. Open a solution in   
    // Visual Studio before running this example.  
    Try  
    {  
        Solution2 soln = (Solution2)_applicationObject.Solution;  
        MessageBox.Show  
("The caption of the active window, obtained through the DTE object, is: "  
 + soln.DTE.ActiveWindow.Caption);  
    }  
    catch(SystemException ex)  
    {  
        MessageBox.Show("ERROR: " + ex);  
    }  
}  

Remarks

In Visual Studio, the DTE object is the root of the automation model, which other object models often call "Application".

Applies to