IRemotingTypeInfo.CanCastTo(Type, Object) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Vérifie si le proxy qui représente le type d’objet spécifié peut être converti en type représenté par l’interface IRemotingTypeInfo .
public:
bool CanCastTo(Type ^ fromType, System::Object ^ o);
public bool CanCastTo(Type fromType, object o);
[System.Security.SecurityCritical]
public bool CanCastTo(Type fromType, object o);
abstract member CanCastTo : Type * obj -> bool
[<System.Security.SecurityCritical>]
abstract member CanCastTo : Type * obj -> bool
Public Function CanCastTo (fromType As Type, o As Object) As Boolean
Paramètres
- fromType
- Type
Type à convertir.
- o
- Object
Objet pour lequel vérifier la conversion.
Retours
true si le cast réussit ; sinon, false.
- Attributs
Exceptions
L’appelant immédiat effectue l’appel via une référence à l’interface et n’a pas d’autorisation d’infrastructure.
Remarques
La méthode actuelle est appelée lorsqu’une tentative est effectuée pour caster un proxy généré à partir d’un ObjRef. Cette méthode prend en compte les informations de type transmises dans le ObjRef.