void CalcRowFooterInfo(TreeListNode node, CalcRowGroupInfoArgs rowArgs) { FieldInfo fi = node.GetType().GetField("owner", BindingFlags.Instance | BindingFlags.NonPublic); TreeListNodes owner = fi.GetValue(node) as TreeListNodes; PropertyInfo pr = owner.GetType().GetProperty("LastNodeEx", BindingFlags.Instance | BindingFlags.NonPublic); TreeListNode lastNode = pr.GetValue(owner, null) as TreeListNode; if (node == lastNode) { if (!(TreeListFilterHelper.HasVisibleChildren(node) && node.Expanded)) { bool even = IsEven(rowArgs.Index); CalcRowFooterInfo(RowsInfo.Rows.Count - 1, node, rowArgs, even); TreeListNode parent = node.ParentNode; if (parent != null) { owner = fi.GetValue(parent) as TreeListNodes; lastNode = pr.GetValue(owner, null) as TreeListNode; } while (parent != null && parent == lastNode) { even = !even; CalcRowFooterInfo(RowsInfo.Rows.Count - 1, parent, rowArgs, even); node = parent; parent = parent.ParentNode; if (parent != null) { owner = fi.GetValue(parent) as TreeListNodes; lastNode = pr.GetValue(owner, null) as TreeListNode; } } } } }
private void TransferList_MouseClick(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Right) { return; } TreeListNode node = TransferList.GetNodeAt(e.Location) as TreeListNode; if (node == null || node.GetType() != typeof(TransferNode)) { return; } ContextMenuStripEx menu = new ContextMenuStripEx(); TransferNode transfer = node as TransferNode; menu.Items.Add(new ToolStripMenuItem("Copy Hash to Clipboaard", null, (s, o) => { Clipboard.SetText(Utilities.ToBase64String(transfer.Transfer.Details.Hash)); })); menu.Show(TransferList, e.Location); }
void RecurseFocus(TreeListNode parent) { // add parent to focus list if (parent.GetType() == typeof(LinkNode)) { Core.KeepData.SafeAdd(((LinkNode)parent).Link.UserID, true); } // iterate through sub items foreach (TreeListNode subitem in parent.Nodes) { if (parent.GetType() == typeof(LinkNode)) { RecurseFocus(subitem); } } }
LinkNode GetSelected() { if (SelectedNodes.Count == 0) { return(null); } TreeListNode node = SelectedNodes[0]; if (node.GetType() != typeof(LinkNode)) { return(null); } return((LinkNode)node); }
private FolderNode LoadWorking(TreeListNode parent, LocalFolder folder) { FolderNode node = new FolderNode(this, folder.Info, parent, false); node.Archived = folder.Archived; node.Integrated = folder.Integrated; if (SelectedFolder != null && node.Details.UID == SelectedFolder.Details.UID) { node.Selected = true; SelectedFolder = node; } if (!folder.Info.IsFlagged(StorageFlags.Archived) || GhostsButton.Checked) GuiUtils.InsertSubNode(parent, node); if (parent.GetType() == typeof(FolderNode)) { FolderNode parentNode = (FolderNode)parent; parentNode.Folders[folder.Info.UID] = node; } if (node.Details.IsFlagged(StorageFlags.Modified)) node.EnsureVisible(); folder.Folders.LockReading(delegate() { foreach (LocalFolder sub in folder.Folders.Values) LoadWorking(node, sub); }); folder.Files.LockReading(delegate() { foreach (LocalFile file in folder.Files.Values) { FileItem item = new FileItem(this, node, file.Info, false); item.Archived = file.Archived; item.Integrated = file.Integrated; node.Files[file.Info.UID] = item; } }); return node; }
void RecurseFocus(TreeListNode parent) { // add parent to focus list if (parent.GetType() == typeof(LinkNode)) Core.KeepData.SafeAdd(((LinkNode)parent).Link.UserID, true); // iterate through sub items foreach (TreeListNode subitem in parent.Nodes) if (parent.GetType() == typeof(LinkNode)) RecurseFocus(subitem); }