View previous topic :: View next topic |
Author |
Message |
Dierk Droth
Joined: 16 Nov 2010 Posts: 27
|
Posted: Fri Dec 03, 2010 12:01 pm Post subject: Globalizer screwing up XAML formatting |
|
|
On editing XAML files Globalizer screws up the formatting and applies it own formatting style.
Is there a way to maintain the existing formatting so Globalizer would not overwrite/change it?
Thanks |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Dec 06, 2010 10:02 pm Post subject: |
|
|
Globalizer.NET uses the standard Microsoft XmlDocument class to read and modify the XAML. Unfortunately this does not give options for preserving the existing formatting.
You could turn off the Globalizer.NET "Convert WPF Windows to use ResxExtension" option when scanning - however then you would have to code the XAML to use the Resx extension by hand. _________________ Infralution Support |
|
Back to top |
|
|
gunters63
Joined: 25 Jan 2011 Posts: 21
|
Posted: Tue Jan 25, 2011 3:31 pm Post subject: |
|
|
I have a similar problem.
For my XAML files i have set the following option in Visual Studio 2010:
Options/Text Editor/XAML/Formatting/Spacing: Check at "Position each attribute on a separate line".
I always auto-format my XAML files with these settings because they are easier to read and changes are easier to track this way (at least for me).
Now whenever Globalizer.NET rewrites this file all attributes are merged back onto one line again. I don't really care about other custom formatting but this one forces me to reformat all XAML files after they have been touched by Globalizer.NET.
Now if you use the standard Microsoft XmlDocument you could use the "WriteTo" overload which enables the use of an XmlWriter (if you are not already doing so). The XmlWriter has an XmlWriterSetting property which enables limited formatting abilities for writing XML, for example "Ident" and "NewLineOnAttributes". The latter would write all attributes on a new line when set.
Probably you could support the limited Xml formatting capabilities there. The user could be able to set those option globally unter Tools/Options/XML Formatting or alternatively under target Properties.
That would already be a big help for me and probably others.
I should probably have posted this under "Feature requests"
Regards,
Gunter |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Jan 25, 2011 11:27 pm Post subject: |
|
|
Yes that's a good suggestion - we will look at adding that feature for the next major release of Globalizer.NET. _________________ Infralution Support |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Jul 22, 2011 3:47 am Post subject: |
|
|
Version 3 of Globalizer has now been released and includes options for controlling XML formatting when Globalizer writes XAML files.
See the Release Announcement for more details. _________________ Infralution Support |
|
Back to top |
|
|
|