TypeHelper Class
Namespace
Statiq.Common
Base Types
  • object
graph BT Type-->Base0["object"] Type["TypeHelper"] class Type type-node

Syntax

public static class TypeHelper

Methods

Name Return Value Summary
Convert<T>(object, Func<T>) T
Converts the provided value to the specified type. This method never throws an exception. It will return the specified default value if the value cannot be converted to T.
static
Convert<T>(object) T
Converts the provided value to the specified type. This method never throws an exception. It will return default(T) if the value cannot be converted to T.
static
ExpandKeyValuePair(KeyValuePair<string, object>, IMetadata) KeyValuePair<string, object>
This resolves the value by recursively expanding IMetadataValue.
static
ExpandValue(string, object, IMetadata) object
This resolves the value by recursively expanding IMetadataValue.
static
RegisterTypeConverter(Type, string) void
Registers a type converter at runtime.
static
RegisterTypeConverter(Type, Type) void
Registers a type converter at runtime.
static
RegisterTypeConverter<TType, TTypeConverter>() void
Registers a type converter at runtime.
static
RegisterTypeConverter<TType>(string) void
Registers a type converter at runtime.
static
RegisterTypeConverter<TType>(Type) void
Registers a type converter at runtime.
static
TryConvert(object, Type, object) bool
Tries to convert the provided value to the specified type.
static
TryConvert<T>(object, T) bool
Trys to convert the provided value to the specified type.
static
TryExpandAndConvert<T>(string, object, IMetadata, T) bool
Tries to convert the provided value to the specified type while recursively expanding IMetadataValue.
static