Class ValueConverter
- Namespace
- Dynamicweb.Core
- Assembly
- Dynamicweb.Core.dll
Represents a value converter used for parsing input strings from forms to their respective type. This class cannot be inherited.
public sealed class ValueConverter
- Inheritance
-
ValueConverter
- Inherited Members
Constructors
ValueConverter()
Initializes a new instance of an object.
public ValueConverter()
Properties
Culture
Gets or sets the culture information.
public CultureInfo Culture { get; set; }
Property Value
DateFormat
Gets or sets the date format.
public string DateFormat { get; set; }
Property Value
DateTimeStyles
Gets or sets date/time styles.
public DateTimeStyles DateTimeStyles { get; set; }
Property Value
NumberStyles
Gets or sets the number styles.
public NumberStyles NumberStyles { get; set; }
Property Value
Methods
Convert(object?, Type)
Converts the given value from one type to another.
public object? Convert(object? value, Type targetType)
Parameters
Returns
- object
Converted value.
ConvertString(string?, Type)
Converts the given string to another type.
public object? ConvertString(string? value, Type targetType)
Parameters
Returns
- object
System.Object as the type of data requested.
Remarks
Returns null if the type specified is not Int16, Int32, Int64, bool, double, decimal, string or DateTime.
If the passed value is empty string or null, the original value is returned as string
Convert<T>(object?)
Converts the given value from one type to another.
public T? Convert<T>(object? value)
Parameters
valueobjectValue to convert.
Returns
- T
Converted value.
Type Parameters
TTarget type.
DefaultValue(Type)
Returns default value for a given type.
public static object? DefaultValue(Type valueType)
Parameters
valueTypeTypeType to return default value for.
Returns
- object
Default value for a given type.
GetEnumerableElementType(Type)
Returns the type of the given enumerable object or null (Nothing in Visual Basic) if the object is not enumerable.
public static Type? GetEnumerableElementType(Type type)
Parameters
typeTypeObject type.
Returns
- Type
The type of the given enumerable object or null (Nothing in Visual Basic) if the object is not enumerable.
GetObjectArray(Type, string, NameValueCollection)
Gets the object array from the collection.
public object[]? GetObjectArray(Type type, string key, NameValueCollection collection)
Parameters
typeTypeType of object array.
keystringKey of target in collection.
collectionNameValueCollectionData container.
Returns
- object[]
objectArray.
IsBoolean(object?)
Returns value indicating whether specified object is a boolean.
public static bool IsBoolean(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is a boolean.
IsBoolean(Type)
Returns value indicating whether specified type represents a boolean.
public static bool IsBoolean(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents a boolean.
IsCollection(object?)
Returns value indicating whether specified object is a collection (implements ICollection or ICollection<T> interface).
public static bool IsCollection(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is a collection (implements ICollection or ICollection<T> interface).
IsCollection(Type)
Returns value indicating whether specified type represents a collection (implements ICollection or ICollection<T> interface).
public static bool IsCollection(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents a collection (implements ICollection or ICollection<T> interface).
IsDate(object?)
Returns value indicating whether specified object is a date.
public static bool IsDate(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is a date.
IsDate(Type)
Returns value indicating whether specified type represents a date.
public static bool IsDate(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents a date.
IsDecimal(object?)
Returns value indicating whether specified object is a decimal number.
public static bool IsDecimal(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is a decimal number.
IsDecimal(Type)
Returns value indicating whether specified type represents a decimal number.
public static bool IsDecimal(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents a decimal number.
IsDictionary(object?)
Returns value indicating whether specified object is a dictionary (implements IDictionary or IDictionary<T> interface).
public static bool IsDictionary(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is a dictionary (implements IDictionary or IDictionary<T> interface).
IsDictionary(Type)
Returns value indicating whether specified type represents a dictionary (implements IDictionary or IDictionary<T> interface).
public static bool IsDictionary(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents a dictionary (implements IDictionary or IDictionary<T> interface).
IsDouble(object?)
Returns value indicating whether specified object is a double precision floating point number.
public static bool IsDouble(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is a double precision floating point number.
IsDouble(Type)
Returns value indicating whether specified type represents a double precision floating point number.
public static bool IsDouble(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents a double precision floating point number.
IsEnumerable(object?)
Returns value indicating whether specified object is an enumerable.
public static bool IsEnumerable(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is an enumerable.
IsEnumerable(Type)
Returns value indicating whether specified type represents an enumerable.
public static bool IsEnumerable(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents an enumerable.
IsInteger(object?)
Returns value indicating whether specified object is a 32bit integer number.
public static bool IsInteger(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is a 32bit integer number.
IsInteger(Type)
Returns value indicating whether specified type represents a 32bit integer number.
public static bool IsInteger(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents a 32bit integer number.
IsJson(object?)
Returns value indicating whether specified object is string in JSON format.
public static bool IsJson(object? value)
Parameters
valueobjectString to examine.
Returns
- bool
Value indicating whether specified object is string in JSON format.
IsList(object?)
Returns value indicating whether specified object is a list (implements IList or IList<T> interface).
public static bool IsList(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is a list (implements IList or IList<T> interface).
IsList(Type)
Returns value indicating whether specified type represents a list (implements IList or IList<T> interface).
public static bool IsList(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents a list (implements IList or IList<T> interface).
IsNowKeyword(object, Type)
Returns value indicating whether specified value represent "Now" keyword
public static bool IsNowKeyword(object value, Type type)
Parameters
Returns
- bool
Value indicating whether specified value represent "Now" keyword.
IsNumber(object?)
Returns value indicating whether specified object is a number.
public static bool IsNumber(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is a number.
IsNumber(Type)
Returns value indicating whether specified type represents a number.
public static bool IsNumber(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents a number.
IsString(object?)
Returns value indicating whether specified object is a string.
public static bool IsString(object? value)
Parameters
valueobjectObject to examine.
Returns
- bool
Value indicating whether specified object is a string.
IsString(Type)
Returns value indicating whether specified type represents a string.
public static bool IsString(Type type)
Parameters
typeTypeType to examine.
Returns
- bool
Value indicating whether specified type represents a string.