Class NumericRecordConverter
- Namespace
- Bonsai
- Assembly
- Bonsai.Core.dll
Provides a type converter to convert numeric records to and from various other representations.
public class NumericRecordConverter : TypeConverter
- Inheritance
-
NumericRecordConverter
- Inherited Members
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.
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Parameters
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
sourceType
TypeA Type that represents the type you want to convert from.
Returns
ConvertFrom(ITypeDescriptorContext, CultureInfo, object)
Converts the given object to the type of this converter, using the specified context and culture information.
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Parameters
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
culture
CultureInfoThe CultureInfo to use as the current culture.
value
objectThe object to convert.
Returns
ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)
Converts the given value object to the specified type, using the specified context and culture information.
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Parameters
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
culture
CultureInfoA CultureInfo. If null is passed, the current culture is assumed.
value
objectThe object to convert.
destinationType
TypeThe Type to convert the value parameter to.
Returns
CreateInstance(ITypeDescriptorContext, IDictionary)
Creates an instance of the type that this TypeConverter is associated with, using the specified context, given a set of property values for the object.
public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues)
Parameters
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
propertyValues
IDictionaryAn IDictionary of new property values.
Returns
- object
An object representing the given IDictionary, or null if the object cannot be created.
GetCreateInstanceSupported(ITypeDescriptorContext)
Returns whether changing a value on this object requires a call to CreateInstance(IDictionary) to create a new value, using the specified context.
public override bool GetCreateInstanceSupported(ITypeDescriptorContext context)
Parameters
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
Returns
- bool
true if changing a property on this object requires a call to CreateInstance(IDictionary) to create a new value; otherwise, false.
GetProperties(ITypeDescriptorContext, object, Attribute[])
Returns a collection of properties for the type of numeric record specified by the value parameter, using the specified context and attributes.
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
Parameters
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
value
objectAn object that specifies the type of numeric record for which to get properties.
attributes
Attribute[]An array of type Attribute that is used as a filter.
Returns
- PropertyDescriptorCollection
A PropertyDescriptorCollection with the properties that are exposed for this data type, or null if there are no properties.
GetPropertiesSupported(ITypeDescriptorContext)
Returns whether this object supports properties, using the specified context.
public override bool GetPropertiesSupported(ITypeDescriptorContext context)
Parameters
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
Returns
- bool
true if GetProperties(object) should be called to find the properties of this object; otherwise, false.