Właściwość SelectedItem.Name —

Pobiera nazwę SelectedItem obiektu.

Przestrzeń nazw:  EnvDTE
Zestaw:  EnvDTE (w EnvDTE.dll)

Składnia

'Deklaracja
ReadOnly Default Property Name As String
string this { get; }
property String^ default {
    String^ get ();
}
abstract Name : string with get
function get Name () : String

Wartość właściwości

Typ: String
Ciąg reprezentujący nazwę SelectedItem obiektu.

Przykłady

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;
        }
        MessageBox.Show(msg);
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

SelectedItem Interfejs

Przestrzeń nazw EnvDTE

Inne zasoby

Porady: kompilowanie i uruchamianie kodu modelu obiektów automatyzacji — przykłady