I'm trying to deserialise an XML file which contains a
System.Drawing.Rectangle. In the simulator everything works as expected, on
the device the Height of the rectangle is always 0.

The code is:

using(var stream = new FileStream(path, FileMode.Open, FileAccess.Read,
FileShare.ReadWrite)) {
var serialiser = new XmlSerializer(typeof(T));

return (T) serialiser.Deserialize(stream);
}

Where T is a List<Animation>, with the Animation class having a public
Rectangle property called DrawingRect. The XML looks like this:

<Animation>
<ID>animation.options.gamecentre.active</ID>
<Texture>images/menus/option_menu_elements</Texture>
<DrawingRect>
<X>146</X>
<Y>97</Y>
<Width>72</Width>
<Height>72</Height>
</DrawingRect>
</Animation>

The device is an iPhone 4S running iOS 5.0.1. MonoTouch is the latest
update. This is happening with every rectangle that's being deserialised,
not just this instance. Can anyone shed any light on why the height would
be zero?
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to