void DoSetUp(XmlReader reader, string endElement, Stack<ICondition> conditionStack) { List<Codon> innerCodons = new List<Codon>(); while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.EndElement: if (reader.LocalName == "Condition" || reader.LocalName == "ComplexCondition") { conditionStack.Pop(); } else if (reader.LocalName == endElement) { if (innerCodons.Count > 0) this.codons.Add(innerCodons); return; } break; case XmlNodeType.Element: string elementName = reader.LocalName; if (elementName == "Condition") { conditionStack.Push(Condition.Read(reader)); } else if (elementName == "ComplexCondition") { conditionStack.Push(Condition.ReadComplexCondition(reader)); } else { Codon newCodon = new Codon(this.AddIn, elementName, Properties.ReadFromAttributes(reader), conditionStack.ToArray()); innerCodons.Add(newCodon); if (!reader.IsEmptyElement) { ExtensionPath subPath = this.AddIn.GetExtensionPath(this.Name + "/" + newCodon.Id); subPath.DoSetUp(reader, elementName, conditionStack); } } break; } } if (innerCodons.Count > 0) this.codons.Add(innerCodons); }
public static void SetUp(ExtensionPath extensionPath, XmlReader reader, string endElement) { extensionPath.DoSetUp(reader, endElement); }
public static void SetUp(ExtensionPath extensionPath, XmlReader reader, string endElement) { extensionPath.DoSetUp(reader, endElement, extensionPath.addIn); }
public static void SetUp(ExtensionPath extensionPath, XmlReader reader, string endElement) { Stack<ICondition> conditionStack = new Stack<ICondition>(); extensionPath.DoSetUp(reader, endElement, conditionStack); }
public static void SetUp(ExtensionPath extensionPath, XmlReader reader, string endElement, Properties properties) { extensionPath.SetParentPathProperties(properties); extensionPath.DoSetUp(reader, endElement, extensionPath.addIn); }