Exemple #1
0
 private Preferences(IDatabasePreferences entity)
     : this(entity as IPreferences, entity.SyncStatus, entity.LastSyncErrorMessage, entity.IsDeleted)
 {
     SyncStatus           = entity.SyncStatus;
     LastSyncErrorMessage = entity.LastSyncErrorMessage;
     IsDeleted            = entity.IsDeleted;
 }
Exemple #2
0
 private Builder(IDatabasePreferences preferences)
 {
     DateFormat          = preferences.DateFormat;
     TimeOfDayFormat     = preferences.TimeOfDayFormat;
     DurationFormat      = preferences.DurationFormat;
     CollapseTimeEntries = preferences.CollapseTimeEntries;
     SyncStatus          = preferences.SyncStatus;
 }
        private void onPreferencesChanged(IDatabasePreferences preferences)
        {
            DurationFormat = preferences.DurationFormat;
            dateFormat     = preferences.DateFormat;

            var segments = Segments.Select(segment => segment.WithDurationFormat(DurationFormat));

            Segments.Clear();
            Segments.AddRange(segments);

            updateCurrentDateRangeString();
        }
Exemple #4
0
 public static Preferences From(IDatabasePreferences entity)
 {
     return(new Preferences(entity, entity.SyncStatus, entity.LastSyncErrorMessage, entity.IsDeleted));
 }
Exemple #5
0
 public IObservable <IDatabasePreferences> Update(long id, IDatabasePreferences entity)
 => storage.Update(id, entity)
 .Select(Preferences.From)
 .Do(currentPreferencesSubject.OnNext);
Exemple #6
0
 public IObservable <IDatabasePreferences> Create(IDatabasePreferences entity)
 => storage.Create(entity)
 .Select(Preferences.From)
 .Do(currentPreferencesSubject.OnNext);
Exemple #7
0
 private IDatabasePreferences updatedPreferences(IDatabasePreferences existing, EditPreferencesDTO dto)
 => Preferences.Builder
 .FromExisting(existing)
 .SetFrom(dto)
 .SetSyncStatus(SyncStatus.SyncNeeded)
 .Build();
Exemple #8
0
 public static Preferences From(IDatabasePreferences entity)
 => new Preferences(entity);
 private void updateFromPreferences(IDatabasePreferences preferences)
 {
     DateFormat             = preferences.DateFormat;
     DurationFormat         = preferences.DurationFormat;
     UseTwentyFourHourClock = preferences.TimeOfDayFormat.IsTwentyFourHoursFormat;
 }
Exemple #10
0
 public static Builder FromExisting(IDatabasePreferences preferences)
 => new Builder(preferences);