コード例 #1
0
 void cmd_QueryOtherPanel(object sender, QueryPanelInfoEventArgs e)
 {
     //passive panel info
     e.FocusedIndex    = doublePanel1.PanelPassive.FocusedIndex;
     e.ItemCollection  = doublePanel1.PanelPassive.Source;
     e.SelectedIndices = doublePanel1.PanelPassive.SelectionIndices;
 }
コード例 #2
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e_current = new QueryPanelInfoEventArgs();
            QueryPanelInfoEventArgs e_other   = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e_current);
            OnQueryOtherPanel(e_other);
            DirectoryList dl_current = (DirectoryList)e_current.ItemCollection;
            DirectoryList dl_other   = null;

            if (e_other.ItemCollection is DirectoryList)
            {
                dl_other = (DirectoryList)e_other.ItemCollection;
            }

            //prepare dialog
            CreateDirectoryDialog dialog = new CreateDirectoryDialog();

            dialog.Text = "Create directory";
            dialog.labelParentDir.Text              = dl_current.DirectoryPath + Path.DirectorySeparatorChar;
            dialog.checkBoxUseTemplate.Checked      = false;
            dialog.textBoxTemplateDirectory.Enabled = false;
            if ((dl_other == null) || (e_other.FocusedIndex <= 0))
            {
                dialog.checkBoxUseTemplate.Checked      = false;
                dialog.textBoxTemplateDirectory.Enabled = false;
            }
            else
            {
                dialog.textBoxTemplateDirectory.Text = Path.Combine(dl_other.DirectoryPath, dl_other.GetItemDisplayNameLong(e_other.FocusedIndex));
            }

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            if (dialog.textBoxDirectoryName.Text == string.Empty)
            {
                Messages.ShowMessage("Directory exists.");
                return;
            }

            string new_directory_name = Path.Combine(dl_current.DirectoryPath, dialog.textBoxDirectoryName.Text);
            string template_dir       = string.Empty;

            if (dialog.checkBoxUseTemplate.Checked)
            {
                template_dir = dialog.textBoxTemplateDirectory.Text;
            }

            try
            {
                Wrapper.CreateDirectoryTree(new_directory_name, template_dir);
            }
            catch (Exception ex)
            {
                Messages.ShowException(ex, string.Format("Failed to create directory '{0}'.", new_directory_name));
            }
        }
コード例 #3
0
 protected void OnQueryOtherPanel(QueryPanelInfoEventArgs e)
 {
     if (QueryOtherPanel != null)
     {
         QueryOtherPanel(this, e);
     }
 }
コード例 #4
0
 private void OnQueryCurrentPanel(QueryPanelInfoEventArgs e)
 {
     if (QueryCurrentPanel != null)
     {
         QueryCurrentPanel(this, e);
     }
 }
コード例 #5
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);

            if (!(e.ItemCollection is DirectoryList))
            {
                return;
            }

            try
            {
                DirectoryList   dl   = (DirectoryList)e.ItemCollection;
                VolumeSpaceInfo info = WinAPiFSwrapper.GetVolumeSpaceInfo(dl.DirectoryPath);

                VolumeSpaceInfoDialog dialog = new VolumeSpaceInfoDialog();
                dialog.textBoxTotalSize.Text      = IOhelper.SizeToString(info.TotalNumberOfBytes);
                dialog.textBoxTotalAvailable.Text = IOhelper.SizeToString(info.FreeBytesAvailable);
                dialog.Text = dl.DirectoryPath;
                dialog.ShowDialog();
            }
            catch (Exception ex)
            {
                Messages.ShowException(ex);
            }
        }
コード例 #6
0
        private void create_fs_directory(QueryPanelInfoEventArgs e_current, QueryPanelInfoEventArgs e_other)
        {
            var           dl_current = (DirectoryList)e_current.ItemCollection;
            DirectoryList dl_other   = null;

            if (e_other.ItemCollection is DirectoryList)
            {
                dl_other = (DirectoryList)e_other.ItemCollection;
            }

            //prepare dialog
            var dialog = new CreateDirectoryDialog();

            dialog.Text = CommandMenu.Text;
            dialog.labelParentDir.Text              = dl_current.DirectoryPath + Path.DirectorySeparatorChar;
            dialog.checkBoxUseTemplate.Checked      = false;
            dialog.textBoxTemplateDirectory.Enabled = false;
            if ((dl_other == null) || (e_other.FocusedIndex <= 0))
            {
                dialog.checkBoxUseTemplate.Checked      = false;
                dialog.textBoxTemplateDirectory.Enabled = false;
            }
            else
            {
                dialog.textBoxTemplateDirectory.Text = Path.Combine(dl_other.DirectoryPath, dl_other.GetItemDisplayNameLong(e_other.FocusedIndex));
            }

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            if (dialog.textBoxDirectoryName.Text == string.Empty)
            {
                Messages.ShowMessage(Options.GetLiteral(Options.LANG_DIRECTORY_EXISTS));
                return;
            }

            var new_directory_name = Path.Combine(dl_current.DirectoryPath, dialog.textBoxDirectoryName.Text);
            var template_dir       = string.Empty;

            if (dialog.checkBoxUseTemplate.Checked)
            {
                template_dir = dialog.textBoxTemplateDirectory.Text;
            }

            try
            {
                WinAPiFSwrapper.CreateDirectoryTree(new_directory_name, template_dir);
            }
            catch (Exception ex)
            {
                Messages.ShowException
                    (ex,
                    string.Format
                        (Options.GetLiteral(Options.LANG_CANNOT_CREATE_DIRECTORY_0),
                        new_directory_name));
            }
        }
コード例 #7
0
        private void on_query_passive_panel(QueryPanelInfoEventArgs e)
        {
            if (QueryPassivePanel == null)
            {
                return;
            }

            QueryPassivePanel(this, e);
        }
