paulcbetts/SaveAllTheTime — pull request #28 by davemckeown (2013-10-04 21:24:32+00:00)
Title: Fix for Issues #19 and #25

This *should* fix issues #19 and #25 without breaking anything else. I think it may also solve issue #20, but I am not familiar with the details of TFS Work Items.

For issue #19 - if the active document is a resx file then the SaveAll method returns before saving documents. I added an event handler to EnvDTE.Events.WindowEvents.WindowActivated to call RaiseChanged when switching documents, this triggers a Save on the resx file as soon as the resx file is no longer the ActiveDocument.

For issue #25 - I added a call to ShouldSaveActiveDocument in the SaveAll, this checks to see if the ActiveDocument is a project item. Project items will never prompt for a SaveAs, so this should be the same as checking to see if a file has been saved at least once. I could not find anything in the VS API that indicates a file state of NEW/UNSAVED, maybe there is something in the DocumentMonitorService but I am not familiar with it. I *think* this also fixes issue #20 but I do not have TFS to test with.

Feel free to comment on any potential issues with the implementation, or code/style issues, I will do my best to fix any issues. I've been using a build of this PR today and its working for me, tested with R# 8.0.1 on VS2012 on Windows 7