예제 #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());
     }
 }
예제 #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>()));
     }
 }
예제 #3
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());
     }
 }
예제 #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>()));
     }
 }