UnitConverter Classe

Definição

Converte um objeto Unit em um objeto de outro tipo de dados e outro tipo em um objeto Unit.Converts from a Unit object to an object of another data type and from another type to a Unit object.

public ref class UnitConverter : System::ComponentModel::TypeConverter
public class UnitConverter : System.ComponentModel.TypeConverter
type UnitConverter = class
    inherit TypeConverter
Public Class UnitConverter
Inherits TypeConverter
Herança
UnitConverter

Comentários

Use a UnitConverter classe para converter um Unit para um objeto de outro tipo de dados.Use the UnitConverter class to convert a Unit to an object of another data type. Você também pode usar a UnitConverter classe para converter um objeto de outro tipo de dados em um Unit .You can also use the UnitConverter class to convert an object of another data type to a Unit.

Observação

Esse conversor pode converter apenas uma cadeia de caracteres para Unit e uma Unit para uma cadeia de caracteres.This converter can convert only a string to Unit and a Unit to a string.

Cuidado

Você nunca deve acessar um conversor de tipo diretamente.You should never access a type converter directly. Em vez disso, chame o conversor apropriado usando System.ComponentModel.TypeDescriptor .Instead, call the appropriate converter by using System.ComponentModel.TypeDescriptor. Para obter mais informações, consulte os exemplos na System.ComponentModel.TypeConverter classe base.For more information, see the examples in the System.ComponentModel.TypeConverter base class.

Construtores

UnitConverter()

Inicializa uma nova instância da classe UnitConverter.Initializes a new instance of the UnitConverter class.

Métodos

CanConvertFrom(ITypeDescriptorContext, Type)

Retorna um valor que indica se o conversor de unidade pode converter o tipo de origem especificado.Returns a value indicating whether the unit converter can convert from the specified source type.

CanConvertFrom(Type)

Retorna se este conversor pode converter um objeto do tipo indicado para o tipo deste conversor.Returns whether this converter can convert an object of the given type to the type of this converter.

(Herdado de TypeConverter)
CanConvertTo(ITypeDescriptorContext, Type)

Retorna um valor que indica se o conversor pode converter um objeto Unit para o tipo especificado.Returns a value indicating whether the converter can convert a Unit object to the specified type.

CanConvertTo(ITypeDescriptorContext, Type)

Retorna se esse conversor pode converter o objeto para o tipo especificado, usando o contexto especificado.Returns whether this converter can convert the object to the specified type, using the specified context.

(Herdado de TypeConverter)
CanConvertTo(Type)

Retorna se esse conversor pode converter o objeto para o tipo especificado.Returns whether this converter can convert the object to the specified type.

(Herdado de TypeConverter)
ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)

Executa a conversão de tipo da lista de contexto, objeto e argumento especificada.Performs type conversion from the specified context, object, and argument list.

ConvertFrom(Object)

Converte o valor fornecido noo tipo deste conversor.Converts the given value to the type of this converter.

(Herdado de TypeConverter)
ConvertFromInvariantString(ITypeDescriptorContext, String)

Converte a cadeia de caracteres fornecida para o tipo deste conversor usando a cultura invariável e o contexto especificado.Converts the given string to the type of this converter, using the invariant culture and the specified context.

(Herdado de TypeConverter)
ConvertFromInvariantString(String)

Converte a cadeia de caracteres fornecida para o tipo deste conversor usando a cultura invariável.Converts the given string to the type of this converter, using the invariant culture.

(Herdado de TypeConverter)
ConvertFromString(ITypeDescriptorContext, CultureInfo, String)

Converte o texto fornecido em um objeto, usando o contexto e a informação de cultura especificados.Converts the given text to an object, using the specified context and culture information.

(Herdado de TypeConverter)
ConvertFromString(ITypeDescriptorContext, String)

Converte o texto fornecido em um objeto, usando o contexto especificado.Converts the given text to an object, using the specified context.

(Herdado de TypeConverter)
ConvertFromString(String)

Converte o texto especificado em um objeto.Converts the specified text to an object.

(Herdado de TypeConverter)
ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type)

Executa a conversão de tipo do tipo de destino especificado de acordo com a lista de contexto, objeto e argumento especificada.Performs type conversion to the specified destination type given the specified context, object and argument list.

ConvertTo(Object, Type)

Converte o objeto de valor especificado para o tipo especificado, usando os argumentos.Converts the given value object to the specified type, using the arguments.

(Herdado de TypeConverter)
ConvertToInvariantString(ITypeDescriptorContext, Object)

Converte o valor especificado em uma representação de cadeia de caracteres que não varia de acordo com a cultura, usando o contexto especificado.Converts the specified value to a culture-invariant string representation, using the specified context.

(Herdado de TypeConverter)
ConvertToInvariantString(Object)

Converte o valor especificado em uma representação de cadeia de caracteres invariável da cultura.Converts the specified value to a culture-invariant string representation.

(Herdado de TypeConverter)
ConvertToString(ITypeDescriptorContext, CultureInfo, Object)

Converte o valor especificado em uma representação de cadeia de caracteres, usando as informações de contexto e cultura especificadas.Converts the given value to a string representation, using the specified context and culture information.

(Herdado de TypeConverter)
ConvertToString(ITypeDescriptorContext, Object)

Converte o valor especificado em uma representação de cadeia de caracteres, usando o contexto fornecido.Converts the given value to a string representation, using the given context.

(Herdado de TypeConverter)
ConvertToString(Object)

Converte o valor especificado em uma representação de cadeia de caracteres.Converts the specified value to a string representation.

(Herdado de TypeConverter)
CreateInstance(IDictionary)

Recria um Object dado um conjunto de valores de propriedade do objeto.Re-creates an Object given a set of property values for the object.

(Herdado de TypeConverter)
CreateInstance(ITypeDescriptorContext, IDictionary)

Cria uma instância do tipo ao qual esse TypeConverter está associado, usando o contexto especificado, dado um conjunto de valores de propriedade para o objeto.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.

(Herdado de TypeConverter)
Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Herdado de Object)
GetConvertFromException(Object)

Retorna uma exceção a ser gerada quando uma conversão não puder ser executada.Returns an exception to throw when a conversion cannot be performed.

(Herdado de TypeConverter)
GetConvertToException(Object, Type)

Retorna uma exceção a ser gerada quando uma conversão não puder ser executada.Returns an exception to throw when a conversion cannot be performed.

(Herdado de TypeConverter)
GetCreateInstanceSupported()

Retorna se a alteração de um valor neste objeto requer uma chamada ao método CreateInstance(IDictionary) para criar um novo valor.Returns whether changing a value on this object requires a call to the CreateInstance(IDictionary) method to create a new value.

(Herdado de TypeConverter)
GetCreateInstanceSupported(ITypeDescriptorContext)

Retorna se a alteração de um valor neste objeto requer uma chamada para CreateInstance(IDictionary) para criar um novo valor, usando o contexto especificado.Returns whether changing a value on this object requires a call to CreateInstance(IDictionary) to create a new value, using the specified context.

(Herdado de TypeConverter)
GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Herdado de Object)
GetProperties(ITypeDescriptorContext, Object)

Retorna uma coleção de propriedades para o tipo de matriz especificado pelo parâmetro de valor, usando o contexto especificado.Returns a collection of properties for the type of array specified by the value parameter, using the specified context.

(Herdado de TypeConverter)
GetProperties(ITypeDescriptorContext, Object, Attribute[])

Retorna uma coleção de propriedades para o tipo de matriz especificado pelo parâmetro de valor, usando o contexto e os atributos especificados.Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes.

(Herdado de TypeConverter)
GetProperties(Object)

Retorna uma coleção de propriedades para o tipo de matriz especificado pelo parâmetro de valor.Returns a collection of properties for the type of array specified by the value parameter.

(Herdado de TypeConverter)
GetPropertiesSupported()

Retorna se este objeto dá suporte a propriedades.Returns whether this object supports properties.

(Herdado de TypeConverter)
GetPropertiesSupported(ITypeDescriptorContext)

Retorna se este objeto é compatível com as propriedades, usando o contexto especificado.Returns whether this object supports properties, using the specified context.

(Herdado de TypeConverter)
GetStandardValues()

Retorna uma coleção de valores padrão do contexto padrão para o tipo de dados para o qual esse conversor de tipo foi criado.Returns a collection of standard values from the default context for the data type this type converter is designed for.

(Herdado de TypeConverter)
GetStandardValues(ITypeDescriptorContext)

Retorna uma coleção de valores padrão para o tipo de dados para o qual esse conversor de tipo foi criado quando fornecido com um contexto de formato.Returns a collection of standard values for the data type this type converter is designed for when provided with a format context.

(Herdado de TypeConverter)
GetStandardValuesExclusive()

Retorna se a coleção de valores padrão retornada de GetStandardValues() é uma lista exclusiva.Returns whether the collection of standard values returned from GetStandardValues() is an exclusive list.

(Herdado de TypeConverter)
GetStandardValuesExclusive(ITypeDescriptorContext)

Retorna se a coleção de valores padrão retornada de GetStandardValues() é uma lista exclusiva de possíveis valores, usando o contexto especificado.Returns whether the collection of standard values returned from GetStandardValues() is an exclusive list of possible values, using the specified context.

(Herdado de TypeConverter)
GetStandardValuesSupported()

Retorna se este objeto dá suporte a um conjunto padrão de valores que podem ser escolhidos em uma lista.Returns whether this object supports a standard set of values that can be picked from a list.

(Herdado de TypeConverter)
GetStandardValuesSupported(ITypeDescriptorContext)

Retorna se o objeto dá suporte a um conjunto de valores padrão que podem ser escolhidos de uma lista, usando o contexto especificado.Returns whether this object supports a standard set of values that can be picked from a list, using the specified context.

(Herdado de TypeConverter)
GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
IsValid(ITypeDescriptorContext, Object)

Retorna se o objeto de valor fornecido é válido para esse tipo e para o contexto especificado.Returns whether the given value object is valid for this type and for the specified context.

(Herdado de TypeConverter)
IsValid(Object)

Retorna se o objeto de valor especificado é válido para esse tipo.Returns whether the given value object is valid for this type.

(Herdado de TypeConverter)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
SortProperties(PropertyDescriptorCollection, String[])

Classifica uma coleção de propriedades.Sorts a collection of properties.

(Herdado de TypeConverter)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Herdado de Object)

Aplica-se a

Confira também