Configurations.Count 属性

获取指示 Configurations 集合中的对象数的值。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
ReadOnly Property Count As Integer
int Count { get; }
property int Count {
    int get ();
}
abstract Count : int with get
function get Count () : int

属性值

类型:Int32
一个整数,指示集合中的对象数。

示例

public void CodeExample(DTE2 dte, AddIn addin)
{   
    try
    {   // Make sure you have a solution loaded into Visual Studio
        // before running the following example. Make sure the "Any
        // CPU" option is marked in the Configuration Manager dialog box.
        Configurations configs = null;
        if (dte.Solution.Projects.Count > 0)
        {
            configs = dte.Solution.Projects.Item(1).ConfigurationManager.Platform("Any CPU");
            // Show the number of configurations in the collection.
            MessageBox.Show(configs.Count.ToString());
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework 安全性

请参阅

参考

Configurations 接口

EnvDTE 命名空间

其他资源

如何:编译和运行自动化对象模型代码示例