/// <summary> /// 添加控件元素 /// </summary> /// <param name="DgnControl"></param> public void Add(PrjUI.PrjEventLog.EventLogBase EventLogControl) { EventLogControl.MouseMoveOver += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.PrjEventLog.EventLogBase.EventMouseMoveOver(EventLogControl_MouseMoveOver); EventLogControl.MouseMoves += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.PrjEventLog.EventLogBase.EventMouseMove(EventLogControl_MouseMoves); EventLogControl.PrjSort += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.PrjEventLog.EventLogBase.EventPrjSort(EventLogControl_PrjSort); EventLogControls.Add(EventLogControl); }
/// <summary> /// 要检项目排序 /// </summary> /// <param name="Index"></param> private void EventLogControl_PrjSort(object sender, int Index) { PrjUI.PrjEventLog.EventLogBase Item = sender as PrjUI.PrjEventLog.EventLogBase; if (EventLogControls.Contains(Item)) { EventLogControlsSort.Add(Index, Item); } }
/// <summary> /// 拷贝需要检定的方案 /// </summary> /// <param name="TaiType"></param> /// <param name="FaName"></param> /// <returns></returns> public CLDC_DataCore.Model.Plan.Plan_EventLog Copy(CLDC_Comm.Enum.Cus_TaiType TaiType, string FaName) { CLDC_DataCore.Model.Plan.Plan_EventLog EventLog = new CLDC_DataCore.Model.Plan.Plan_EventLog((int)TaiType, ""); //创建一个新的多功能方案 for (int i = 0; i < EventLogControls.Count; i++) { PrjUI.PrjEventLog.EventLogBase Item = EventLogControls[i]; if (Item.IsCheck) { EventLog.Add(Item.EventLogID, Item.EventLogName, Item.EventLogPlanPrj.OutPramerter.Jion(), Item.Parm); } } EventLog.SetPram((int)TaiType, FaName); return(EventLog); }
/// <summary> /// 控件面板移动完毕事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void EventLogControl_MouseMoveOver(object sender, EventArgs e) { if (!IsMoved) { return; //如果控件没有移动过 } IsMoved = false; bool IsInsert = false; PrjUI.PrjEventLog.EventLogBase Item = sender as PrjUI.PrjEventLog.EventLogBase; int Index = EventLogControls.FindIndex(delegate(PrjUI.PrjEventLog.EventLogBase DgnItem) { return(DgnItem == Item); }); EventLogControls.Remove(Item); for (int i = 0; i < EventLogControls.Count; i++) { if (Item.Top < EventLogControls[i].Top + EventLogControls[i].Height) { EventLogControls.Insert(i, Item); IsInsert = true; Index = i >= Index?Index:i; break; } } if (!IsInsert) { EventLogControls.Add(Item); } int ScrollValue = 0; if (_CtrParent.VerticalScroll.Visible) { ScrollValue = _CtrParent.VerticalScroll.Value; } this.Sort(Index); if (_CtrParent.VerticalScroll.Visible) { _CtrParent.VerticalScroll.Value = ScrollValue; } }