private void PasteFiles()
        {
            string path = null;

            if (fKeyTargetIsThis)
            {
                path = Path;
            }
            else
            {
                foreach (QMenuItem item in from ToolStripItem item in DisplayedItems
                         where item.Selected select item as QMenuItem)
                {
                    if (item != null)
                    {
                        if (item is SubDirTipForm.ToolStripMenuItemEx)
                        {
                            bool flag2;
                            if (PathIsExecutable(item.Path, out flag2) && !flag2)
                            {
                                StringCollection fileDropList = Clipboard.GetFileDropList();
                                if ((fileDropList != null) && (fileDropList.Count > 0))
                                {
                                    string            str2 = "\"" + fileDropList.StringJoin("\" \"") + "\"";
                                    MenuItemArguments mia  = new MenuItemArguments(item.Path, MenuTarget.File, MenuGenre.Application);
                                    mia.Argument = str2;
                                    AppLauncher.Execute(mia, fIsRootMenu ? Handle : IntPtr.Zero);
                                }
                                return;
                            }
                        }
                        else if (Directory.Exists(item.TargetPath))
                        {
                            path = item.TargetPath;
                        }
                    }
                    break;
                }
            }
            if (!string.IsNullOrEmpty(path))
            {
                ShellMethods.PasteFile(path, hwndDialogParent);
                if (QTUtility.IsXP)
                {
                    DropDownMenuDropTarget root = GetRoot(this);
                    if (root != null)
                    {
                        root.Close(ToolStripDropDownCloseReason.ItemClicked);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private static void virtualDirectory_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            QMenuItem clickedItem = e.ClickedItem as QMenuItem;

            if ((clickedItem != null) && (clickedItem.Target == MenuTarget.File))
            {
                if (!clickedItem.MenuItemArguments.TokenReplaced)
                {
                    AppLauncher.ReplaceAllTokens(clickedItem.MenuItemArguments, string.Empty);
                }
                AppLauncher.Execute(clickedItem.MenuItemArguments, IntPtr.Zero);
            }
        }
        private void PasteFiles()
        {
            string path = null;

            if (this.fKeyTargetIsThis)
            {
                path = base.Path;
            }
            else
            {
                foreach (ToolStripItem item in this.DisplayedItems)
                {
                    if (!item.Selected)
                    {
                        continue;
                    }
                    QMenuItem item2 = item as QMenuItem;
                    if (item2 != null)
                    {
                        if (item2 is SubDirTipForm.ToolStripMenuItemEx)
                        {
                            bool flag2;
                            if (PathIsExecutable(item2.Path, out flag2) && !flag2)
                            {
                                StringCollection fileDropList = Clipboard.GetFileDropList();
                                if ((fileDropList != null) && (fileDropList.Count > 0))
                                {
                                    string str2 = string.Empty;
                                    foreach (string str3 in fileDropList)
                                    {
                                        str2 = str2 + "\"" + str3 + "\" ";
                                    }
                                    str2 = str2.Trim();
                                    if (str2.Length > 0)
                                    {
                                        MenuItemArguments mia = new MenuItemArguments(item2.Path, MenuTarget.File, MenuGenre.Application);
                                        mia.Argument = str2;
                                        AppLauncher.Execute(mia, this.fIsRootMenu ? base.Handle : IntPtr.Zero);
                                    }
                                }
                                return;
                            }
                        }
                        else if (Directory.Exists(item2.TargetPath))
                        {
                            path = item2.TargetPath;
                        }
                    }
                    break;
                }
            }
            if (!string.IsNullOrEmpty(path))
            {
                ShellMethods.PasteFile(path, this.hwndDialogParent);
                if (!QTUtility.IsVista)
                {
                    DropDownMenuDropTarget root = GetRoot(this);
                    if (root != null)
                    {
                        root.Close(ToolStripDropDownCloseReason.ItemClicked);
                    }
                }
            }
        }