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); } }
public bool StartUndoManager() // this needs to be called after the first (by program) filling of the grid, i.e. undo starts after initialising the grid { lastError = string.Empty; try { if (gridDataTable.PrimaryKey.Count() == 0) { throw new Exception("DataTable does not have a PrimaryKey."); } gridDataSet.AcceptChanges(); // accept (by program) changes of initialising the grid undoManager = new ADOUndoManager(); undoManager.AddDataSet(gridDataSet); return(true); } catch (Exception exception) { undoManager = null; lastError = "Enabling undo-functionality failed." + Environment.NewLine + exception.Message; return(false); } }
internal VariablesUndoAction(ADOUndoManager undoManager) { _undoManager = undoManager; }
internal void RegisterWithUndoManager(ADOUndoManager undoMananger) { undoMananger.AddDataSet(_dataConfig); }
public UndoAction(ADOUndoManager undoManager) { _undoManager = undoManager; }