internal static void GetPropertiesFromAttributes(IConstructionCallMessage ctorMsg, object[] attributes)
 {
     if (attributes == null)
     {
         return;
     }
     for (int index = 0; index < attributes.Length; ++index)
     {
         IContextAttribute contextAttribute = attributes[index] as IContextAttribute;
         if (contextAttribute == null)
         {
             throw new RemotingException(Environment.GetResourceString("Remoting_Activation_BadAttribute"));
         }
         ActivationServices.CheckForInfrastructurePermission((RuntimeAssembly)contextAttribute.GetType().Assembly);
         contextAttribute.GetPropertiesForNewContext(ctorMsg);
     }
 }
Example #2
0
 internal static void GetPropertiesFromAttributes(IConstructionCallMessage ctorMsg, object[] attributes)
 {
     if (attributes != null)
     {
         for (int i = 0; i < attributes.Length; i++)
         {
             IContextAttribute attribute = attributes[i] as IContextAttribute;
             if (attribute == null)
             {
                 throw new RemotingException(Environment.GetResourceString("Remoting_Activation_BadAttribute"));
             }
             RuntimeAssembly asm = (RuntimeAssembly)attribute.GetType().Assembly;
             CheckForInfrastructurePermission(asm);
             attribute.GetPropertiesForNewContext(ctorMsg);
         }
     }
 }
Example #3
0
        private static bool QueryAttributesIfContextOK(Context ctx, IConstructionCallMessage ctorMsg, object[] attributes)
        {
            bool flag = true;

            if (attributes != null)
            {
                for (int i = 0; i < attributes.Length; i++)
                {
                    IContextAttribute attribute = attributes[i] as IContextAttribute;
                    if (attribute == null)
                    {
                        throw new RemotingException(Environment.GetResourceString("Remoting_Activation_BadAttribute"));
                    }
                    RuntimeAssembly asm = (RuntimeAssembly)attribute.GetType().Assembly;
                    CheckForInfrastructurePermission(asm);
                    flag = attribute.IsContextOK(ctx, ctorMsg);
                    if (!flag)
                    {
                        return(flag);
                    }
                }
            }
            return(flag);
        }
        private static bool QueryAttributesIfContextOK(Context ctx, IConstructionCallMessage ctorMsg, object[] attributes)
        {
            bool flag = true;

            if (attributes != null)
            {
                for (int index = 0; index < attributes.Length; ++index)
                {
                    IContextAttribute contextAttribute = attributes[index] as IContextAttribute;
                    if (contextAttribute == null)
                    {
                        throw new RemotingException(Environment.GetResourceString("Remoting_Activation_BadAttribute"));
                    }
                    ActivationServices.CheckForInfrastructurePermission((RuntimeAssembly)contextAttribute.GetType().Assembly);
                    flag = contextAttribute.IsContextOK(ctx, ctorMsg);
                    if (!flag)
                    {
                        break;
                    }
                }
            }
            return(flag);
        }