This documentation is archived and is not being maintained.

RemotingConfiguration.IsActivationAllowed Method

Returns a Boolean value that indicates whether the specified Type is allowed to be client activated.

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

public static bool IsActivationAllowed (
	Type svrType
)
public static boolean IsActivationAllowed (
	Type svrType
)
public static function IsActivationAllowed (
	svrType : Type
) : boolean
Not applicable.

Parameters

svrType

The object Type to check.

Return Value

true if the specified Type is allowed to be client activated; otherwise, false.

Exception typeCondition

SecurityException

At least one of the callers higher in the callstack does not have permission to configure remoting types and channels.

The current method is used at the server end to determine whether an activation of the object Type is explicitly allowed by the server.


// 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(MyServerImpl.
    class.ToType())) {
    // Get the registered activated service types .
    ActivatedServiceTypeEntry myActivatedServiceEntries[] = 
        RemotingConfiguration.GetRegisteredActivatedServiceTypes();
    Console.WriteLine("The Length of the registered activated service"
        + " type array is " + myActivatedServiceEntries.get_Length());
    Console.WriteLine("The Object type is:"
        + myActivatedServiceEntries[0].get_ObjectType());
}

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
Show: