annotate Implab.Playground/Program.cs @ 269:ff581cff7003 v3

Working on Unity container xml configuration
author cin
date Tue, 24 Apr 2018 01:46:02 +0300
parents 0be8a6ae8307
children ade80d94dfb5
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;
268
0be8a6ae8307 Implemented typereference parser
cin
parents: 267
diff changeset
2 using System.Diagnostics;
0be8a6ae8307 Implemented typereference parser
cin
parents: 267
diff changeset
3 using Implab.Diagnostics;
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
4 using Implab.ServiceHost.Unity;
229
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
5 using Implab.Xml;
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
6 using Unity;
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
7 using Unity.Injection;
229
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
8
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
9 namespace Implab.Playground {
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
10
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
11 public class Foo {
269
ff581cff7003 Working on Unity container xml configuration
cin
parents: 268
diff changeset
12
ff581cff7003 Working on Unity container xml configuration
cin
parents: 268
diff changeset
13 public class Bar {
ff581cff7003 Working on Unity container xml configuration
cin
parents: 268
diff changeset
14
ff581cff7003 Working on Unity container xml configuration
cin
parents: 268
diff changeset
15 }
ff581cff7003 Working on Unity container xml configuration
cin
parents: 268
diff changeset
16
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
17 public int IntValue { get; set; }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
18
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
19 public string StringValue { get; set; }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
20
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
21 }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
22
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
23 public class Container<T> {
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
24 public Container() {
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
25
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
26 }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
27
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
28 public Container(T instance) {
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
29 Instance = instance;
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
30 }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
31
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
32 public T Instance { get; set; }
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
33 }
255
b00441e04738 Adde workaround to the behaviour of the logical operations stack in conjuction
cin
parents: 236
diff changeset
34
229
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
35 public class Program {
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
36
255
b00441e04738 Adde workaround to the behaviour of the logical operations stack in conjuction
cin
parents: 236
diff changeset
37 static void Main(string[] args) {
267
6b3e5c48131b Working on Unity xml configuration
cin
parents: 260
diff changeset
38 var container = new UnityContainer();
255
b00441e04738 Adde workaround to the behaviour of the logical operations stack in conjuction
cin
parents: 236
diff changeset
39
269
ff581cff7003 Working on Unity container xml configuration
cin
parents: 268
diff changeset
40 var conf = SerializationHelpers.DeserializeFromFile<ContainerElement>("data/sample.xml");
233
d6fe09f5592c Improved AsyncQueue
cin
parents: 229
diff changeset
41
269
ff581cff7003 Working on Unity container xml configuration
cin
parents: 268
diff changeset
42 Console.WriteLine($"Registrations: {conf.Registrations.Count}");
268
0be8a6ae8307 Implemented typereference parser
cin
parents: 267
diff changeset
43
233
d6fe09f5592c Improved AsyncQueue
cin
parents: 229
diff changeset
44 }
229
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
45
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
46
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
47 }
5f7a3e1d32b9 JsonXmlReader performance tuning
cin
parents:
diff changeset
48 }