annotate Implab.Playground/Program.cs @ 267:6b3e5c48131b v3

Working on Unity xml configuration
author cin
date Fri, 20 Apr 2018 19:05:12 +0300
parents 547a2fc0d93e
children 0be8a6ae8307
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
1 using System;
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
2 using Implab.ServiceHost.Unity;
229
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
3 using Implab.Xml;
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
4 using Unity;
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
5 using Unity.Injection;
229
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
6
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
7 namespace Implab.Playground {
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
8
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
9 public class Foo {
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
10 public int IntValue { get; set; }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
11
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
12 public string StringValue { get; set; }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
13
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
14 }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
15
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
16 public class Container<T> {
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
17 public Container() {
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
18
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
19 }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
20
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
21 public Container(T instance) {
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
22 Instance = instance;
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
23 }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
24
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
25 public T Instance { get; set; }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
26 }
255
b00441e04738 Adde workaround to the behaviour of the logical operations stack in conjuction
cin
parents: 236
diff changeset
27
229
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
28 public class Program {
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
29
255
b00441e04738 Adde workaround to the behaviour of the logical operations stack in conjuction
cin
parents: 236
diff changeset
30 static void Main(string[] args) {
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
31 var container = new UnityContainer();
255
b00441e04738 Adde workaround to the behaviour of the logical operations stack in conjuction
cin
parents: 236
diff changeset
32
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
33 var containerConfig = SerializationHelpers.DeserializeFromFile<ContainerElement>("data/sample.xml");
233
d6fe09f5592c Improved AsyncQueue
cin
parents: 229
diff changeset
34
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
35 Console.WriteLine($"container: {containerConfig.Registrations.Count}");
233
d6fe09f5592c Improved AsyncQueue
cin
parents: 229
diff changeset
36 }
229
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
37
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
38
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
39 }
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
40 }