Show / Hide Table of Contents

Class TypeSlim

Lightweight representation of a type.

Inheritance
System.Object
TypeSlim
ArrayTypeSlim
GenericParameterTypeSlim
GenericTypeSlim
SimpleTypeSlimBase
StructuralTypeSlim
Implements
System.IEquatable<TypeSlim>
Namespace: System.Reflection
Assembly: Nuqleon.Linq.Expressions.Bonsai.dll
Syntax
public abstract class TypeSlim : Object, IEquatable<TypeSlim>

Constructors

TypeSlim()

Creates a new type representation object.

Declaration
protected TypeSlim()

Properties

Kind

Gets the kind of the type.

Declaration
public abstract TypeSlimKind Kind { get; }
Property Value
Type Description
TypeSlimKind

Methods

Array(TypeSlim)

Creates a new lightweight representation of a single-dimensional array type.

Declaration
public static ArrayTypeSlim Array(TypeSlim elementType)
Parameters
Type Name Description
TypeSlim elementType

The element type of the array.

Returns
Type Description
ArrayTypeSlim

A lightweight representation of a single-dimensional array type.

Array(TypeSlim, Int32)

Creates a new lightweight representation of a multi-dimensional array type.

Declaration
public static ArrayTypeSlim Array(TypeSlim elementType, int rank)
Parameters
Type Name Description
TypeSlim elementType

The element type of the array.

System.Int32 rank

The number of dimensions of the array.

Returns
Type Description
ArrayTypeSlim

A lightweight representation of a multi-dimensional array type.

Equals(Object)

The default equals method.

Declaration
public override sealed bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The object to compare against.

Returns
Type Description
System.Boolean

true if the given object equals this object, false otherwise.

Equals(TypeSlim)

The equals method for comparing against other class instances.

Declaration
public virtual bool Equals(TypeSlim other)
Parameters
Type Name Description
TypeSlim other

The other instance.

Returns
Type Description
System.Boolean

true if the given instance equals this instance, false otherwise.

Generic(GenericDefinitionTypeSlim, ReadOnlyCollection<TypeSlim>)

Creates a new lightweight representation of a closed generic type.

Declaration
public static GenericTypeSlim Generic(GenericDefinitionTypeSlim typeDefinition, ReadOnlyCollection<TypeSlim> arguments)
Parameters
Type Name Description
GenericDefinitionTypeSlim typeDefinition

Generic type definition.

System.Collections.ObjectModel.ReadOnlyCollection<TypeSlim> arguments

Generic type arguments.

Returns
Type Description
GenericTypeSlim

A new lightweight representation of a closed generic type.

Generic(GenericDefinitionTypeSlim, TypeSlim)

Creates a new lightweight representation of a closed generic type with one type argument.

Declaration
public static GenericTypeSlim Generic(GenericDefinitionTypeSlim typeDefinition, TypeSlim argument1)
Parameters
Type Name Description
GenericDefinitionTypeSlim typeDefinition

Generic type definition.

TypeSlim argument1

The first type argument.

Returns
Type Description
GenericTypeSlim

A new lightweight representation of a closed generic type.

Generic(GenericDefinitionTypeSlim, TypeSlim, TypeSlim)

Creates a new lightweight representation of a closed generic type with two type arguments.

Declaration
public static GenericTypeSlim Generic(GenericDefinitionTypeSlim typeDefinition, TypeSlim argument1, TypeSlim argument2)
Parameters
Type Name Description
GenericDefinitionTypeSlim typeDefinition

Generic type definition.

TypeSlim argument1

The first type argument.

TypeSlim argument2

The second type argument.

Returns
Type Description
GenericTypeSlim

A new lightweight representation of a closed generic type.

Generic(GenericDefinitionTypeSlim, TypeSlim, TypeSlim, TypeSlim)

Creates a new lightweight representation of a closed generic type with three type arguments.

Declaration
public static GenericTypeSlim Generic(GenericDefinitionTypeSlim typeDefinition, TypeSlim argument1, TypeSlim argument2, TypeSlim argument3)
Parameters
Type Name Description
GenericDefinitionTypeSlim typeDefinition

Generic type definition.

TypeSlim argument1

The first type argument.

TypeSlim argument2

The second type argument.

TypeSlim argument3

The third type argument.

Returns
Type Description
GenericTypeSlim

A new lightweight representation of a closed generic type.

Generic(GenericDefinitionTypeSlim, TypeSlim, TypeSlim, TypeSlim, TypeSlim)

Creates a new lightweight representation of a closed generic type with four type arguments.

Declaration
public static GenericTypeSlim Generic(GenericDefinitionTypeSlim typeDefinition, TypeSlim argument1, TypeSlim argument2, TypeSlim argument3, TypeSlim argument4)
Parameters
Type Name Description
GenericDefinitionTypeSlim typeDefinition

Generic type definition.

TypeSlim argument1

The first type argument.

TypeSlim argument2

The second type argument.

TypeSlim argument3

The third type argument.

TypeSlim argument4

