IRemotingTypeInfo.CanCastTo(Type, Object) Méthode

Définition

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.

S’applique à