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");
            }
        }
Beispiel #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);
        }
Beispiel #3
0
 public MessageWindow(ShellContextMenu parent)
 {
     m_Parent = parent;
 }
Beispiel #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();
        }
Beispiel #5
0
        /// <summary>
        /// Deletes the currently selected items.
        /// </summary>
        public void DeleteSelectedItems()
        {
            ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems);

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

            contextMenu.InvokeCut();;
        }
Beispiel #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;
 }
Beispiel #9
0
        /// <summary>
        ///     Pastes the contents of the clipboard into the current folder.
        /// </summary>
        public void PasteClipboard()
        {
            var contextMenu = new ShellContextMenu(ShellItem);

            contextMenu.InvokePaste();
        }
Beispiel #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();
 }
Beispiel #11
0
 /// <summary>
 /// Deletes the currently selected items.
 /// </summary>
 public void DeleteSelectedItems()
 {
     ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems);
     contextMenu.InvokeDelete();
 }
Beispiel #12
0
 /// <summary>
 /// Cuts the currently selected items.
 /// </summary>
 public void CutSelectedItems()
 {
     ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems);
     contextMenu.InvokeCut(); ;
 }
Beispiel #13
0
 /// <summary>
 /// Copies the currently selected items to the clipboard.
 /// </summary>
 public void CopySelectedItems()
 {
     ShellContextMenu contextMenu = new ShellContextMenu(SelectedItems);
     contextMenu.InvokeCopy();
 }
Beispiel #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());
     
     
 }