private void ExportToFieldWorksInterlinearDlg_Load(object sender, EventArgs e) { var wsList = GetAvailableWritingSystems() .Select(ws => new DisplayFriendlyWritingSystem { Id = ws.Id, Name = ws.Language.Name }).ToArray(); if (wsList.Length == 0) { var msg = LocalizationManager.GetString("DialogBoxes.Transcription.ExportToFieldWorksInterlinearDlg.CannotFindFLExWritingSystemsMsg2", "SayMore was unable to find any Writing Systems on this computer. Make sure FLEx version 7.1 or greater is " + "installed and has been run at least once. For now, you can export as English, and fix that up after you " + "have imported into FLEx."); ErrorReport.NotifyUserOfProblem(msg); wsList = new DisplayFriendlyWritingSystem[1]; wsList[0] = new DisplayFriendlyWritingSystem { Id = "en", Name = "English" }; } _comboTranscriptionWs.Items.AddRange(wsList); _comboTranslationWs.Items.AddRange(wsList); IntializeWritingSystemCombo(_comboTranscriptionWs, Settings.Default.TranscriptionWsForFWInterlinearExport); IntializeWritingSystemCombo(_comboTranslationWs, string.IsNullOrEmpty(Settings.Default.FreeTranslationWsForFWInterlinearExport) ? "en" : Settings.Default.FreeTranslationWsForFWInterlinearExport); HandleWritingSystemChanged(null, null); }
/// ------------------------------------------------------------------------------------ private void HandleWritingSystemChanged(object sender, EventArgs e) { if (_comboTranscriptionWs.SelectedItem == null || _comboTranslationWs.SelectedItem == null) { UpdateDisplay(); return; } TranscriptionWs = _comboTranscriptionWs.SelectedItem as DisplayFriendlyWritingSystem; FreeTranslationWs = _comboTranslationWs.SelectedItem as DisplayFriendlyWritingSystem; if (TranscriptionWs != null) { Settings.Default.TranscriptionWsForFWInterlinearExport = TranscriptionWs.Id; } if (FreeTranslationWs != null) { Settings.Default.FreeTranslationWsForFWInterlinearExport = FreeTranslationWs.Id; } UpdateDisplay(); }