MrKWatkins.Reflection 1.3.1 Help

TypeExtensions Class

Definition

Extension methods for Type.

public static class TypeExtensions

Methods

Name

Description

EnumerateNestedTypes(Type)

If a type is a nested type then it enumerates its parents, starting at the outermost type, followed by the type itself. If it is not nested then it just returns the type.

GetAccessibility(Type)

Returns the Accessibility of the specified Type.

IsProtected(Type)

Returns true if the type is protected as viewed from an external assembly, i.e. its Accessibility is Protected or ProtectedInternal; false otherwise.

IsPublic(Type)

Returns true if the type is public, nested or not, i.e. its Accessibility is Public; false otherwise.

IsPublicOrProtected(Type)

Returns true if the type is public or protected as viewed from an external assembly, i.e. its Accessibility is Public, Protected or ProtectedInternal; false otherwise.

IsReadOnlyStruct(Type)

Returns true if the specified Type is a readonly struct; false otherwise.

IsRecord(Type)

Returns true if the specified Type is a record class or record struct; false otherwise.

IsRefStruct(Type)

Returns true if the specified Type is a ref struct; false otherwise.

IsStatic(Type)

Returns true if the specified Type is static; false otherwise.

Last modified: 17 December 2024