public CallHomeSettings(CallHomeStatus status, int intervalInDays, DayOfWeek dayOfWeek, int timeOfDay, int retryInterval) { Status = status; IntervalInDays = intervalInDays; DayOfWeek = dayOfWeek; TimeOfDay = timeOfDay; RetryInterval = retryInterval; }
public CallHomeSettings(Dictionary <string, string> config) { Status = config == null || !config.ContainsKey(STATUS) ? CallHomeStatus.Undefined : (BoolKey(config, STATUS) ? CallHomeStatus.Enabled : CallHomeStatus.Disabled); IntervalInDays = IntKey(config, INTERVAL_IN_DAYS, intervalInDaysDefault); if (!Enum.TryParse(Get(config, DAY_OF_WEEK), out DayOfWeek)) { DayOfWeek = (DayOfWeek)GetDefaultDay(); } TimeOfDay = IntKey(config, TIME_OF_DAY, GetDefaultTime()); RetryInterval = IntKey(config, RETRY_INTERVAL, RetryIntervalDefault); UploadTokenSecretUuid = Get(config, UPLOAD_TOKEN_SECRET); NewUploadRequest = Get(config, NEW_UPLOAD_REQUEST); UserNameSecretUuid = Get(config, UPLOAD_CREDENTIAL_USER_SECRET); PasswordSecretUuid = Get(config, UPLOAD_CREDENTIAL_PASSWORD_SECRET); LastSuccessfulUpload = Get(config, LAST_SUCCESSFUL_UPLOAD); }