protected void AddSupportingTokens(SendSecurityHeader securityHeader, IList <SupportingTokenSpecification> supportingTokens)
        {
            if (supportingTokens != null)
            {
                for (int i = 0; i < supportingTokens.Count; ++i)
                {
                    SecurityToken           token           = supportingTokens[i].SecurityToken;
                    SecurityTokenParameters tokenParameters = supportingTokens[i].SecurityTokenParameters;
                    switch (supportingTokens[i].SecurityTokenAttachmentMode)
                    {
                    case SecurityTokenAttachmentMode.Signed:
                        securityHeader.AddSignedSupportingToken(token, tokenParameters);
                        break;

                    case SecurityTokenAttachmentMode.Endorsing:
                        securityHeader.AddEndorsingSupportingToken(token, tokenParameters);
                        break;

                    case SecurityTokenAttachmentMode.SignedEncrypted:
                        securityHeader.AddBasicSupportingToken(token, tokenParameters);
                        break;

                    case SecurityTokenAttachmentMode.SignedEndorsing:
                        securityHeader.AddSignedEndorsingSupportingToken(token, tokenParameters);
                        break;

                    default:
                        Fx.Assert("Unknown token attachment mode " + supportingTokens[i].SecurityTokenAttachmentMode.ToString());
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.Format(SR.UnknownTokenAttachmentMode, supportingTokens[i].SecurityTokenAttachmentMode.ToString())));
                    }
                }
            }
        }
        protected void AddSupportingTokens(SendSecurityHeader securityHeader, IList <SupportingTokenSpecification> supportingTokens)
        {
            if (supportingTokens != null)
            {
                for (int i = 0; i < supportingTokens.Count; i++)
                {
                    SecurityToken           securityToken           = supportingTokens[i].SecurityToken;
                    SecurityTokenParameters securityTokenParameters = supportingTokens[i].SecurityTokenParameters;
                    switch (supportingTokens[i].SecurityTokenAttachmentMode)
                    {
                    case SecurityTokenAttachmentMode.Signed:
                        securityHeader.AddSignedSupportingToken(securityToken, securityTokenParameters);
                        break;

                    case SecurityTokenAttachmentMode.Endorsing:
                        securityHeader.AddEndorsingSupportingToken(securityToken, securityTokenParameters);
                        break;

                    case SecurityTokenAttachmentMode.SignedEndorsing:
                        securityHeader.AddSignedEndorsingSupportingToken(securityToken, securityTokenParameters);
                        break;

                    case SecurityTokenAttachmentMode.SignedEncrypted:
                        securityHeader.AddBasicSupportingToken(securityToken, securityTokenParameters);
                        break;

                    default:
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(System.ServiceModel.SR.GetString("UnknownTokenAttachmentMode", new object[] { supportingTokens[i].SecurityTokenAttachmentMode.ToString() })));
                    }
                }
            }
        }
 protected void AddSupportingTokens(SendSecurityHeader securityHeader, IList<SupportingTokenSpecification> supportingTokens)
 {
     if (supportingTokens != null)
     {
         for (int i = 0; i < supportingTokens.Count; ++i)
         {
             SecurityToken token = supportingTokens[i].SecurityToken;
             SecurityTokenParameters tokenParameters = supportingTokens[i].SecurityTokenParameters;
             switch (supportingTokens[i].SecurityTokenAttachmentMode)
             {
                 case SecurityTokenAttachmentMode.Signed:
                     securityHeader.AddSignedSupportingToken(token, tokenParameters);
                     break;
                 case SecurityTokenAttachmentMode.Endorsing:
                     securityHeader.AddEndorsingSupportingToken(token, tokenParameters);
                     break;
                 case SecurityTokenAttachmentMode.SignedEncrypted:
                     securityHeader.AddBasicSupportingToken(token, tokenParameters);
                     break;
                 case SecurityTokenAttachmentMode.SignedEndorsing:
                     securityHeader.AddSignedEndorsingSupportingToken(token, tokenParameters);
                     break;
                 default:
                     Fx.Assert("Unknown token attachment mode " + supportingTokens[i].SecurityTokenAttachmentMode.ToString());
                     throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.UnknownTokenAttachmentMode, supportingTokens[i].SecurityTokenAttachmentMode.ToString())));
             }
         }
     }
 }
        protected void AddSupportingTokens(SendSecurityHeader securityHeader, IList<SupportingTokenSpecification> supportingTokens)
        {
            if (supportingTokens != null)
            {
                for (int i = 0; i < supportingTokens.Count; i++)
                {
                    SecurityToken securityToken = supportingTokens[i].SecurityToken;
                    SecurityTokenParameters securityTokenParameters = supportingTokens[i].SecurityTokenParameters;
                    switch (supportingTokens[i].SecurityTokenAttachmentMode)
                    {
                        case SecurityTokenAttachmentMode.Signed:
                            securityHeader.AddSignedSupportingToken(securityToken, securityTokenParameters);
                            break;

                        case SecurityTokenAttachmentMode.Endorsing:
                            securityHeader.AddEndorsingSupportingToken(securityToken, securityTokenParameters);
                            break;

                        case SecurityTokenAttachmentMode.SignedEndorsing:
                            securityHeader.AddSignedEndorsingSupportingToken(securityToken, securityTokenParameters);
                            break;

                        case SecurityTokenAttachmentMode.SignedEncrypted:
                            securityHeader.AddBasicSupportingToken(securityToken, securityTokenParameters);
                            break;

                        default:
                            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(System.ServiceModel.SR.GetString("UnknownTokenAttachmentMode", new object[] { supportingTokens[i].SecurityTokenAttachmentMode.ToString() })));
                    }
                }
            }
        }