private Preferences(IDatabasePreferences entity) : this(entity as IPreferences, entity.SyncStatus, entity.LastSyncErrorMessage, entity.IsDeleted) { SyncStatus = entity.SyncStatus; LastSyncErrorMessage = entity.LastSyncErrorMessage; IsDeleted = entity.IsDeleted; }
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(); }
public static Preferences From(IDatabasePreferences entity) { return(new Preferences(entity, entity.SyncStatus, entity.LastSyncErrorMessage, entity.IsDeleted)); }
public IObservable <IDatabasePreferences> Update(long id, IDatabasePreferences entity) => storage.Update(id, entity) .Select(Preferences.From) .Do(currentPreferencesSubject.OnNext);
public IObservable <IDatabasePreferences> Create(IDatabasePreferences entity) => storage.Create(entity) .Select(Preferences.From) .Do(currentPreferencesSubject.OnNext);
private IDatabasePreferences updatedPreferences(IDatabasePreferences existing, EditPreferencesDTO dto) => Preferences.Builder .FromExisting(existing) .SetFrom(dto) .SetSyncStatus(SyncStatus.SyncNeeded) .Build();
public static Preferences From(IDatabasePreferences entity) => new Preferences(entity);
private void updateFromPreferences(IDatabasePreferences preferences) { DateFormat = preferences.DateFormat; DurationFormat = preferences.DurationFormat; UseTwentyFourHourClock = preferences.TimeOfDayFormat.IsTwentyFourHoursFormat; }
public static Builder FromExisting(IDatabasePreferences preferences) => new Builder(preferences);