public void OnLoadNextLevel(NodeLoader loader) { _nextLevelLoaded = true; WixCultureCollection cultures = this.Cultures; if (cultures != null && cultures.CultureList.Count > 0) { ImageList imgs = null; if (this.TreeView != null) { imgs = this.TreeView.ImageList; } foreach (WixCultureNode s in cultures.CultureList) { int idx = -1; if (imgs != null) { Image img = VPLUtil.GetLanguageImageByName(s.CultureNode.Culture); if (img != null) { idx = imgs.Images.Add(img, Color.White); } } TreeNodeWixCulture sn = new TreeNodeWixCulture(s, idx); Nodes.Add(sn); } } }
public TreeNodeWixCultureList(WixCultureCollection cultures) : base(cultures) { ImageIndex = TreeViewWix.IMG_LANGS; SelectedImageIndex = ImageIndex; Nodes.Add(new CLoader()); }
private void mnu_addCulture(object sender, EventArgs e) { TreeViewWix tv = this.TreeView as TreeViewWix; if (tv != null) { WixCultureCollection cc = this.Cultures; StringCollection ss = new StringCollection(); foreach (WixCultureNode cn in cc.CultureList) { ss.Add(cn.CultureNode.Culture); } DlgLanguages dlg = new DlgLanguages(); dlg.SetUseSpecificCulture(); dlg.LoadData(ss); Form f = null; if (this.TreeView != null) { f = this.TreeView.FindForm(); } if (dlg.ShowDialog(f) == DialogResult.OK) { ss = dlg.SelectedLanguages; if (ss.Count > 0) { this.Expand(); bool added = false; ImageList imgs = null; if (this.TreeView != null) { imgs = this.TreeView.ImageList; } foreach (string s in ss) { if (!cc.CultureExists(s)) { int idx = -1; if (imgs != null) { Image img = VPLUtil.GetLanguageImageByName(s); if (img != null) { idx = imgs.Images.Add(img, Color.White); } } XmlNode xn = tv.createCultureXmlNode(s, false); WixCultureNode wcn = new WixCultureNode(xn); cc.CultureList.Add(wcn); TreeNodeWixCulture twc = new TreeNodeWixCulture(wcn, idx); this.Nodes.Add(twc); added = true; } } if (added) { tv.OnPropertyValueChanged(); } } } } }