Share via


CodeTypeMember.Attributes 屬性

定義

取得或設定成員的屬性 (Attribute)。

public:
 property System::CodeDom::MemberAttributes Attributes { System::CodeDom::MemberAttributes get(); void set(System::CodeDom::MemberAttributes value); };
public System.CodeDom.MemberAttributes Attributes { get; set; }
member this.Attributes : System.CodeDom.MemberAttributes with get, set
Public Property Attributes As MemberAttributes

屬性值

MemberAttributes 值的位元組合,用來指示成員的屬性。 預設值是 Private | Final

備註

這個屬性是用來指定類型成員的屬性。

成員屬性會分類在群組中,每個群組都有遮罩。 存取群組包含包含 、PrivateFamilyAssembly詞彙的旗標Public。 範圍群組包含 、FinalStaticOverrideConstAbstract旗標。 遮罩 AccessMask 會識別存取屬性。 遮罩 ScopeMask 會識別範圍屬性。 屬性的 Attributes 預設值包含來自存取和範圍的旗標。 若要變更存取或範圍,請先遮罩現有的旗標,然後設定新的值。 例如,將名為) 的 constructor1 建構函式識別為 公用的建構函式 (的程式代碼語句為 constructor1.Attributes = (constructor1.Attributes & ~MemberAttributes.AccessMask) | MemberAttributes.Public;

適用於

另請參閱