This documentation is archived and is not being maintained.

IRemotingTypeInfo Interface

Provides type information for an object.

For a list of all members of this type, see IRemotingTypeInfo Members.

[Visual Basic]
Public Interface IRemotingTypeInfo
public interface IRemotingTypeInfo
public __gc __interface IRemotingTypeInfo
public interface IRemotingTypeInfo


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


[Visual Basic] 
Dim objRefSample As ObjRef = RemotingServices.GetObjRefForProxy(myRemoteObject)
Console.WriteLine("***ObjRef Details***")
Console.WriteLine("URI:" + ControlChars.Tab + "{0}", objRefSample.URI)
Dim channelData As Object() = objRefSample.ChannelInfo.ChannelData
Console.WriteLine("Channel Info:")
Dim o As Object
For Each o In  channelData
   Console.WriteLine(ControlChars.Tab + "{0}", o.ToString())
Next o
Dim envoyInfo As IEnvoyInfo = objRefSample.EnvoyInfo
If envoyInfo Is Nothing Then
   Console.WriteLine("This ObjRef does not have envoy information.")
   Dim envoySinks As IMessageSink = envoyInfo.EnvoySinks
   Console.WriteLine("Envoy Sink Class: {0}", envoySinks)
End If
Dim typeInfo As IRemotingTypeInfo = objRefSample.TypeInfo
Console.WriteLine("Remote type name: {0}", typeInfo.TypeName)
Console.WriteLine("Can my object cast to a Bitmap? {0}", typeInfo.CanCastTo(GetType(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())

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());

ObjRef* objRefSample = RemotingServices::GetObjRefForProxy(myRemoteObject);
Console::WriteLine(S"***ObjRef Details***");
Console::WriteLine(S"URI:\t {0}", objRefSample->URI);
Object* channelData[] = objRefSample->ChannelInfo->ChannelData;
Console::WriteLine(S"Channel Info:");
IEnumerator* myEnum = channelData->GetEnumerator();
while (myEnum->MoveNext()) 
    Object* o = __try_cast<Object*>(myEnum->Current);

    Console::WriteLine(S"\t {0}", o);
    IEnvoyInfo* envoyInfo = objRefSample->EnvoyInfo;
    if (envoyInfo == 0) 
        Console::WriteLine(S"This ObjRef does not have envoy information.");
        IMessageSink* envoySinks = envoyInfo->EnvoySinks;
        Console::WriteLine(S"Envoy Sink Class: {0}", envoySinks);
    IRemotingTypeInfo* typeInfo = objRefSample->TypeInfo;
    Console::WriteLine(S"Remote type name: {0}", typeInfo->TypeName);
    Console::WriteLine(S"Can my Object cast to a Bitmap? {0}",
        __box(typeInfo->CanCastTo(__typeof(System::Drawing::Bitmap), objRefSample)));
    Console::WriteLine(S"Is this Object from this AppDomain? {0}", __box(objRefSample->IsFromThisAppDomain()));
    Console::WriteLine(S"Is this Object from this process? {0}",  __box(objRefSample->IsFromThisProcess()));

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Namespace: System.Runtime.Remoting

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

IRemotingTypeInfo Members | System.Runtime.Remoting Namespace