annotate Implab.ServiceHost/Unity/ContainerElement.cs @ 267:6b3e5c48131b v3

Working on Unity xml configuration
author cin
date Fri, 20 Apr 2018 19:05:12 +0300
parents
children ff581cff7003
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
267
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
1 using Implab.Xml;
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
2 using System.Collections.Generic;
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
3 using System.Xml;
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
4 using System.Xml.Schema;
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
5 using System.Xml.Serialization;
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
6
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
7 namespace Implab.ServiceHost.Unity {
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
8 [XmlRoot("container", Namespace = Schema.ContainerConfigurationNamespace)]
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
9 public class ContainerElement : IXmlSerializable {
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
10
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
11 public List<ServiceElement> Registrations {get; set; } = new List<ServiceElement>();
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
12
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
13 public XmlSchema GetSchema() {
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
14 return null;
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
15 }
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
16
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
17 public void ReadXml(XmlReader reader) {
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
18 while(reader.Read() && reader.NodeType != XmlNodeType.EndElement) {
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
19 var registration = SerializationHelpers.Deserialize<ServiceElement>(reader);
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
20 Registrations.Add(registration);
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
21 }
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
22 }
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
23
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
24 public void WriteXml(XmlWriter writer) {
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
25 throw new System.NotImplementedException();
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
26 }
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
27 }
6b3e5c48131b Working on Unity xml configuration
cin
parents:
diff changeset
28 }