Ejemplo n.º 1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            scheduler = StdSchedulerFactory.GetDefaultScheduler();
            var customTraceListener = new CustomTraceListener();

            customTraceListener.TraceWriter = this;
            GlobalContainer.Instance.ServiceContainer.Register <ITraceWriter, frmMain>(new PerContainerLifetime());
            GlobalContainer.Instance.ServiceContainer.Initialize(reg => reg.ServiceType == typeof(ITraceWriter), (factory, instance) => instance = this);
            Trace.Listeners.Add(customTraceListener);
        }
Ejemplo n.º 2
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     scheduler = StdSchedulerFactory.GetDefaultScheduler();
     var customTraceListener = new CustomTraceListener();
     customTraceListener.TraceWriter = this;
     GlobalContainer.Instance.ServiceContainer.Register<ITraceWriter, frmMain>(new PerContainerLifetime());
     GlobalContainer.Instance.ServiceContainer.Initialize(reg => reg.ServiceType == typeof(ITraceWriter), (factory, instance) => instance = this);
     Trace.Listeners.Add(customTraceListener);
 }