ligershark/AzureJobs — pull request #41 by philoushka (2014-08-03 22:16:31+00:00)
Title: Move shared code into base classes; implement listen switch for ImgCompressor and TxtMin.

TextMinifier and ImageCompressor appeared to have the same basic structure, similar methods, etc. If you like, I've refactored to include:

- move app functionality to a Mgr class (an unimaginative name) from `Program.cs`, resulting in skinny `Program.cs` classes.
- move common functionality into a base class in Common proj: setting up logging, caching, cmd line help generation, queueing, and filesystem watching.
- define an interface with common methods that both apps' Mgr classes should implement; different implementation that makes more sense for an interface rather than 2 implementations in the base class.
- allow both programs to be quit with Enter key. Previously would have to be quit. both TxtMin and ImgComp will use the `--listen` cmd line arg to run until user hits Enter. If `--listen` is set, the app will sleep for 1 sec, check whether Enter key was pressed. If not pressed, then process queue. If pressed, exit.
If `--listen` isn't set, the program will exit after first run.
- added the Renamed event to the fileSystemWatcher to include files that get dropped and subsequently renamed.
- left ImgComp `StartAsAzureJob()` alone as much as possible. The only significant change I made here is that the csv report will be dropped in the dir of images, and not in app_data as previously coded. Reason was that the AzureJob method was implemented differently as the cmdline method, so it wasn't clear whether `app_data` was a hard dependency. I searched through the solution, and didn't find that to be the case. Let me know what you think on this. I found [one potential reference that may be impacted](http://i.imgur.com/LfIHaO3.png). I wasn't sure how impactful, as TextMin has the same. So please let me know if this is impactful.

If there's anything I went too far on, or anything confusing, or anything I can adjust, please let me know!