SelectedItem.Collection プロパティ

定義

このを SelectedItems サポートしているオブジェクトを格納しているコレクションを取得し SelectedItem ます。

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

プロパティ値

SelectedItems

SelectedItems コレクション。

属性

public void CodeExample(DTE2 dte)  
{    
    try  
    {  
        // Open project and select one or more items in the  
        // solution explorer before running this example.  
        SelectedItem selItem;  
        string msg = "";  
        if (dte.SelectedItems.Count > 0)  
        {  
            selItem = dte.SelectedItems.Item(1);  
            msg = "The first selected item is " + selItem.Name;  
            msg += "\nThis SelectedItem corresponds to the following ProjectItem: " + selItem.ProjectItem.Name;  
            msg += "\nThis SelectedItem is part of a collection of " + selItem.Collection.Count.ToString() + " items.";  
            msg += "\nThis is contained in the following application: " + selItem.DTE.Name;  
        }  
        MessageBox.Show(msg);  
    }  
    catch(Exception ex)  
    {  
        MessageBox.Show(ex.Message);  
    }  
}  

適用対象