This documentation is archived and is not being maintained.

IRemotingTypeInfo.CanCastTo Method

Checks whether the proxy that represents the specified object type can be cast to the type represented by the IRemotingTypeInfo interface.

Namespace: System.Runtime.Remoting
Assembly: mscorlib (in mscorlib.dll)

bool CanCastTo (
	Type fromType,
	Object o
)
boolean CanCastTo (
	Type fromType, 
	Object o
)
function CanCastTo (
	fromType : Type, 
	o : Object
) : boolean

Parameters

fromType

The type to cast to.

o

The object for which to check casting.

Return Value

true if cast will succeed; otherwise, false.

Exception typeCondition

SecurityException

The immediate caller makes the call through a reference to the interface and does not have infrastructure permission.

The current method is called when an attempt is made to cast a proxy generated from a ObjRef. This method takes into account the type information carried in the ObjRef.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Show: