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();
        }
Пример #8
0
 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());
     
     
 }