private IList <string> CreateListOfProperlyOrderedNames(XmlElement element, IList <MessagePart> messagePartAndChoiceExtensionParts , MessageVisitor visitor) { IList <string> properlyOrderedProvidedRelationshipNames = new List <string>(); foreach (MessagePart messagePart in messagePartAndChoiceExtensionParts) { ElementBridge helper = new ElementBridge(element, messagePart, GetInteraction(element.OwnerDocument)); foreach (RelationshipBridge relationshipBridge in helper.GetRelationships()) { if (!relationshipBridge.IsStructuralAttribute()) { ICollection <string> names = relationshipBridge.GetNames(); if (!names.IsEmpty()) { IEnumerator <string> iterator = names.GetEnumerator(); if (iterator.MoveNext()) { //For .NET translation properlyOrderedProvidedRelationshipNames.Add(iterator.Current); } if (names.Count > 1) { // not expecting this to ever happen, but need to know if it does so we can adjust the code visitor.AddError("Internal error: found more than one name " + ListNames(names), element); } } } } } return(properlyOrderedProvidedRelationshipNames); }
private void ProcessAllRelationships(XmlElement element, Interaction interaction, IList <MessagePart> messagePartAndChoiceExtensionParts , MessageVisitor visitor) { ICollection <string> knownItems = new HashSet <string>(); ValidateElementOrder(messagePartAndChoiceExtensionParts, element, visitor); foreach (MessagePart messagePart in messagePartAndChoiceExtensionParts) { ElementBridge helper = new ElementBridge(element, messagePart, GetInteraction(element.OwnerDocument)); foreach (RelationshipBridge relationship in helper.GetRelationships()) { knownItems.AddAll(relationship.GetNames()); ProcessRelationship(interaction, messagePart, relationship, visitor); } } ProcessUnknownStructuralAttributes(new HashSet <string>(knownItems), element, visitor); ProcessUnknownChildElements(new HashSet <string>(knownItems), element, visitor); }
public RelationshipBridge(ElementBridge elementBridge, Relationship relationship) { this.elementBridge = elementBridge; this.relationship = relationship; }