RemotingServices.IsObjectOutOfAppDomain(Object) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Devuelve un valor de tipo booleano que indica si el objeto especificado por el proxy transparente se encuentra en un dominio de aplicación diferente al del objeto que llamó al método actual.
public:
static bool IsObjectOutOfAppDomain(System::Object ^ tp);
public static bool IsObjectOutOfAppDomain (object tp);
static member IsObjectOutOfAppDomain : obj -> bool
Public Shared Function IsObjectOutOfAppDomain (tp As Object) As Boolean
Parámetros
- tp
- Object
Objeto que se va a comprobar.
Devoluciones
Es true
si el objeto no está en el dominio de aplicación actual; en caso contrario, es false
.
Ejemplos
// 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)
Comentarios
Para obtener información sobre los dominios de aplicación, vea Dominios de aplicación.