次の方法で共有


HTMLWindow.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(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

Property Value

DTE

A DTE object.

Attributes

Examples

public void CodeExample(DTE2 dte)  
{  
   // Make sure you have an open HTML document before running this example  
    try  
    {  
        if (dte.ActiveDocument.ActiveWindow.Object is HTMLWindow)  
        {  
            HTMLWindow htmlwin;  
            string msg = "";  
            htmlwin = dte.ActiveDocument.ActiveWindow.Object as HTMLWindow;  
            // Show the related application object's name.  
            msg += "The application containing this HTMLWindow is " + htmlwin.DTE.Name;  
            // Show the HTMLWindow's parent object.  
            msg += "\nThe HTMLWindow's parent object is " + htmlwin.Parent.Type.ToString();  
            MessageBox.Show(msg);  
        }  
    }  
    catch(Exception ex)  
    {  
        MessageBox.Show(ex.Message);  
    }  
}  

Remarks

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

Applies to