RemotingServices.IsObjectOutOfAppDomain Method

Returns a Boolean value that indicates whether the object specified by the given transparent proxy is contained in a different application domain than the object that called the current method.

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

public static bool IsObjectOutOfAppDomain (
	Object tp
)
public static boolean IsObjectOutOfAppDomain (
	Object tp
)
public static function IsObjectOutOfAppDomain (
	tp : Object
) : boolean
Not applicable.

Parameters

tp

The object to check.

Return Value

true if the object is out of the current application domain; otherwise, false.

For information about application domains, see Application Domains.

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

Windows 98, Windows Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: