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

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

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

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

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