Exemplo n.º 1
0
 public PathArc(ArcKind kind, int poly1Index, int poly2Index, PathEdge edge)
 {
     this.kind = kind;
     this.poly1Index = poly1Index;
     this.poly2Index = poly2Index;
     this.edge = edge;
 }
Exemplo n.º 2
0
 public PathArc(ArcKind kind, int poly1Index, int poly2Index, PathEdge edge)
 {
     this.kind       = kind;
     this.poly1Index = poly1Index;
     this.poly2Index = poly2Index;
     this.edge       = edge;
 }
Exemplo n.º 3
0
        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;
                }
            }
        }
Exemplo n.º 4
0
        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;
                }
            }
        }