コード例 #8
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);

            if (e.FocusedIndex < 0)
            {
                return;
            }

            DirectoryList dl_list = (DirectoryList)e.ItemCollection;

            if (dl_list.GetItemDisplayNameLong(e.FocusedIndex) == "..")
            {
                return;
            }

            //check volume caps
            string     root_path = Path.GetPathRoot(dl_list.DirectoryPath);
            VolumeInfo vi        = new VolumeInfo(root_path);

            if ((vi.FileSystemFlags & VolumeCaps.NamedStreams) != VolumeCaps.NamedStreams)
            {
                Messages.ShowMessage
                    (string.Format
                        ("File system on drive {0} not support named streams",
                        root_path));
                return;
            }

            StreamList new_source = new StreamList
                                        (Path.Combine(dl_list.DirectoryPath, dl_list.GetItemDisplayNameLong(e.FocusedIndex)),
                                        false,
                                        0,
                                        false);

            try
            {
                new_source.Refill();
            }
            catch (Exception ex)
            {
                Messages.ShowException(ex);
                return;
            }

            SetNewSourceEventArgs e_new_source = new SetNewSourceEventArgs
                                                     (new_source,
                                                     false,
                                                     string.Empty);

            OnSetNewSource(e_new_source);
        }
コード例 #9
0
        private void create_zip_directory(QueryPanelInfoEventArgs e_current)
        {
            var zd = (ZipDirectory)e_current.ItemCollection;

            //prepare dialog
            var dialog = new CreateDirectoryDialog();

            dialog.Text = CommandMenu.Text;
            dialog.labelParentDir.Text              = zd.CurrentZipDirectory + "/";
            dialog.checkBoxUseTemplate.Checked      = false;
            dialog.checkBoxUseTemplate.Enabled      = false;
            dialog.textBoxTemplateDirectory.Enabled = false;

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            if (dialog.textBoxDirectoryName.Text.Length == 0)
            {
                Messages.ShowMessage("directory name cannot be empty");
                return;
            }

            var new_directory_name = string.Empty;

            if (zd.CurrentZipDirectory == string.Empty)
            {
                new_directory_name = dialog.textBoxDirectoryName.Text;
            }
            else
            {
                new_directory_name = zd.CurrentZipDirectory + "/" + dialog.textBoxDirectoryName.Text;
            }
            if (!new_directory_name.EndsWith("/"))
            {
                new_directory_name = new_directory_name + "/";
            }

            try
            {
                var dir_entry = zd.ZipFile.EntryFactory.MakeDirectoryEntry(new_directory_name);
                dir_entry.Size           = 0;
                dir_entry.CompressedSize = 0; //required, else exception throws
                zd.ZipFile.BeginUpdate();
                zd.ZipFile.Add(dir_entry);
                zd.ZipFile.CommitUpdate();
                zd.Refill();
            }
            catch (Exception ex)
            {
                Messages.ShowException(ex);
            }
        }
コード例 #10
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e_current = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e_current);
            FtpDirectoryList ftp_list = (FtpDirectoryList)e_current.ItemCollection;

            string current_dir = ftp_list.DirectoryPath;

            //show dialog
            CreateDirectoryDialog dialog = new CreateDirectoryDialog();

            dialog.Text = Options.GetLiteral(Options.LANG_DIRECTORY_CREATE);
            dialog.labelParentDir.Text              = current_dir;
            dialog.checkBoxUseTemplate.Enabled      = false;
            dialog.textBoxTemplateDirectory.Enabled = false;

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            string new_dir = FtpPath.Combine(current_dir, dialog.textBoxDirectoryName.Text);

            //create dir tree
            if (ftp_list.MainWindow != null)
            {
                ftp_list.MainWindow.NotifyLongOperation
                    (string.Format
                        (Options.GetLiteral(Options.LANG_DIRECTORY_CREATE_0),
                        new_dir),
                    true);
            }

            try
            {
                ftp_list.Connection.CreateDirectoryTree(new_dir);
            }
            catch (Exception ex)
            {
                Messages.ShowException(ex);
            }

            if (ftp_list.MainWindow != null)
            {
                ftp_list.MainWindow.NotifyLongOperation
                    (string.Empty,
                    false);
            }

            ftp_list.Refill();
        }
コード例 #11
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);

            if (e.ItemCollection.MainWindow == null)
            {
                return;
            }

            e.ItemCollection.MainWindow.commandPrompt.AddCommandChunk
                (e.ItemCollection.GetCommandlineTextShort(e.FocusedIndex));
        }
コード例 #12
0
        protected override void internal_command_proc()
        {
            var e_current = new QueryPanelInfoEventArgs();
            var e_other   = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e_current);
            OnQueryOtherPanel(e_other);

            if (e_current.ItemCollection is DirectoryList)
            {
                create_fs_directory(e_current, e_other);
            }
            else if (e_current.ItemCollection is ZipDirectory)
            {
                create_zip_directory(e_current);
            }
        }
コード例 #13
0
        void one_plugin_QueryHostInfo(object sender, QueryHostInfoEventArgs e)
        {
            //query panels
            var e_active  = new QueryPanelInfoEventArgs();
            var e_passive = new QueryPanelInfoEventArgs();

            on_query_active_panel(e_active);
            on_query_passive_panel(e_passive);

            //create args
            var selected_files = new string[0];

            if ((e_active.SelectedIndices.Length == 0) && (e_active.FocusedIndex >= 0))
            {
                selected_files = new string[] { e_active.ItemCollection.GetCommandlineTextLong(e_active.FocusedIndex) };
            }
            else
            {
                selected_files = new string[e_active.SelectedIndices.Length];
                for (var i = 0; i < e_active.SelectedIndices.Length; i++)
                {
                    selected_files[i] = e_active.ItemCollection.GetCommandlineTextLong(e_active.SelectedIndices[i]);
                }
            }
            var active_directory = string.Empty;

            if (e_active.ItemCollection is DirectoryList)
            {
                active_directory = ((DirectoryList)e_active.ItemCollection).DirectoryPath;
            }
            var passive_directory = string.Empty;

            if (e_passive.ItemCollection is DirectoryList)
            {
                passive_directory = ((DirectoryList)e_passive.ItemCollection).DirectoryPath;
            }
            var main_form = Program.MainWindow;

            //and set event arg props
            e.DirectoryActive    = active_directory;
            e.DirectoryPassive   = passive_directory;
            e.MainPluginMenuItem = parent_plugin_menu;
            e.MainWindow         = main_form;
            e.SelectedEntries    = selected_files;
        }
