##// END OF EJS Templates
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)...
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete) Implab.ServiceHost: rewritten TypeReference (added support for nested types), stable API

File last commit:

r278:6691aff01de1 v3
r278:6691aff01de1 v3
Show More
Program.cs
136 lines | 3.9 KiB | text/x-csharp | CSharpLexer
cin
Working on Unity xml configuration
r267 using System;
cin
Refactoring...
r277 using System.Collections.Generic;
cin
Implemented typereference parser
r268 using System.Diagnostics;
cin
preview version of Unity xml configuration
r272 using System.Linq;
cin
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)...
r278 using Implab.Components;
cin
Implemented typereference parser
r268 using Implab.Diagnostics;
cin
Working on Unity xml configuration
r267 using Implab.ServiceHost.Unity;
cin
JsonXmlReader performance tuning...
r229 using Implab.Xml;
cin
Working on Unity xml configuration
r267 using Unity;
using Unity.Injection;
cin
preview version of Unity xml configuration
r272 using Unity.Registration;
cin
JsonXmlReader performance tuning...
r229
namespace Implab.Playground {
cin
Working on Unity xml configuration
r267
public class Foo {
cin
Working on Unity container xml configuration
r269
public class Bar {
}
cin
Working on Unity container xml configuration
r270 public string Name { get; set; }
cin
Working on Unity xml configuration
r267 public int IntValue { get; set; }
public string StringValue { get; set; }
cin
Refactoring...
r277 public void AddRange(Foo[] items) {
Console.WriteLine($"AddRange: Foo[]");
}
cin
Working on Unity xml configuration
r267 }
cin
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)...
r278 public class FooFactory : IFactory<Foo>, IFactory<Foo.Bar> {
public bool UseSsl { get; set; }
public string Connection { get; set; }
public Foo Create() {
return new Foo() {
Name = "AutoFac"
};
}
Foo.Bar IFactory<Foo.Bar>.Create() {
return new Foo.Bar();
}
}
cin
preview version of Unity xml configuration
r272 public interface IContainer<T> {
T Instance { get; set; }
}
public class Container<T> : IContainer<T> {
cin
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)...
r278 public class Bar {
}
public class Bar<T2> {
public class Baz {
}
}
cin
Working on Unity xml configuration
r267 public Container() {
}
public Container(T instance) {
Instance = instance;
}
public T Instance { get; set; }
cin
Working on Unity container xml configuration
r270
public void SetInstance(T value) {
Instance = value;
}
cin
Refactoring...
r277
public void AddRange(List<T> items) {
Console.WriteLine($"AddRange: {typeof(List<T>)}");
}
public void AddRange(T[] items) {
Console.WriteLine($"AddRange: T[] ofType {typeof(T[])}");
}
cin
Working on Unity xml configuration
r267 }
cin
Adde workaround to the behaviour of the logical operations stack in conjuction...
r255
cin
JsonXmlReader performance tuning...
r229 public class Program {
cin
Adde workaround to the behaviour of the logical operations stack in conjuction...
r255 static void Main(string[] args) {
cin
Refactoring...
r277 var listener = new SimpleTraceListener(Console.Out);
var source = Trace<TypeResolver>.TraceSource;
source.Switch.Level = SourceLevels.All;
source.Listeners.Add(listener);
cin
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)...
r278 var resolver = new TypeResolver();
resolver.AddNamespace("System");
resolver.AddNamespace("System.Collections.Generic");
resolver.AddNamespace("Implab.Playground");
resolver.AddMapping("string", typeof(string));
resolver.AddMapping("listOf`1", typeof(List<>));
cin
Working on Unity xml configuration: Refactoring in progress
r273
cin
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)...
r278 var spec = TypeReference.Parse("Container{listOf{string}}+Bar{List{string}}");
cin
Working on Unity xml configuration: Refactoring in progress
r273
cin
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)...
r278 var t = resolver.Resolve(spec, true);
cin
Refactoring...
r277
cin
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)...
r278 Console.WriteLine("{0}", t);
Console.WriteLine("Spec: {0}", spec);
Console.WriteLine("IsGenericType: {0}", t.IsGenericType);
Console.WriteLine("IsGenericTypeDefinition: {0}", t.IsGenericTypeDefinition);
Console.WriteLine("ContainsGenericParameters: {0}", t.ContainsGenericParameters);
cin
preview version of Unity xml configuration
r272 }
cin
Implemented typereference parser
r268
cin
preview version of Unity xml configuration
r272 static void DisplayContainerRegistrations(IUnityContainer theContainer) {
string regName, regType, mapTo, lifetime;
Console.WriteLine("Container has {0} Registrations:",
theContainer.Registrations.Count());
foreach (ContainerRegistration item in theContainer.Registrations) {
regType = item.RegisteredType.FullName;
mapTo = item.MappedToType.FullName;
regName = item.Name ?? "[default]";
lifetime = item.LifetimeManager.LifetimeType.Name;
if (mapTo != regType) {
mapTo = " -> " + mapTo;
} else {
mapTo = string.Empty;
}
lifetime = lifetime.Substring(0, lifetime.Length - "LifetimeManager".Length);
Console.WriteLine("+ {0}{1} '{2}' {3}", regType, mapTo, regName, lifetime);
}
cin
Improved AsyncQueue...
r233 }
cin
JsonXmlReader performance tuning...
r229
}
}