Esempio n. 1
0
        //--------------------------------------------------------------------
        private void DisplayDefinition(TreeNode node)
        {
            m_panelViewer.SuspendDrawing();
            //Masque le viewer visible
            foreach (Control ctrl in m_panelViewer.Controls)
            {
                ctrl.Visible = false;
            }

            IDefinition definition = m_mibTree.GetDefinition(node);

            if (definition != null)
            {
                m_lblType.Text = definition.Name + " (" + CUtilSurEnum.GetNomConvivial(definition.Type.ToString()) + ")";
                Type tpViewer = CSNMPClassViewer.GetViewerTypeFor(definition);
                if (tpViewer != null)
                {
                    ISNMPClassViewer viewer = null;
                    if (!m_dicViewerConnus.TryGetValue(tpViewer, out viewer))
                    {
                        viewer = Activator.CreateInstance(tpViewer, null) as ISNMPClassViewer;
                        m_panelViewer.Controls.Add((Control)viewer);
                        ((Control)viewer).Dock      = DockStyle.Fill;
                        m_dicViewerConnus[tpViewer] = viewer;
                    }
                    ((Control)viewer).Visible = true;
                    viewer.DisplayElement(definition);
                    viewer.MibNavigator = this;
                }
            }

            /*else
             * {
             *  TrapType trap = m_mibTree.GetTrap(node);
             *  if (trap != null)
             *  {
             *      m_lblType.Text = trap.Name + " (" + I.T("Trap|20107") + ")";
             *      if (m_panelDetailTrap == null)
             *      {
             *          m_panelDetailTrap = new CPanelDetailTrap();
             *          m_panelViewer.Controls.Add(m_panelDetailTrap);
             *          ((Control)m_panelDetailTrap).Dock = DockStyle.Fill;
             *      }
             *      m_panelDetailTrap.Visible = true;
             *      m_panelDetailTrap.DisplayElement(trap);
             *      m_panelDetailTrap.MibNavigator = this;
             *  }
             * }*/

            m_panelViewer.ResumeDrawing();
            UpdateBoutonsNavigation();
            if (SelectedDefinitionChanged != null)
            {
                SelectedDefinitionChanged(this, null);
            }
        }
Esempio n. 2
0
 //------------------------------------
 public static void Autoexec()
 {
     CSNMPClassViewer.RegisterViewer(typeof(ObjectType), typeof(CPanelDetailObjectType));
 }
Esempio n. 3
0
 //------------------------------------
 public static void Autoexec()
 {
     CSNMPClassViewer.RegisterViewer(typeof(TrapType), typeof(CPanelDetailTrap));
 }
Esempio n. 4
0
 //------------------------------------
 public static void Autoexec()
 {
     CSNMPClassViewer.RegisterViewer(typeof(NotificationType), typeof(CPanelDetailNotification));
 }
Esempio n. 5
0
 //------------------------------------
 public static void Autoexec()
 {
     CSNMPClassViewer.RegisterViewer(typeof(OidValueAssignment), typeof(CPanelDetailObjetDossier));
 }