annotate 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
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
269
ff581cff7003 Working on Unity container xml configuration
cin
parents: 267
diff changeset
11 public List<IConfigurationElement> Registrations {get; set; } = new List<IConfigurationElement>();
267
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) {
269
ff581cff7003 Working on Unity container xml configuration
cin
parents: 267
diff changeset
19 var registration = ConfigurationSchema.Default.Deserialize<IConfigurationElement>(reader);
267
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 }