public PathArc(ArcKind kind, int poly1Index, int poly2Index, PathEdge edge) { this.kind = kind; this.poly1Index = poly1Index; this.poly2Index = poly2Index; this.edge = edge; }
public void FromXml(XmlReader r) { while (r.Read()) { if (r.NodeType == XmlNodeType.Whitespace) { continue; } for (int i = 0; i < r.AttributeCount; i++) { r.MoveToAttribute(i); // set the field in this object based on the element we just read switch (r.Name) { case "kind": kind = ArcKindFromString(r.Value); break; case "poly1Index": poly1Index = int.Parse(r.Value); break; case "poly2Index": poly2Index = int.Parse(r.Value); break; } } r.MoveToElement(); //Moves the reader back to the element node. // look for the start of an element if (r.NodeType == XmlNodeType.Element) { // parse that element // save the name of the element string elementName = r.Name; switch (elementName) { case "PathEdge": edge = new PathEdge(r); break; } } else if (r.NodeType == XmlNodeType.EndElement) { break; } } }