示例#1
0
        public async Task DoAFileCopy()
        {
            CreateTestFile();

            var result = await FileWithProgress.CopyAsync(TestFilePath, TestDestinationPath, ProgressUpdater);

            Assert.IsTrue(result);

            Assert.IsTrue(File.Exists(TestDestinationPath));

            Assert.IsTrue(File.Exists(TestFilePath));
        }
示例#2
0
 internal async Task <bool> CopyAsync(string sourcePath, string destinationPath, Action <decimal> updateProgressBar)
 {
     this.IsCancelled         = false;
     this.UpdateProgressAsPct = updateProgressBar;
     try
     {
         _isMoving = true;
         return(await FileWithProgress.CopyAsync(sourcePath, destinationPath, ProgressCallback, this));
     }
     finally
     {
         _isMoving = false;
     }
 }