RemotingConfiguration.IsActivationAllowed Method (Type)

 

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)

[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.RemotingConfiguration)]
public static bool IsActivationAllowed(
	Type svrType
)

Parameters

svrType
Type: System.Type

The object Type to check.

Return Value

Type: System.Boolean

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

Exception Condition
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);
}

SecurityPermission

for configuration of the remoting infrastructure. Demand value: SecurityAction.Demand; Permission value: SecurityPermissionFlag.RemotingConfiguration

.NET Framework
Available since 1.1
Return to top
Show: