public override object GetValue(IBuilderContext context)
            {
                DependencyResolutionLocatorKey key = new DependencyResolutionLocatorKey(typeof(ITraceSourceCatalogService), null);
                ITraceSourceCatalogService     svc = (ITraceSourceCatalogService)context.Locator.Get(key);

                return(svc != null?svc.GetTraceSource(sourceName) : null);
            }
示例#2
0
        public void TraceSourceIsInjected()
        {
            WorkItem container               = new TestableRootWorkItem();
            ITraceSourceCatalogService ts    = container.Services.Get <ITraceSourceCatalogService>();
            TestEventTopic             topic = new TestEventTopic();

            workItem.EventTopics.Add(topic);

            Assert.IsFalse(String.IsNullOrEmpty(topic.TraceSourceName));
        }