private void cmdProperties(object sender, EventArgs e) { // Get the current language object LocLanguage language = LocDB.DB.FindLanguageByName(m_comboLanguage.Text); if (null == language) { return; } DlgNewLanguage dlg = new DlgNewLanguage(); dlg.SetAsPropertiesMode(language.ID, language.Name); if (DialogResult.Cancel == dlg.ShowDialog(this)) { return; } language.FontName = dlg.FontName; language.FontSize = dlg.FontSize; PopulateLanguageCombo(); LanguageCombo.Text = dlg.LanguageName; m_labelYourLanguage.Text = dlg.LanguageName; SetFont(); }
// Scaffolding ----------------------------------------------------------------------- #region Constructor(LocDB) public Localizer(LocDB _DB) { m_DB = _DB; InitializeComponent(); LocLanguage language = _DB.PrimaryLanguage; if (null != language) { m_iLanguage = language.Index; } else if (_DB.Languages.Length > 0) { m_iLanguage = 0; } }
private void cmdClosing(object sender, FormClosingEventArgs e) { // Allow the person to cancel if that is what they wish (That is, don't // do error checking which would make it impossible to cancel the dialog!) if (DialogResult.Cancel == DialogResult) return; // We must have an abbreviation if (string.IsNullOrEmpty(Abbreviation)) { AbbrevError = "Please supply an abbreviation"; e.Cancel = true; return; } // The abbreviation cannot conflict with anything else in the LocDb LocLanguage language = LocDB.DB.FindLanguage(Abbreviation); if (!m_bPropertiesMode && null != language) { AbbrevError = "This abbreviation is already taken; please choose another."; e.Cancel = true; return; } // We must have a language name if (string.IsNullOrEmpty(LanguageName)) { NameError = "Please supply a language name"; e.Cancel = true; return; } // The name cannot conflict with anything else in the LocDb language = LocDB.DB.FindLanguageByName(LanguageName); if (!m_bPropertiesMode && null != language) { NameError = "This name is already taken; please choose another."; e.Cancel = true; return; } e.Cancel = false; }
private void cmdNewLanguage(object sender, EventArgs e) { DlgNewLanguage dlg = new DlgNewLanguage(); if (DialogResult.Cancel == dlg.ShowDialog(this)) { return; } // Create the new LocLanguage object LocLanguage language = LocDB.DB.AppendLanguage(dlg.Abbreviation, dlg.LanguageName); language.FontName = dlg.FontName; language.FontSize = dlg.FontSize; // Add the language to our combo box PopulateLanguageCombo(); // Force an update of the interface to the new language FilterCombo.Text = c_ShowAll; LanguageCombo.Text = dlg.LanguageName; m_labelYourLanguage.Text = dlg.LanguageName; SetFont(); }
public bool SetLanguage(LocLanguage l) { language = l; return(true); }
public bool SetLanguage(LocLanguage l) { language = l; return true; }
private static void SetLocalizationSuccessHandler(int index, LocKeys locKeys, LocLanguage language) { _strings = CreateDictionary(locKeys.Strings, language.Strings); _loadedLoc = index; LastLoc = index; IsInitialized = true; if (OnLocChanged != null) { OnLocChanged(); } }