public void showFlowchar(WorkflowStruct.flowcharStruct flowcharStruct)
        {
            body.Children.Clear();

            //(1)

            body.Children.Add(new nodeControl(flowcharStruct.beginNode));
            //(2)
            foreach (var nodeItem in flowcharStruct.nodeList)
            {
                body.Children.Add(new nodeControl(nodeItem));
            }

            //(3)
            foreach (var lineItem in flowcharStruct.lineList)
            {
                var v=lineItem.connectorPoint[0];
                lineItem.connectorPoint.RemoveAt(0);

                List<Point> ps=new List<Point>();
                foreach(var i in   lineItem.connectorPoint)
                {
                    ps.Add(new Point{ X=i.x ,Y=i.y});
                }

                Path line = drawLines(new Point { X = v.x, Y = v.y }, ps);

                line.Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Blue);
                line.StrokeThickness = 5;
              //  line.StrokeStartLineCap = PenLineCap.Round;
                line.StrokeEndLineCap = PenLineCap.Triangle;
                line.StrokeLineJoin = PenLineJoin.Round;
                body.Children.Add(line);
            }
        }
Exemplo n.º 2
0
 void showFlowchar(WorkflowStruct.node node)
 {
     this.Background = System.Windows.Media.Brushes.Red;
     Canvas.SetLeft(this, node.ShapeSize.x);
     Canvas.SetTop(this, node.ShapeSize.y);
     this.Width =node.ShapeSize.width;
     this.Height = node.ShapeSize.height;
     this.displayName.Text = node.DisplayName;
 }
Exemplo n.º 3
0
 public nodeControl(WorkflowStruct.node node)
 {
     InitializeComponent();
     showFlowchar(node);
 }