public void ImportDict() { try { Atlas.Dict = new Dict(Atlas.GetDictPath(), Atlas); Atlas.Dict.OnDictLoadEnd += (bool success) => { if (success) { labelStatus.Text = Lang.Get("import_dict"); } else { labelStatus.Text = Lang.Get("import_dict_fail"); } buttonSetText.Enabled = true; SetTextWindow.SetInputMode(); }; labelStatus.Text = Lang.Get("import_dict_before"); Atlas.Dict.Import(); } catch (Exception ex) { Program.ErrorMessage(ex, "Error on end init"); return; } }
void SetText() { GetValues(); SetTextWindow.SetTitle(); DialogResult result = SetTextWindow.ShowDialog(this); if (SetTextWindow.Cancel) { return; } try { if (SetTextWindow.InputMode == InputMode.LyricInput) { Ust.SetLyric(SetTextWindow.Words); } else { Ust.SetLyric(SetTextWindow.Syllables); } Settings.IsParsed = true; CheckAccess(); } catch (Exception ex) { Program.ErrorMessage(ex); return; } SetLyric(); }
public void Init(Ust ust, Atlas atlas) { Atlas = atlas; Ust = ust; Parser = new Parser(Atlas, Ust); Settings.MinLengthDefault = 110 * (int)Ust.Tempo / 120; Settings.MinLength = Settings.MinLengthDefault; textBoxMinLength.Text = Settings.MinLength.ToString(); ImportDict(); comboBoxLanguage.Items.Clear(); comboBoxLanguage.Items.AddRange(Lang.Languages); comboBoxLanguage.SelectedItem = Lang.Current; SetLyric(); buttonSetText.Enabled = false; SetTextWindow = new SetTextWindow(Atlas, Ust); if (Singer.Current.IsLoaded) { checkBoxLengthByOto.Checked = true; } }