RemotingServices.IsObjectOutOfContext(Object) 메서드

정의

지정된 프록시가 나타내는 개체가 현재 메서드를 호출한 개체와 다른 컨텍스트에 포함되어 있는지 여부를 나타내는 부울 값을 반환합니다.

public:
 static bool IsObjectOutOfContext(System::Object ^ tp);
public static bool IsObjectOutOfContext(object tp);
static member IsObjectOutOfContext : obj -> bool
Public Shared Function IsObjectOutOfContext (tp As Object) As Boolean

매개 변수

tp
Object

확인할 개체입니다.

반품

개체가 현재 컨텍스트에서 벗어나면

예제

// Create a remote version of TempConverter::Converter.
TempConverter::Converter^ converter1 =
      dynamic_cast<TempConverter::Converter^>(Activator::GetObject(
      TempConverter::Converter::typeid,
      "http://localhost:8085/TempConverter" ));

// Create a local version of TempConverter::Converter.
TempConverter::Converter^ converter2 = gcnew TempConverter::Converter;

// Returns true, converter1 is remote and in a different appdomain.
System::Runtime::Remoting::RemotingServices::IsObjectOutOfAppDomain( converter1 );

// Returns false, converter2 is local and running in this appdomain.
System::Runtime::Remoting::RemotingServices::IsObjectOutOfAppDomain( converter2 );

// Returns true, converter1 is remote and in a different context.
System::Runtime::Remoting::RemotingServices::IsObjectOutOfContext( converter1 );

// Returns false, converter2 is local and running in this context.
System::Runtime::Remoting::RemotingServices::IsObjectOutOfContext( converter2 );
// Create a remote version of TempConverter.Converter.
TempConverter.Converter converter1 =
        (TempConverter.Converter) Activator.GetObject(
        typeof(TempConverter.Converter),
        "http://localhost:8085/TempConverter");

// Create a local version of TempConverter.Converter.
TempConverter.Converter converter2 = new TempConverter.Converter();

// Returns true, converter1 is remote and in a different appdomain.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfAppDomain(
                        converter1);

// Returns false, converter2 is local and running in this appdomain.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfAppDomain(
                        converter2);

// Returns true, converter1 is remote and in a different context.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfContext(
                        converter1);

// Returns false, converter2 is local and running in this context.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfContext(
                        converter2);
' Create remote version of TempConverter.Converter.
Dim converter1 As TempConverter.Converter

converter1 = CType(Activator.GetObject(GetType( _
                     TempConverter.Converter), _
                     "http://localhost:8085/TempConverter"), _
                     TempConverter.Converter)
' Create local version of TempConverter.Converter.
Dim converter2 As New TempConverter.Converter()

' Returns true, converter1 is remote and in a different appdomain.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfAppDomain( _
                                                   converter1)

' Returns false, converter2 is local and running in this appdomain.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfAppDomain( _
                                                   converter2)

' Returns true, converter1 is remote and in a different context.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfContext( _
                                                   converter1)

' Returns false, converter2 is local and running in this context.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfContext( _
                                                   converter2)

설명

컨텍스트는 내부에 있는 개체에 대한 환경을 정의하는 순서가 지정된 속성 시퀀스입니다. 컨텍스트는 동기화, 트랜잭션, Just-In-Time 활성화, 보안 등과 같은 특정 자동 서비스를 요구하도록 구성된 개체에 대한 활성화 프로세스 중에 만들어집니다. 여러 개체가 컨텍스트 내에 살 수 있습니다.

적용 대상

추가 정보