private void GetFileStatistics(TestDocument doc, string filePath) { FileAnalyzer analyzer = FileAnalyzerFactory.Create(filePath); DocumentProperties stats = analyzer.GetProperties(); doc.Pages = stats.Pages; doc.Author = stats.Author; doc.Application = stats.Application; doc.FileSize = stats.FileSize; doc.Orientation = (stats.Orientation ?? Framework.Documents.Orientation.Portrait).ToString(); }
private static void watcher_FoundFile(object sender, FileSystemEventArgs e) { Thread.Sleep(TimeSpan.FromSeconds(1)); Console.WriteLine("Found file: " + e.FullPath); ValidationResult result = FileAnalyzerFactory.Create(e.FullPath).Validate(); if (result.Success == false) { DoNotifications(e.FullPath, result.Result); } }
/// <summary> /// Initializes a new instance of the <see cref="OutputProcessor"/> class. /// </summary> /// <param name="filePath">The file to be processed by this <see cref="OutputProcessor"/> instance.</param> public OutputProcessor(string filePath) { _analyzer = FileAnalyzerFactory.Create(filePath); }