Sdílet prostřednictvím


Projects.Count – vlastnost

Získá hodnotu určující počet objektů v Projects kolekce.

Obor názvů:  EnvDTE
Sestavení:  EnvDTE (v EnvDTE.dll)

Syntaxe

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

Hodnota vlastnosti

Typ: System.Int32
Celé číslo označující počet objektů Projects kolekce.

Příklady

public void CodeExample(DTE2 dte)
{  
    try
    {   // Open a project before running this sample
        Projects prjs = dte.Solution.Projects;
        string msg = "There are " + prjs.Count.ToString() + " projects in this collection.";
        msg += "\nThe application containing this Projects collection: " + prjs.DTE.Name;
        msg += "\nThe parent object of the Projects collection: " + prjs.Parent.Name;
        msg += "\nThe GUID representing the Projects type: " + prjs.Kind;
        if (prjs.Properties != null)
        {
            msg += "\nProperties:";
            foreach (Property prop in prjs.Properties)
            {
                msg += "\n   " + prop.Name;
            }
        }
        MessageBox.Show(msg, "Projects Collection");
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

Zabezpečení rozhraní .NET Framework

Viz také

Odkaz

Projects Rozhraní

EnvDTE – obor názvů

Další zdroje

How to: Compile and Run the Automation Object Model Code Examples