/// <summary> /// </summary> public void RemoveObject(FunctionButton fb) { if (List.Contains(fb)) { List.Remove(fb); } }
/// <summary> /// </summary> public FunctionButton Add(FunctionButton fb) { //如果已经存在,则不用增加了 if (!List.Contains(fb)) { List.Add(fb); } return(fb); }
/// <summary> /// </summary> public ProcessSettingForm(FunctionButton fb) { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // fFunctionButton = fb; //baseBussiness = new BaseBusiness(); }
/// <summary> /// 调整控件的位置 /// </summary> private void MoveRightControls(FunctionButton deleteCtrl) { //是否为维修 bool isRepairNode = false; foreach (FlowButton fb in this.InFlows) { if (fb is DownArrowButton) { isRepairNode = true; break; } } if (isRepairNode) { deleteCtrl.Parent.Controls.Remove(deleteCtrl); return; } (this.Parent as Panel).AutoScrollPosition = new Point(0, 0); int flowWidth = 0; foreach (Control ctrl in this.Parent.Controls) { if (ctrl is RightArrowButton) { flowWidth = ctrl.Width; break; } } Hashtable htFlow = new Hashtable(); Hashtable htProcess = new Hashtable(); foreach (Control ctrl in this.Parent.Controls) { if (ctrl.Left > deleteCtrl.Left) { ctrl.Left -= (deleteCtrl.Width + flowWidth); } if (ctrl is FunctionButton && ctrl != deleteCtrl) { htProcess.Add((ctrl as FunctionButton).ProcessID, ctrl); } if (ctrl is FlowButton && ctrl != deleteCtrl) { htFlow.Add((ctrl as FlowButton).ProcessID, ctrl); } } Control ctrlParent = deleteCtrl.Parent; string wfID = deleteCtrl.WorkFlowID; this.Parent.Controls.Clear(); foreach (string code in htProcess.Keys) { if (htProcess.ContainsKey(code)) { ctrlParent.Controls.Add(htProcess[code] as FunctionButton); } } foreach (string code in htFlow.Keys) { if (htFlow.ContainsKey(code)) { ctrlParent.Controls.Add(htFlow[code] as FlowButton); } } // Sys_WorkFlowClass swc = new Sys_WorkFlowClass(); // Hashtable htFLows = swc.GetDeSerializeFlow(wfID,htProcess); // // // foreach(string code in htFLows.Keys) // { // if(htFLows.ContainsKey(code)) // { // FlowButton fb = htFLows[code] as FlowButton; // if(fb.Left > deleteCtrl.Left) // fb.Left -= (deleteCtrl.Width + flowWidth); // ctrlParent.Controls.Add(fb); // } // } }
public StraightArrowButton(Color backColor, double degree, FunctionButton btn) { //this.BackColor = backColor; this.degree = degree; this.FromProcesses.Add(btn); }