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

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

                for (int i = 0; i < DgnControls.Count; i++)
                {
                    PrjUI.PrjDgn.DgnBase 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);
            }
Exemplo n.º 4
0
            /// <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.PrjDgn.DgnBase Item = sender as PrjUI.PrjDgn.DgnBase;

                int Index = DgnControls.FindIndex(delegate(PrjUI.PrjDgn.DgnBase 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;
                }
            }