コード例 #14
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);

            WnetResourceList rl = (WnetResourceList)e.ItemCollection;

            if (rl.GetItemDisplayNameLong(e.FocusedIndex) == "..")
            {
                return;
            }

            NETRESOURCE res_info = rl[e.FocusedIndex];

            NetInfoDialog dialog = new NetInfoDialog();

            dialog.FillInfo(res_info);
            dialog.ShowDialog();
        }
コード例 #15
0
        protected override void internal_command_proc()
        {
            try
            {
                var e_current = new QueryPanelInfoEventArgs();
                OnQueryCurrentPanel(e_current);

                var pl = (ProcessList)e_current.ItemCollection;
                var p = pl[e_current.FocusedIndex];

                var dialog = new ProcessInfoDialog();
                //p.Refresh();
                dialog.Fill(p);
                dialog.ShowDialog();
            }
            catch (Exception ex)
            {
                Messages.ShowException(ex);
            }
        }
コード例 #16
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);

            if (e.FocusedIndex == -1)
            {
                return;
            }

            if (e.ItemCollection == null)
            {
                return;
            }

            DirectoryList dl          = (DirectoryList)e.ItemCollection;
            string        target_file = Path.Combine(dl.DirectoryPath, dl.GetItemDisplayNameLong(e.FocusedIndex));

            AFSdialog dialog = new AFSdialog(target_file);

            dialog.ShowDialog();
        }
コード例 #17
0
        protected override void internal_command_proc()
        {
            var e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);



            var dl = (DirectoryList)e.ItemCollection;

            if (dl.GetItemDisplayNameLong(e.FocusedIndex) == "..")
            {
                return;
            }

            var file_name = Path.Combine(dl.DirectoryPath, dl.GetItemDisplayNameLong(e.FocusedIndex));

            var dialog = new FileInformationDialog();

            try
            {
                if (dl.MainWindow != null)
                {
                    dl.MainWindow.NotifyLongOperation(Options.GetLiteral(Options.LANG_QUERY_PROPERTIES), true);
                }

                dialog.FillContents(file_name);
            }
            finally
            {
                if (dl.MainWindow != null)
                {
                    dl.MainWindow.NotifyLongOperation(string.Empty, false);
                }
            }
            dialog.ShowDialog();
        }
コード例 #18
0
        protected override void internal_command_proc()
        {
            try
            {
                var e = new QueryPanelInfoEventArgs();
                OnQueryCurrentPanel(e);

                if (!(e.ItemCollection is DirectoryList))
                {
                    return;
                }

                var dl        = (DirectoryList)e.ItemCollection;
                var file_name = dl[e.FocusedIndex].FullName;

                var dialog = new FileViewEditDialog();
                dialog.OpenView(file_name);
                dialog.Show();
            }
            catch (Exception ex)
            {
                Messages.ShowException(ex);
            }
        }
コード例 #19
0
        private void execute(UserMenuEntry entry)
        {
            string command_expanded = entry.CommandText;

            try
            {
                QueryPanelInfoEventArgs e_current = new QueryPanelInfoEventArgs();
                QueryPanelInfoEventArgs e_other   = new QueryPanelInfoEventArgs();
                OnQueryCurrentPanel(e_current);
                OnQueryOtherPanel(e_other);
                string repl_text = string.Empty;

                //process %1
                if (command_expanded.Contains("%1"))
                {
                    repl_text = e_current.ItemCollection.GetCommandlineTextShort(e_current.FocusedIndex);
                    if (repl_text.Contains(" "))
                    {
                        repl_text = '"' + repl_text + '"';
                    }
                    command_expanded = command_expanded.Replace("%1", repl_text);
                }

                //process %2
                if (command_expanded.Contains("%2"))
                {
                    repl_text = e_current.ItemCollection.GetCommandlineTextLong(e_current.FocusedIndex);
                    if (repl_text.Contains(" "))
                    {
                        repl_text = '"' + repl_text + '"';
                    }
                    command_expanded = command_expanded.Replace("%2", repl_text);
                }

                //process %3
                if (command_expanded.Contains("%3"))
                {
                    DirectoryList dl = (DirectoryList)e_other.ItemCollection;
                    repl_text = dl.DirectoryPath;
                    if (repl_text.Contains(" "))
                    {
                        repl_text = '"' + repl_text + '"';
                    }
                    command_expanded = command_expanded.Replace("%3", repl_text);
                }

                string reg_pattern = Options.REGEX_PARSE_COMMAND;
                Regex  rex         = new Regex(reg_pattern);

                string[] splitted = rex.Split(command_expanded, 2);
                if (splitted.Length < 2)
                {
                    throw new ApplicationException(Options.GetLiteral(Options.LANG_CANNOT_PARSE_COMMAND_LINE));
                }

                string command_name = splitted[1];
                string command_args = splitted.Length > 2 ? splitted[2] : string.Empty;

                ProcessStartInfo psi = new ProcessStartInfo();
                psi.Arguments        = command_args;
                psi.CreateNoWindow   = (entry.Options & ProcessStartFlags.NoWindow) == ProcessStartFlags.NoWindow;
                psi.ErrorDialog      = false;
                psi.FileName         = command_name;
                psi.UseShellExecute  = (entry.Options & ProcessStartFlags.UseShellexecute) == ProcessStartFlags.UseShellexecute;
                psi.WorkingDirectory = Directory.GetCurrentDirectory();

                Process p = new Process();
                p.StartInfo = psi;
                p.Start();
            }
            catch (Exception ex)
            {
                Messages.ShowException
                    (ex,
                    string.Format
                        (Options.GetLiteral(Options.LANG_CANNOT_EXECUTE_0),
                        command_expanded));
            }
        }
コード例 #20
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e_current = new QueryPanelInfoEventArgs();
            QueryPanelInfoEventArgs e_other   = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e_current);
            OnQueryOtherPanel(e_other);

            if (e_current.FocusedIndex == -1)
            {
                return;
            }

            if (!(e_other.ItemCollection is DirectoryList))
            {
                Messages.ShowMessage(Options.GetLiteral(Options.LANG_WRONG_DESTINATION));
                return;
            }

            //see source
            DirectoryList     dl_source   = (DirectoryList)e_current.ItemCollection;
            DirectoryList     dl_target   = (DirectoryList)e_other.ItemCollection;
            List <FileInfoEx> source_list = new List <FileInfoEx>();

            int[] sel_indices = e_current.SelectedIndices;
            if (sel_indices.Length == 0)
            {
                if (dl_source.GetItemDisplayNameLong(e_current.FocusedIndex) == "..")
                {
                    return;
                }

                source_list.Add(dl_source[e_current.FocusedIndex]);
            }
            else
            {
                for (int i = 0; i < sel_indices.Length; i++)
                {
                    source_list.Add(dl_source[sel_indices[i]]);
                }
            }

            //prepare move dialog
            MoveFileDialog dialog = new MoveFileDialog();

            dialog.MoveEngineOptions = Options.MoveEngineOptions;
            dialog.Text                    = Options.GetLiteral(Options.LANG_MOVE_RENAME);
            dialog.textBoxMask.Text        = "*";
            dialog.textBoxDestination.Text = string.Empty;

            //and show
            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            MoveEngineOptions move_opts = dialog.MoveEngineOptions;

            Options.MoveEngineOptions = move_opts;

            //prepare progress dialog
            dialog_progress = new CopyFileProgressDialog();
            dialog_progress.labelError.Visible            = false;
            dialog_progress.labelSpeed.Text               = string.Empty;
            dialog_progress.labelStatus.Text              = string.Empty;
            dialog_progress.labelStatusTotal.Text         = string.Empty;
            dialog_progress.checkBoxCloseOnFinish.Checked = Options.CopyCloseProgress;

            //calc location - it is not modal!
            dialog_progress.TopLevel = true;
            int x_center = Program.MainWindow.Left + Program.MainWindow.Width / 2;
            int y_center = Program.MainWindow.Top + Program.MainWindow.Height / 2;
            int x_dialog = x_center - dialog_progress.Width / 2;
            int y_dialog = y_center - dialog_progress.Height / 2;

            if (x_dialog < 0)
            {
                x_dialog = 0;
            }
            if (x_dialog < 0)
            {
                y_dialog = 0;
            }

            //show progress
            dialog_progress.Show();
            dialog_progress.Location = new System.Drawing.Point(x_dialog, y_dialog);

            //prepare move engine
            MoveFileEngine move_engine = new MoveFileEngine
                                             (source_list,
                                             dialog.textBoxDestination.Text == string.Empty ? dl_target.DirectoryPath : Path.Combine(dl_target.DirectoryPath, dialog.textBoxDestination.Text),
                                             dialog.textBoxMask.Text,
                                             move_opts,
                                             dialog_progress);

            move_engine.Done += new EventHandler(move_engine_Done);

            //and run
            move_engine.Do();
        }
コード例 #21
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);

            if (e.FocusedIndex == -1)
            {
                return;
            }

            bool group_mode = false;

            int[] sel_indices = e.SelectedIndices;
            //we not need cache selection
            //becouse e.ItemsCollection must not change (DirectoryList not sort on attributes)
            group_mode = (sel_indices.Length > 1);
            DirectoryList   dl     = (DirectoryList)e.ItemCollection;
            WIN32_FIND_DATA f_data = new WIN32_FIND_DATA();

            string target_file = string.Empty;

            if (!group_mode)
            {
                if (sel_indices.Length == 0)
                {
                    target_file = Path.Combine(dl.DirectoryPath, dl.GetItemDisplayNameLong(e.FocusedIndex));
                }
                else
                {
                    target_file = Path.Combine(dl.DirectoryPath, dl.GetItemDisplayNameLong(sel_indices[0]));
                }
                if (target_file.EndsWith(".."))
                {
                    target_file = dl.DirectoryPath;
                }
                if (!WinAPiFSwrapper.GetFileInfo(target_file, ref f_data))
                {
                    return;
                }
            }



            FileAttributesEditDialog dialog = new FileAttributesEditDialog();

            if (!group_mode)
            {
                dialog.buttonClear.Enabled = false;
                set_attributes_to_dialog(dialog, f_data.dwFileAttributes);
                dialog.Text = String.Format
                                  (Options.GetLiteral(Options.LANG_FILE_ATTRIBUTES) + " [{0}]", target_file);
            }
            else
            {
                dialog.buttonClear.Enabled = true;
                dialog.buttonOK.Text       = Options.GetLiteral(Options.LANG_ADD);
                dialog.Text = string.Format
                                  (Options.GetLiteral(Options.LANG_FILE_ATTRIBUTES) + " [{0} " + Options.GetLiteral(Options.LANG_ENTRIES) + "]", sel_indices.Length);
            }
            set_readonly_attributes(dialog);

            DialogResult d_res = dialog.ShowDialog();

            switch (d_res)
            {
            case DialogResult.OK:
                //group mode = add attributes
                //single mode = set attributes
                if (!group_mode)
                {
                    try
                    {
                        set_attributes_file(target_file, get_attributes_from_dialog(dialog));
                    }
                    catch (Exception ex)
                    {
                        Messages.ShowException(ex);
                    }
                }
                else
                {
                    //group mode
                    FileAttributes add_fa = get_attributes_from_dialog(dialog);
                    foreach (int one_index in sel_indices)
                    {
                        target_file = Path.Combine(dl.DirectoryPath, dl.GetItemDisplayNameLong(one_index));
                        try
                        {
                            add_attributes_file(target_file, add_fa);
                            OnItemProcessDone(new ItemEventArs(one_index));
                        }
                        catch (Exception ex)
                        {
                            Messages.ShowException(ex);
                        }
                    }
                }
                break;

            case DialogResult.Yes:
                //group mode only = clear attributes
                FileAttributes clear_fa = get_attributes_from_dialog(dialog);
                foreach (int one_index in sel_indices)
                {
                    target_file = Path.Combine(dl.DirectoryPath, dl.GetItemDisplayNameLong(one_index));
                    try
                    {
                        clear_attributes_file(target_file, clear_fa);
                        OnItemProcessDone(new ItemEventArs(one_index));
                    }
                    catch (Exception ex)
                    {
                        Messages.ShowException(ex);
                    }
                }
                break;
            }
        }
コード例 #22
0
        protected override void internal_command_proc()
        {
            var e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);

            if (!(e.ItemCollection is ZipDirectory))
            {
                return;
            }

            var zd = (ZipDirectory)e.ItemCollection;
            var initial_sources = new List <string>();
            var initial_zip_dir = zd.CurrentZipDirectory;

            if (initial_zip_dir.StartsWith("/"))
            {
                initial_zip_dir = initial_zip_dir.Substring(1);
            }
            if ((!initial_zip_dir.EndsWith("/")) && (initial_zip_dir != string.Empty))
            {
                initial_zip_dir = initial_zip_dir + "/";
            }
            if (e.SelectedIndices.Length == 0)
            {
                if (zd.GetItemDisplayName(e.FocusedIndex) == "..")
                {
                    return;
                }
                initial_sources.Add(initial_zip_dir + zd.GetItemDisplayName(e.FocusedIndex));
            }
            else
            {
                for (var i = 0; i < e.SelectedIndices.Length; i++)
                {
                    initial_sources.Add(initial_zip_dir + zd.GetItemDisplayName(e.SelectedIndices[i]));
                }
            }

            //show dialog
            var dialog = new DeleteFileDialog();

            dialog.Text = Options.GetLiteral(Options.LANG_DELETE);
            dialog.DeleteFileOptions               = DeleteFileOptions.DeleteEmptyDirectories | DeleteFileOptions.DeleteReadonly | DeleteFileOptions.RecursiveDeleteFiles;
            dialog.textBoxMask.Text                = "*";
            dialog.checkBoxForceReadonly.Enabled   = false;
            dialog.checkBoxRecursive.Enabled       = false;
            dialog.checkBoxRemoveEmptyDirs.Enabled = false;
            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var del_list = new List <ZipEntry>();

            create_delete_list(del_list, initial_sources, dialog.textBoxMask.Text, zd.ZipFile);

            var main_win = (mainForm)Program.MainWindow;

            try
            {
                zd.ZipFile.BeginUpdate();
                for (var i = 0; i < del_list.Count; i++)
                {
                    main_win.NotifyLongOperation
                        (string.Format
                            (Options.GetLiteral(Options.LANG_DELETE_NOW_0),
                            del_list[i].Name),
                        true);
                    zd.ZipFile.Delete(del_list[i]);
                }
                main_win.NotifyLongOperation(Options.GetLiteral(Options.LANG_COMMIT_ARCHIVE_UPDATES), true);
                zd.ZipFile.CommitUpdate();

                zd.Refill();
            }
            catch (Exception ex)
            {
                Messages.ShowException(ex);
            }
            finally
            {
                main_win.NotifyLongOperation("Done", false);
            }
        }
