IRemotingTypeInfo Interface

 

Provides type information for an object.

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

[ComVisibleAttribute(true)]
public interface IRemotingTypeInfo

NameDescription
System_CAPS_pubpropertyTypeName

Gets or sets the fully qualified type name of the server object in a ObjRef.

NameDescription
System_CAPS_pubmethodCanCastTo(Type, Object)

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

Use this interface to provide custom type information that is carried along with the ObjRef objects.

ObjRef objRefSample = RemotingServices.GetObjRefForProxy(myRemoteObject);
Console.WriteLine("***ObjRef Details***");
Console.WriteLine("URI:\t{0}", objRefSample.URI);
object[] channelData = objRefSample.ChannelInfo.ChannelData;
Console.WriteLine("Channel Info:");
foreach(object o in channelData)
    Console.WriteLine("\t{0}", o.ToString());
IEnvoyInfo envoyInfo = objRefSample.EnvoyInfo;
if (envoyInfo == null) {
    Console.WriteLine("This ObjRef does not have envoy information.");
}
else {
    IMessageSink envoySinks = envoyInfo.EnvoySinks;
    Console.WriteLine("Envoy Sink Class: {0}", envoySinks);
}
IRemotingTypeInfo typeInfo = objRefSample.TypeInfo;
Console.WriteLine("Remote type name: {0}", typeInfo.TypeName);
Console.WriteLine("Can my object cast to a Bitmap? {0}",
    typeInfo.CanCastTo(typeof(System.Drawing.Bitmap), objRefSample));
Console.WriteLine("Is this object from this AppDomain? {0}", objRefSample.IsFromThisAppDomain());
Console.WriteLine("Is this object from this process? {0}",  objRefSample.IsFromThisProcess());

.NET Framework
Available since 1.1
Return to top
Show: