private void EditLang() { LanguageTreeNode lngNode = this._treeView.SelectedNode as LanguageTreeNode; if (lngNode == null) { return; } AppTreeNode appNode = lngNode.Parent as AppTreeNode; if (appNode == null) { return; } LanguageEditorDocument editor = Global.DockManager.ShowLanguageEditorDocument(appNode.AppItem); editor.SetLanguageInfo(lngNode.LanguageInfo); }
private void _contextMenuStrip_Opening(object sender, CancelEventArgs e) { AppTreeNode appNode = this._treeView.SelectedNode as AppTreeNode; LanguageTreeNode lngNode = this._treeView.SelectedNode as LanguageTreeNode; if (appNode != null) { _mniAddLanguage.Visible = true; _mniEditLanguage.Visible = false; } else if (lngNode != null) { _mniAddLanguage.Visible = false; _mniEditLanguage.Visible = true; } else { e.Cancel = true; return; } }