Esempio n. 1
0
 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());
     }
 }
Esempio n. 2
0
 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());
     }
 }
Esempio n. 4
0
 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>()));
     }
 }