The identifiers defined in the System.CodeDom.MemberAttributes enumeration can be used to indicate the scope and access attributes of a class member.
There is no Virtual member attribute. A member is declared virtual by setting its member access to MemberAttributes.Public (property1.Attributes = MemberAttributes.Public) without specifying it as MemberAttributes.Final. The absence of the MemberAttributes.Final flag makes a member virtual in C# (public virtual), overrideable in Visual Basic (Public Overrideable). To avoid declaring the member as virtual or overrideable, set both the MemberAttributes.Public and MemberAttributes.Final flags in the CodeTypeMember.Attributes property. See the CodeTypeMember.Attributes property for more information on setting member attributes.
The pattern for setting the access flags (flags containing the terms Public, Private, Assembly, or Family) is to mask out all access flags using the MemberAttributes.AccessMask mask and then set the desired access flag. For example, the code statement to identify a constructor (named constructor1) as public is constructor1.Attributes = (constructor1.Attributes & ~MemberAttributes.AccessMask) | MemberAttributes.Public;. Setting the CodeTypeMember.Attributes property directly to an access flag (for example, constructor1.Attributes = MemberAttributes.Public;) erases all other flags that might be set. This pattern should also be used for setting the scope flags (MemberAttributes.Abstract, MemberAttributes.Final, MemberAttributes.Static, MemberAttributes.Override or MemberAttributes.Const) using the MemberAttributes.ScopeMask mask.
An abstract member.
An access mask.
A member that is accessible to any class within the same assembly.
A constant member.
A member that is accessible within the family of its class and derived classes.
A member that is accessible within its class, and derived classes in the same assembly.
A member that is accessible within its class, its derived classes in any assembly, and any class in the same assembly.
A member that cannot be overridden in a derived class.
A new member.
An overloaded member. Some languages, such as Visual Basic, require overloaded members to be explicitly indicated.
A member that overrides a base class member.
A private member.
A public member.
A scope mask.
A static member. In Visual Basic, this is equivalent to the Shared keyword.
A VTable mask.