C# Class Microsoft.Tools.WindowsInstaller.EncodingConverter

Provides conversion between strings and Encoding.
Inheritance: System.ComponentModel.TypeConverter
Afficher le fichier Open project: heaths/psmsi Class Usage Examples

Méthodes publiques

Méthode Description
CanConvertFrom ( ITypeDescriptorContext context, Type sourceType ) : bool

Returns True when sourceType is a String or Int32.

CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool

Returns True when destinationType is a String or Int32.

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

Converts a String or Int32 to an Encoding.

Returns Encoding.Default if the value is null or an empty string.

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

Gets the name or code page for an Encoding.

Private Methods

Méthode Description
IsNumeric ( Type type ) : bool

Returns true if the type is a signed or unsigned short or larger integer.

Method Details

CanConvertFrom() public méthode

Returns True when sourceType is a String or Int32.
public CanConvertFrom ( ITypeDescriptorContext context, Type sourceType ) : bool
context ITypeDescriptorContext Additional context for conversion.
sourceType System.Type The type of the source object.
Résultat bool

CanConvertTo() public méthode

Returns True when destinationType is a String or Int32.
public CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool
context ITypeDescriptorContext Additional context for conversion.
destinationType System.Type The type of the destination object.
Résultat bool

ConvertFrom() public méthode

Converts a String or Int32 to an Encoding.
Returns Encoding.Default if the value is null or an empty string.
No could be matched to the string or code page integer.
public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext Additional context for conversion.
culture System.Globalization.CultureInfo The culture to use for conversion.
value object The or value to convert.
Résultat object

ConvertTo() public méthode

Gets the name or code page for an Encoding.
public ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object
context ITypeDescriptorContext Additional context for conversion.
culture System.Globalization.CultureInfo The culture to use for conversion.
value object The to convert.
destinationType System.Type The type of the destination object.
Résultat object