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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。