public MenuItem[] GetContextMenuItems(bool bReadOnly) { MenuItem[] mns = new MenuItem[2]; if (string.IsNullOrEmpty(_name)) { mns[0] = new MenuItemWithBitmap("Set UI language", mn_setLanguage, TreeViewObjectExplorer.GetLangaugeBitmapByName(_culture.Name)); } else { mns[0] = new MenuItemWithBitmap("Set UI language", mn_setLanguage, TreeViewObjectExplorer.GetLangaugeBitmapByName(_name)); } mns[1] = new MenuItemWithBitmap("Remove", mn_delLanguage, Resources._cancel.ToBitmap()); return(mns); }
public void OnLanguageChanged() { if (string.IsNullOrEmpty(_resman.DesignerLanguageName)) { this.Hide(); } else { this.Show(); } picLang.Image = TreeViewObjectExplorer.GetLangaugeBitmapByName(_resman.DesignerLanguageName); lblLang.Text = _resman.DesingerCultureDisplay; this.Width = lblLang.Left + lblLang.Width + 3; this.Refresh(); }
public void CreateContextmenu() { ContextMenu mnu = new ContextMenu(); mnu.MenuItems.Add(new MenuItemWithBitmap("Edit resources", mnu_editresources, Resources.resx.ToBitmap())); // if (_resman.Languages.Count > 0) { mnu.MenuItems.Add(new MenuItem("-")); MenuItemWithBitmap m = new MenuItemWithBitmap("default culture", mnu_changeCulture, TreeViewObjectExplorer.GetLangaugeBitmapByName(string.Empty)); m.Tag = ""; mnu.MenuItems.Add(m); foreach (string s in _resman.Languages) { if (string.CompareOrdinal(s, "zh") == 0) { m = new MenuItemWithBitmap("中文 zh", mnu_changeCulture, TreeViewObjectExplorer.GetLangaugeBitmapByName(s)); m.Tag = s; mnu.MenuItems.Add(m); } else { CultureInfo c = CultureInfo.GetCultureInfo(s); if (c != null) { m = new MenuItemWithBitmap(ProjectResources.CultureDisplay(c), mnu_changeCulture, TreeViewObjectExplorer.GetLangaugeBitmapByName(s)); m.Tag = s; mnu.MenuItems.Add(m); } } } } // this.ContextMenu = mnu; lblLang.ContextMenu = mnu; picLang.ContextMenu = mnu; }
public languageItem(string name) { _name = name; _img = TreeViewObjectExplorer.GetLangaugeBitmapByName(_name); }