public virtual SamlCondition LoadCondition(XmlDictionaryReader reader, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
 {
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");
     }
     if (reader.IsStartElement(this.DictionaryManager.SamlDictionary.AudienceRestrictionCondition, this.DictionaryManager.SamlDictionary.Namespace))
     {
         SamlAudienceRestrictionCondition condition = new SamlAudienceRestrictionCondition();
         condition.ReadXml(reader, this, keyInfoSerializer, outOfBandTokenResolver);
         return condition;
     }
     if (!reader.IsStartElement(this.DictionaryManager.SamlDictionary.DoNotCacheCondition, this.DictionaryManager.SamlDictionary.Namespace))
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(System.IdentityModel.SR.GetString("SAMLUnableToLoadUnknownElement", new object[] { reader.LocalName })));
     }
     SamlDoNotCacheCondition condition2 = new SamlDoNotCacheCondition();
     condition2.ReadXml(reader, this, keyInfoSerializer, outOfBandTokenResolver);
     return condition2;
 }
        public virtual SamlCondition LoadCondition(XmlDictionaryReader reader, SecurityTokenSerializer keyInfoSerializer, SecurityTokenResolver outOfBandTokenResolver)
        {
            if (reader == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");

            if (reader.IsStartElement(DictionaryManager.SamlDictionary.AudienceRestrictionCondition, DictionaryManager.SamlDictionary.Namespace))
            {
                SamlAudienceRestrictionCondition audienceRestriction = new SamlAudienceRestrictionCondition();
                audienceRestriction.ReadXml(reader, this, keyInfoSerializer, outOfBandTokenResolver);
                return audienceRestriction;
            }
            else if (reader.IsStartElement(DictionaryManager.SamlDictionary.DoNotCacheCondition, DictionaryManager.SamlDictionary.Namespace))
            {
                SamlDoNotCacheCondition doNotCacheCondition = new SamlDoNotCacheCondition();
                doNotCacheCondition.ReadXml(reader, this, keyInfoSerializer, outOfBandTokenResolver);
                return doNotCacheCondition;
            }
            else
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.SAMLUnableToLoadUnknownElement, reader.LocalName)));
        }