コード例 #23
0
        protected override void internal_command_proc()
        {
            try
            {
                var e = new QueryPanelInfoEventArgs();
                OnQueryCurrentPanel(e);
                if (e.FocusedIndex == -1)
                {
                    return;
                }

                var target_file = string.Empty;
                var dl          = (DirectoryList)e.ItemCollection;
                var sel_indices = e.SelectedIndices;
                var group_mode  = (sel_indices.Length > 1);
                //we need cache list of selected files
                //becouse e.ItemCollection can change while processing (sort!)
                var sel_names = new List <string>();
                for (var i = 0; i < sel_indices.Length; i++)
                {
                    sel_names.Add(e.ItemCollection.GetItemDisplayNameLong(sel_indices[i]));
                }


                if (!group_mode)
                {
                    if (sel_indices.Length == 1)
                    {
                        target_file = Path.Combine(dl.DirectoryPath, dl.GetItemDisplayNameLong(sel_indices[0]));
                    }
                    else
                    {
                        target_file = Path.Combine(dl.DirectoryPath, dl.GetItemDisplayNameLong(e.FocusedIndex));
                    }
                }
                if (target_file.EndsWith(".."))
                {
                    target_file = dl.DirectoryPath + Path.DirectorySeparatorChar;
                }

                FileSystemInfo target_fsi = null;
                if (!group_mode)
                {
                    target_fsi = IOhelper.GetFileSystemInfo(target_file);
                }

                var dialog = new TouchFileDialog();

                dialog.Text = Options.GetLiteral(Options.LANG_TOUCH);

                if (!group_mode)
                {
                    dialog.textBoxFileName.Text             = target_file;
                    dialog.dateTimePickerAccess.Value       = target_fsi.LastAccessTime;
                    dialog.dateTimePickerCreation.Value     = target_fsi.CreationTime;
                    dialog.dateTimePickerModification.Value = target_fsi.LastWriteTime;
                }
                else
                {
                    dialog.textBoxFileName.Text    = string.Format("{0} " + Options.GetLiteral(Options.LANG_ENTRIES), sel_indices.Length);
                    dialog.textBoxFileName.Enabled = false;
                }

                if (dialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                if (!group_mode)
                {
                    if (dialog.textBoxFileName.Text != target_file)
                    {
                        //try create new file
                        netCommander.FileSystemEx.WinAPiFSwrapper.CreateNewEmptyFile(dialog.textBoxFileName.Text);
                        //if success
                        target_fsi = new FileInfo(dialog.textBoxFileName.Text);
                    }
                }

                //set times
                if (group_mode)
                {
                    foreach (var one_name in sel_names)
                    {
                        try
                        {
                            target_file = Path.Combine(dl.DirectoryPath, one_name);
                            target_fsi  = IOhelper.GetFileSystemInfo(target_file);
                            if (dialog.dateTimePickerAccess.Checked)
                            {
                                target_fsi.LastAccessTime = dialog.dateTimePickerAccess.Value;
                            }
                            if (dialog.dateTimePickerCreation.Checked)
                            {
                                target_fsi.CreationTime = dialog.dateTimePickerCreation.Value;
                            }
                            if (dialog.dateTimePickerModification.Checked)
                            {
                                target_fsi.LastWriteTime = dialog.dateTimePickerModification.Value;
                            }
                            OnItemProcessDone(new ItemEventArs(one_name));
                        }
                        catch (Exception ex)
                        {
                            Messages.ShowException(ex);
                        }
                    }
                }
                else
                {
                    try
                    {
                        if (dialog.dateTimePickerAccess.Checked)
                        {
                            target_fsi.LastAccessTime = dialog.dateTimePickerAccess.Value;
                        }
                        if (dialog.dateTimePickerCreation.Checked)
                        {
                            target_fsi.CreationTime = dialog.dateTimePickerCreation.Value;
                        }
                        if (dialog.dateTimePickerModification.Checked)
                        {
                            target_fsi.LastWriteTime = dialog.dateTimePickerModification.Value;
                        }
                    }
                    catch (Exception ex)
                    {
                        Messages.ShowException(ex);
                    }
                }
            }
            catch (Exception ex)
            {
                Messages.ShowException(ex);
            }
        } // end of proc
コード例 #24
0
 void plugin_engine_QueryActivePanel(object sender, QueryPanelInfoEventArgs e)
 {
     e.FocusedIndex    = doublePanel1.PanelActive.FocusedIndex;
     e.ItemCollection  = doublePanel1.PanelActive.Source;
     e.SelectedIndices = doublePanel1.PanelActive.SelectionIndices;
 }
コード例 #25
0
        protected override void internal_command_proc()
        {
            var e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);

            if (e.FocusedIndex == -1)
            {
                return;
            }

            var dl = (DirectoryList)e.ItemCollection;

            if (dl.GetItemDisplayNameLong(e.FocusedIndex) == "..")
            {
                return;
            }

            //show dialog
            var psi       = new ProcessStartInfo();
            var file_name = dl[e.FocusedIndex].FullName;

            psi.FileName = file_name;
            var opts   = Options.RunExeOptions;
            var dialog = new RunexeDialog();

            dialog.Text                         = Options.GetLiteral(Options.LANG_EXECUTE);
            dialog.RunExeOptions                = opts;
            dialog.textBoxArguments.Text        = string.Empty;
            dialog.textBoxFilename.Text         = dl[e.FocusedIndex].FileName;
            dialog.textBoxWorkingDirectory.Text = dl.DirectoryPath;
            if (psi.Verbs != null)
            {
                foreach (var verb in psi.Verbs)
                {
                    dialog.comboBoxVerb.Items.Add(verb);
                }
            }

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            opts = dialog.RunExeOptions;
            Options.RunExeOptions = opts;

            psi.LoadUserProfile = (opts & RunExeOptions.LoadEnvironment) == RunExeOptions.LoadEnvironment;
            if ((opts & RunExeOptions.RunInConsole) == RunExeOptions.RunInConsole)
            {
                if (file_name.Contains(" "))
                {
                    file_name = '"' + file_name + '"';
                }
                psi.FileName  = "cmd";
                psi.Arguments = "/K " + file_name;
            }
            else
            {
                psi.FileName = file_name;
            }

            if ((opts & RunExeOptions.UseRunas) == RunExeOptions.UseRunas)
            {
                var user = string.Empty;
                var pass = string.Empty;

                if (Messages.AskCredentials(Options.GetLiteral(Options.LANG_ACCOUNT), Options.GetLiteral(Options.LANG_EXECUTE) + " '" + file_name + "'", ref user, ref pass) == DialogResult.OK)
                {
                    psi.UserName = user;
                    var sec = new System.Security.SecureString();
                    foreach (var c in pass)
                    {
                        sec.AppendChar(c);
                    }
                    psi.Password = sec;
                }
            }

            psi.UseShellExecute = (opts & RunExeOptions.UseShellExecute) == RunExeOptions.UseShellExecute;

            psi.WorkingDirectory = dialog.textBoxWorkingDirectory.Text;
            psi.Verb             = dialog.comboBoxVerb.Text;
            psi.Arguments        = psi.Arguments + " " + dialog.textBoxArguments.Text;

            try
            {
                Process.Start(psi);
            }
            catch (Exception ex)
            {
                Messages.ShowException
                    (ex,
                    string.Format(Options.GetLiteral(Options.LANG_CANNOT_EXCUTE_0_1), psi.FileName, psi.Arguments));
            }
        }
コード例 #26
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);

            if (e.FocusedIndex == -1)
            {
                return;
            }

            FtpDirectoryList ftp_list = (FtpDirectoryList)e.ItemCollection;

            connection = ftp_list.Connection;
            List <FtpEntryInfo> sels = new List <FtpEntryInfo>();

            if (e.SelectedIndices.Length == 0)
            {
                sels.Add(ftp_list[e.FocusedIndex]);
            }
            else
            {
                for (int i = 0; i < e.SelectedIndices.Length; i++)
                {
                    sels.Add(ftp_list[e.SelectedIndices[i]]);
                }
            }

            //show delete dialog
            DeleteFileDialog dialog = new DeleteFileDialog();

            dialog.Text = "Delete files";
            if (sels.Count == 1)
            {
                if (sels[0].Directory)
                {
                    //dialog.labelQuestion.Text =
                    //    string.Format
                    //    ("Do you REALLY want to delete '{0}'? This directory and all its contents it will be destroyed for ever.",
                    //    FtpPath.Combine(sels[0].DirectoryPath, sels[0].EntryName));
                }
                else
                {
                    //dialog.labelQuestion.Text =
                    //    string.Format
                    //    ("Do you REALLY want to delete '{0}'? The file will be destroyed for ever.",
                    //    FtpPath.Combine(sels[0].DirectoryPath, sels[0].EntryName));
                }
            }
            else
            {
                //dialog.labelQuestion.Text =
                //    string.Format
                //    ("Do you REALLY want to delete {0} entries? All selected files and directories with the contents will be destroyed for ever.",
                //    sels.Count);
            }
            //dialog.checkBoxForceReadonly.Checked = false;
            //dialog.checkBoxForceReadonly.Enabled = false;
            //dialog.checkBoxSupressExceptions.Checked = false;

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            //save user selection
            //Options.DeleteSupressExceptions = dialog.checkBoxSupressExceptions.Checked;
            //supress_errors = dialog.checkBoxSupressExceptions.Checked;

            //and kill
            foreach (FtpEntryInfo info in sels)
            {
                delete_recursive(info, ftp_list.MainWindow);
            }
            if (ftp_list.MainWindow != null)
            {
                ftp_list.MainWindow.NotifyLongOperation
                    (string.Empty, false);
            }

            e.ItemCollection.Refill();
        }
