public IBackgroundPrimitive Clone() { LinePrimitive line = new LinePrimitive(this.LineType, this.PenIndex, this.P1, this.P2); return(line); }
/// <summary> /// Set Line primitive to xml document /// </summary> private void SetLine(XmlDocument doc, XmlElement parentNode, LinePrimitive line) { XmlElement lineNode = doc.CreateElement("Line"); //Set the line type attribute XmlAttribute type = doc.CreateAttribute("type"); switch (line.LineType) { case LineType.LINE: type.InnerText = "Line"; break; case LineType.RAY: type.InnerText = "Ray"; break; case LineType.SEGMENT: type.InnerText = "Segment"; break; default: type.InnerText = "Line"; break; } lineNode.SetAttributeNode(type); XmlAttribute point1 = doc.CreateAttribute("point1"); point1.InnerText = "(" + line.P1.X + "," + line.P1.Y + ")"; lineNode.SetAttributeNode(point1); XmlAttribute point2 = doc.CreateAttribute("point2"); point2.InnerText = "(" + line.P2.X + "," + line.P2.Y + ")"; lineNode.SetAttributeNode(point2); XmlAttribute pen = doc.CreateAttribute("pen"); pen.InnerText = "" + line.PenIndex; lineNode.SetAttributeNode(pen); parentNode.AppendChild(lineNode); }
public IBackgroundPrimitive Clone() { LinePrimitive line = new LinePrimitive(this.LineType, this.PenIndex, this.P1, this.P2); return line; }
public LinePrimitiveRenderer(LinePrimitive line, float zoom) { this.m_Line = line; this.m_HasIterator = false; this.m_Zoom = zoom; }