Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Globalizer screwing up XAML formatting

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  
Author Message
Dierk Droth



Joined: 16 Nov 2010
Posts: 27

PostPosted: Fri Dec 03, 2010 12:01 pm    Post subject: Globalizer screwing up XAML formatting Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Dec 06, 2010 10:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
gunters63



Joined: 25 Jan 2011
Posts: 21

PostPosted: Tue Jan 25, 2011 3:31 pm    Post subject: Reply with quote

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" Smile

Regards,
Gunter
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Jan 25, 2011 11:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Jul 22, 2011 3:47 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group