Property.Name 屬性
取得物件名稱。
命名空間: EnvDTE
組件: EnvDTE (在 EnvDTE.dll 中)
語法
'宣告
ReadOnly Property Name As String
string Name { get; }
property String^ Name {
String^ get ();
}
abstract Name : string with get
function get Name () : String
屬性值
類型:String
代表物件名稱的字串值。
範例
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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。