Exemplo n.º 1
0
 void Update()
 {
     try
     {
         frm_AddNewProjection _AddNew = new frm_AddNewProjection(_currP);
         if (_AddNew.ShowDialog() == DialogResult.OK)
         {
             foreach (Control ctr in pnlProjectionList.Controls)
             {
                 ProjectionControl _Projection = ctr as ProjectionControl;
                 if (_Projection.isPressed && _Projection.Code == _currP.Code)
                 {
                     int idx = pnlProjectionList.Controls.IndexOf(_Projection);
                     pnlProjectionList.Controls.Remove(_Projection);
                     ProjectionControl _NewProjection = _AddNew._ACtrl.Copy();
                     _NewProjection._OnClick += new ProjectionControl.OnClick(_Projection__OnClick);
                     pnlProjectionList.Controls.Add(_NewProjection);
                     pnlProjectionList.Controls.SetChildIndex(_NewProjection, idx);
                     _NewProjection._ProjectionObject.PerformClick();
                   
                 }
             }
         }
     }
     catch
     {
     }
 }
Exemplo n.º 2
0
        void Insert()
        {
             try
            {
                frm_AddNewProjection _AddNew = new frm_AddNewProjection(null);
                if (_AddNew.ShowDialog() == DialogResult.OK)
                {
                    ProjectionControl _NewProjection = _AddNew._ACtrl.Copy();
                    _NewProjection._OnClick += new ProjectionControl.OnClick(_Projection__OnClick);
                    pnlProjectionList.Controls.Add(_NewProjection);
                    pnlProjectionList.ScrollControlIntoView(_NewProjection);

                }
            }
             catch
             {
             }
        }