Loading...
 
Multi-Language Add-In for Visual Studio

Multi-Language Add-In for Visual Studio


Automatic saving .ResX on scan

Hi Phil,

Thanks for the long waited feature on automatically saving .ResX on scan. Really a time saver. The only thing missing now on the same note, is that the .Designer.cs files too pop-up asking user to save them. Do you think you could do the same for .Designer.cs files as you did to .ResX?

Thanks!

caco

Germany

Hi,

Can you try version 4.7x.0041 please? This should no longer prompt to save any files during the controls scan.

However, it will probably save some files unnecessarily.

I will try to explain what is happening. The Add-In scans controls using the Forms-Designer windows (even if they are not visible). If a designer window is already open, then it does not need to open the window. In this case is does not close the window and it does not save any files. If the designer window is not already open, then the Add-In opens the window, and closes it afterwards. In this case, there is no reason why the files should be dirty and even if they are, there is no need to save them. Up to now, the Add-In has therefore closed the window and specified that the files should not be saved.

Opening a designer window may actually open three files: The main .cs/vb file, the .designer.cs/vb file and a .resx file. My guess is that the parameter to not save the file only works for the main .cs/vb file. If either of the other two files are dirty, then Visual Studio always shows a prompt to save the file. In my opinion, this is quite simply an error in Visual Studio.

I have been testing with one of the Infragistics sample projecs, which consistently wants to save some of the .resx file (although I have no idea why).

The change that I have now made, is simply to specify that dirty files should be saved (instead of not saved). You will probably see the mouse pointer change when it does this. I am not at all happy with this change, but it does seem better than showing repeated prompts so save files during the scan.

(Actually, I hate programs that make unnecessary changes to files, in particular if you can't really determine what has been changed.)

Phil

Hi Phil,

Just tested .41 and it now hangs on Rescan Project on a form that needs all three (.cs, .Designer.cs and .resX) files "changed". It's "processing" (wheel icon on Win7), and has no CPU activity whatsoever. It did checkout a few before, including one need the three files (some require only the .ResX, others both .cs and .resX).. I'll try to restart VS and try again.

I assumed that was the problem, as I've encountered it in the past when opening and then closing a form without changes (VS thinks it's changed and asks for saving files)..

I agree that's not the best behavior, but given the circumstances, I guess it's the best option anyway.

For me it's not that much of a hassle, because everything is in source control, so I can always check, if necessary why was the form changed..

Thanks again for the fast response,
caco

Hi Phil,

After some tests, I've found the problem to be with the Form itself. It looks like something VS did, not related to multi-language. It is a .NET 1.1 upgraded form (no .Design.Cs) which was manually converted to a partial class, so maybe there's something not done right there...

The translation tool works great, and no problems scanning controls and not having them pop-up for save confirmation. Please don't read the first paragraph of last message.. ;)

Regards,
caco