Class
TypeExtensions

Extension methods for working with types

Definition

Namespace:Telerik.DataSource.Extensions

Assembly:Telerik.DataSource.dll

Syntax:

cs-api-definition
public static class TypeExtensions

Inheritance: objectTypeExtensions

Methods

DefaultValue(Type)

Returns the default value of the given type

Declaration

cs-api-definition
public static object DefaultValue(this Type type)

Parameters

type

Type

Returns

object

GetNonNullableType(Type)

Returns the non-nullable type for the type that is passed.

Declaration

cs-api-definition
public static Type GetNonNullableType(this Type type)

Parameters

type

Type

Returns

Type

GetTypeName(Type)

Returns the name of the type as a string

Declaration

cs-api-definition
public static string GetTypeName(this Type type)

Parameters

type

Type

Returns

string

IsCompatibleWith(Type, Type)

Returns true if the source can be assigned to the target

Declaration

cs-api-definition
public static bool IsCompatibleWith(this Type source, Type target)

Parameters

source

Type

target

Type

Returns

bool

IsDynamicObject(Type)

Returns true if the object is dynamic

Declaration

cs-api-definition
public static bool IsDynamicObject(this Type type)

Parameters

type

Type

Returns

bool

IsEnumType(Type)

Returns true if the type is an enumeration

Declaration

cs-api-definition
public static bool IsEnumType(this Type type)

Parameters

type

Type

Returns

bool

IsGenericType(Type)

Returns true if the type is generic

Declaration

cs-api-definition
public static bool IsGenericType(this Type type)

Parameters

type

Type

Returns

bool

IsInterface(Type)

Returns true if the type is an interface

Declaration

cs-api-definition
public static bool IsInterface(this Type type)

Parameters

type

Type

Returns

bool

IsNullableType(Type)

Returns true if the type is nullable

Declaration

cs-api-definition
public static bool IsNullableType(this Type type)

Parameters

type

Type

Returns

bool

IsNumericType(Type)

Returns true if the type is a number type

Declaration

cs-api-definition
public static bool IsNumericType(this Type type)

Parameters

type

Type

Returns

bool

IsPlainType(Type)

Returns true if the object is plain (that is, not dynamic)

Declaration

cs-api-definition
public static bool IsPlainType(this Type type)

Parameters

type

Type

Returns

bool

IsPredefinedType(Type)

Returns true if the type is one of the standard .NET types

Declaration

cs-api-definition
public static bool IsPredefinedType(this Type type)

Parameters

type

Type

Returns

bool

IsValueType(Type)

Returns true if the type is a Value type

Declaration

cs-api-definition
public static bool IsValueType(this Type type)

Parameters

type

Type

Returns

bool