#if !NET35 namespace TeamCity.VSTest.TestLogger { using System; using System.Collections.Generic; using IoC; using JetBrains.TeamCity.ServiceMessages.Write; using JetBrains.TeamCity.ServiceMessages.Write.Special; using JetBrains.TeamCity.ServiceMessages.Write.Special.Impl.Updater; using MessageWriters; using static IoC.Lifetime; internal class IoCConfiguration: IConfiguration { public IEnumerable Apply(IMutableContainer container) { var autowiringStrategy = AutowiringStrategies.AspectOriented() .Tag(attribute => attribute.Tag); var options = new Options(); yield return container .Bind().To(ctx => autowiringStrategy) .Bind().To() .Bind().As(Singleton).To(ctx => options) .Bind().As(Singleton).To() .Bind().As(Singleton).To() .Bind().Bind().As(Singleton).To() .Bind().To() .Bind().To() .Bind().To() .Bind().To() .Bind().To(ctx => DateTime.Now) .Bind().Tag(typeof(TimestampUpdater)).As(Singleton).To() .Bind().Tag(typeof(MessageBackupUpdater)).As(Singleton).To() .Bind().Tag(typeof(TestInfoUpdater)).As(Singleton).To() .Bind().As(Singleton).To() .Bind().As(Singleton).To() .Bind().As(Singleton).To() .Bind().As(Singleton).To() .Bind().As(Singleton).To(ctx => new MessageWriterFactory(ctx.Container.Inject()).GetMessageWriter()) .Bind().To( ctx => ctx.Container.Inject().CreateWriter( message => ctx.Container.Inject().Write(message), options.FallbackToStdOutTestReporting)); } } } #endif