コード例 #1
0
        void newControl_DeletePlageEventHandler(object sender, EventArgs e)
        {
            CControlEditionPlageIP controlASupprimer = sender as CControlEditionPlageIP;

            if (controlASupprimer != null)
            {
                controlASupprimer.Visible = false;
                Control parent = controlASupprimer.Parent;
                controlASupprimer.Parent = null;
                parent.Controls.Remove(controlASupprimer);
                controlASupprimer.Dispose();
            }
        }
コード例 #2
0
        private void AjouterControlPlageIp(CPlageIP plage)
        {
            CControlEditionPlageIP newControl = new CControlEditionPlageIP();

            if (newControl != null)
            {
                ((Control)newControl).Dock          = DockStyle.Top;
                newControl.DeletePlageEventHandler += new EventHandler(newControl_DeletePlageEventHandler);
                newControl.LockEdition              = !m_gestionnaireModeEdition.ModeEdition;
                newControl.Init(plage);
                CWin32Traducteur.Translate(newControl);
                m_panelPlagesIP.Controls.Add((Control)newControl);
                ((Control)newControl).BringToFront();
            }
        }
コード例 #3
0
        public CResultAErreur MajChamps()
        {
            CResultAErreur result = CResultAErreur.True;

            m_lienProxy.ClearPlages();
            foreach (Control ctrl in m_panelPlagesIP.Controls)
            {
                CControlEditionPlageIP control = ctrl as CControlEditionPlageIP;
                if (control != null)
                {
                    control.MajChamps();
                    m_lienProxy.AddPlage(control.PlageIP);
                }
            }
            return(result);
        }