/// <summary> /// Provides the dictionary on which operation should be performed /// </summary> /// <returns></returns> public Dictionary GetPatchDictionary() { Dictionary retVal = null; MainWindow mainWindow = GuiUtils.MdiWindow; EfsSystem efsSystem = mainWindow.EfsSystem; if (efsSystem != null) { ModelElement modelElement = Item as ModelElement; if (modelElement != null) { int updates = 0; foreach (Dictionary dict in efsSystem.Dictionaries) { if (modelElement.Dictionary.IsUpdatedBy(dict)) { // Set retVal to the update in case it is the only one for the base dictionary retVal = dict; updates++; } } if (updates == 0) { MessageBox.Show("No updates loaded for the current dictionary."); } if (updates > 1) { // if there are 0 or 1 possible updates, it will already have the correct value // if there are more, choose the update from a list of possibilities DictionarySelector.DictionarySelector dictionarySelector = new DictionarySelector.DictionarySelector(FilterOptions.Updates, modelElement.Dictionary); dictionarySelector.ShowDictionaries(mainWindow); if (dictionarySelector.Selected != null) { retVal = dictionarySelector.Selected; } } } } return(retVal); }
/// <summary> /// Provides the dictionary on which operation should be performed /// </summary> /// <returns></returns> public DataDictionary.Dictionary GetActiveDictionary() { DataDictionary.Dictionary retVal = null; if (EFSSystem != null) { if (EFSSystem.Dictionaries.Count == 1) { retVal = EFSSystem.Dictionaries[0]; } else { DictionarySelector.DictionarySelector dictionarySelector = new DictionarySelector.DictionarySelector(EFSSystem); dictionarySelector.ShowDialog(this); if (dictionarySelector.Selected != null) { retVal = dictionarySelector.Selected; } } } return(retVal); }