public LookupFormFileIsInUse(LookupForm form, string path) : base(path) { this.form = form; CanClose = true; WindowHandle = form.Handle; }
private void OpenDictionaries(IList <DictionaryInfo> dicts) { foreach (var di in dicts) { LookupForm.OpenDictionary(di); } }
protected override void OnCreateMainForm() { switch (GuiConfiguration.StartupAction) { case "Practice": MainForm = new Forms.PracticeWindow(DataStore.Database.GetSuggestedPracticeItems(GuiConfiguration.PracticeDefaultCount), PracticeMode.Learn); break; case "Dictionary": string dict = GuiConfiguration.StartupDictionary; if (string.IsNullOrEmpty(dict)) { break; } Exception error = null; try { DictionaryInfo info = new SimpleDictionary.Info(dict); MainForm = new Forms.LookupForm(info); } catch (System.IO.IOException e) { // TODO: Access/permission exceptions? error = e; } catch (DictionaryLoadException e) { error = e; // Maybe there should be some UI for this (it's there, but not loadable?)... } if (error != null) { ProgramLog.Default.AddMessage(LogType.Error, "Could not load dictionary {0}: {1}", dict, error.Message); } break; } if (MainForm == null) { MainForm = new Forms.StartPage(); } }
protected override void OnCreateMainForm() { switch (GuiConfiguration.StartupAction) { case "Practice": MainForm = new Forms.PracticeWindow(DataStore.Database.GetSuggestedPracticeItems(GuiConfiguration.PracticeDefaultCount), PracticeMode.Learn); break; case "Dictionary": string dict = GuiConfiguration.StartupDictionary; if (string.IsNullOrEmpty(dict)) break; Exception error = null; try { DictionaryInfo info = new SimpleDictionary.Info(dict); MainForm = new Forms.LookupForm(info); } catch (System.IO.IOException e) { // TODO: Access/permission exceptions? error = e; } catch (DictionaryLoadException e) { error = e; // Maybe there should be some UI for this (it's there, but not loadable?)... } if (error != null) ProgramLog.Default.AddMessage(LogType.Error, "Could not load dictionary {0}: {1}", dict, error.Message); break; } if (MainForm == null) MainForm = new Forms.StartPage(); }