Langue

QueryStringConverter.CanConvert(Type) Méthode

Définition

Détermine si le type spécifié peut être converti en et à partir d’une représentation sous forme de chaîne.

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

Paramètres

type
Type

À Type convertir.

Retours

Valeur qui spécifie si le type peut être converti.

Exemples

Le code suivant montre comment déterminer si la QueryStringConverter conversion en et à partir du type spécifié peut être convertie.

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

S’applique à