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.
- Inheritance
-
Value
Converter
- Inherited Members
Constructors
ValueConverter()
Initializes a new instance of an object.
Properties
Culture
Gets or sets the culture information.
Property Value
DateFormat
Gets or sets the date format.
Property Value
DateTimeStyles
Gets or sets date/time styles.
Property Value
NumberStyles
Gets or sets the number styles.
Property Value
Methods
Convert(object?, Type)
Converts the given value from one type to another.
Parameters
Returns
- object
Converted value.
ConvertString(string?, Type)
Converts the given string to another type.
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.
Parameters
value
objectValue to convert.
Returns
- T
Converted value.
Type Parameters
T
Target type.
DefaultValue(Type)
Returns default value for a given type.
Parameters
valueType
TypeType 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.
Parameters
type
TypeObject 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.
Parameters
type
TypeType of object array.
key
stringKey of target in collection.
collection
NameValue Collection Data container.
Returns
- object[]
objectArray.
IsBoolean(object?)
Returns value indicating whether specified object is a boolean.
Parameters
value
objectObject to examine.
Returns
- bool
Value indicating whether specified object is a boolean.
IsBoolean(Type)
Returns value indicating whether specified type represents a boolean.
Parameters
type
TypeType 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).
Parameters
value
objectObject 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).
Parameters
type
TypeType 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.
Parameters
value
objectObject to examine.
Returns
- bool
Value indicating whether specified object is a date.
IsDate(Type)
Returns value indicating whether specified type represents a date.
Parameters
type
TypeType to examine.
Returns
- bool
Value indicating whether specified type represents a date.
IsDecimal(object?)
Returns value indicating whether specified object is a decimal number.
Parameters
value
objectObject 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.
Parameters
type
TypeType 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).
Parameters
value
objectObject 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).
Parameters
type
TypeType 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.
Parameters
value
objectObject 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.
Parameters
type
TypeType 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.
Parameters
value
objectObject to examine.
Returns
- bool
Value indicating whether specified object is an enumerable.
IsEnumerable(Type)
Returns value indicating whether specified type represents an enumerable.
Parameters
type
TypeType 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.
Parameters
value
objectObject 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.
Parameters
type
TypeType 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.
Parameters
value
objectString 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).
Parameters
value
objectObject 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).
Parameters
type
TypeType 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
Parameters
Returns
- bool
Value indicating whether specified value represent "Now" keyword.
IsNumber(object?)
Returns value indicating whether specified object is a number.
Parameters
value
objectObject to examine.
Returns
- bool
Value indicating whether specified object is a number.
IsNumber(Type)
Returns value indicating whether specified type represents a number.
Parameters
type
TypeType to examine.
Returns
- bool
Value indicating whether specified type represents a number.
IsString(object?)
Returns value indicating whether specified object is a string.
Parameters
value
objectObject to examine.
Returns
- bool
Value indicating whether specified object is a string.
IsString(Type)
Returns value indicating whether specified type represents a string.
Parameters
type
TypeType to examine.
Returns
- bool
Value indicating whether specified type represents a string.