Class VariableConverter
Inherited Members
Namespace: Xareus.Scenarios.Converter
Assembly: Xareus.Scenarios.dll
Syntax
[TypeConverterFor(typeof(Variable))]
public class VariableConverter : TypeConverter
Methods
CanConvertFrom(ITypeDescriptorContext, Type)
Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.
Declaration
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Parameters
Type | Name | Description |
---|---|---|
ITypeDescriptorContext | context | An ITypeDescriptorContext that provides a format context. |
Type | sourceType | A Type that represents the type you want to convert from. |
Returns
Type | Description |
---|---|
bool | true if this converter can perform the conversion; otherwise, false. |
Overrides
CanConvertTo(ITypeDescriptorContext, Type)
Returns whether this converter can convert the object to the specified type, using the specified context.
Declaration
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
Parameters
Type | Name | Description |
---|---|---|
ITypeDescriptorContext | context | An ITypeDescriptorContext that provides a format context. |
Type | destinationType | A Type that represents the type you want to convert to. |
Returns
Type | Description |
---|---|
bool | true if this converter can perform the conversion; otherwise, false. |
Overrides
ConvertFrom(ITypeDescriptorContext, CultureInfo, object)
Converts the given object to the type of this converter, using the specified context and culture information.
Declaration
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Parameters
Type | Name | Description |
---|---|---|
ITypeDescriptorContext | context | An ITypeDescriptorContext that provides a format context. |
CultureInfo | culture | The CultureInfo to use as the current culture. |
object | value | The object to convert. |
Returns
Type | Description |
---|---|
object | An object that represents the converted value. |
Overrides
Exceptions
Type | Condition |
---|---|
NotSupportedException | The conversion cannot be performed. |
ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)
Converts the given value object to the specified type, using the specified context and culture information.
Declaration
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Parameters
Type | Name | Description |
---|---|---|
ITypeDescriptorContext | context | An ITypeDescriptorContext that provides a format context. |
CultureInfo | culture | A CultureInfo. If null is passed, the current culture is assumed. |
object | value | The object to convert. |
Type | destinationType | The Type to convert the |
Returns
Type | Description |
---|---|
object | An object that represents the converted value. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
NotSupportedException | The conversion cannot be performed. |