MetalamaAPI documentationAspect APIMetalama.​Framework.​CodeGeneric­Extensions
Open sandboxFocus

GenericExtensions Class

Provides extension methods to work with generic declarations.

Inheritance
System.Object
GenericExtensions
Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public static class GenericExtensions : Object

Methods

Name Description
ForTypeInstance(IConstructor, INamedType)

Returns a representation of the current IConstructor, but for a different generic instance of the declaring type.

ForTypeInstance(IEvent, INamedType)

Returns a representation of the current IEvent, but for a different generic instance of the declaring type.

ForTypeInstance(IField, INamedType)

Returns a representation of the current IField, but for a different generic instance of the declaring type.

ForTypeInstance(IMethod, INamedType)

Returns a representation of the current IMethod, but for a different generic instance of the declaring type.

ForTypeInstance(INamedType, INamedType)

Returns a representation of the current nested INamedType, but for a different generic instance of the declaring type.

ForTypeInstance(IProperty, INamedType)

Returns a representation of the current IProperty, but for a different generic instance of the declaring type.

GetBase(IMemberOrNamedType)

Gets the base type of a type or the base member of an overridden member, if any.

GetOriginalDefinition(IConstructor)
GetOriginalDefinition(IDeclaration)
GetOriginalDefinition(IEvent)
GetOriginalDefinition(IMember)
GetOriginalDefinition(IMemberOrNamedType)
GetOriginalDefinition(IMethod)
GetOriginalDefinition(INamedType)
GetOriginalDefinition(IProperty)
IsSelfOrDeclaringTypeGeneric(IMemberOrNamedType)

Returns true if the current declaration, or any the declaring type, is generic.

WithTypeArguments(IMethod, IType[])

Constructs a generic instance of an IMethod, with type arguments given as IType.

WithTypeArguments(IMethod, IReadOnlyList<IType>)
WithTypeArguments(IMethod, IReadOnlyList<Type>)
WithTypeArguments(IMethod, IReadOnlyList<Type>, IReadOnlyList<Type>)
WithTypeArguments(IMethod, Type[])

Constructs a generic instance of an IMethod, with type arguments given as reflection System.Type.

WithTypeArguments(IMethod, Type[], Type[])
WithTypeArguments(INamedType, IType[])

Constructs a generic instance of an INamedType, with type arguments given as IType.

WithTypeArguments(INamedType, IReadOnlyList<Type>)
WithTypeArguments(INamedType, Type[])

Constructs a generic instance of an INamedType, with type arguments given a reflection System.Type.