void AccessTreeView(TreeViewObject parent, CustomTreeView treeView, object owner, string name, string imageKey) { Owner = owner; if (parent != null) { parent.Childs.Add(this); this.Parent = parent; } Id = DateTime.Now.Millisecond; TreeNodeCollection nodes = null; if (parent == null) { nodes = treeView.Nodes; } else { Parent = parent; nodes = parent.Node.Nodes; } nodes.Add(Id.ToString(), name); nodes[Id.ToString()].ImageKey = imageKey; nodes[Id.ToString()].SelectedImageKey = imageKey; Node = nodes[Id.ToString()]; Node.Tag = this; this.Name = name; this.ImageKey = imageKey; }
public TreeViewObject(TreeViewObject parent, CustomTreeView treeView, object owner, string name, string imageKey) { AccessTreeView(parent, treeView, owner, name, imageKey); //if (treeView.Created) //{ // AccessTreeViewDelegate d = new AccessTreeViewDelegate(AccessTreeView); // treeView.BeginInvoke(d, parent, treeView, owner, name, imageKey); //} //else //{ //} //d.Invoke(parent, treeView, owner, name, imageKey); }
public void OnDoubleClick(TreeViewObject obj, CustomTreeView treeView) { throw new NotImplementedException(); }
public void OnFocus(TreeViewObject obj, CustomTreeView treeView) { }
public void OnProperty(TreeViewObject obj, CustomTreeView treeView) { // MessageBox.Show(obj.Name); }
public void OnDelete(TreeViewObject obj, CustomTreeView treeView) { }
public void OnSelectTreeViewObject(TreeViewObject obj, CustomTreeView treeView) { //MessageBox.Show(obj.Name); }