MethodBase.IsPublic 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 a value indicating whether this is a public method.

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

abstract IsPublic : bool with get
override IsPublic : bool with get

Property Value

Type: System.Boolean

true if this method is public; otherwise, false.

To get the MethodBase, first get the type. From the type, get the method. From the method, get the MethodBase. If the MethodBase or constructor is other than public, it is protected and cannot be readily accessed. To access a non-public method, set the BindingFlags mask to NonPublic in GetMethod.

The following example uses the IsPublic property to display a message that indicates whether the specified method is public.

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: