Export (0) Print
Expand All

CodeTypeMember.Attributes Property

Gets or sets the attributes of the member.

Namespace:  System.CodeDom
Assembly:  System (in System.dll)

public MemberAttributes Attributes { get; set; }

Property Value

Type: System.CodeDom.MemberAttributes
A bitwise combination of the MemberAttributes values used to indicate the attributes of the member. The default value is Private | Final.

This property is used to specify the attributes of the type member.

Member attributes are classified in groups, with a mask for each group. The access group consists of flags containing the terms Public, Private, Family, or Assembly. The scope group includes flags for Abstract, Final, Static, Override, and Const. The AccessMask mask identifies the access attributes. The ScopeMask mask identifies the scope attributes. The default value for the Attributes property includes flags from both access and scope. To change either access or scope, first mask out the existing flags and then set the new value. For example, the code statement to identify a constructor (named constructor1) as public is constructor1.Attributes = (constructor1.Attributes & ~MemberAttributes.AccessMask) | MemberAttributes.Public;.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft