Пример #1
0
		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);
		}
Пример #2
0
		public static void SetUp(ExtensionPath extensionPath, XmlReader reader, string endElement)
		{
			extensionPath.DoSetUp(reader, endElement);
		}
Пример #3
0
 public static void SetUp(ExtensionPath extensionPath, XmlReader reader, string endElement)
 {
     extensionPath.DoSetUp(reader, endElement, extensionPath.addIn);
 }
Пример #4
0
		public static void SetUp(ExtensionPath extensionPath, XmlReader reader, string endElement)
		{
			Stack<ICondition> conditionStack = new Stack<ICondition>();
			extensionPath.DoSetUp(reader, endElement, conditionStack);
		}
Пример #5
0
 public static void SetUp(ExtensionPath extensionPath, XmlReader reader, string endElement, Properties properties)
 {
     extensionPath.SetParentPathProperties(properties);
     extensionPath.DoSetUp(reader, endElement, extensionPath.addIn);
 }