Exemple #1
0
        private void CopyFile_DoWork(object sender, DoWorkEventArgs e)
        {
            if (cbIsDelDestFile.Checked)
            {
                FileMg.ClearManualFolder();
                FileMg.InitDataFolder();
            }

            e.Result = FileMg.DirectoryCopy(tbRawFileFolder.Text, FileMg.ManualSourceFileDir, true, false, backgroundWorker);
        }
        private void CopyFile_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                FileMg.DirectoryDelete(FileMg.AutoTmtOutputFileDir, true);
                FileMg.DeleteTmtCacheFile(FileMg.AutoTmtDataFileDir);
            }
            catch
            { }

            if (cbIsDelDestFile.Checked)
            {
                FileMg.ClearAutoFolder();
                FileMg.InitDataFolder();
            }

            e.Result = FileMg.DirectoryCopy(tbRawFileFolder.Text, FileMg.AutoSourceFileDir, true, false, backgroundWorker);
        }
Exemple #3
0
 private static bool CopyRawFiles(BackgroundWorker backgroundWorker, string dirName)
 {
     OutputMg.OutputHeader1(backgroundWorker, "Step 1", "Copy Source File");
     try
     {
         OutputMg.OutputContent(backgroundWorker, "Start to count number under " + dirName);
         int sourceFileNumber = FileMg.CountFileNumber(dirName);
         OutputMg.OutputContent(backgroundWorker, "Finished counting. Total file number is: " + sourceFileNumber);
         OutputMg.OutputContent(backgroundWorker, "Starting copy files");
         int numCopy = FileMg.DirectoryCopy(dirName, FileMg.AutoSourceFileDir, true, false, backgroundWorker);
         OutputMg.OutputContent(backgroundWorker, "Finished copying files. Total file number is: " + numCopy);
         return(true);
     }
     catch
     {
         OutputMg.OutputHeader1(backgroundWorker, "Failed", "Copy files failed. Please try to run this tool as Administrator.");
         return(false);
     }
 }