QueryStringConverter.CanConvert(Type) Método

Definição

Determina se o tipo especificado pode ser convertido em uma representação de cadeia de caracteres.

public:
 virtual bool CanConvert(Type ^ type);
public virtual bool CanConvert (Type type);
abstract member CanConvert : Type -> bool
override this.CanConvert : Type -> bool
Public Overridable Function CanConvert (type As Type) As Boolean

Parâmetros

type
Type

O Type a ser convertido.

Retornos

Boolean

Um valor que especifica se um tipo pode ser convertido.

Exemplos

O código a seguir mostra como determinar se o QueryStringConverter tipo pode ser convertido de e para o tipo especificado.

if (converter.CanConvert(typeof(Int32)))
    converter.ConvertStringToValue("123", typeof(Int32));
If (converter.CanConvert(GetType(Int32))) Then
    converter.ConvertStringToValue("123", GetType(Int32))
End If

Aplica-se a