예제 #1
0
 void WriteSimpleType(Type type, object val)
 {
     var serializer = new XmlSerializerFactory().CreateSerializer(type);
     XmlSerializerNamespaces xmlnsEmpty = new XmlSerializerNamespaces();
     xmlnsEmpty.Add("", "");
     serializer.Serialize(writer, val, xmlnsEmpty);
 }
예제 #2
0
        void WriteDynamicType(Type type, object val)
        {
            writer.WriteElementString("Type", type.FullName);

            writer.WriteStartElement("Value");
            var serializer = new XmlSerializerFactory().CreateSerializer(type);
            XmlSerializerNamespaces xmlnsEmpty = new XmlSerializerNamespaces();
            xmlnsEmpty.Add("", "");
            serializer.Serialize(writer, val, xmlnsEmpty);
            writer.WriteEndElement();
        }