/// <summary>
 /// 添加控件元素
 /// </summary>
 /// <param name="DgnControl"></param>
 public void Add(PrjUI.PrjPrePare.PreBase DgnControl)
 {
     DgnControl.MouseMoveOver += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.PrjPrePare.PreBase.EventMouseMoveOver(DgnControl_MouseMoveOver);
     DgnControl.MouseMoves    += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.PrjPrePare.PreBase.EventMouseMove(DgnControl_MouseMoves);
     DgnControl.PrjSort       += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.PrjPrePare.PreBase.EventPrjSort(DgnControl_PrjSort);
     DgnControls.Add(DgnControl);
 }
            /// <summary>
            /// 要检项目排序
            /// </summary>
            /// <param name="Index"></param>
            private void DgnControl_PrjSort(object sender, int Index)
            {
                PrjUI.PrjPrePare.PreBase Item = sender as PrjUI.PrjPrePare.PreBase;

                if (DgnControls.Contains(Item))
                {
                    DgnControlsSort.Add(Index, Item);
                }
            }
            /// <summary>
            /// 拷贝需要检定的方案
            /// </summary>
            /// <param name="TaiType"></param>
            /// <param name="FaName"></param>
            /// <returns></returns>
            public CLDC_DataCore.Model.Plan.Plan_PrepareTest Copy(CLDC_Comm.Enum.Cus_TaiType TaiType, string FaName)
            {
                CLDC_DataCore.Model.Plan.Plan_PrepareTest Dgn = new CLDC_DataCore.Model.Plan.Plan_PrepareTest((int)TaiType, "");           //创建一个新的多功能方案

                for (int i = 0; i < DgnControls.Count; i++)
                {
                    PrjUI.PrjPrePare.PreBase Item = DgnControls[i];
                    if (Item.IsCheck)
                    {
                        Dgn.Add(Item.DgnID, Item.DgnName, Item.DgnPlanPrj.OutPramerter.Jion(), Item.Parm);
                    }
                }
                Dgn.SetPram((int)TaiType, FaName);
                return(Dgn);
            }
            /// <summary>
            /// 控件面板移动完毕事件
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void DgnControl_MouseMoveOver(object sender, EventArgs e)
            {
                if (!IsMoved)
                {
                    return;                 //如果控件没有移动过
                }
                IsMoved = false;
                bool IsInsert = false;

                PrjUI.PrjPrePare.PreBase Item = sender as PrjUI.PrjPrePare.PreBase;

                int Index = DgnControls.FindIndex(delegate(PrjUI.PrjPrePare.PreBase DgnItem) { return(DgnItem == Item); });

                DgnControls.Remove(Item);

                for (int i = 0; i < DgnControls.Count; i++)
                {
                    if (Item.Top < DgnControls[i].Top + DgnControls[i].Height)
                    {
                        DgnControls.Insert(i, Item);
                        IsInsert = true;
                        Index    = i >= Index?Index:i;
                        break;
                    }
                }
                if (!IsInsert)
                {
                    DgnControls.Add(Item);
                }

                int ScrollValue = 0;

                if (_CtrParent.VerticalScroll.Visible)
                {
                    ScrollValue = _CtrParent.VerticalScroll.Value;
                }
                this.Sort(Index);
                if (_CtrParent.VerticalScroll.Visible)
                {
                    _CtrParent.VerticalScroll.Value = ScrollValue;
                }
            }