Generated by DocFX

Class TypeExtensions

Type extensions.

Inheritance
System.Object
TypeExtensions
Namespace: ISynergy.Framework.Core.Extensions
Assembly: ISynergy.Framework.Core.dll
Syntax
public static class TypeExtensions : object

Methods

View Source

GetDefaultValue(Type)

Gets the default value for a type. This method should serve as a programmatic equivalent to default(T).

Declaration
public static object GetDefaultValue(this Type type)
Parameters
Type Name Description
Type type

The type whose default value should be retrieved.

Returns
Type Description
System.Object
View Source

GetInnerMostType(Type)

Gets the type of the element in a jagged or multi-dimensional matrix.

Declaration
public static Type GetInnerMostType(this Type type)
Parameters
Type Name Description
Type type

The array type whose element type should be computed.

Returns
Type Description
Type
View Source

GetInterfaces(Type, Boolean)

Get interfaces from type.

Declaration
public static IEnumerable<Type> GetInterfaces(this Type _self, bool includeInherited)
Parameters
Type Name Description
Type _self

The self.

System.Boolean includeInherited

if set to true [include inherited].

Returns
Type Description
IEnumerable<Type>

IEnumerable<Type>.

View Source

HasDefaultConstructor(Type)

Determines whether the given type has a public default (parameterless) constructor.

Declaration
public static bool HasDefaultConstructor(this Type t)
Parameters
Type Name Description
Type t

The type to check.

Returns
Type Description
System.Boolean

True if the type has a public parameterless constructor; false otherwise.

View Source

MakeArrayType(Type, Int32, Boolean)

Returns a type object representing an array of the current type, with the specified number of dimensions.

Declaration
public static Type MakeArrayType(this Type elementType, int rank, bool jagged)
Parameters
Type Name Description
Type elementType

Type of the element.

System.Int32 rank

The rank.

System.Boolean jagged

Whether to return a type for a jagged array of the given rank, or a multdimensional array. Default is false (default is to return multidimensional array types).

Returns
Type Description
Type