SelectedItems.DTE プロパティ

更新 : 2007 年 11 月

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

名前空間 :  EnvDTE
アセンブリ :  EnvDTE (EnvDTE.dll 内)

構文

'宣言
ReadOnly Property DTE As DTE
'使用
Dim instance As SelectedItems
Dim value As DTE

value = instance.DTE
DTE DTE { get; }
property DTE^ DTE {
    DTE^ get ();
}
function get DTE () : DTE

プロパティ値

型 : EnvDTE.DTE

DTE オブジェクト。

解説

Visual Studio では、DTE オブジェクトがオートメーション モデルのルート オブジェクトです。他のオブジェクト モデルでは、多くの場合、"アプリケーション" と呼ばれます。

public void CodeExample(DTE2 dte)
{  
    try
    {
        // Open project and select one or more items in 
        // Solution Explorer before running this example.
        SelectedItem selItem;
        SelectedItems selItems;
        string msg = "";
        if (dte.SelectedItems.Count > 0)
        {
            selItems = dte.SelectedItems;
            selItem = selItems.Item(1);
            msg = "The first selected item is " + selItem.Name;
            msg += "\n Do the Parent and DTE property return the same object? " + (selItems.DTE.Equals(selItems.Parent)).ToString();
        }
        MessageBox.Show(msg);
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

アクセス許可

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

参照

参照

SelectedItems インターフェイス

SelectedItems メンバ

EnvDTE 名前空間

その他の技術情報

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