comparison Implab.ServiceHost/Unity/ContainerElement.cs @ 269:ff581cff7003 v3

Working on Unity container xml configuration
author cin
date Tue, 24 Apr 2018 01:46:02 +0300
parents 6b3e5c48131b
children ade80d94dfb5
comparison
equal deleted inserted replaced
268:0be8a6ae8307 269:ff581cff7003
6 6
7 namespace Implab.ServiceHost.Unity { 7 namespace Implab.ServiceHost.Unity {
8 [XmlRoot("container", Namespace = Schema.ContainerConfigurationNamespace)] 8 [XmlRoot("container", Namespace = Schema.ContainerConfigurationNamespace)]
9 public class ContainerElement : IXmlSerializable { 9 public class ContainerElement : IXmlSerializable {
10 10
11 public List<ServiceElement> Registrations {get; set; } = new List<ServiceElement>(); 11 public List<IConfigurationElement> Registrations {get; set; } = new List<IConfigurationElement>();
12 12
13 public XmlSchema GetSchema() { 13 public XmlSchema GetSchema() {
14 return null; 14 return null;
15 } 15 }
16 16
17 public void ReadXml(XmlReader reader) { 17 public void ReadXml(XmlReader reader) {
18 while(reader.Read() && reader.NodeType != XmlNodeType.EndElement) { 18 while(reader.Read() && reader.NodeType != XmlNodeType.EndElement) {
19 var registration = SerializationHelpers.Deserialize<ServiceElement>(reader); 19 var registration = ConfigurationSchema.Default.Deserialize<IConfigurationElement>(reader);
20 Registrations.Add(registration); 20 Registrations.Add(registration);
21 } 21 }
22 } 22 }
23 23
24 public void WriteXml(XmlWriter writer) { 24 public void WriteXml(XmlWriter writer) {