Пример #1
0
        public ServiceConfig()
        {
            _supportedProperties = ServiceConfigProperty.GetSupportedProperties();

            _intervalInSeconds = (int)_supportedProperties["IntervalInSeconds"].DefaultValue;

            _loggingLevel = SupportedPropertyOption.GetEnumValueForOption <LoggingLevel>(_supportedProperties["LoggingLevel"], _supportedProperties["LoggingLevel"].DefaultValue.ToString());

            _logToDatabase = (bool)_supportedProperties["LogToDatabase"].DefaultValue;

            _daysOfDatabaseLoggingHistory = (int)_supportedProperties["DaysOfDatabaseLoggingHistory"].DefaultValue;

            _logToFile = (bool)_supportedProperties["LogToFile"].DefaultValue;

            _daysOfFileLoggingHistory = (int)_supportedProperties["DaysOfFileLoggingHistory"].DefaultValue;

            _maxLogFileSizeInMB = (int)_supportedProperties["MaxLogFileSizeInMB"].DefaultValue;

            _enableMailNotifications = (bool)_supportedProperties["EnableMailNotifications"].DefaultValue;

            _fromEmailAddress = (string)_supportedProperties["FromEmailAddress"].DefaultValue;

            _toEmailAddresses = (string)_supportedProperties["ToEmailAddresses"].DefaultValue;

            _smtpHost = (string)_supportedProperties["SmtpHost"].DefaultValue;

            _smtpPort = (int)_supportedProperties["SmtpPort"].DefaultValue;

            _smtpRequiresSsl = (bool)_supportedProperties["SmtpRequiresSsl"].DefaultValue;

            _smtpUsername = (string)_supportedProperties["SmtpUsername"].DefaultValue;

            _smtpPassword = (string)_supportedProperties["SmtpPassword"].DefaultValue;
        }
Пример #2
0
        public ServiceConfig(int intervalInSeconds, LoggingLevel loggingLevel, bool logToDatabase, int daysOfDatabaseLoggingHistory, bool logToFile, int daysOfFileLoggingHistory)
        {
            _supportedProperties = ServiceConfigProperty.GetSupportedProperties();

            IntervalInSeconds = intervalInSeconds;

            LoggingLevel = loggingLevel;

            LogToDatabase = true;

            DaysOfDatabaseLoggingHistory = daysOfDatabaseLoggingHistory;

            LogToFile = true;

            DaysOfFileLoggingHistory = daysOfFileLoggingHistory;
        }
Пример #3
0
 private void OnDeserializing(StreamingContext context)
 {
     _supportedProperties = ServiceConfigProperty.GetSupportedProperties();
 }