C# Class Microsoft.Windows.Controls.Ribbon.StringCollectionConverter

A class used to convert a comma separated list into
Inheritance: System.ComponentModel.TypeConverter
Exibir arquivo Open project: kasicass/kasicass

Public Methods

Method Description
CanConvertFrom ( ITypeDescriptorContext context, Type sourceType ) : bool

Returns whether this converter can convert from a string list to a StringCollection.

CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool

Returns true if this type converter can convert to the given type.

ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object

Converts the given object to a StringCollection.

ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object

TypeConverter method implementation that converts an object of type StringCollection to an InstanceDescriptor or a string. If the source is not a StringCollection or the destination is not a string it forwards the call to TypeConverter.ConvertTo.

Method Details

CanConvertFrom() public method

Returns whether this converter can convert from a string list to a StringCollection.
public CanConvertFrom ( ITypeDescriptorContext context, Type sourceType ) : bool
context ITypeDescriptorContext An ITypeDescriptorContext that provides the format context.
sourceType System.Type A Type that represents the type you want to convert from.
return bool

CanConvertTo() public method

Returns true if this type converter can convert to the given type.
public CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool
context ITypeDescriptorContext ITypeDescriptorContext
destinationType System.Type Type to convert to
return bool

ConvertFrom() public method

Converts the given object to a StringCollection.
public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext An ITypeDescriptorContext that provides a format context.
culture System.Globalization.CultureInfo The CultureInfo to use as the current culture.
value object The object to convert.
return object

ConvertTo() public method

TypeConverter method implementation that converts an object of type StringCollection to an InstanceDescriptor or a string. If the source is not a StringCollection or the destination is not a string it forwards the call to TypeConverter.ConvertTo.
/// A NotSupportedException is thrown if the example object is null /// or if the destinationType isn't one of the valid destination types. ///
public ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object
context ITypeDescriptorContext ITypeDescriptorContext
culture System.Globalization.CultureInfo
value object value to convert from
destinationType System.Type Type to convert to
return object