NanoByte.Common
Public Member Functions | Protected Member Functions | Properties | List of all members
NanoByte.Common.Values.Design.ValueTypeConverter< T > Class Template Referenceabstract

Abstract base-class for easily creating a TypeConverter for a struct (value type). More...

Inheritance diagram for NanoByte.Common.Values.Design.ValueTypeConverter< T >:

Public Member Functions

override bool GetCreateInstanceSupported (ITypeDescriptorContext context)
 
override bool GetPropertiesSupported (ITypeDescriptorContext context)
 
override PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context, object value, Attribute[] attributes)
 
override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
 
override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
 
override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
 
override? object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
 
override object CreateInstance (ITypeDescriptorContext context, IDictionary propertyValues)
 

Protected Member Functions

virtual string GetElementSeparator (CultureInfo culture)
 The separator to place between individual elements. More...
 
abstract ConstructorInfo GetConstructor ()
 
Returns
The constructor used to create new instances of T (deserialization).

 
abstract object[] GetArguments (T value)
 
Returns
The arguments for the constructor of T .

 
abstract string[] GetValues (T value, ITypeDescriptorContext context, CultureInfo culture)
 
Returns
The elements of T converted to strings.

 
abstract T GetObject (string[] values, CultureInfo culture)
 
Returns
A new instance of T .

 
abstract T GetObject (IDictionary propertyValues)
 
Returns
A new instance of T .

 

Properties

abstract int NoArguments [get]
 The number of arguments the constructor of T has. More...
 

Detailed Description

Abstract base-class for easily creating a TypeConverter for a struct (value type).

Template Parameters
TThe struct to create the TypeConverter for.

Providing a TypeConverter for a struct improves the runtime experience with PropertyGrids.

Add this attribute to the struct:

[TypeConverter(typeof(ClassDerivedFromThisOne))]
Type Constraints
T :struct 

Member Function Documentation

◆ GetElementSeparator()

virtual string NanoByte.Common.Values.Design.ValueTypeConverter< T >.GetElementSeparator ( CultureInfo  culture)
inlineprotectedvirtual

The separator to place between individual elements.

Property Documentation

◆ NoArguments

abstract int NanoByte.Common.Values.Design.ValueTypeConverter< T >.NoArguments
getprotected

The number of arguments the constructor of T has.


The documentation for this class was generated from the following file: