protected override void OnReplaceAction() { MethodDiagramViewer mv = this.Parent as MethodDiagramViewer; if (mv != null) { ISingleAction av = this.ActionObject as ISingleAction; List <IAction> actReplaceList = DesignUtil.SelectAction(mv.DesignerHolder.Loader, av.ActionData, null, false, mv.DesignerHolder.Method, mv.ActionsHolder, this.FindForm()); if (actReplaceList != null && actReplaceList.Count > 0) { av.ActionId = new TaskID(actReplaceList[0].WholeActionId); av.ActionData = actReplaceList[0]; IMethodDiagram p = this.Parent as IMethodDiagram; if (p != null) { p.OnActionNameChanged(av.ActionData.ActionName, av.ActionId.WholeTaskId); } } } }
protected override void OnEditAction() { MethodDiagramViewer mv = this.DiagramViewer; if (mv != null) { ILimnorDesignerLoader loader = mv.DesignerHolder.Designer as ILimnorDesignerLoader; ISingleAction av = this.ActionObject as ISingleAction; string name = av.ActionData.ActionName; FormProgress.HideProgress(); if (av.ActionData.Edit(loader.Writer, mv.Method, this.FindForm(), false)) { if (name != av.ActionData.ActionName) { IMethodDiagram p = this.Parent as IMethodDiagram; if (p != null) { p.OnActionNameChanged(av.ActionData.ActionName, av.ActionId.WholeTaskId); } } mv.Changed = true; } } }
public UndoActionGroupState(IUndoHost host, IMethodDiagram editor, BranchList actions) { _actions = (BranchList)actions.Clone(); _host = host; _editor = editor; }