public ItemList(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid, Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit, Element[] items) : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit) { if (items != null) { this.items = RmFactory.LocatableList<Element>(this, items); } SetAttributeDictionary(); CheckInvariants(); }
public ItemSingle(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid, Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit, Element item) : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit) { Check.Require(item != null, "item must not be null"); this.item = item; if (this.item != null) this.item.Parent = this; SetAttributeDictionary(); CheckInvariants(); }
protected override void ReadXmlBase(System.Xml.XmlReader reader) { base.ReadXmlBase(reader); if (reader.LocalName != "item") { throw new ApplicationException("Expected Element 'item', but it is " + reader.NodeType.ToString() + " '" + reader.LocalName + "'"); } this.item = new OpenEhr.RM.DataStructures.ItemStructure.Representation.Element(); this.item.ReadXml(reader); this.item.Parent = this; }
protected override void ReadXmlBase(System.Xml.XmlReader reader) { base.ReadXmlBase(reader); if(reader.LocalName != "item") throw new ApplicationException("Expected Element 'item', but it is " + reader.NodeType.ToString() + " '" + reader.LocalName + "'"); this.item = new OpenEhr.RM.DataStructures.ItemStructure.Representation.Element(); this.item.ReadXml(reader); this.item.Parent = this; }
protected override void ReadXmlBase(System.Xml.XmlReader reader) { base.ReadXmlBase(reader); if (reader.LocalName == "items") { LocatableList<Element> items = new LocatableList<Element>(); do { Element element = new Element(); element.ReadXml(reader); element.Parent = this; items.Add(element); // Added checking on reader.NodeType == Element is because ItemList xml instance // is something like: <items> <items xsi:type='ELEMENT'>..</items></items>. // After reading all element contents, the reader.LocalName is still items, // but the reader NodeType is EndElement. This situation is similar as Section, ItemTable } while (reader.LocalName == "items" && reader.NodeType == System.Xml.XmlNodeType.Element); this.items = items; } reader.MoveToContent(); }