//------------------------------------------- private void RefillSansDelai() { m_wndListe.BeginUpdate(); m_wndListe.Items.Clear(); HashSet <DefinitionType> types = new HashSet <DefinitionType>(); m_allDefs.Sort((x, y) => m_nSortOnName * x.Name.CompareTo(y.Name) + m_nSortOnType * x.Type.ToString().CompareTo(y.Type.ToString())); foreach (ListViewItem item in m_wndListeTypes.CheckedItems) { if (item.Tag is DefinitionType) { types.Add((DefinitionType)item.Tag); } } string strSearch = m_txtName.Text.ToUpper(); foreach (IDefinition def in from d in m_allDefs where types.Contains(d.Type) && (strSearch == "" || d.Name.ToUpper().Contains(strSearch)) select d) { ListViewItem item = new ListViewItem(def.Name); item.SubItems.Add(CUtilSurEnum.GetNomConvivial(def.Type.ToString())); item.Tag = def; item.ImageIndex = (int)def.Type; m_wndListe.Items.Add(item); } m_wndListe.EndUpdate(); }
//-------------------------------------------------------------------- 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); } }
//------------------------------------------- private void InitTypes() { m_wndListe.Items.Clear(); foreach (object valeur in Enum.GetValues(typeof(DefinitionType))) { ListViewItem item = new ListViewItem(CUtilSurEnum.GetNomConvivial(valeur.ToString())); item.Tag = valeur; item.Checked = true; item.ImageIndex = (int)valeur; m_wndListeTypes.Items.Add(item); } m_timerOnChangeFiltre.Stop(); }
private static CResultAErreur ShowHelp() { CResultAErreur result = CResultAErreur.True; foreach (object value in Enum.GetValues(typeof(EErreurs))) { result.EmpileErreur((int)value + " : " + CUtilSurEnum.GetNomConvivial(value.ToString())); } result.EmpileErreur(I.T("Errors : |30003")); result.EmpileErreur("[Variable name]=[Variable value] : Specify a process variable value. If the variable name or the variable value contains spaces, use \"|30004"); result.EmpileErreur(I.T("ProcessId=x : Specify the process to run, where x is the Internal ID of the process to run|30005")); result.EmpileErreur(I.T("Help : to display help about TimosProcess|30006")); result.EmpileErreur(I.T("TimosProcess command line arguments|30007")); return(result); }
/// /////////////////////////////////////////// protected override string GetMyLibelle() { string strLib = I.T("Each @1 @2|101", m_nEcart.ToString(), CUtilSurEnum.GetNomConvivial(m_nUnite.ToString())); return(strLib); }