Example #1
0
 public void DelStartNode(StartNodeControl con)
 {
     this.WorkflowProcessCurrent.StartNode = null;
     UserControls.Remove(con.Id);
     canvas.Children.Remove(con);
     foreach (var item in con.StartNode.LeavingTransitions)
     {
         item.FromNode = null;
     }
     foreach (var item in con.StartNode.EnteringLoops)
     {
         item.ToNode = null;
     }
 }
Example #2
0
        private void StartNodeButtonDown(object sender, MouseButtonEventArgs e)
        {
            //开始节点
            if (this.WorkflowProcessCurrent.StartNode == null)
            {
                StartNodeControl snc = new StartNodeControl(this, null, false);
                snc.InitNode();
                if (!canvas.Children.Contains(snc))
                {
                    snc.LoadNode();
                    //设置位置
                    Point p = e.GetPosition(canvas);
                    snc.SetPoint((double)(p.X - snc.Bounds.Width / 2), (double)(p.Y - snc.Bounds.Height / 2));

                    this.AddHandle(snc);
                    canvas.Children.Add(snc);
                    this.WorkflowProcessCurrent.StartNode = snc.StartNode;

                    UserControls.Add(snc.Id, snc);

                }
            }
            else
            {
                MainPage.Message("提示", "只能有一个开始节点。");
            }
            listBox.SelectedIndex = 0;
        }