public void LoadResourceNodes <T>() where T : ResourcePointer { ProjectResources rm = this.ResourceManager; IList <T> rs = rm.GetResourceList <T>(); SortedList <string, TreeNode> s = new SortedList <string, TreeNode>(); foreach (T r in rs) { if (IsForSelection) { TreeNodeResourceCode tn = new TreeNodeResourceCode(r); s.Add(tn.Text, tn); } else { TreeNodeResource tn = r.CreateTreeNode(); s.Add(tn.Text, tn); } } IEnumerator <KeyValuePair <string, TreeNode> > en = s.GetEnumerator(); while (en.MoveNext()) { Nodes.Add(en.Current.Value); } }
private void onNodeSelection(object sender, EventArgs e) { bool bHandled = false; EventArgObjectSelected eos = e as EventArgObjectSelected; if (eos != null) { TreeNodeResource tr = eos.SelectedObject as TreeNodeResource; if (tr != null) { bHandled = true; tr.OnSelected(textBoxDefault, textBoxLocal, pictureBoxDefault, pictureBoxLocal, null); } else { TreeNodeLocalizeResource tnl = eos.SelectedObject as TreeNodeLocalizeResource; if (tnl != null) { bHandled = true; tnl.OnSelected(textBoxDefault, textBoxLocal, pictureBoxDefault, pictureBoxLocal, tnl.Culture); } } } if (!bHandled) { textBoxDefault.Visible = false; textBoxLocal.Visible = false; pictureBoxDefault.Visible = false; pictureBoxLocal.Visible = false; } }
public override void LoadNextLevel(TreeViewObjectExplorer tv, TreeNodeObject parentNode) { TreeNodeResource tc = (TreeNodeResource)parentNode; tc.OnLoadNextLevel(); }