Projects.Properties 属性

定义

获取与集合相关的所有属性的集合 Projects

public:
 property EnvDTE::Properties ^ Properties { EnvDTE::Properties ^ get(); };
[System.Runtime.InteropServices.DispId(201)]
public EnvDTE.Properties Properties { [System.Runtime.InteropServices.DispId(201)] get; }
[<System.Runtime.InteropServices.DispId(201)>]
[<get: System.Runtime.InteropServices.DispId(201)>]
member this.Properties : EnvDTE.Properties
Public ReadOnly Property Properties As Properties

属性值

Properties

一个 Properties 集合。

属性

示例

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

注解

某些属性作为对象的自动化属性 Solution 或通过解决方案获得的对象公开,如 SolutionBuild 生成依赖项的对象。

适用于