MethodBase.Attributes Property

 
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.

Gets the attributes associated with this method.

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

abstract Attributes : MethodAttributes with get

Property Value

Type: System.Reflection.MethodAttributes

One of the MethodAttributes values.

All members have a set of attributes, which are defined in relation to the specific type of member.

To get the MethodAttributes, first get the type. From the type, get the method. From the method, get the MethodAttributes.

Notes to Implementers:

Use the Attributes property to determine whether a method is public, private, final, virtual, and so on.

The following code example displays the attributes of the user-defined method Mymethod.

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

This code produces the following output:

Reflection.MethodBase.Attributes Sample

Mymethodbase = Void Mymethod(Int32, System.String ByRef, System.String ByRef)

PrivateScope

FamANDAssem

Family

Public

HideBySig

ReuseSlot

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: