[Mono-bugs] [Bug 650385] IXmlSerializable columns aren't deserialised correctly when writing a diffgram

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Nov 7 14:28:38 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=650385

https://bugzilla.novell.com/show_bug.cgi?id=650385#c1


--- Comment #1 from Clinton Volzke <cvolzke at live.com.au> 2010-11-07 19:28:37 UTC ---
Forgot to add this class to the fix:

    internal class XmlDataSerializationHelper
    {
        public static object XmlStringToObject(Type type, string value)
        {
            IXmlSerializable obj =
(IXmlSerializable)Activator2.CreateInstance(type, true);
            using (XmlReader xmlTextReader = XmlReader.Create(new
StringReader(value), new XmlReaderSettings { ConformanceLevel =
ConformanceLevel.Fragment }))
            {
                obj.ReadXml(xmlTextReader);
            }
            return obj;
        }

        public static string ObjectToXmlString(IXmlSerializable obj)
        {
            StringWriter writer = new StringWriter();
            using (XmlWriter xmlWriter = XmlWriter.Create(writer, new
XmlWriterSettings()))
            {
                obj.WriteXml(xmlWriter);
            }
            return writer.ToString();
        }
    }

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list