In This Article

Modifiers Enum

Specifies the modifiers for a type or member.

[Flags]
public enum Modifiers

Fields

Name Description
Abstract

Defines a class or member that must be inherited. Represents MustOverride and MustInherit in Visual Basic.

AccessMask

The bitmask for access modifiers.

Assembly

Internal (also known as Internal or Friend) access. Code within the assembly that declares an assembly element can access it.

Async

Specifies that the target procedure is asynchronously executed.

ByRef

Specifies that a value is passed by reference. Used in C# only.

Default

Identifies a property as the default property of its class, structure, or interface. Used in Visual Basic only.

External

Defines a method that is implemented externally.

Family

Protected access.
Code within the class that declares a family (also known as Protected) element, or a class derived from it, can access the element.

FamilyOrAssembly

Family or assembly access. This is a union of Family and Assembly access. Code within the same class or the same assembly as the element, or within any class derived from the element's class, can access it.

Final

Defines a class or member that cannot be overridden (also known as Sealed). Represents NotInheritable and NotOverridable in Visual Basic.

Iterator

Specifies that a property or procedure that contains an iterator. Used in Visual Basic only.

Narrowing

Indicates that a conversion operator (CType) converts a class or structure to a type that might not be able to hold some of the possible values of the original class or structure. Used in Visual Basic only.

New

Hides a defined member in a base class. Represents Shadows in Visual Basic.

None

No modifier.

Overloads

Specifies that a property or procedure redeclares one or more existing properties or procedures with the same name. Used in Visual Basic only.

Override

Defines a member that overrides a base abstract or virtual implementation. Represents Overrides in Visual Basic.

Partial

Defines the type as a partial type which is defined in multiple parts.

Private

Private access. Code within the type that declares a private element, including code within contained types, can access the element.

Public

Public access. Any code that can see a public element can access it.

ReadOnly

Defines a read-only member.

Static

Defines a static member. Represents Shared in Visual Basic.

Unsafe

Defines an unsafe context. Used in C# only.

Virtual

Defines a member that can be overridden. Represents Overridable in Visual Basic.

Volatile

Defines a field that can be modified by multiple concurrently executing threads. Used in C# only.

Widening

Indicates that a conversion operator (CType) converts a class or structure to a type that can hold all possible values of the original class or structure. Used in Visual Basic only.

WithEvents

Specifies that one or more declared member variables refer to an instance of a class that can raise events. Used in Visual Basic only.

WriteOnly

Specifies that a property can be written but not read. Used in Visual Basic only.