public void BackupFolder(string fullPath) { Log.Info("Creating backup for {0}", fullPath); try { var parentDirectory = Catel.IO.Path.GetParentDirectory(fullPath); var directoryName = Catel.IO.Path.GetRelativePath(fullPath, parentDirectory); var destinationDirectory = _operationContextService.CurrentContext.FileSystemContext.GetDirectory(directoryName); _fileSystemService.CopyDirectory(fullPath, destinationDirectory); } catch (Exception exception) { Log.Error(exception, "Failed to create backup for {0}", fullPath); } }
public async void CopyDirectory(string source, string destination) { await _filesystem.CopyDirectory(source, destination, progress => _hub.Clients.All.SendAsync("CopyDirectoryProgress", progress)); await _hub.Clients.All.SendAsync("CopyDirectoryCompleted"); }