<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>XNA Framework</title><link>http://forums.xna.com/forums/56.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: Using DefaultValueAttribute with XNA's Color / Vector2, etc.</title><link>http://forums.xna.com/forums/thread/169337.aspx</link><pubDate>Sat, 25 Apr 2009 23:55:51 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:169337</guid><dc:creator>bryanedds</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/169337.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=56&amp;PostID=169337</wfw:commentRss><description>I think I&amp;#39;m going to try overriding some behavior of XmlReader / Writer for the Color items.&lt;br /&gt;</description></item><item><title>Re: Using DefaultValueAttribute with XNA's Color / Vector2, etc.</title><link>http://forums.xna.com/forums/thread/169332.aspx</link><pubDate>Sat, 25 Apr 2009 23:47:35 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:169332</guid><dc:creator>thecray</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/169332.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=56&amp;PostID=169332</wfw:commentRss><description>There is a built in way, it&amp;#39;s called the IntermediateSerializer, it&amp;#39;s linked in Shawn&amp;#39;s post.&lt;br /&gt;
Using that will allow you to define Vector3&amp;#39;s as just &amp;lt;SomeVector&amp;gt;1 2 3&amp;lt;/SomeVector&amp;gt;, as well as most other XNA types. This can then be compiled in to a binary format using a content writer, which means it will load a hell of a lot faster in your game.&lt;br /&gt;
&lt;br /&gt;
It will also allow you to set the [ContentSerializerIgnore] option on any properties which you do not wish to be contained in your .xml, and [ContentSerializer(Optional = true)] on any properties which you want to be serialized, but not necessarily required. This will allow you to then define default values in the constructor of your object.</description></item><item><title>Re: Using DefaultValueAttribute with XNA's Color / Vector2, etc.</title><link>http://forums.xna.com/forums/thread/169231.aspx</link><pubDate>Sat, 25 Apr 2009 17:58:29 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:169231</guid><dc:creator>bryanedds</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/169231.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=56&amp;PostID=169231</wfw:commentRss><description>Yes, I&amp;#39;m using the XmlSerializer and the duplicated values are really hurting my document load / save times.&lt;br /&gt;
&lt;br /&gt;
If there&amp;#39;s no in-built way to fix this, can you think of a work-around I might try?&lt;br /&gt;
&lt;br /&gt;
Thanks Shawn!&lt;br /&gt;</description></item><item><title>Re: Using DefaultValueAttribute with XNA's Color / Vector2, etc.</title><link>http://forums.xna.com/forums/thread/169211.aspx</link><pubDate>Sat, 25 Apr 2009 17:04:00 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:169211</guid><dc:creator>Shawn Hargreaves</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/169211.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=56&amp;PostID=169211</wfw:commentRss><description>What serializer are you using to create this XML?&lt;br /&gt;
&lt;br /&gt;
From the way this is including both the R/G/B/A properties and the PackedValue, I would guess you&amp;#39;re using XmlSerializer? That doesn&amp;#39;t properly support the XNA Framework math types, so you will get this kind of duplication in the output XML.&lt;br /&gt;
&lt;br /&gt;
The Content Pipeline IntermediateSerializer class does know how to efficiently serialize all our math classes. &lt;a href="http://www.talula.demon.co.uk/blogindex.html#intermediateserializer"&gt;Details here&lt;/a&gt;.&lt;br /&gt;</description></item><item><title>Using DefaultValueAttribute with XNA's Color / Vector2, etc.</title><link>http://forums.xna.com/forums/thread/169170.aspx</link><pubDate>Sat, 25 Apr 2009 14:16:20 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:169170</guid><dc:creator>bryanedds</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/169170.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=56&amp;PostID=169170</wfw:commentRss><description>Hi all!&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;ve been looking for a way to use the [DefaultValue] attribute on XNA&amp;#39;s Color, Vector2, 3, etc. I tried pretty much everything with the attribute&amp;#39;s overloads, but nothing seemed to work. It&amp;#39;s really bad that like half of my .xml documents are a bunch of these -&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;R&amp;gt;255&amp;lt;/R&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;G&amp;gt;255&amp;lt;/G&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;B&amp;gt;255&amp;lt;/B&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;A&amp;gt;255&amp;lt;/A&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PackedValue&amp;gt;4294967295&amp;lt;/PackedValue&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Color&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- over and over again.&lt;br /&gt;
&lt;br /&gt;
Any ideas?&lt;br /&gt;</description></item></channel></rss>