次の方法で共有


VSProjectItem.DTE プロパティ

トップ レベルの機能拡張オブジェクトを返します。

名前空間:  VSLangProj
アセンブリ:  VSLangProj (VSLangProj.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 では、DTE オブジェクトがオートメーション モデルのルート オブジェクトです。他のオブジェクト モデルでは、多くの場合、"アプリケーション" と呼ばれます。

Public Sub PrjDTE(ByVal dte As DTE2)
    ' List the parent object for the first VSProjectItem.
    ' Before running, open a VB or C# application in VS.
    Dim vsPrj As VSProject = _
    CType(dte.Solution.Projects.Item(1).Object, _
    VSProject)
    Dim vsPrjItem As VSProjectItem

    vsPrjItem = CType(dte.Solution.Projects.Item(1) _
    .ProjectItems.Item(1).Object, VSProjectItem)
    MsgBox("Parent object for VSProjectItem: " & vsPrjItem.DTE)
End Sub
public void PrjDTE(DTE2 dte)
{
    // Lists the parent object for the first VSProjectItem.
    // Before running, open a VB or C# application in VS.
    VSProject vsPrj = (VSProject)dte.Solution.
    Projects.Item(1).Object;
    VSProjectItem vsPrjItem;

    vsPrjItem = (VSProjectItem)dte.Solution.
    Projects.Item(1).ProjectItems.Item(1).Object;
    MessageBox.Show("Parent object for VSProjectItem" + vsPrjItem.DTE);
}

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

VSProjectItem インターフェイス

VSLangProj 名前空間

その他の技術情報

方法 : オートメーション オブジェクト モデルのコード例をコンパイルおよび実行する