Exemplo n.º 1
0
 public static CultureInfo ShowLanguageSelectDialog(Form owner)
 {
     using (var window = new LanguageSelectDialog())
     {
         window.Icon          = owner.Icon;
         window.StartPosition = FormStartPosition.CenterParent;
         return(window.ShowDialog(owner) == DialogResult.OK ? window._selectedLanguage : null);
     }
 }
Exemplo n.º 2
0
        private void addLanguageToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            var tag = e.ClickedItem.Tag as CultureInfo;

            if (tag != null)
            {
                CurrentResource.AddLanguage(tag.Name, Settings.Default.AddDefaultValuesOnLanguageAdd);

                UpdateMenuStrip();
                resourceGrid1.RefreshResourceDisplay();
            }
            else if (e.ClickedItem.Text.Equals(MoreLanguagesMenuitemName, StringComparison.InvariantCulture))
            {
                var language = LanguageSelectDialog.ShowLanguageSelectDialog(this);
                if (language != null && !CurrentResource.Languages.ContainsKey(language.Name))
                {
                    CurrentResource.AddLanguage(language.Name, Settings.Default.AddDefaultValuesOnLanguageAdd);

                    UpdateMenuStrip();
                    resourceGrid1.RefreshResourceDisplay();
                }
            }
        }