Proprietà Commands2.Count

Ottiene un valore che indica il numero di oggetti in Commands raccolta.

Spazio dei nomi:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Sintassi

'Dichiarazione
ReadOnly Property Count As Integer
int Count { get; }
property int Count {
    int get ();
}
abstract Count : int
function get Count () : int

Valore proprietà

Tipo: System.Int32
Il numero di oggetti in Commands raccolta.

Esempi

Sub CountExample(ByVal dte As DTE2)

    ' Display all add-ins.
    Dim i As Integer
    Dim addIn As AddIn
    Dim msg As String

    For i = 1 To dte.AddIns.Count
        addIn = dte.AddIns.Item(i)
        msg &= "    " & addIn.Name

        If addIn.Connected Then
            msg &= " (Loaded)" & vbCrLf
        Else
            msg &= " (Not Loaded)" & vbCrLf
        End If
    Next

    MsgBox("Available add-ins:" & vbCrLf & vbCrLf & msg)

End Sub
public void CountExample(DTE2 dte)
{
    // Display all add-ins.
    AddIn addIn;
    string msg = "";

    for (int i = 1; i <= dte.AddIns.Count; ++i)
    {
        addIn = dte.AddIns.Item(i);
        msg += "    " + addIn.Name;

        if (addIn.Connected)
            msg += " (Loaded)\n";
        else
            msg += " (Not Loaded)\n";
    }

    MessageBox.Show("Available add-ins:\n\n" + msg);
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Commands2 Interfaccia

Overload Count

Spazio dei nomi EnvDTE80

Altre risorse

Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione