##// END OF EJS Templates
Added test for TraceRegistry
Added test for TraceRegistry

File last commit:

r287:78da52bb28f0 v3
r287:78da52bb28f0 v3
Show More
Program.cs
45 lines | 953 B | text/x-csharp | CSharpLexer
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Dynamic;
using System.Linq;
using Implab.Components;
using Implab.Diagnostics;
using Implab.ServiceHost.Unity;
using Implab.Xml;
using Unity;
using Unity.Injection;
using Unity.Registration;
namespace Implab.Playground {
using static Trace<Bar>;
class Foo {
}
class Bar : Foo {
}
public class Program {
static void Main(string[] args) {
Trace<Foo>.Log("First!");
Log("+1!");
using(TraceRegistry.Global.Subscribe(x => {
var ch = x as TraceSourceChannel;
if (ch == null)
return;
Console.WriteLine($"{ch.Id}: {ch.Source.Name}");
}, true)) {
Trace<Foo>.Log("Hi!");
Log("Respect!");
}
}
}
}