PropertyAttributes Enumeration

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Defines the attributes that can be associated with a property. These attribute values are defined in corhdr.h.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

[<SerializableAttribute>]
[<FlagsAttribute>]
[<ComVisibleAttribute(true)>]
type PropertyAttributes

Member nameDescription
HasDefault

Specifies that the property has a default value.

None

Specifies that no attributes are associated with a property.

Reserved2

Reserved.

Reserved3

Reserved.

Reserved4

Reserved.

ReservedMask

Specifies a flag reserved for runtime use only.

RTSpecialName

Specifies that the metadata internal APIs check the name encoding.

SpecialName

Specifies that the property is special, with the name describing how the property is special.

To get the PropertyAttributes, first get the class Type. From the Type, get the PropertyInfo. From the PropertyInfo, get the Attributes.

The enumerated value is a number representing the bitwise OR of the attributes implemented on the method.

The following example builds three properties and displays the PropertyAttributes enumerated value. Note that the read-only property has no setter and thus cannot be changed by.Caption = statement.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: