TypeDescriptor.GetConverter Metodo

Definizione

Restituisce un convertitore di tipi per un componente o un tipo.

Overload

Nome Descrizione
GetConverter(Type)

Restituisce un convertitore di tipi per il tipo specificato.

GetConverter(Object, Boolean)

Restituisce un convertitore di tipi per il tipo del componente specificato con un descrittore di tipo personalizzato.

GetConverter(Object)

Restituisce un convertitore di tipi per il tipo del componente specificato.

GetConverter(Type)

Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs

Restituisce un convertitore di tipi per il tipo specificato.

public:
 static System::ComponentModel::TypeConverter ^ GetConverter(Type ^ type);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")]
public static System.ComponentModel.TypeConverter GetConverter(Type type);
public static System.ComponentModel.TypeConverter GetConverter(Type type);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")>]
static member GetConverter : Type -> System.ComponentModel.TypeConverter
static member GetConverter : Type -> System.ComponentModel.TypeConverter
Public Shared Function GetConverter (type As Type) As TypeConverter

Parametri

type
Type

Oggetto Type del componente di destinazione.

Valori restituiti

Oggetto TypeConverter per il tipo specificato.

Attributi

Eccezioni

type è null.

Commenti

Chiamare questa versione di questo metodo solo quando non si dispone di un'istanza dell'oggetto .

Questo metodo cerca il convertitore di tipi appropriato cercando un oggetto TypeConverterAttribute. Se non riesce a trovare un TypeConverterAttributeoggetto , attraversa la gerarchia di classi di base della classe finché non trova un tipo primitivo.

Vedi anche

Si applica a

GetConverter(Object, Boolean)

Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs

Restituisce un convertitore di tipi per il tipo del componente specificato con un descrittore di tipo personalizzato.

public:
 static System::ComponentModel::TypeConverter ^ GetConverter(System::Object ^ component, bool noCustomTypeDesc);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All. The Type of component cannot be statically discovered.")]
public static System.ComponentModel.TypeConverter GetConverter(object component, bool noCustomTypeDesc);
public static System.ComponentModel.TypeConverter GetConverter(object component, bool noCustomTypeDesc);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All. The Type of component cannot be statically discovered.")>]
static member GetConverter : obj * bool -> System.ComponentModel.TypeConverter
static member GetConverter : obj * bool -> System.ComponentModel.TypeConverter
Public Shared Function GetConverter (component As Object, noCustomTypeDesc As Boolean) As TypeConverter

Parametri

component
Object

Componente per cui ottenere il convertitore.

noCustomTypeDesc
Boolean

true non considerare le informazioni sulla descrizione del tipo personalizzato; in caso contrario, false.

Valori restituiti

Oggetto TypeConverter per il componente specificato.

Attributi

Eccezioni

component è null.

component è un oggetto remoto tra processi.

Commenti

Questo metodo cerca il convertitore di tipi appropriato cercando di trovare un oggetto TypeConverterAttribute. Se non riesce a trovare un TypeConverterAttributeoggetto , attraversa la gerarchia di classi di base della classe finché non trova un tipo primitivo.

Vedi anche

Si applica a

GetConverter(Object)

Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs
Origine:
TypeDescriptor.cs

Restituisce un convertitore di tipi per il tipo del componente specificato.

public:
 static System::ComponentModel::TypeConverter ^ GetConverter(System::Object ^ component);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All. The Type of component cannot be statically discovered.")]
public static System.ComponentModel.TypeConverter GetConverter(object component);
public static System.ComponentModel.TypeConverter GetConverter(object component);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All. The Type of component cannot be statically discovered.")>]
static member GetConverter : obj -> System.ComponentModel.TypeConverter
static member GetConverter : obj -> System.ComponentModel.TypeConverter
Public Shared Function GetConverter (component As Object) As TypeConverter

Parametri

component
Object

Componente per cui ottenere il convertitore.

Valori restituiti

Oggetto TypeConverter per il componente specificato.

Attributi

Eccezioni

component è null.

component è un oggetto remoto tra processi.

Esempio

Per un esempio di utilizzo di questo metodo, vedere la TypeConverter classe .

Commenti

Questo metodo individua un convertitore di tipi appropriato cercando un oggetto TypeConverterAttribute. Se non riesce a trovare un TypeConverterAttributeoggetto , attraversa la gerarchia di classi di base della classe finché non trova un tipo primitivo.

Questo metodo equivale al metodo di GetConverter overload con un secondo parametro di false.

Vedi anche

Si applica a