protected override bool OtherSinceDatesDidntChange(ISinceParameters old, ISinceParameters next, DateTimeOffset at)
 => next.Workspaces == old.Workspaces &&
 next.Clients == old.Clients &&
 next.Projects == at &&
 next.Tags == old.Tags &&
 next.Tasks == old.Tasks &&
 next.TimeEntries == old.TimeEntries;
Exemplo n.º 2
0
 public void SetValuesFrom(ISinceParameters parameters)
 {
     Workspaces  = parameters.Workspaces;
     Tags        = parameters.Tags;
     Clients     = parameters.Clients;
     Projects    = parameters.Projects;
     Tasks       = parameters.Tasks;
     TimeEntries = parameters.TimeEntries;
 }
Exemplo n.º 3
0
 public FetchObservables(ISinceParameters sinceParameters,
                         IObservable <List <IWorkspace> > workspaces, IObservable <List <IClient> > clients,
                         IObservable <List <IProject> > projects, IObservable <List <ITimeEntry> > timeEntries
                         )
 {
     SinceParameters = sinceParameters;
     Workspaces      = workspaces;
     Clients         = clients;
     Projects        = projects;
     TimeEntries     = timeEntries;
 }
 protected override FetchObservables CreateObservables(
     ISinceParameters since        = null,
     List <ITimeEntry> timeEntries = null)
 => new FetchObservables(
     since ?? new SinceParameters(null),
     Observable.Return(new List <IWorkspace>()),
     Observable.Return(new List <IWorkspaceFeatureCollection>()),
     Observable.Return(new List <IClient>()),
     Observable.Return(new List <IProject>()),
     Observable.Return(timeEntries),
     Observable.Return(new List <ITag>()),
     Observable.Return(new List <ITask>()));
 protected override FetchObservables CreateObservables(
     ISinceParameters since   = null,
     List <IProject> projects = null)
 => new FetchObservables(
     since ?? new SinceParameters(null),
     Observable.Return(new List <IWorkspace>()),
     Observable.Return(new List <IWorkspaceFeatureCollection>()),
     Observable.Return(Substitute.For <IUser>()),
     Observable.Return(new List <IClient>()),
     Observable.Return(projects),
     Observable.Return(new List <ITimeEntry>()),
     Observable.Return(new List <ITag>()),
     Observable.Return(new List <ITask>()),
     Observable.Return(Substitute.For <IPreferences>()));
Exemplo n.º 6
0
 public SinceParameters(
     ISinceParameters since,
     DateTimeOffset?workspaces  = null,
     DateTimeOffset?tags        = null,
     DateTimeOffset?clients     = null,
     DateTimeOffset?projects    = null,
     DateTimeOffset?tasks       = null,
     DateTimeOffset?timeEntries = null)
 {
     Workspaces  = workspaces ?? since?.Workspaces;
     Tags        = tags ?? since?.Tags;
     Clients     = clients ?? since?.Clients;
     Projects    = projects ?? since?.Projects;
     Tasks       = tasks ?? since?.Tasks;
     TimeEntries = timeEntries ?? since?.TimeEntries;
 }
Exemplo n.º 7
0
 protected FetchObservables CreateFetchObservables(
     FetchObservables old, ISinceParameters sinceParameters,
     IObservable <List <IWorkspace> > workspaces = null,
     IObservable <List <IWorkspaceFeatureCollection> > workspaceFeatures = null,
     IObservable <List <IClient> > clients        = null,
     IObservable <List <IProject> > projects      = null,
     IObservable <List <ITimeEntry> > timeEntries = null,
     IObservable <List <ITag> > tags   = null,
     IObservable <List <ITask> > tasks = null)
 => new FetchObservables(
     old?.SinceParameters ?? sinceParameters,
     old?.Workspaces ?? workspaces,
     old?.WorkspaceFeatures ?? workspaceFeatures,
     old?.Clients ?? clients,
     old?.Projects ?? projects,
     old?.TimeEntries ?? timeEntries,
     old?.Tags ?? tags,
     old?.Tasks ?? tasks);
Exemplo n.º 8
0
 public FetchObservables(ISinceParameters sinceParameters,
                         IObservable <List <IWorkspace> > workspaces,
                         IObservable <List <IWorkspaceFeatureCollection> > workspaceFeatures,
                         IObservable <List <IClient> > clients,
                         IObservable <List <IProject> > projects,
                         IObservable <List <ITimeEntry> > timeEntries,
                         IObservable <List <ITag> > tags,
                         IObservable <List <ITask> > tasks
                         )
 {
     SinceParameters   = sinceParameters;
     Workspaces        = workspaces;
     WorkspaceFeatures = workspaceFeatures;
     Clients           = clients;
     Projects          = projects;
     TimeEntries       = timeEntries;
     Tags  = tags;
     Tasks = tasks;
 }
Exemplo n.º 9
0
 public void Set(ISinceParameters parameters)
 {
     doTransaction(p => p.SetValuesFrom(parameters));
 }
Exemplo n.º 10
0
 protected abstract DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <TDatabaseInterface> entities);
Exemplo n.º 11
0
 protected override ISinceParameters UpdateSinceParameters(ISinceParameters old, DateTimeOffset?lastUpdated)
 => new SinceParameters(old, projects: lastUpdated);
Exemplo n.º 12
0
 protected override DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <IDatabaseProject> entities)
 => entities.Select(p => p?.At).Where(d => d.HasValue).DefaultIfEmpty(old.Projects).Max();
Exemplo n.º 13
0
 protected abstract FetchObservables CreateObservables(ISinceParameters since = null, List <TInterface> entities = null);
Exemplo n.º 14
0
 protected abstract bool OtherSinceDatesDidntChange(ISinceParameters old, ISinceParameters next, DateTimeOffset at);
Exemplo n.º 15
0
 protected override DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <IDatabaseWorkspaceFeatureCollection> entities)
 => null;
Exemplo n.º 16
0
 public FetchObservables(FetchObservables old, ISinceParameters sinceParameters)
     : this(sinceParameters, old.Workspaces, old.WorkspaceFeatures, old.Clients, old.Projects, old.TimeEntries, old.Tags, old.Tasks)
 {
 }
Exemplo n.º 17
0
 protected override ISinceParameters UpdateSinceParameters(ISinceParameters old, DateTimeOffset?lastUpdated)
 => old;
Exemplo n.º 18
0
 protected override DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <IDatabasePreferences> entities)
 => null;
Exemplo n.º 19
0
 protected abstract ISinceParameters UpdateSinceParameters(ISinceParameters old, DateTimeOffset?lastUpdated);