Beispiel #1
0
        //---------------------------------------------------------------
        private void m_lnkAddHandler_LinkClicked(object sender, EventArgs e)
        {
            CTrapHandler handler = new CTrapHandler();

            if (CFormEditeTrapHandler.EditeTrapHandler(handler, m_baseTypesAlarmes, m_browser.RootDefinition))
            {
                m_baseHandlers.AddTrapHandler(handler);
                FillListeHandlers();
            }
        }
Beispiel #2
0
 //---------------------------------------------------------------
 private void m_wndListeHandlers_DoubleClick(object sender, EventArgs e)
 {
     if (m_wndListeHandlers.SelectedItems.Count == 1)
     {
         CTrapHandler handler = m_wndListeHandlers.SelectedItems[0] as CTrapHandler;
         if (handler != null)
         {
             if (CFormEditeTrapHandler.EditeTrapHandler(handler, m_baseTypesAlarmes, m_browser.RootDefinition))
             {
                 FillListeHandlers();
             }
         }
     }
 }
Beispiel #3
0
        public static bool EditeTrapHandler(
            CTrapHandler handler,
            IBaseTypesAlarmes baseTypes,
            IDefinition rootDefinition)
        {
            CFormEditeTrapHandler form = new CFormEditeTrapHandler();

            form.m_handler         = handler;
            form.m_baseTypesAlarme = baseTypes;
            form.m_rootDefinition  = rootDefinition;
            bool bResult = form.ShowDialog() == DialogResult.OK;

            form.Dispose();
            return(bResult);
        }
Beispiel #4
0
        //---------------------------------------------------------------
        private void m_lnkCreateHandler_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            IDefinition def = m_browser.SelectedDefinition;

            if (def != null)
            {
                NotificationType notification = def.Entity as NotificationType;
                if (notification != null)
                {
                    CTrapHandler handler = CTrapHandler.CreateFromMib(def.Tree, def);
                    handler.TrapManager = m_baseHandlers;
                    if (handler != null)
                    {
                        if (CFormEditeTrapHandler.EditeTrapHandler(handler, m_baseTypesAlarmes, m_browser.RootDefinition))
                        {
                            m_baseHandlers.AddTrapHandler(handler);
                            FillListeHandlers();
                        }
                    }
                }
            }
        }