private void mn_delLanguage(object sender, EventArgs e) { if (this.TreeView != null) { if (MessageBox.Show(this.TreeView.FindForm(), "Do you want to remove this language?", "Language", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (string.IsNullOrEmpty(_name)) { _resman.RemoveLanguage(_culture.Name); } else { _resman.RemoveLanguage(_name); } TreeNodeResourceManager tm = null; if (this.Parent != null && this.Parent.Parent != null) { tm = this.Parent.Parent as TreeNodeResourceManager; } this.Remove(); if (tm != null) { tm.ResetResourcesCollectionNodes(); } } } }
public void LoadData(LimnorProject proj) { _resman = proj.GetProjectSingleData <ProjectResources>(); _curLanguageName = _resman.DesignerLanguageName; _rootTreeNode = new TreeNodeResourceManager(_resman, false); treeView1.Nodes.Add(_rootTreeNode); _rootTreeNode.Expand(); Text = Text + " - " + proj.ProjectName; }
private void mn_selLanguages(object sender, EventArgs e) { if (this.TreeView != null) { if (_resman.SelectLanguages(this.TreeView.FindForm())) { TreeNodeResourceManager tm = null; for (int i = 0; i < this.TreeView.Nodes.Count; i++) { tm = this.TreeView.Nodes[i] as TreeNodeResourceManager; if (tm != null) { break; } } LoadLanguages(); if (tm != null) { tm.ResetResourcesCollectionNodes(); } } } }