4 using System.Xml.Serialization;
17 #region IXmlSerializable implementation
18 public void WriteXml(XmlWriter writer)
26 XmlSerializerNamespaces Namespaces =
new XmlSerializerNamespaces();
27 Namespaces.Add(
string.Empty,
string.Empty);
30 XmlSerializer serializer =
new XmlSerializer(E.GetType());
31 serializer.Serialize(writer, E, Namespaces);
43 if (reader.IsEmptyElement)
45 reader.ReadStartElement();
49 General.TypeList Types =
new General.TypeList(AppDomain.CurrentDomain.GetAssemblies().ToList().SelectMany(s => s.GetTypes()).Where(p => typeof(
IEffect).IsAssignableFrom(p) && !p.IsAbstract));
53 while (reader.NodeType !=
System.Xml.XmlNodeType.EndElement)
55 Type T = Types[reader.LocalName];
58 XmlSerializer serializer =
new XmlSerializer(T);
60 if (!Contains(E.
Name))
71 reader.ReadEndElement();
86 foreach (
IEffect Effect
in this)
96 public void Init(Table.Table Table)
98 foreach (
IEffect Effect
in this)
void Finish()
Calls Finish on all IEffect objects in the list.
void Init(Table.Table Table)
Calls Init on all IEffect objects in the list.
new string Name
Name of the effect.
void Init(Table.Table Table)
Init must do all necessary initialization work after the IEffect object has been instanciated.
void ReadXml(XmlReader reader)
Deserializes the IEffect objects in the XmlReader The IEffect objects are deserialized using the obje...
Common interface for all effects. If a new effect is implemented it is best to inherit from the abst...
void Finish()
Finish must do all necessary cleanupwork before a IEffect object is discarded.
A list of uniquely named items which can be referenced by their name.
The namespace DirectOutput.General contains classes for general use.
System.Xml.Schema.XmlSchema GetSchema()
Method is required by the IXmlSerializable interface
EffectList()
Initializes a new instance of the EffectList class.
Collection of IEffect objects. Every object can only exist once in the list and every objects needs t...