Count Property
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Commands.Count Property

Gets a value indicating the number of objects in the Commands collection.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

int Count { get; }
/** @property */
int get_Count ()

function get Count () : int

Property Value

The number of objects in the Commands collection.

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";
            msg += " (Not Loaded)\n";

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