void VariablesForm_Load(object sender, EventArgs e) { string helpPath; EM_AppContext.Instance.GetHelpPath(out helpPath); helpProvider.HelpNamespace = helpPath; btnSwitchablePolicies.Enabled = !EM_AppContext.Instance.IsPublicVersion(); try { _undoManager = new ADOUndoManager(); _undoManager.AddDataSet(_varConfigFacade._varConfig); _acronymManager = new AcronymManager(this); _variablesManager = new VariablesManager(this); _acronymManager.FillAcronymsList(); _variablesManager.FillVariablesList(); //fill the combo-box containing all countries to filter for country specific descriptions RepositoryItemComboBox ricmbCountry = cmbCountry.Edit as RepositoryItemComboBox; ricmbCountry.Items.Clear(); ricmbCountry.Items.Add(_anyCountry); foreach (CountryAdministration.Country country in CountryAdministration.CountryAdministrator.GetCountries()) { ricmbCountry.Items.Add(country._shortName); } cmbCountry.EditValue = _anyCountry; //fill the combo-box containing all acronym types for searching an acronym //(should actually be updated if an acronym type is added/removed, but considering this is a very uncommon event and a rather unimportant function ...) RepositoryItemComboBox ricmbAcronymType = cmbAcronymType.Edit as RepositoryItemComboBox; ricmbAcronymType.Items.Clear(); ricmbAcronymType.Items.Add(_allAcronymTypes); foreach (VarConfig.AcronymTypeRow acroTypeRow in _varConfigFacade.GetAllAcronyms()) { ricmbAcronymType.Items.Add(acroTypeRow.LongName.ToUpper()); } cmbAcronymType.EditValue = ricmbAcronymType.Items[0].ToString(); //add data-dependant filter-checkboxes (show benefit variables, show demographic variables, ...) DrawFilterCheckboxes(); //_varConfigFacade contains a list of variables and acronyms created in the current session _varConfigFacade.ClearNewRowsList(); SetButtonGreyState(); } catch (Exception exception) { Tools.UserInfoHandler.ShowException(exception); } }
internal void UpdateListsAndFilters(bool updateVariables, bool updateAcronyms, bool updateFilterCheckboxes) { if (updateFilterCheckboxes) { DrawFilterCheckboxes(); } if (updateAcronyms) { _acronymManager.FillAcronymsList(); } if (updateVariables) { _variablesManager.FillVariablesList(); _variablesManager.SetFilter(); } SetButtonGreyState(); }