/// <summary> /// 发起流程。 /// </summary> /// <param name="wfDefine"></param> public static void StartWorkflowInstance(WFDefine wfDefine, WorkflowInstanceCallBack callBack) { System.Type T = EAS.Objects.ClassProvider.GetType(wfDefine.SilverMType); if (T == null) { MessageBox.Show(string.Format("没有找到名称为\"{0}\"的功能模块", wfDefine.Module), "提示", MessageBoxButton.OK); return; } if (EAS.Application.Instance != null) { if (typeof(Control).IsAssignableFrom(T)) { object wfAddIn = System.Activator.CreateInstance(T); WfInstanceWindow wfInstanceForm = new WfInstanceWindow(wfAddIn, true, Guid.Empty); wfInstanceForm.Closed += (s, e) => { callBack(); }; wfInstanceForm.Show(); } else if (typeof(ChildWindow).IsAssignableFrom(T)) { ChildWindow wfAddIn = System.Activator.CreateInstance(T) as ChildWindow; wfAddIn.Closed += (s, e) => { callBack(); }; WfAddInHelper.Start(wfAddIn); } else { WfAddInHelper.Start(System.Activator.CreateInstance(T)); } } }
protected override void OnOpened() { if (this.m_InstanceID == Guid.Empty) { WfAddInHelper.Start(this.WfAddIn); } else { WfAddInHelper.LoadWorkflowInstance(this.WfAddIn, true, this.m_InstanceID); } if (EAS.Application.Instance != null) { EAS.Application.Instance.AddInClosing += new AddInEventHandler(OnAddInClosing); } }