Esempio n. 1
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;
        }