public void ReadFrom(XmlDictionaryReader reader) { reader.ReadStartElement(ElementName, NamespaceUri); while (reader.IsStartElement()) { string item = DataReference.ReadFrom(reader); if (this.referredIds.Contains(item)) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(System.ServiceModel.SR.GetString("InvalidDataReferenceInReferenceList", new object[] { "#" + item }))); } this.referredIds.Add(item); } reader.ReadEndElement(); if (this.DataReferenceCount == 0) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(System.ServiceModel.SR.GetString("ReferenceListCannotBeEmpty"))); } }
public void ReadFrom(XmlDictionaryReader reader) { reader.ReadStartElement(ElementName, NamespaceUri); while (reader.IsStartElement()) { string id = DataReference.ReadFrom(reader); if (this.referredIds.Contains(id)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new Exception(SR.Format("InvalidDataReferenceInReferenceList", "#" + id))); } this.referredIds.Add(id); } reader.ReadEndElement(); // ReferenceList if (this.DataReferenceCount == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Exception(SR.Format("ReferenceListCannotBeEmpty"))); } }
public void ReadFrom(XmlDictionaryReader reader) { reader.ReadStartElement(ElementName, NamespaceUri); while (reader.IsStartElement()) { string id = DataReference.ReadFrom(reader); if (_referredIds.Contains(id)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new SecurityMessageSerializationException(string.Format(SR_IdentityModel.InvalidDataReferenceInReferenceList, "#" + id))); } _referredIds.Add(id); } reader.ReadEndElement(); // ReferenceList if (this.DataReferenceCount == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityMessageSerializationException(SR_IdentityModel.ReferenceListCannotBeEmpty)); } }