Beispiel #1
0
        private void StartCopy2()
        {
            // if last time stopped cancel set initials it again
            CopyFile.CancelStop();

            copyFileProgress              cpProgress    = new copyFileProgress(ProgressShowForSingleFile);
            CopyFileFinishedCallback      cpFinished    = new CopyFileFinishedCallback(CopySingleFileCompleted);
            TrasferedSizeDelegate         tsTransfer    = new TrasferedSizeDelegate(CalculateTotalTransfered);
            CopyAllFinishedCallback       cpFinishedAll = new CopyAllFinishedCallback(FinishedCopyingAllFiles);
            SingleFileCopyStartedDelegate sfCopyd       = new SingleFileCopyStartedDelegate(CopySingleFileStarted);

            foreach (string fileName in SelectedFiles)
            {
                CopyFile cp = new CopyFile(fileName, GetDestinationFileName(fileName), cpFinished, cpProgress, tsTransfer);

                if (ignoreCurrentFile == true)
                {
                    // Reset for next use
                    ignoreCurrentFile = false;
                    //
                    continue;
                }

                sfCopyd(new CopyCurrentFileInfo
                {
                    oldFile           = fileName,
                    newFile           = GetDestinationFileName(fileName),
                    CurrentFileNumber = SelectedFiles.IndexOf(fileName) + 1,
                    TotalFileNumber   = SelectedFiles.Count
                });

                cp.StartCopyAsync2();
            }
            cpFinishedAll();
        }
Beispiel #2
0
 public CopyFile(string oldFile, string newFile, CopyFileFinishedCallback cpfcallback, copyFileProgress cpProgress, TrasferedSizeDelegate transfered)
 {
     this._oldeFile = oldFile;
     this._newFile  = newFile;
     this._Copy_Completed_Callback = cpfcallback;
     this._Copy_Progress           = cpProgress;
     this._trasferedSize           = transfered;
 }
Beispiel #3
0
        private void StartCut2()
        {
            // if last time stopped cancel set initials it again
            CopyFile.CancelStop();

            copyFileProgress              cpProgress    = new copyFileProgress(ProgressShowForSingleFile);
            CopyFileFinishedCallback      cpFinished    = new CopyFileFinishedCallback(CopySingleFileCompleted);
            TrasferedSizeDelegate         tsTransfer    = new TrasferedSizeDelegate(CalculateTotalTransfered);
            CopyAllFinishedCallback       cpFinishedAll = new CopyAllFinishedCallback(FinishedCopyingAllFiles);
            SingleFileCopyStartedDelegate sfCopyd       = new SingleFileCopyStartedDelegate(CopySingleFileStarted);

            foreach (string fileName in SelectedFiles)
            {
                CutFile cu = new CutFile(fileName, GetDestinationFileName(fileName), cpFinished, cpProgress, tsTransfer);

                if (ignoreCurrentFile == true)
                {
                    // Reset for next use
                    ignoreCurrentFile = false;
                    //
                    continue;
                }

                sfCopyd(new CopyCurrentFileInfo
                {
                    newFile           = fileName,
                    oldFile           = GetDestinationFileName(fileName),
                    CurrentFileNumber = SelectedFiles.IndexOf(fileName) + 1,
                    TotalFileNumber   = SelectedFiles.Count
                });

                cu.StartCutAsync2();
            }
            cpFinishedAll();

            // file watcher is disabled durring cutting operation
            // when cutting is done,it should be enabled again
            _enable_watcher();
            //
        }