Example #1
0
 public ComPlusThreadInitializer(ContractDescription contract, DispatchOperation operation, ServiceInfo info)
 {
     this.info = info;
     this.iid  = contract.ContractType.GUID;
     if (info.CheckRoles)
     {
         string[] serviceRoleMembers   = null;
         string[] contractRoleMembers  = null;
         string[] operationRoleMembers = null;
         serviceRoleMembers = info.ComponentRoleMembers;
         foreach (ContractInfo info2 in this.info.Contracts)
         {
             if (!(info2.IID == this.iid))
             {
                 continue;
             }
             contractRoleMembers = info2.InterfaceRoleMembers;
             foreach (System.ServiceModel.ComIntegration.OperationInfo info3 in info2.Operations)
             {
                 if (info3.Name == operation.Name)
                 {
                     operationRoleMembers = info3.MethodRoleMembers;
                     break;
                 }
             }
             if (operationRoleMembers == null)
             {
                 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.ListenerInitFailed(System.ServiceModel.SR.GetString("ComOperationNotFound", new object[] { contract.Name, operation.Name })));
             }
             break;
         }
         this.comAuth = new ComPlusAuthorization(serviceRoleMembers, contractRoleMembers, operationRoleMembers);
     }
 }
 public ComPlusThreadInitializer(ContractDescription contract, DispatchOperation operation, ServiceInfo info)
 {
     this.info = info;
     this.iid = contract.ContractType.GUID;
     if (info.CheckRoles)
     {
         string[] serviceRoleMembers = null;
         string[] contractRoleMembers = null;
         string[] operationRoleMembers = null;
         serviceRoleMembers = info.ComponentRoleMembers;
         foreach (ContractInfo info2 in this.info.Contracts)
         {
             if (!(info2.IID == this.iid))
             {
                 continue;
             }
             contractRoleMembers = info2.InterfaceRoleMembers;
             foreach (System.ServiceModel.ComIntegration.OperationInfo info3 in info2.Operations)
             {
                 if (info3.Name == operation.Name)
                 {
                     operationRoleMembers = info3.MethodRoleMembers;
                     break;
                 }
             }
             if (operationRoleMembers == null)
             {
                 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.ListenerInitFailed(System.ServiceModel.SR.GetString("ComOperationNotFound", new object[] { contract.Name, operation.Name })));
             }
             break;
         }
         this.comAuth = new ComPlusAuthorization(serviceRoleMembers, contractRoleMembers, operationRoleMembers);
     }
 }
        public ComPlusThreadInitializer(ContractDescription contract,
                                        DispatchOperation operation,
                                        ServiceInfo info)
        {
            this.info = info;
            iid = contract.ContractType.GUID;

            if (info.CheckRoles)
            {
                string[] serviceRoleMembers = null;
                string[] contractRoleMembers = null;
                string[] operationRoleMembers = null;

                // Figure out the role members we want...
                //
                serviceRoleMembers = info.ComponentRoleMembers;
                foreach (ContractInfo contractInfo in this.info.Contracts)
                {
                    if (contractInfo.IID == iid)
                    {
                        contractRoleMembers = contractInfo.InterfaceRoleMembers;
                        foreach (OperationInfo opInfo in contractInfo.Operations)
                        {
                            if (opInfo.Name == operation.Name)
                            {
                                operationRoleMembers = opInfo.MethodRoleMembers;
                                break;
                            }
                        }

                        if (operationRoleMembers == null)
                        {
                            // Did not find the operation
                            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.ListenerInitFailed(
                                SR.GetString(SR.ComOperationNotFound,
                                             contract.Name,
                                             operation.Name)));
                        }
                        break;
                    }
                }

                this.comAuth = new ComPlusAuthorization(serviceRoleMembers,
                                                        contractRoleMembers,
                                                        operationRoleMembers);
            }
        }
        public ComPlusThreadInitializer(ContractDescription contract,
                                        DispatchOperation operation,
                                        ServiceInfo info)
        {
            this.info = info;
            iid       = contract.ContractType.GUID;

            if (info.CheckRoles)
            {
                string[] serviceRoleMembers   = null;
                string[] contractRoleMembers  = null;
                string[] operationRoleMembers = null;

                // Figure out the role members we want...
                //
                serviceRoleMembers = info.ComponentRoleMembers;
                foreach (ContractInfo contractInfo in this.info.Contracts)
                {
                    if (contractInfo.IID == iid)
                    {
                        contractRoleMembers = contractInfo.InterfaceRoleMembers;
                        foreach (OperationInfo opInfo in contractInfo.Operations)
                        {
                            if (opInfo.Name == operation.Name)
                            {
                                operationRoleMembers = opInfo.MethodRoleMembers;
                                break;
                            }
                        }

                        if (operationRoleMembers == null)
                        {
                            // Did not find the operation
                            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.ListenerInitFailed(
                                                                                          SR.GetString(SR.ComOperationNotFound,
                                                                                                       contract.Name,
                                                                                                       operation.Name)));
                        }
                        break;
                    }
                }

                this.comAuth = new ComPlusAuthorization(serviceRoleMembers,
                                                        contractRoleMembers,
                                                        operationRoleMembers);
            }
        }