static void EnsureDefaults(SimpleDependencyResolver dependencyResolver, SmtpAgentSettings settings) { if (!dependencyResolver.IsRegistered <ILogFactory>()) { dependencyResolver.Register <ILogFactory>(new NLogFactory(settings.LogSettings)); } if (!dependencyResolver.IsRegistered <IAuditor>()) { dependencyResolver.Register <IAuditor>(new EventLogAuditor()); } }
static void EnsureDefaults(SimpleDependencyResolver dependencyResolver, SmtpAgentSettings settings) { if (!dependencyResolver.IsRegistered <ILogFactory>()) { dependencyResolver.Register <ILogFactory>(new NLogFactory(settings.LogSettings)); } if (!dependencyResolver.IsRegistered <IAuditor <IBuildAuditLogMessage> >() && !dependencyResolver.IsRegistered <IAuditor>()) { dependencyResolver.Register <IAuditor <IBuildAuditLogMessage> >(new SmtpAgentEventLogAuditor(new EventLogAuditor())); } if (dependencyResolver.IsRegistered <IAuditor>()) { // // wrap legacy IAuditor // dependencyResolver.Register <IAuditor <IBuildAuditLogMessage> >(new SmtpAgentEventLogAuditor(dependencyResolver.Resolve <IAuditor>())); } }
static void EnsureDefaults(SimpleDependencyResolver dependencyResolver, SmtpAgentSettings settings) { if (!dependencyResolver.IsRegistered<ILogFactory>()) { dependencyResolver.Register<ILogFactory>(new NLogFactory(settings.LogSettings)); } if (!dependencyResolver.IsRegistered<IAuditor>()) { dependencyResolver.Register<IAuditor>(new EventLogAuditor()); } }
static void EnsureDefaults(SimpleDependencyResolver dependencyResolver, SmtpAgentSettings settings) { if (!dependencyResolver.IsRegistered<ILogFactory>()) { dependencyResolver.Register<ILogFactory>(new NLogFactory(settings.LogSettings)); } if (!dependencyResolver.IsRegistered<IAuditor<IBuildAuditLogMessage>>() && !dependencyResolver.IsRegistered<IAuditor>()) { dependencyResolver.Register<IAuditor<IBuildAuditLogMessage>>(new SmtpAgentEventLogAuditor(new EventLogAuditor())); } if (dependencyResolver.IsRegistered<IAuditor>()) { // // wrap legacy IAuditor // dependencyResolver.Register<IAuditor<IBuildAuditLogMessage>>(new SmtpAgentEventLogAuditor(dependencyResolver.Resolve<IAuditor>())); } }