internal void SetupMouseDown(ContentsTreeControl control, MouseEventArgs e) { ContentsTreeControl = control; CurrentContentsTreeMouseDownEvent = e; // save event info for later use MetaTreeNode mtn = control.GetMetaTreeNodeAt(e.Location, out CurrentContentsTreeListNode); if (mtn == null || mtn.Target == null) { return; } CurrentContentsMetaTreeNode = mtn; if (e.Button != MouseButtons.Right) { return; // all done if other than right button } if (mtn.Owner != SS.I.UserName) { return; // not allowed to do anything with another user's folder } if (mtn.Type == MetaTreeNodeType.Project || mtn.Type == MetaTreeNodeType.SystemFolder || mtn.Type == MetaTreeNodeType.UserFolder) // can only create a user folder under these { CreateUserFolderMenuItem.Visible = true; } else { CreateUserFolderMenuItem.Visible = false; } TreePopupMenu.Show(control, new System.Drawing.Point(e.X, e.Y)); return; }
private void treeList1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) { Point p2 = Control.MousePosition; TreePopupMenu.ShowPopup(p2); }