我有一個類併爲它分配了一些屬性。從C#中的類中移除屬性
class MyClass
{
[Category("Common")]
[Description("Name")]
[Browsable(true)]
public string Name
{
get { return name;}
set { name = value; }
}
[Category("Common")]
[Description("Contact")]
[Browsable(true)]
public string ContactNo
{
get { return number;}
set { number = value; }
}
}
這裏, 當我實例化這個類,我想,當滿足特定條件,以除去contactNo財產。我怎樣才能做到這一點?
你是什麼意思刪除屬性? – Mivaweb
你不能「刪除」屬性...你想要做什麼? – xanatos
@Mivaweb:我的意思是我不想在屬性網格中顯示該屬性。 – user4818954