示例#1
0
        public SettingsStorage(Version version, IKeyValueStorage keyValueStorage)
        {
            Ensure.Argument.IsNotNull(keyValueStorage, nameof(keyValueStorage));

            this.version         = version;
            this.keyValueStorage = keyValueStorage;

            (isNewUserSubject, IsNewUser) = prepareSubjectAndObservable(isNewUserKey, keyValueStorage.GetBool);
            (enabledCalendarsSubject, EnabledCalendars) = prepareSubjectAndObservable(EnabledCalendarIds());
            (isManualModeEnabledSubject, IsManualModeEnabledObservable) = prepareSubjectAndObservable(preferManualModeKey, keyValueStorage.GetBool);
            (areRunningTimerNotificationsEnabledSubject, AreRunningTimerNotificationsEnabledObservable) = prepareSubjectAndObservable(runningTimerNotificationsKey, keyValueStorage.GetBool);
            (areStoppedTimerNotificationsEnabledSubject, AreStoppedTimerNotificationsEnabledObservable) = prepareSubjectAndObservable(stoppedTimerNotificationsKey, keyValueStorage.GetBool);
            (hasTappedTimeEntrySubject, HasTappedTimeEntry)                     = prepareSubjectAndObservable(hasTappedTimeEntryKey, keyValueStorage.GetBool);
            (hasEditedTimeEntrySubject, HasEditedTimeEntry)                     = prepareSubjectAndObservable(hasEditedTimeEntryKey, keyValueStorage.GetBool);
            (hasSelectedProjectSubject, HasSelectedProject)                     = prepareSubjectAndObservable(hasSelectedProjectKey, keyValueStorage.GetBool);
            (stopButtonWasTappedSubject, StopButtonWasTappedBefore)             = prepareSubjectAndObservable(stopButtonWasTappedBeforeKey, keyValueStorage.GetBool);
            (userSignedUpUsingTheAppSubject, UserSignedUpUsingTheApp)           = prepareSubjectAndObservable(userSignedUpUsingTheAppKey, keyValueStorage.GetBool);
            (startButtonWasTappedSubject, StartButtonWasTappedBefore)           = prepareSubjectAndObservable(startButtonWasTappedBeforeKey, keyValueStorage.GetBool);
            (projectOrTagWasAddedSubject, ProjectOrTagWasAddedBefore)           = prepareSubjectAndObservable(projectOrTagWasAddedBeforeKey, keyValueStorage.GetBool);
            (calendarNotificationsEnabledSubject, CalendarNotificationsEnabled) = prepareSubjectAndObservable(calendarNotificationsEnabledKey, keyValueStorage.GetBool);
            (navigatedAwayFromMainViewAfterTappingStopButtonSubject, NavigatedAwayFromMainViewAfterTappingStopButton) = prepareSubjectAndObservable(navigatedAwayFromMainViewAfterTappingStopButtonKey, keyValueStorage.GetBool);
            (hasTimeEntryBeenContinuedSubject, HasTimeEntryBeenContinued) = prepareSubjectAndObservable(hasTimeEntryBeenContinuedKey, keyValueStorage.GetBool);
            (timeSpanBeforeCalendarNotificationsSubject, TimeSpanBeforeCalendarNotifications) = prepareSubjectAndObservable(keyValueStorage.GetTimeSpan(timeSpanBeforeCalendarNotificationsKey) ?? defaultTimeSpanBeforeCalendarNotificationsSubject);
        }