/// <summary> /// Called on mouse up event /// </summary> /// <param name="e">Event args</param> protected virtual void OnMouseUp(MouseEventArgs e) // for tree control on the left pane { if (e.Button == MouseButtons.Right) { List <object> commands = ApplicationUtil.GetPopupCommandTags(m_lastHit, m_contextMenuCommandProviders); Point screenPoint = m_treeControl.PointToScreen(new Point(e.X, e.Y)); m_commandService.RunContextMenu(commands, screenPoint); } }
private void thumbnailControl_MouseUp(object sender, MouseEventArgs e) { IResource asset = null; if (e.Button == MouseButtons.Right) { Point screenPoint; Point clientPoint = new Point(e.X, e.Y); if (m_thumbnailControl.Visible) { asset = SelectedAsset(m_thumbnailControl, clientPoint); screenPoint = m_thumbnailControl.PointToScreen(clientPoint); } else { asset = SelectedAsset(m_listView, clientPoint); screenPoint = m_listView.PointToScreen(clientPoint); } if (asset != null) { IResource assetObj = asset as IResource; if (assetObj != null) { List <object> commands = ApplicationUtil.GetPopupCommandTags(assetObj, m_contextMenuCommandProviders); commands.Add(Command.ReloadAsset); commands.Add(Command.UnloadAssets); commands.Add(Command.DetailsView); commands.Add(Command.ThumbnailView); commands.Add(Command.AddExistingAsset); m_commandService.RunContextMenu(commands, screenPoint); } } else { List <object> commands = new List <object>(); commands.Add(Command.ReloadAsset); commands.Add(Command.UnloadAssets); commands.Add(Command.DetailsView); commands.Add(Command.ThumbnailView); commands.Add(Command.AddExistingAsset); m_commandService.RunContextMenu(commands, screenPoint); } } m_dragging = false; }