共用方式為


Property.Collection 屬性

取得包含支援此屬性之 Property 物件的 Collection。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
ReadOnly Property Collection As Properties
    Get
Properties Collection { get; }
property Properties^ Collection {
    Properties^ get ();
}
abstract Collection : Properties
function get Collection () : Properties

屬性值

型別:EnvDTE.Properties
Properties 集合。

範例

public void CodeExample(DTE2 dte)
{  
    try
    {   // Open a solution before running this example
        Properties props = dte.Solution.Properties;
        Property prop;
        string msg = "";
        if (props.Count > 0)
        {
            prop = props.Item(1); // Get first property
            msg += "\nThis Property is named: " + prop.Name;
            msg += "\nThis Property is located in a collection within         
            the following solution: " + 
            ((Solution)prop.Collection.Parent).FullName;
            if (prop.Parent.Equals(prop.Collection))
                msg += "\nThe parent and collection properties return 
                the same object.";
            msg += "\nThe DTE property returns: " + prop.DTE.Name;
        }
        MessageBox.Show(msg, "Property Object");
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework 安全性

請參閱

參考

Property 介面

EnvDTE 命名空間

其他資源

HOW TO:編譯和執行 Automation 物件模型程式碼範例