Exemplo n.º 1
0
        private void MoveCacheWidthBackgroundWorker(string currentDesktopFolder, string destDataPathFolder)
        {
            var workerModel = new MoveCacheBackgroundWorkerModel()
            {
                DeskTopFolder          = currentDesktopFolder,
                DesktopFoldersAndFiles = FolderUtil.GetSubFoldersAndFiles(currentDesktopFolder),
                UserDefinedFolder      = destDataPathFolder,
            };

            using (var backgroundWorker = new BackgroundWorker()
            {
                WorkerReportsProgress = true
            })
            {
                backgroundWorker.ProgressChanged    += MoveCacheBackgroundWorker_ProgressChanged;
                backgroundWorker.DoWork             += MoveCacheBackgroundWorker_DoWork;
                backgroundWorker.RunWorkerCompleted += MoveCacheBackgroundWorker_RunWorkerCompleted;
                backgroundWorker.RunWorkerAsync(workerModel);
            }
        }