コード例 #27
0
 void user_menu_QueryCurrentPanel(object sender, QueryPanelInfoEventArgs e)
 {
     e.FocusedIndex    = doublePanel1.PanelActive.FocusedIndex;
     e.ItemCollection  = doublePanel1.PanelActive.Source;
     e.SelectedIndices = doublePanel1.PanelActive.SelectionIndices;
 }
コード例 #28
0
        protected override void internal_command_proc()
        {
            QueryPanelInfoEventArgs e_current = new QueryPanelInfoEventArgs();
            QueryPanelInfoEventArgs e_other   = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e_current);
            OnQueryOtherPanel(e_other);

            //int buffer_size = 0x8000;

            if (!(e_other.ItemCollection is DirectoryList))
            {
                Messages.ShowMessage
                    (Options.GetLiteral(Options.LANG_WRONG_DESTINATION));
                return;
            }

            DirectoryList         dl              = (DirectoryList)e_other.ItemCollection;
            string                dest_dir        = dl.DirectoryPath;
            ZipDirectory          zd              = (ZipDirectory)e_current.ItemCollection;
            ZipFile               source_zip_file = zd.ZipFile;
            string                zip_current_dir = zd.CurrentZipDirectory;
            ArchiveExtractOptions opts            = Options.ArchiveExtractOptions;

            //show user dialog
            ExtractDialog dialog = new ExtractDialog();

            dialog.ArchiveExtractOptions  = opts;
            dialog.textBoxSourceMask.Text = "*";
            dialog.Text = Options.GetLiteral(Options.LANG_EXTRACT);
            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            //retrieve options
            opts = dialog.ArchiveExtractOptions;
            string dest_path   = Path.Combine(dest_dir, dialog.textBoxDestination.Text);
            string source_mask = dialog.textBoxSourceMask.Text;

            Options.ArchiveExtractOptions = opts;

            //retrieve source list
            List <string> source_list = new List <string>();

            if ((e_current.SelectedIndices.Length == 0) && (e_current.FocusedIndex != 0))
            {
                //focused index==0 always ref to parent entry, so skip it
                source_list.Add(zd.GetItemDisplayName(e_current.FocusedIndex));
            }
            else
            {
                for (int i = 0; i < e_current.SelectedIndices.Length; i++)
                {
                    if (e_current.SelectedIndices[i] == 0)
                    {
                        continue;
                    }

                    source_list.Add(zd.GetItemDisplayName(e_current.SelectedIndices[i]));
                }
            }

            //prepare progress dialog

            dialog_progress = new CopyFileProgressDialog();
            dialog_progress.labelError.Visible            = false;
            dialog_progress.labelSpeed.Text               = string.Empty;
            dialog_progress.labelStatus.Text              = string.Empty;
            dialog_progress.labelStatusTotal.Text         = string.Empty;
            dialog_progress.checkBoxCloseOnFinish.Checked = Options.CopyCloseProgress;

            dialog_progress.TopLevel = true;
            int x_center = Program.MainWindow.Left + Program.MainWindow.Width / 2;
            int y_center = Program.MainWindow.Top + Program.MainWindow.Height / 2;
            int x_dialog = x_center - dialog_progress.Width / 2;
            int y_dialog = y_center - dialog_progress.Height / 2;

            if (x_dialog < 0)
            {
                x_dialog = 0;
            }
            if (x_dialog < 0)
            {
                y_dialog = 0;
            }
            dialog_progress.Show();
            dialog_progress.Location = new System.Drawing.Point(x_dialog, y_dialog);

            ZipExtractEngine engine = new ZipExtractEngine
                                          (source_list,
                                          dest_path,
                                          opts,
                                          dialog_progress,
                                          dialog.textBoxSourceMask.Text,
                                          zd.ZipFile,
                                          zd.CurrentZipDirectory);

            engine.Done            += new EventHandler(engine_Done);
            engine.ExtractItemDone += new ItemEventHandler(engine_ExtractItemDone);

            zip_directory = zd;
            zd.LockSafe   = true;

            engine.Run();

            //ZipEntry source_entry = zd[e_current.FocusedIndex];
            //if (source_entry == null)
            //{
            //    return;
            //}

            //Stream out_stream = source_zip_file.GetInputStream(source_entry);
            //string target_file_name = Path.Combine(dest_dir, source_entry.Name);
            //FileStream writer = new FileStream(target_file_name, FileMode.CreateNew, FileAccess.Write, FileShare.Read);
            //byte[] buffer = new byte[buffer_size];
            //int bytes_readed = 0;
            //while ((bytes_readed = out_stream.Read(buffer, 0, buffer_size)) != 0)
            //{
            //    writer.Write(buffer, 0, bytes_readed);
            //}
            //writer.Flush();
            //writer.Close();
            //out_stream.Close();
        }
