C# Class System.ComponentModel.GuidConverter

Provides a type converter to convert globally unique identifier objects to and from various other representations.

Inheritance: TypeConverter
Afficher le fichier Open project: dotnet/corefx Class Usage Examples

Méthodes publiques

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

Gets a value indicating whether this converter can convert an object in the given source type to a globally unique identifier object using the context.

CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool

Gets a value indicating whether this converter can convert an object to the given destination type using the context.

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

Converts the given object to a globally unique identifier object.

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

Converts the given object to another type. The most common types to convert are to and from a string object. The default implementation will make a call to ToString on the object if the object is valid and if the destination type is string. If this cannot convert to the desitnation type, this will throw a NotSupportedException.

Method Details

CanConvertFrom() public méthode

Gets a value indicating whether this converter can convert an object in the given source type to a globally unique identifier object using the context.

public CanConvertFrom ( ITypeDescriptorContext context, Type sourceType ) : bool
context ITypeDescriptorContext
sourceType Type
Résultat bool

CanConvertTo() public méthode

Gets a value indicating whether this converter can convert an object to the given destination type using the context.

public CanConvertTo ( ITypeDescriptorContext context, Type destinationType ) : bool
context ITypeDescriptorContext
destinationType Type
Résultat bool

ConvertFrom() public méthode

Converts the given object to a globally unique identifier object.

public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext
culture System.Globalization.CultureInfo
value object
Résultat object

ConvertTo() public méthode

Converts the given object to another type. The most common types to convert are to and from a string object. The default implementation will make a call to ToString on the object if the object is valid and if the destination type is string. If this cannot convert to the desitnation type, this will throw a NotSupportedException.
public ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object
context ITypeDescriptorContext
culture System.Globalization.CultureInfo
value object
destinationType Type
Résultat object