TypeUtilities Class

Provides utilities for working with types at runtime.

Definition

Namespace: Avalonia.Utilities
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static class TypeUtilities
Inheritance
Object    TypeUtilities

Methods

AcceptsNull(Type) Returns a value indicating whether null can be assigned to the specified type.
AcceptsNullT Returns a value indicating whether null can be assigned to the specified type.
CanCastT(Object) Returns a value indicating whether value can be casted to the specified type. If value is null, checks if instances of that type can be null.
ConvertImplicitT(Object) 
ConvertImplicitOrDefault(Object, Type) Convert a value to a type using the implicit conversions allowed by the C# language or return the default for the type if the value could not be converted.
ConvertOrDefault(Object, Type, CultureInfo) Convert a value to a type by any means possible, returning the default for that type if the value could not be converted.
Default(Type) Gets the default value for the specified type.
IsNumeric(Type) Determines if a type is numeric. Nullable numeric types are considered numeric.
TryConvert(Type, Object, CultureInfo, Object) Try to convert a value to a type by any means possible.
TryConvertImplicit(Type, Object, Object) Try to convert a value to a type using the implicit conversions allowed by the C# language.

See Also