private void mainDiagram_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (string.Compare(this.mainDiagram.Tag.ToString(), WorkflowUtils.CurrentKey) != 0)
     {
         this.WebMethod.LoadProperty(WorkflowUtils.CLIENTSCRIPT_PARAM_WORKFLOW,
                                     this.mainDiagram.Tag.ToString(),
                                     WorkflowUtils.ExtractWorkflowInfoJson(this.mainDiagram));
     }
 }
        /// <summary>
        /// Tab关闭时触发
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Item_RequestClose(object sender, EventArgs e)
        {
            DiagramPageViewModel item = sender as DiagramPageViewModel;

            DiagramDataSource.Remove(item);
            this.WebInterAct.DeleteProcess(WorkflowUtils.CLIENTSCRIPT_PARAM_WORKFLOW,
                                           item.Key,
                                           WorkflowUtils.ExtractWorkflowInfoJson(item));
        }
        private void AddNewCommandExecuted(WorkflowInfo info)
        {
            if (info == null)
            {
                throw new ArgumentNullException("WorkflowInfo不能为空");
            }

            DiagramPageViewModel vw = new DiagramPageViewModel(info, WebInterAct);

            vw.RequestClose += this.Item_RequestClose;
            this.DiagramDataSource.Add(vw);
            WebInterAct.LoadProperty(WorkflowUtils.CLIENTSCRIPT_PARAM_WORKFLOW,
                                     vw.Key,
                                     WorkflowUtils.ExtractWorkflowInfoJson(vw));
        }
示例#4
0
        public override void DoMouseDown()
        {
            if (this.Active)
            {
                new WebInterAction().LoadProperty(WorkflowUtils.CLIENTSCRIPT_PARAM_WORKFLOW,
                                                  this.Diagram.Tag.ToString(),
                                                  WorkflowUtils.ExtractWorkflowInfoJson(this.Diagram));

                var form = this.Diagram.PartsModel.FindNodeByKey("menuNode");
                if (form == null)
                {
                    return;
                }

                form.Visible = false;
            }

            // all done!
            StopTool();
        }
        private void Process_MouseButton(object sender, MouseButtonEventArgs e)
        {
            //e.Handled = true;
            if (string.Compare(this.mainDiagram.Tag.ToString(), WorkflowUtils.CurrentKey) != 0)
            {
                HtmlPage.Window.Invoke("LoadProperty", WorkflowUtils.CLIENTSCRIPT_PARAM_WORKFLOW, this.mainDiagram.Tag.ToString(), WorkflowUtils.ExtractWorkflowInfoJson(this.mainDiagram));

                WorkflowUtils.CurrentKey = this.mainDiagram.Tag.ToString();
            }
        }
示例#6
0
        public override void DoMouseDown()
        {
            base.DoMouseDown();

            Diagram diagram = this.Diagram;

            if (diagram == null)
            {
                return;
            }

            //得到当前的Part
            Part currentPart = FindPartAt(diagram.LastMousePointInModel, true);

            if (currentPart == null)
            {
                //活动上下文菜单
                var form = this.Diagram.PartsModel.FindNodeByKey(DiagramPage.ACTCONTEXT_MENU);

                if (form != null)
                {
                    form.Visible = false;
                }

                //流程上下文菜单
                form = this.Diagram.PartsModel.FindNodeByKey(DiagramPage.WFCONTEXT_MENU);

                if (form != null)
                {
                    form.Visible = false;
                }

                //如果Part和当前Part不一致,则切换属性
                if (string.Compare(diagram.Tag.ToString(), WorkflowUtils.CurrentKey) != 0)
                {
                    HtmlPage.Window.Invoke("LoadProperty", WorkflowUtils.CLIENTSCRIPT_PARAM_WORKFLOW, diagram.Tag.ToString(), WorkflowUtils.ExtractWorkflowInfoJson(diagram));
                    WorkflowUtils.CurrentKey = diagram.Tag.ToString();
                }
            }
            else
            {
                if (currentPart.DataContext is Northwoods.GoXam.PartManager.PartBinding)
                {
                    Northwoods.GoXam.PartManager.PartBinding currentBinding = (Northwoods.GoXam.PartManager.PartBinding)((currentPart as FrameworkElement).DataContext);

                    if (currentBinding.Data == null)
                    {
                        return;
                    }

                    if (currentBinding.Data is ActivityNode)
                    {
                        ActivityNode nodeData = currentBinding.Data as ActivityNode;

                        if (nodeData == null)
                        {
                            return;
                        }

                        string strKey = string.Format("{0}@{1}", diagram.Tag.ToString(), nodeData.Key);

                        if (string.Compare(strKey, WorkflowUtils.CurrentKey) != 0)
                        {
                            HtmlPage.Window.Invoke("LoadProperty", WorkflowUtils.CLIENTSCRIPT_PARAM_ACTIVITY, diagram.Tag.ToString(), WorkflowUtils.ExtractActivityInfoJson(nodeData));
                            WorkflowUtils.CurrentKey = strKey;
                        }
                    }
                }
            }
        }