private void ReadConfiguration(EmailLoggerConfiguration configuration) { if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } if (!configuration.IsEnough()) { throw new ArgumentException("Configuration is incorrect", nameof(configuration)); } Login = configuration.Login; Password = configuration.Password; Subject = configuration.Subject; Sender = configuration.Sender; Receivers = configuration.Receivers; SmtpHost = configuration.SmtpHost; SmptPort = configuration.SmptPort; ReportPeriod = configuration.ReportPeriod; FlushLevel = configuration.FlushLevel; SendEmptyReports = configuration.SendEmptyReports; MaxQueueSize = configuration.MaxQueueSize; }
public EmailLogger(LogLevel level, EmailLoggerConfiguration configuration) { Level = level; ReadConfiguration(configuration); }
public EmailLogger(EmailLoggerConfiguration configuration) { Level = Logger.Level; ReadConfiguration(configuration); }