Skip to content

Mirror::Weaver::Extensions

Public Functions

Name
bool Is(this TypeReference td, Type t)
bool Is< T >(this TypeReference td)
bool IsDerivedFrom< T >(this TypeDefinition td)
bool IsDerivedFrom(this TypeDefinition td, Type baseClass)
TypeReference GetEnumUnderlyingType(this TypeDefinition td)
bool ImplementsInterface< TInterface >(this TypeDefinition td)
bool IsMultidimensionalArray(this TypeReference tr)
bool CanBeResolved(this TypeReference parent)
MethodReference MakeHostInstanceGeneric(this MethodReference self, GenericInstanceType instanceType)
Given a method of a generic class such as ArraySegmentT.get_Count, and a generic instance such as ArraySegmentint Creates a reference to the specialized method ArraySegmentint.get_Count
FieldReference SpecializeField(this FieldReference self, GenericInstanceType instanceType)
Given a field of a generic class such as Writer.write, and a generic instance such as ArraySegmentint Creates a reference to the specialized method ArraySegmentint`.get_Count
CustomAttribute GetCustomAttribute< TAttribute >(this ICustomAttributeProvider method)
bool HasCustomAttribute< TAttribute >(this ICustomAttributeProvider attributeProvider)
T GetField< T >(this CustomAttribute ca, string field, T defaultValue)
MethodDefinition GetMethod(this TypeDefinition td, string methodName)
List< MethodDefinition > GetMethods(this TypeDefinition td, string methodName)
MethodDefinition GetMethodInBaseType(this TypeDefinition td, string methodName)
IEnumerable< FieldDefinition > FindAllPublicFields(this TypeReference variable)
Finds public fields in type and base type
IEnumerable< FieldDefinition > FindAllPublicFields(this TypeDefinition typeDefinition)
Finds public fields in type and base type

Public Functions Documentation

function Is

static inline bool Is(
    this TypeReference td,
    Type t
)

function Is< T >

static bool Is< T >(
    this TypeReference td
)

function IsDerivedFrom< T >

static bool IsDerivedFrom< T >(
    this TypeDefinition td
)

function IsDerivedFrom

static inline bool IsDerivedFrom(
    this TypeDefinition td,
    Type baseClass
)

function GetEnumUnderlyingType

static inline TypeReference GetEnumUnderlyingType(
    this TypeDefinition td
)

function ImplementsInterface< TInterface >

static inline bool ImplementsInterface< TInterface >(
    this TypeDefinition td
)

function IsMultidimensionalArray

static inline bool IsMultidimensionalArray(
    this TypeReference tr
)

function CanBeResolved

static inline bool CanBeResolved(
    this TypeReference parent
)

function MakeHostInstanceGeneric

static inline MethodReference MakeHostInstanceGeneric(
    this MethodReference self,
    GenericInstanceType instanceType
)

Given a method of a generic class such as ArraySegmentT.get_Count, and a generic instance such as ArraySegmentint Creates a reference to the specialized method ArraySegmentint.get_Count

Parameters:

  • self
  • instanceType

Return:

Note that calling ArraySegment`T.get_Count directly gives an invalid IL error

function SpecializeField

static inline FieldReference SpecializeField(
    this FieldReference self,
    GenericInstanceType instanceType
)

Given a field of a generic class such as Writer.write, and a generic instance such as ArraySegmentint Creates a reference to the specialized method ArraySegmentint`.get_Count

Parameters:

  • self
  • instanceType Generic Instance eg Writer

Return:

Note that calling ArraySegment`T.get_Count directly gives an invalid IL error

function GetCustomAttribute< TAttribute >

static inline CustomAttribute GetCustomAttribute< TAttribute >(
    this ICustomAttributeProvider method
)

function HasCustomAttribute< TAttribute >

static inline bool HasCustomAttribute< TAttribute >(
    this ICustomAttributeProvider attributeProvider
)

function GetField< T >

static inline T GetField< T >(
    this CustomAttribute ca,
    string field,
    T defaultValue
)

function GetMethod

static inline MethodDefinition GetMethod(
    this TypeDefinition td,
    string methodName
)

function GetMethods

static inline List< MethodDefinition > GetMethods(
    this TypeDefinition td,
    string methodName
)

function GetMethodInBaseType

static inline MethodDefinition GetMethodInBaseType(
    this TypeDefinition td,
    string methodName
)

function FindAllPublicFields

static inline IEnumerable< FieldDefinition > FindAllPublicFields(
    this TypeReference variable
)

Finds public fields in type and base type

Parameters:

  • variable

Return:

function FindAllPublicFields

static inline IEnumerable< FieldDefinition > FindAllPublicFields(
    this TypeDefinition typeDefinition
)

Finds public fields in type and base type

Parameters:

  • variable

Return:


Updated on 26 January 2021 at 13:37:24 UTC