TypeUtilities Class

Summary

Provides utilities for working with types at runtime.
Namespace
Avalonia.Utilities
Base Types
  • object
graph BT Type-->Base0["object"] Type["TypeUtilities"] class Type type-node

Syntax

public static class TypeUtilities

Methods

Name Value Summary
AcceptsNull(Type) bool
Returns a value indicating whether null can be assigned to the specified type.
static
ConvertImplicit<T>(object) T
static
ConvertImplicitOrDefault(object, Type) object
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.
static
ConvertOrDefault(object, Type, CultureInfo) object
Convert a value to a type by any means possible, returning the default for that type if the value could not be converted.
static
Default(Type) object
Gets the default value for the specified type.
static
IsNumeric(Type) bool
Determines if a type is numeric. Nullable numeric types are considered numeric.
static
TryConvert(Type, object, CultureInfo, object) bool
Try to convert a value to a type by any means possible.
static
TryConvertImplicit(Type, object, object) bool
Try to convert a value to a type using the implicit conversions allowed by the C# language.
static