Exemple #1
0
            /// <summary>
            /// 拷贝需要检定的方案
            /// </summary>
            /// <param name="TaiType"></param>
            /// <param name="FaName"></param>
            /// <returns></returns>
            public CLDC_DataCore.Model.Plan.Plan_Specal Copy(CLDC_Comm.Enum.Cus_TaiType TaiType, string FaName)
            {
                CLDC_DataCore.Model.Plan.Plan_Specal Specal = new CLDC_DataCore.Model.Plan.Plan_Specal((int)TaiType, "");           //创建一个新的特殊检定方案

                for (int i = 0; i < SpecialControls.Count; i++)
                {
                    PrjUI.UI_SpecialPrj Item = SpecialControls[i];

                    Specal.Add(Item.GetItem());
                }
                Specal.SetPram((int)TaiType, FaName);
                return(Specal);
            }
Exemple #2
0
            /// <summary>
            /// 添加控件元素
            /// </summary>
            /// <param name="DgnControl"></param>
            public void Add(PrjUI.UI_SpecialPrj SpecialControl)
            {
                SpecialControl.MouseMoveOver += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.UI_SpecialPrj.EventMouseMoveOver(SpecialControl_MouseMoveOver);
                SpecialControl.MouseMoves    += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.UI_SpecialPrj.EventMouseMove(SpecialControl_MouseMoves);
                SpecialControl.PanelClose    += new CLDC_MeterUI.UI_FA.FAPrj.PrjUI.UI_SpecialPrj.EventPanelClose(SpecialControl_PanelClose);
                _CtrParent.Controls.Add(SpecialControl);
                SpecialControls.Add(SpecialControl);

                if (_CtrParent.VerticalScroll.Visible)
                {
                    this.SetWidth(_CtrParent.Width - 16, SpecialControls.Count - 1);
                }
                else
                {
                    this.SetWidth(_CtrParent.Width, SpecialControls.Count - 1);
                }

                this.Sort(SpecialControls.Count - 1);
            }
Exemple #3
0
            /// <summary>
            /// 控件面板移动完毕事件
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void SpecialControl_MouseMoveOver(object sender, EventArgs e)
            {
                if (!IsMoved)
                {
                    return;                 //如果控件没有移动过
                }
                IsMoved = false;
                bool IsInsert = false;

                PrjUI.UI_SpecialPrj Item = sender as PrjUI.UI_SpecialPrj;

                int Index = SpecialControls.FindIndex(delegate(PrjUI.UI_SpecialPrj SpecialItem) { return(SpecialItem == Item); });

                SpecialControls.Remove(Item);

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

                int ScrollValue = 0;

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