4 using System.Xml.Serialization;
16 #region IXmlSerializable implementation
17 public void WriteXml(XmlWriter writer)
25 XmlSerializerNamespaces Namespaces =
new XmlSerializerNamespaces();
26 Namespaces.Add(
string.Empty,
string.Empty);
29 XmlSerializer serializer =
new XmlSerializer(E.GetType());
30 serializer.Serialize(writer, E, Namespaces);
42 if (reader.IsEmptyElement)
44 reader.ReadStartElement();
47 General.TypeList Types =
new General.TypeList(AppDomain.CurrentDomain.GetAssemblies().ToList().SelectMany(s => s.GetTypes()).Where(p => typeof(
IOutput).IsAssignableFrom(p) && !p.IsAbstract));
51 while (reader.NodeType !=
System.Xml.XmlNodeType.EndElement)
53 Type T = Types[reader.LocalName];
56 XmlSerializer serializer =
new XmlSerializer(T);
58 if (!Contains(O.
Name))
69 reader.ReadEndElement();
85 #region Event handling
87 void OutputList_BeforeClear(
object sender, EventArgs e)
97 e.
Item.ValueChanged -=
new Output.ValueChangedEventHandler(Item_ValueChanged);
102 e.
Item.ValueChanged +=
new Output.ValueChangedEventHandler(Item_ValueChanged);
107 e.
OldItem.ValueChanged -=
new Output.ValueChangedEventHandler(Item_ValueChanged);
108 e.
NewItem.ValueChanged +=
new Output.ValueChangedEventHandler(Item_ValueChanged);
111 void Item_ValueChanged(
object sender, OutputEventArgs e)
113 OnOutputValueChanged(e.Output);
118 #region ValueChanged Event
127 if (OutputValueChanged != null)
143 public delegate
void OutputValueChangedEventHandler(
object sender,
OutputEventArgs e);
155 this.AfterInsert +=
new EventHandler<InsertEventArgs<IOutput>>(OutputList_AfterInsert);
156 this.AfterRemove +=
new EventHandler<RemoveEventArgs<IOutput>>(OutputList_AfterRemove);
157 this.AfterSet +=
new EventHandler<SetEventArgs<IOutput>>(OutputList_AfterSet);
158 this.BeforeClear +=
new EventHandler<EventArgs>(OutputList_BeforeClear);
Ty Item
The value of the Item to remove from index.
Event args for Set events.
OutputList()
Initializes a new instance of the OutputList class.
OutputValueChangedEventHandler OutputValueChanged
Event fires if the value of any IOutput in the list has changed.
void ReadXml(XmlReader reader)
Deserializes the IOutput objects in the XmlReader. The IOutput objects are deserialized using the ob...
Ty NewItem
New item for the replacement.
Output.ValueChangedEventHandler ValueChanged
This event has to fire if the Value of the output is changed
Ty Item
The new value of the element at Index.
EventErgs for remove events
delegate void ValueChangedEventHandler(object sender, OutputEventArgs e)
Event handler for ValueChanged events.
string Name
Gets or sets the name of the item. Must fire the BeforeNameChange and AfterNameChange events when th...
System.Xml.Schema.XmlSchema GetSchema()
Method is required by the IXmlSerializable interface.
Common interface for outputs of any output controller. The Output class implements this interface and...
Ty OldItem
Item to be replaced.
void OnOutputValueChanged(IOutput Output)
Triggers the OutputValueChanged event when called.
EventArgs for events of IOutput objects.
A list of uniquely named items which can be referenced by their name.
Eventargs of BeforeInsert and AfterInsert events.
The namespace DirectOutput.General contains classes for general use.
Basic IOutput implementation.