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");
            }
        }
示例#2
0
        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);
        }
示例#3
0
 public MessageWindow(ShellContextMenu parent)
 {
     m_Parent = parent;
 }
示例#4
0
        /// <summary>
        /// Pastes the contents of the clipboard into the current folder.
        /// </summary>
        public void PasteClipboard()
        {
            ShellContextMenu contextMenu = new ShellContextMenu(m_CurrentFolder);

            contextMenu.InvokePaste();
        }
示例#5
0
        /// <summary>
        /// Deletes the currently selected items.
        /// </summary>
        public void DeleteSelectedItems()
        {
            ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems);

            contextMenu.InvokeDelete();
        }
示例#6
0
        /// <summary>
        /// Cuts the currently selected items.
        /// </summary>
        public void CutSelectedItems()
        {
            ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems);

            contextMenu.InvokeCut();;
        }
示例#7
0
        /// <summary>
        /// Copies the currently selected items to the clipboard.
        /// </summary>
        public void CopySelectedItems()
        {
            ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems);

            contextMenu.InvokeCopy();
        }
 public MessageWindow(ShellContextMenu parent)
 {
     m_Parent = parent;
 }
示例#9
0
        /// <summary>
        ///     Pastes the contents of the clipboard into the current folder.
        /// </summary>
        public void PasteClipboard()
        {
            var contextMenu = new ShellContextMenu(ShellItem);

            contextMenu.InvokePaste();
        }
示例#10
0
 /// <summary>
 /// Pastes the contents of the clipboard into the current folder.
 /// </summary>
 public void PasteClipboard()
 {
     ShellContextMenu contextMenu = new ShellContextMenu(m_CurrentFolder);
     contextMenu.InvokePaste();
 }
示例#11
0
 /// <summary>
 /// Deletes the currently selected items.
 /// </summary>
 public void DeleteSelectedItems()
 {
     ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems);
     contextMenu.InvokeDelete();
 }
示例#12
0
 /// <summary>
 /// Cuts the currently selected items.
 /// </summary>
 public void CutSelectedItems()
 {
     ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems);
     contextMenu.InvokeCut(); ;
 }
示例#13
0
 /// <summary>
 /// Copies the currently selected items to the clipboard.
 /// </summary>
 public void CopySelectedItems()
 {
     ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems);
     contextMenu.InvokeCopy();
 }
示例#14
0
 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());
     
     
 }