다음을 통해 공유


IRemotingTypeInfo 인터페이스

정의

개체에 대한 형식 정보를 제공합니다.

public interface class IRemotingTypeInfo
public interface IRemotingTypeInfo
[System.Runtime.InteropServices.ComVisible(true)]
public interface IRemotingTypeInfo
type IRemotingTypeInfo = interface
[<System.Runtime.InteropServices.ComVisible(true)>]
type IRemotingTypeInfo = interface
Public Interface IRemotingTypeInfo
특성

예제

ObjRef^ objRefSample = RemotingServices::GetObjRefForProxy( myRemoteObject );
Console::WriteLine( "***ObjRef Details***" );
Console::WriteLine( "URI:\t {0}", objRefSample->URI );
array<Object^>^channelData = objRefSample->ChannelInfo->ChannelData;
Console::WriteLine( "Channel Info:" );
for each(Object^ o in channelData)
   Console::WriteLine("\t{0}", o->ToString());
IEnvoyInfo^ envoyInfo = objRefSample->EnvoyInfo;
if ( envoyInfo == nullptr )
{
   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( System::Drawing::Bitmap::typeid, 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());
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.")
Else
   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 개체입니다.

속성

TypeName

ObjRef에 있는 서버 개체의 정규화된 형식 이름을 가져오거나 설정합니다.

메서드

CanCastTo(Type, Object)

지정된 개체 형식을 나타내는 프록시가 IRemotingTypeInfo 인터페이스를 통해 표시되는 형식으로 캐스팅될 수 있는지 검사합니다.

적용 대상