Projects.Properties 属性

获取属于 Projects 集合的所有属性的集合。

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

语法

声明
ReadOnly Property Properties As Properties
Properties Properties { get; }
property Properties^ Properties {
    Properties^ get ();
}
abstract Properties : Properties with get
function get Properties () : Properties

属性值

类型:EnvDTE.Properties
一个 Properties 集合。

备注

一些属性公开为 Solution 对象上的自动化属性,或者公开为通过解决方案获取的对象(如生成依赖项的 SolutionBuild 对象)的自动化属性。

示例

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);
    }
}

.NET Framework 安全性

请参阅

参考

Projects 接口

EnvDTE 命名空间

其他资源

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