Skip to content

MemberInfoExtensions Class ​

Definition ​

Extension methods for MemberInfo.

c#
public static class MemberInfoExtensions

View source

Methods ​

NameDescription
GetAccessibility(MemberInfo)Returns the Accessibility of the specified MemberInfo.
GetNamespace(MemberInfo)Returns the namespace the specified MemberInfo is contained in, or null if it's in the global namespace.
GetNamespaceOrThrow(MemberInfo)Returns the namespace the specified MemberInfo is contained in, or throws if it's in the global namespace.
IsProtected(MemberInfo)Returns true if the member is protected as viewed from an external assembly, that is, its Accessibility is Protected or ProtectedInternal; false otherwise.
IsPublic(MemberInfo)Returns true if the member is public, that is, its Accessibility is Public; false otherwise.
IsPublicOrProtected(MemberInfo)Returns true if the member is public or protected as viewed from an external assembly, that is, its Accessibility is Public, Protected or ProtectedInternal; false otherwise.
ToDisplayName(MemberInfo)Returns a display name for the member. Created using DisplayNameFormatter with default options.