////初始化过程中也会执行!!! protected override void OnNodeAdded(Node node) { base.OnNodeAdded(node); ActivityNode data = node.Data as ActivityNode; if (data == null) { return; } if (IsOverviewDiagram(node)) { return; } if (data.IsDynamic == false) { ActivityType nodeType = (ActivityType)Enum.Parse(typeof(ActivityType), data.Category, false); if (!IsValidKey(data.Key, nodeType, node.Diagram)) { data.Key = CreateActivityKey(); } } else { if (!IsValidKey(data.Key, ActivityType.Normal, node.Diagram)) { data.Key = CreateActivityKey(); } data.IsDynamic = true; } _webMethod.LoadProperty(WorkflowUtils.CLIENTSCRIPT_PARAM_ACTIVITY, node.Diagram.Tag.ToString(), WorkflowUtils.ExtractActivityInfoJson(data)); }
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)); }