Ejemplo n.º 1
0
 public void AddGraph(Graph graph)
 {
     this.AppendChild(graph);
 }
Ejemplo n.º 2
0
 public void RemoveGraph(Graph graph)
 {
     this.RemoveChild(graph);
 }
Ejemplo n.º 3
0
        private string getOuterXml(Graph graph1,Point offset,IList connectLines ,StringBuilder sb,SvgElementCollection selectCollection)
        {
            XmlElement node = graph1.Clone() as XmlElement;
            if(graph1 is ConnectLine)
            {
                ConnectLine cline = graph1 as ConnectLine;
                if(connectLines.Contains(graph1.ID) ||(cline.StartGraph==null||cline.EndGraph==null)||(!selectCollection.Contains(cline.StartGraph)||!selectCollection.Contains(cline.EndGraph))) return string.Empty;

                connectLines.Add(graph1.ID);
            }else
            {
                Matrix matrix1 =new Matrix();
                if (graph1.SvgAttributes.ContainsKey("transform"))
                {
                    matrix1 = (graph1.SvgAttributes["transform"] as Matrix).Clone();
                }
                matrix1.Translate(-offset.X,-offset.Y,MatrixOrder.Append);
                node.SetAttribute("transform", new ItopVector.Core.Types.Transf(matrix1).ToString());
            }

            sb.Append(node.OuterXml);

            foreach(Graph graph2 in graph1.ConnectLines)
            {
                getOuterXml(graph2,Point.Empty,connectLines, sb,selectCollection);
            }

            return sb.ToString();
        }