private static void OnChanged(object sender, FileSystemEventArgs e) { string changedFullPath = e.FullPath; using (IEncoderEngine encoderEngine = EncoderEngine.CreateEncoderEngine(changedFullPath)) { encoderEngine.EncodeToJPG(); } //ISaveFile saveFile = SaveFile.CreateSaveFile(changedFullPath); //saveFile.SaveToArchiveFolder(); }
private static void EncodeAll(string folderName) { string[] filePathsArray = Directory.GetFiles(folderName, "*.bmp"); foreach (string path in filePathsArray) { Console.WriteLine(path); using (IEncoderEngine encoderEngine = EncoderEngine.CreateEncoderEngine(path)) { encoderEngine.EncodeToJPG(); } ISaveFile saveFile = SaveFile.CreateSaveFile(path); saveFile.SaveToArchiveFolder(); } Console.WriteLine("Done Encoding. Click space to exit."); Console.ReadKey(); }
private static void EncodeSingle(string fileName) { if (File.Exists(fileName)) { using (IEncoderEngine encoderEngine = EncoderEngine.CreateEncoderEngine(fileName)) { encoderEngine.EncodeToJPG(); } ISaveFile saveFile = SaveFile.CreateSaveFile(fileName); saveFile.SaveToArchiveFolder(); Console.WriteLine("Done encoding file: " + fileName); Console.ReadKey(); } else { Console.WriteLine("Could not find file: " + fileName); Console.ReadKey(); } }