RemotingConfiguration.IsActivationAllowed(Type) Método

Definição

Retorna um valor booliano que indica se o Type especificado pode ser ativado pelo cliente.

public:
 static bool IsActivationAllowed(Type ^ svrType);
public static bool IsActivationAllowed (Type svrType);
static member IsActivationAllowed : Type -> bool
Public Shared Function IsActivationAllowed (svrType As Type) As Boolean

Parâmetros

svrType
Type

O objeto Type a ser verificado.

Retornos

true se o Type especificado puder ser ativado pelo cliente, caso contrário, false.

Exceções

Pelo menos um dos chamadores no topo da pilha de chamadas não tem permissão para configurar canais e tipos de comunicação remota.

Exemplos

// Check whether the 'MyServerImpl' object is allowed for 
// activation or not.
if ( RemotingConfiguration::IsActivationAllowed( MyServerImpl::typeid ) )
{
   // Get the registered activated service types .
   array<ActivatedServiceTypeEntry^>^myActivatedServiceEntries = RemotingConfiguration::GetRegisteredActivatedServiceTypes();
   Console::WriteLine( "The Length of the registered activated service type array is {0}", myActivatedServiceEntries->Length );
   Console::WriteLine( "The Object type is:{0}", myActivatedServiceEntries[ 0 ]->ObjectType );
}

// Check whether the 'MyServerImpl' object is allowed for
// activation or not.
if(RemotingConfiguration.IsActivationAllowed(typeof(MyServerImpl)))
{
 // Get the registered activated service types .
 ActivatedServiceTypeEntry[] myActivatedServiceEntries =
       RemotingConfiguration.GetRegisteredActivatedServiceTypes();
Console.WriteLine("The Length of the registered activated service"
                 +" type array is "+myActivatedServiceEntries.Length);
Console.WriteLine("The Object type is:"
                    +myActivatedServiceEntries[0].ObjectType);
}
' Check whether the 'MyServerImpl' object is allowed for activation or not.
If RemotingConfiguration.IsActivationAllowed(GetType(MyServerImpl)) Then
   ' Get the registered activated service types .
   Dim myActivatedServiceEntries As ActivatedServiceTypeEntry() = _ 
                       RemotingConfiguration.GetRegisteredActivatedServiceTypes()
   Console.WriteLine("The Length of the registered activated service type array is " + _ 
                                  myActivatedServiceEntries.Length.ToString())
   Console.WriteLine("The Object type is:" + _ 
                           myActivatedServiceEntries(0).ObjectType.ToString())
End If

Comentários

O método atual é usado na extremidade do servidor para determinar se uma ativação do objeto Type é explicitamente permitida pelo servidor.

Aplica-se a