public void Execute() { string path; var selectedItem = this.treeViewModel.SelectedItem; if (selectedItem == null) { path = this.workspaceDirectoryModel.CurrentWorkspaceDirectory; } else { path = selectedItem.Path; } if (String.IsNullOrEmpty(path) || (!File.Exists(path) && !Directory.Exists(path))) { return; } var uri = new Uri(path); ShellItem shellItem = new ShellItem(uri); ShellContextMenu menu = new ShellContextMenu(shellItem); try { menu.ShowContextMenu(System.Windows.Forms.Control.MousePosition); } catch (Exception ex) { Logger.Error(ex, "Failed to show Windows Explorer Context Menu"); } }
void fileMenu_Popup(object sender, EventArgs e) { ShellItem[] selectedItems = shellView.SelectedItems; if (selectedItems.Length > 0) { m_ContextMenu = new ShellContextMenu(selectedItems); } else { m_ContextMenu = new ShellContextMenu(treeView.SelectedFolder); } m_ContextMenu.Populate(fileMenu); }
public MessageWindow(ShellContextMenu parent) { m_Parent = parent; }
/// <summary> /// Pastes the contents of the clipboard into the current folder. /// </summary> public void PasteClipboard() { ShellContextMenu contextMenu = new ShellContextMenu(m_CurrentFolder); contextMenu.InvokePaste(); }
/// <summary> /// Deletes the currently selected items. /// </summary> public void DeleteSelectedItems() { ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems); contextMenu.InvokeDelete(); }
/// <summary> /// Cuts the currently selected items. /// </summary> public void CutSelectedItems() { ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems); contextMenu.InvokeCut();; }
/// <summary> /// Copies the currently selected items to the clipboard. /// </summary> public void CopySelectedItems() { ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems); contextMenu.InvokeCopy(); }
/// <summary> /// Pastes the contents of the clipboard into the current folder. /// </summary> public void PasteClipboard() { var contextMenu = new ShellContextMenu(ShellItem); contextMenu.InvokePaste(); }
/// <summary> /// Cuts the currently selected items. /// </summary> public void CutSelectedItems() { ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems); contextMenu.InvokeCut(); ; }
private void Item_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { FileItem item = (FileItem)sender; ShellItem myFile = new ShellItem(new Uri(item.Filepath)); ShellContextMenu ctxmenu = new ShellContextMenu(myFile); ctxmenu.ShowContextMenu(null, Helpers.GetMousePosition()); }