/// <summary> /// Добавить истинные признаки при их отсутствии /// </summary> /// <param name="mark">Исходное значение для всех признаков</param> public void Add(HMark mark) { int cntBit = -1 , valChanged = 0; Delegate [] arHandler = ValueChanged == null ? new Delegate [] { } : ValueChanged.GetInvocationList(); foreach (DelegateIntFunc f in arHandler) { ValueChanged -= f; } cntBit = sizeof(Int32) * 8; for (int i = 0; i < cntBit; i++) { if ((IsMarked(mark.Value, i) == true) && (IsMarked(i) == false)) { marked(true, i); valChanged += HMath.Pow2(i); } else { ; } } foreach (DelegateIntFunc f in arHandler) { ValueChanged += new DelegateIntFunc(f); } ValueChanged?.Invoke(valChanged); }
/// <summary> /// Установить значение всех признаков /// </summary> /// <param name="mark">Исходное значение для всех признаков</param> public void SetOf(HMark mark) { //for (int i = 0; i < sizeof (Int32) * 8; i ++) // marked (IsMarked (i), i); m_mark = mark.Value; }
public PanelAdminKomDisp(int idListener, ASUTP.Core.HMark markQueries) : base(idListener, markQueries, new int[] { 0, (int)TECComponent.ID.GTP }) { //??? вызывается из базового класса //InitializeComponents (); }
public FormChangeMode(List <TEC> tec, List <int> listIDsProfileCheckedIndices, System.Windows.Forms.ContextMenuStrip FormMainContextMenuStrip /*= null*//*, DelegateFunc changeMode*/) { InitializeComponent(); this.Text = @"Выбор режима"; if (listIDsProfileCheckedIndices.Count > 0) { if (!(m_MainFormContextMenuStripListTecViews == null)) { m_MainFormContextMenuStripListTecViews.ItemClicked -= new ToolStripItemClickedEventHandler(MainFormContextMenuStripListTecViews_ItemClicked); m_MainFormContextMenuStripListTecViews = null; } else { ; } } else { ; //Нет ID для автозагрузки } m_MainFormContextMenuStripListTecViews = FormMainContextMenuStrip; m_MainFormContextMenuStripListTecViews.ItemClicked += new ToolStripItemClickedEventHandler(MainFormContextMenuStripListTecViews_ItemClicked); this.m_list_tec = new List <TEC> (); foreach (TEC t in tec) { //if ((HAdmin.DEBUG_ID_TEC == -1) || (HAdmin.DEBUG_ID_TEC == t.m_id)) this.m_list_tec.Add(t); //else ; } m_modeTECComponent = new HMark(0); m_listCheckBoxTECComponent = new List <CheckBox> () { checkBoxTEC, checkBoxGTP, checkBoxPC, checkBoxTG }; m_markTabAdminChecked = new HMark(0); m_listItems = new List <ListBoxItem>(); m_list_change_items = new List <ListBoxItem>(); if (!(m_list_tec == null)) { bool bChecked = false; foreach (TEC t in m_list_tec) { bChecked = false; if (listIDsProfileCheckedIndices.IndexOf(t.m_id) > -1) { bChecked = true; } else { ; } m_listItems.Add(new ListBoxItem(t.m_id, t.name_shr, bChecked)); if (t.ListTECComponents.Count > 0) { foreach (TECComponent g in t.ListTECComponents) { bChecked = false; if (listIDsProfileCheckedIndices.IndexOf(g.m_id) > -1) { bChecked = true; } else { ; } m_listItems.Add(new ListBoxItem(g.m_id, t.name_shr + " - " + g.name_shr, bChecked)); } } else { ; } } bChecked = listIDsProfileCheckedIndices.IndexOf(ID_ADMIN_TABS[(int)MANAGER.DISP]) > -1; m_listItems.Add(new ListBoxItem(ID_ADMIN_TABS[(int)MANAGER.DISP], getNameAdminValues(MANAGER.DISP, MODE_TECCOMPONENT.GTP), bChecked)); //m_markTabAdminChecked.Set ((int)MANAGER.DISP, bChecked); bChecked = listIDsProfileCheckedIndices.IndexOf(ID_ADMIN_TABS[(int)MANAGER.NSS]) > -1; m_listItems.Add(new ListBoxItem(ID_ADMIN_TABS[(int)MANAGER.NSS], getNameAdminValues(MANAGER.NSS, MODE_TECCOMPONENT.TEC), bChecked)); //TEC, TG, PC - не имеет значения... //m_markTabAdminChecked.Set((int)MANAGER.NSS, bChecked); bChecked = listIDsProfileCheckedIndices.IndexOf(ID_ADMIN_TABS[(int)MANAGER.ALARM]) > -1; m_listItems.Add(new ListBoxItem(ID_ADMIN_TABS[(int)MANAGER.ALARM], getNameAdminValues(MANAGER.ALARM, MODE_TECCOMPONENT.GTP), bChecked)); //m_markTabAdminChecked.Set((int)MANAGER.ALARM, bChecked); bChecked = listIDsProfileCheckedIndices.IndexOf(ID_ADMIN_TABS[(int)MANAGER.LK]) > -1; m_listItems.Add(new ListBoxItem(ID_ADMIN_TABS[(int)MANAGER.LK], getNameAdminValues(MANAGER.LK, MODE_TECCOMPONENT.TEC), bChecked)); //TEC, TG, PC - не имеет значения... bChecked = listIDsProfileCheckedIndices.IndexOf(ID_ADMIN_TABS[(int)MANAGER.TEPLOSET]) > -1; m_listItems.Add(new ListBoxItem(ID_ADMIN_TABS[(int)MANAGER.TEPLOSET], getNameAdminValues(MANAGER.TEPLOSET, MODE_TECCOMPONENT.TEC), bChecked)); //TEC, TG, PC - не имеет значения... } else { } m_listCheckBoxTECComponent[(int)MODE_TECCOMPONENT.TEC].Checked = true; m_listCheckBoxTECComponent[(int)MODE_TECCOMPONENT.GTP].Checked = true; closing = false; }
public PanelAdminKomDisp(ASUTP.Core.HMark markQueries) : base(FormChangeMode.MODE_TECCOMPONENT.GTP, markQueries, new int[] { 0, (int)TECComponent.ID.GTP }) { //??? вызывается из базового класса //InitializeComponents (); }
public PanelAdminKomDisp(ASUTP.Core.HMark markQueries) : base(FormChangeMode.MODE_TECCOMPONENT.GTP, markQueries, new int[] { 0, (int)TECComponent.ID.GTP }) { btnImportCSV_AdminDefaultValues.Enabled = AllowUserImportAdminValuesDefault; btnImportCSV_PBRValues.Enabled = AllowUserImportCSVPBRValues; }