The fourth type argument.

Returns
Type Description
GenericTypeSlim

A new lightweight representation of a closed generic type.

Generic(GenericDefinitionTypeSlim, TypeSlim[])

Creates a new lightweight representation of a closed generic type.

Declaration
public static GenericTypeSlim Generic(GenericDefinitionTypeSlim typeDefinition, params TypeSlim[] arguments)
Parameters
Type Name Description
GenericDefinitionTypeSlim typeDefinition

Generic type definition.

TypeSlim[] arguments

Generic type arguments.

Returns
Type Description
GenericTypeSlim

A new lightweight representation of a closed generic type.

GenericDefinition(AssemblySlim, String)

Creates a new lightweight representation of an open generic type.

Declaration
public static GenericDefinitionTypeSlim GenericDefinition(AssemblySlim assembly, string name)
Parameters
Type Name Description
AssemblySlim assembly

Assembly defining the type.

System.String name

Name of the type.

Returns
Type Description
GenericDefinitionTypeSlim

A new lightweight representation of an open generic type.

GenericParameter(String)

Creates a new lightweight representation of a generic parameter type.

Declaration
public static GenericParameterTypeSlim GenericParameter(string name)
Parameters
Type Name Description
System.String name

Name of the generic parameter type (for diagnostic purposes only).

Returns
Type Description
GenericParameterTypeSlim

A new lightweight representation of a generic parameter type.

GetHashCode()

Returns a hash code for this object.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

The hash code.

Simple(AssemblySlim, String)

Creates a new lightweight representation of a simple type, i.e. not constructed from other types.

Declaration
public static SimpleTypeSlim Simple(AssemblySlim assembly, string name)
Parameters
Type Name Description
AssemblySlim assembly

Assembly defining the type.

System.String name

Name of the type.

Returns
Type Description
SimpleTypeSlim

A new lightweight representation of a simple type, i.e. not constructed from other types.

Structural(ReadOnlyCollection<PropertyInfoSlim>, Boolean, StructuralTypeSlimKind)

Creates a new lightweight representation of a structural type with the specified properties.

Declaration
public static StructuralTypeSlim Structural(ReadOnlyCollection<PropertyInfoSlim> properties, bool hasValueEqualitySemantics, StructuralTypeSlimKind kind)
Parameters
Type Name Description
System.Collections.ObjectModel.ReadOnlyCollection<PropertyInfoSlim> properties

The properties of the structural type.

System.Boolean hasValueEqualitySemantics

true if the structural type has value equality semantics, false otherwise.

StructuralTypeSlimKind kind

The kind of structural type.

Returns
Type Description
StructuralTypeSlim

A new lightweight representation of a structural type with the specified properties.

ToCSharpString()

Gets a string representation of the type using C# syntax. The resulting string is not guaranteed to be semantically equivalent and should be used for diagnostic purposes only.

Declaration
public string ToCSharpString()
Returns
Type Description
System.String

String representation of the type using C# syntax.

ToString()

Returns a friendly string representation of the type.

Declaration
public override string ToString()
Returns
Type Description
System.String

Friendly string representation of the type.

Operators

Equality(TypeSlim, TypeSlim)

Operator overload for equality checks between slim types.

Declaration
public static bool operator ==(TypeSlim typeSlimA, TypeSlim typeSlimB)
Parameters
Type Name Description
TypeSlim typeSlimA

The left slim type.

TypeSlim typeSlimB

The right slim type.

Returns
Type Description
System.Boolean

true if the slim types are equal, false otherwise.

Inequality(TypeSlim, TypeSlim)

Operator overload for inequality checks between slim types.

Declaration
public static bool operator !=(TypeSlim typeSlimA, TypeSlim typeSlimB)
Parameters
Type Name Description
TypeSlim typeSlimA

The left slim type.

TypeSlim typeSlimB

The right slim type.

Returns
Type Description
System.Boolean

true if the slim types are not equal, false otherwise.

Implements

System.IEquatable<>

Extension Methods

TypeSlimExtensions.ToType(TypeSlim)
TypeSlimExtensions.ToType(TypeSlim, IReflectionProvider)
TypeSlimExtensions.GetConstructor(TypeSlim, ReadOnlyCollection<TypeSlim>)
TypeSlimExtensions.GetProperty(TypeSlim, String, TypeSlim, ReadOnlyCollection<TypeSlim>, Boolean)
TypeSlimExtensions.GetField(TypeSlim, String, TypeSlim)
TypeSlimExtensions.GetSimpleMethod(TypeSlim, String, ReadOnlyCollection<TypeSlim>, TypeSlim)
TypeSlimExtensions.GetGenericDefinitionMethod(TypeSlim, String, ReadOnlyCollection<TypeSlim>, ReadOnlyCollection<TypeSlim>, TypeSlim)
TypeSlimExtensions.GetGenericMethod(TypeSlim, GenericDefinitionMethodInfoSlim, ReadOnlyCollection<TypeSlim>)
In This Article
Back to top Generated by DocFX