protected override void processData() { var dataPath = SourcePath + "\\Data\\"; if (!System.IO.Directory.Exists(dataPath)) { onTaskStateChanged(this, new TaskStateChangedEventArgs() { TaskState = TaskState.DataProc, Description = "未找到一般数据的备份目录,跳过该步。" }); return; } var outpath = DestinationPath + "\\Data\\"; onTaskStateChanged(this, new TaskStateChangedEventArgs() { TaskState = TaskState.DataProc, Description = "开始还原一般数据..." }); FileCopyHelper.CopyDirectory(dataPath, outpath); onTaskStateChanged(this, new TaskStateChangedEventArgs() { TaskState = TaskState.DataProc, Description = "一般数据还原完成,输出目录:" + outpath }); }
public void Execute() { if (Progress != null) { Progress(0); } using (var fch = new FileCopyHelper(_source, _destination)) { for (int i = 0; i < fch.PageNumber; i++) { fch.CopyPage(); if (Progress != null) { Progress((i + 1) * 100 / fch.PageNumber); } } } }
private void ExecuteCopyFile(CopyFileContext context, FileInfo source, FileInfo destination, Statements.FileCopyOptions options) { FileCopyHelper.CopyFile(source, destination, options, new CopyFileHandler((s, t, st, sz, tr) => ((CopyFileContext)st).HandleProgress(s, t, sz, tr)), context); }