コード例 #29
0
        protected override void internal_command_proc()
        {
            abort = false;
            QueryPanelInfoEventArgs e = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e);

            if (e.FocusedIndex == -1)
            {
                return;
            }

            if (!(e.ItemCollection is DirectoryList))
            {
                return;
            }

            DirectoryList dl = (DirectoryList)e.ItemCollection;

            main_window = dl.MainWindow;
            int[] sel_indices = e.SelectedIndices;
            //we must cache selection
            //becouse indexes will be change while deleting
            List <FileInfoEx> sel_files = new List <FileInfoEx>();

            if (sel_indices.Length > 0)
            {
                for (int i = 0; i < sel_indices.Length; i++)
                {
                    sel_files.Add(dl[sel_indices[i]]);
                }
            }
            else
            {
                if (dl[e.FocusedIndex].FileName == "..")
                {
                    Messages.ShowMessage(Options.GetLiteral(Options.LANG_WRONG_DESTINATION));
                    return;
                }
                sel_files.Add(dl[e.FocusedIndex]);
            }

            //now we have list for delete

            opts = Options.DeleteFileOptions;

            //show user dialog...
            DeleteFileDialog dialog = new DeleteFileDialog();

            dialog.Text = CommandMenu.Text;
            dialog.DeleteFileOptions = opts;
            dialog.textBoxMask.Text  = "*";

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            opts = dialog.DeleteFileOptions;
            Options.DeleteFileOptions = opts;
            delete_mask = dialog.textBoxMask.Text;

            if (sel_files.Count == 1)
            {
                delete_entry(sel_files[0]);
            }
            else
            {
                foreach (FileInfoEx info in sel_files)
                {
                    if (abort)
                    {
                        break;
                    }
                    delete_entry(info);
                }
            }
            if (main_window != null)
            {
                main_window.NotifyLongOperation(string.Empty, false);
            }
        }
コード例 #30
0
        protected override void internal_command_proc()
        {
            var e_current = new QueryPanelInfoEventArgs();
            var e_other   = new QueryPanelInfoEventArgs();

            OnQueryCurrentPanel(e_current);
            OnQueryOtherPanel(e_other);

            if (e_current.FocusedIndex == -1)
            {
                return;
            }

            if (e_other.ItemCollection is FtpDirectoryList)
            {
                //do ftp download
                upload_to_ftp(e_current, e_other);
                return;
            }
            else if (e_other.ItemCollection is ZipDirectory)
            {
                add_to_zip(e_current, e_other);
                return;
            }
            else if (!(e_other.ItemCollection is DirectoryList))
            {
                Messages.ShowMessage(Options.GetLiteral(Options.LANG_WRONG_DESTINATION));
                return;
            }

            //see source
            var source_list = new List <FileInfoEx>();
            var dl_source   = (DirectoryList)e_current.ItemCollection;
            var dl_target   = (DirectoryList)e_other.ItemCollection;
            var sel_indices = e_current.SelectedIndices;

            if (sel_indices.Length == 0)
            {
                if (dl_source.GetItemDisplayNameLong(e_current.FocusedIndex) == "..")
                {
                    return;
                }
                //get focused entry
                source_list.Add(dl_source[e_current.FocusedIndex]);
            }
            else
            {
                //get source from selection
                for (var i = 0; i < sel_indices.Length; i++)
                {
                    source_list.Add(dl_source[sel_indices[i]]);
                }
            }

            var dest_path = dl_target.DirectoryPath;

            //prepare copy dialog
            var dialog = new CopyFileDialog();

            dialog.CopyEngineOptions = Options.CopyEngineOptions;
            dialog.Text = Options.GetLiteral(Options.LANG_COPY);

            dialog.textBoxSourceMask.Text = "*";

            dialog.textBoxDestination.Text = string.Empty;

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            //save user selection
            var engine_opts = dialog.CopyEngineOptions;

            Options.CopyEngineOptions = engine_opts;

            //prepare progress dialog
            dialog_progress = new CopyFileProgressDialog();
            dialog_progress.labelError.Visible            = false;
            dialog_progress.labelSpeed.Text               = string.Empty;
            dialog_progress.labelStatus.Text              = string.Empty;
            dialog_progress.labelStatusTotal.Text         = string.Empty;
            dialog_progress.checkBoxCloseOnFinish.Checked = Options.CopyCloseProgress;

            dialog_progress.TopLevel = true;
            var x_center = Program.MainWindow.Left + Program.MainWindow.Width / 2;
            var y_center = Program.MainWindow.Top + Program.MainWindow.Height / 2;
            var x_dialog = x_center - dialog_progress.Width / 2;
            var y_dialog = y_center - dialog_progress.Height / 2;

            if (x_dialog < 0)
            {
                x_dialog = 0;
            }
            if (x_dialog < 0)
            {
                y_dialog = 0;
            }
            dialog_progress.Show();
            dialog_progress.Location = new System.Drawing.Point(x_dialog, y_dialog);

            //prepare copy engine
            var dest_remote = true;

            try
            {
                var dest_info = new FileInfoEx();
                FileInfoEx.TryGet(dest_path, ref dest_info);
                var chars = dest_info.GetDeviceInfo().Characteristics;
                if (((chars & NT_FS_DEVICE_CHARACTERISTICS.Remote) == NT_FS_DEVICE_CHARACTERISTICS.Remote) ||
                    ((chars & NT_FS_DEVICE_CHARACTERISTICS.Removable) == NT_FS_DEVICE_CHARACTERISTICS.Removable) ||
                    ((chars & NT_FS_DEVICE_CHARACTERISTICS.WebDAV) == NT_FS_DEVICE_CHARACTERISTICS.WebDAV))
                {
                    dest_remote = true;
                }
                else
                {
                    dest_remote = false;
                }
            }
            catch (Exception) { }

            dest_path = dialog.textBoxDestination.Text == string.Empty ? dest_path : Path.Combine(dest_path, dialog.textBoxDestination.Text);
            var copy_engine = new CopyFileEngine
                                  (source_list, dest_path, engine_opts, dialog_progress, dialog.textBoxSourceMask.Text, dest_remote);

            copy_engine.Done         += new EventHandler(copy_engine_Done);
            copy_engine.CopyItemDone += new ItemEventHandler(copy_engine_CopyItemDone);

            //and do job
            copy_engine.Do();
        }