public static async Task SaveHumanReadableText(this Poll poll, int i, FilesystemTools filesystemTools, DirectoryInfo dir, CancellationToken token, ILog log) { var textFile = filesystemTools.CreateFile(dir, $"{i} {poll.GetName()}.txt", CreateMode.OverwriteExisting); await File.WriteAllTextAsync(textFile.FullName, poll.Serialize(), token); }
public static IEnumerable <IDownload> ToDownloads(this Document document, int i, FilesystemTools filesystemTools, DirectoryInfo dir, ILog log) { // TODO: looks like Title already has Extension yield return(new Download(new Uri(document.Uri), dir, $"{i} {document.Title}")); }
public static IEnumerable <IDownload> ToDownloads(this Link link, int i, FilesystemTools filesystemTools, DirectoryInfo dir, ILog log) { yield return(new Download(link.Uri, dir, link.Title)); }
public Logic(TokenMagic tokenMagic, VkApi vkApi, VkApiUtils vkApiUtils, BackgroundDownloader downloader, FilesystemTools filesystemTools, DownloadQueueProvider queueProvider, WallHandler wallHandler, AudioHandler audioHandler, PhotoHandler photoHandler, IOptionsSnapshot <Settings> settings) { this.settings = settings.Value; this.tokenMagic = tokenMagic; this.vkApi = vkApi; this.vkApiUtils = vkApiUtils; this.downloader = downloader; this.filesystemTools = filesystemTools; this.queueProvider = queueProvider; this.wallHandler = wallHandler; this.audioHandler = audioHandler; this.photoHandler = photoHandler; }
public WallHandler(VkApiUtils vkApiUtils, FilesystemTools filesystemTools, IHandler <Post> postHandler) : base(filesystemTools) { this.vkApiUtils = vkApiUtils; this.postHandler = postHandler; }
protected HandlerBase(FilesystemTools filesystemTools) { this.filesystemTools = filesystemTools; }
public static async Task SaveHumanReadableText(this IReadOnlyList <Comment> comments, FilesystemTools filesystemTools, DirectoryInfo dir, CancellationToken token, ILog log) { var data = string.Join("\n\n", comments.Select(c => c.Serialize())); var textFile = filesystemTools.CreateFile(dir, $"comments.txt", CreateMode.OverwriteExisting); await File.WriteAllTextAsync(textFile.FullName, data, token); }
public CommentHandler(FilesystemTools filesystemTools, AttachmentProcessor attachmentProcessor) : base(filesystemTools) { this.attachmentProcessor = attachmentProcessor; }
public PhotoHandler(VkApiUtils vkApiUtils, FilesystemTools filesystemTools, IHandler <AlbumWithPhoto> albumHandler) : base(filesystemTools) { this.vkApiUtils = vkApiUtils; this.albumHandler = albumHandler; }
public CommentsHandler(VkApiUtils vkApiUtils, FilesystemTools filesystemTools, IHandler <Comment> commentHandler) : base(filesystemTools) { this.vkApiUtils = vkApiUtils; this.commentHandler = commentHandler; }
public PostHandler(FilesystemTools filesystemTools, AttachmentProcessor attachmentProcessor, CommentsHandler commentsHandler) : base(filesystemTools) { this.attachmentProcessor = attachmentProcessor; this.commentsHandler = commentsHandler; }
public void IsDirectory_should_Throw_when_entry_missing() { Executing.This(() => FilesystemTools.IsDirectory(Path.Combine(TestRoot, "nothing"))) .Should().Throw <FileNotFoundException>(); }
public void Exists_should_check_missing_items() { var missing = FilesystemTools.Exists(Path.Combine(TestRoot, "nothing")); missing.Should().Be.False(); }
public AudioHandler(VkApiUtils vkApiUtils, FilesystemTools filesystemTools, IHandler <PlaylistWithAudio> playlistHandler) : base(filesystemTools) { this.vkApiUtils = vkApiUtils; this.playlistHandler = playlistHandler; }