4 using System.Xml.Serialization;
5 using DirectOutput.General.Generic;
7 namespace DirectOutput.Cab.Out
16 #region IXmlSerializable implementation
22 public void WriteXml(XmlWriter writer)
25 XmlSerializerNamespaces Namespaces =
new XmlSerializerNamespaces();
26 Namespaces.Add(
string.Empty,
string.Empty);
29 XmlSerializer serializer =
new XmlSerializer(OC.GetType());
30 serializer.Serialize(writer, OC, Namespaces);
40 public void ReadXml(XmlReader reader)
42 if (reader.IsEmptyElement)
44 reader.ReadStartElement();
48 General.TypeList Types =
new General.TypeList(AppDomain.CurrentDomain.GetAssemblies().ToList().SelectMany(s => s.GetTypes()).Where(p => typeof(
IOutputController).IsAssignableFrom(p) && !p.IsAbstract));
52 while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
54 Type T = Types[reader.LocalName];
57 XmlSerializer serializer =
new XmlSerializer(T);
59 if (!Contains(O.
Name))
70 reader.ReadEndElement();
78 public System.Xml.Schema.XmlSchema
GetSchema() {
return (null); }
89 Log.
Debug(
"Initializing output controllers");
94 Log.
Debug(
"Output controllers initialized");
102 Log.
Debug(
"Finishing output controllers");
107 Log.
Debug(
"Output controllers finished");