Click or drag to resize

ObjectExtension Class

Provides extension methods for converting object instances.
Inheritance Hierarchy
System.Object
  TB.ComponentModel.ObjectExtension

Namespace:  TB.ComponentModel
Assembly:  UniversalTypeConverter (in UniversalTypeConverter.dll) Version: 2.0.0
Syntax
C#
public static class ObjectExtension

The ObjectExtension type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAs<T>
Converts the given value to the given type using the default converter. The result provides access to the converted value if conversion succeeded and simplifies access to default values if conversion failed.
Public methodStatic memberCanConvert Obsolete.
For backward compatibility only. Use IsConvertibleTo(Object, Type, CultureInfo) instead.
Public methodStatic memberCanConvertTo<T> Obsolete.
Public methodStatic memberConvert Obsolete.
For backward compatibility only. Use To(Object, Type, CultureInfo) instead.
Public methodStatic memberConvertTo<T> Obsolete.
Public methodStatic memberConvertToEnumerable(IEnumerable, Type) Obsolete.
For backward compatibility only. Use ToEnumerable(IEnumerable, Type, CultureInfo) instead.
Public methodStatic memberConvertToEnumerable<T>(IEnumerable) Obsolete.
Public methodStatic memberIsConvertibleTo(Object, Type, CultureInfo)
Determines whether the given value can be converted to the specified type using the default converter.
Public methodStatic memberIsConvertibleTo(Object, Type, Object, CultureInfo)
Converts the given value to the given type using the default converter. A return value indicates whether the operation succeeded.
Public methodStatic memberIsConvertibleTo<T>(Object, CultureInfo)
Determines whether the given value can be converted to the specified type using the default converter.
Public methodStatic memberIsConvertibleTo<T>(Object, T, CultureInfo)
Converts the given value to the given type using the default converter. A return value indicates whether the operation succeeded.
Public methodStatic memberTo(Object, Type, CultureInfo)
Converts the given value to the given type using the default converter.
Public methodStatic memberTo<T>(Object, CultureInfo)
Converts the given value to the given type using the default converter.
Public methodStatic memberToDictionary
Creates a new dictionary whose key value pairs represent all non static public values of the given source. If source is null, an empty dictionary is created. If source has no non static public properties or fields (eg. int), the dictionary contains only one key named "Value" representing the given value itself.
Public methodStatic memberTryConvert Obsolete.
For backward compatibility only. Use IsConvertibleTo(Object, Type, CultureInfo) instead.
Public methodStatic memberTryConvertTo<T> Obsolete.
Top
See Also