comparison Implab.Playground/Program.cs @ 270:ade80d94dfb5 v3

Working on Unity container xml configuration
author cin
date Wed, 25 Apr 2018 04:44:40 +0300
parents ff581cff7003
children d4d437ec4483
comparison
equal deleted inserted replaced
269:ff581cff7003 270:ade80d94dfb5
11 public class Foo { 11 public class Foo {
12 12
13 public class Bar { 13 public class Bar {
14 14
15 } 15 }
16
17 public string Name { get; set; }
16 18
17 public int IntValue { get; set; } 19 public int IntValue { get; set; }
18 20
19 public string StringValue { get; set; } 21 public string StringValue { get; set; }
20 22
28 public Container(T instance) { 30 public Container(T instance) {
29 Instance = instance; 31 Instance = instance;
30 } 32 }
31 33
32 public T Instance { get; set; } 34 public T Instance { get; set; }
35
36 public void SetInstance(T value) {
37 Instance = value;
38 }
33 } 39 }
34 40
35 public class Program { 41 public class Program {
36 42
37 static void Main(string[] args) { 43 static void Main(string[] args) {
38 var container = new UnityContainer(); 44 var container = new UnityContainer();
39 45
40 var conf = SerializationHelpers.DeserializeFromFile<ContainerElement>("data/sample.xml"); 46 var conf = SerializationHelpers.DeserializeFromFile<ContainerElement>("data/sample.xml");
41 47
42 Console.WriteLine($"Registrations: {conf.Registrations.Count}"); 48 Console.WriteLine($"Registrations: {conf.Items.Count}");
43 49
44 } 50 }
45 51
46 52
47 } 53 }