コード例 #1
0
ファイル: EmailLogger.cs プロジェクト: masums/ITCC.Library
        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;
        }
コード例 #2
0
ファイル: EmailLogger.cs プロジェクト: masums/ITCC.Library
 public EmailLogger(LogLevel level, EmailLoggerConfiguration configuration)
 {
     Level = level;
     ReadConfiguration(configuration);
 }
コード例 #3
0
ファイル: EmailLogger.cs プロジェクト: masums/ITCC.Library
 public EmailLogger(EmailLoggerConfiguration configuration)
 {
     Level = Logger.Level;
     ReadConfiguration(configuration);
 }