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;
示例#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;
 }
示例#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>()));
示例#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;
 }
示例#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);
示例#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;
 }
 public void Set(ISinceParameters parameters)
 {
     doTransaction(p => p.SetValuesFrom(parameters));
 }
示例#10
0
 protected abstract DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <TDatabaseInterface> entities);
示例#11
0
 protected override ISinceParameters UpdateSinceParameters(ISinceParameters old, DateTimeOffset?lastUpdated)
 => new SinceParameters(old, projects: lastUpdated);
示例#12
0
 protected override DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <IDatabaseProject> entities)
 => entities.Select(p => p?.At).Where(d => d.HasValue).DefaultIfEmpty(old.Projects).Max();
示例#13
0
 protected abstract FetchObservables CreateObservables(ISinceParameters since = null, List <TInterface> entities = null);
示例#14
0
 protected abstract bool OtherSinceDatesDidntChange(ISinceParameters old, ISinceParameters next, DateTimeOffset at);
示例#15
0
 protected override DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <IDatabaseWorkspaceFeatureCollection> entities)
 => null;
示例#16
0
 public FetchObservables(FetchObservables old, ISinceParameters sinceParameters)
     : this(sinceParameters, old.Workspaces, old.WorkspaceFeatures, old.Clients, old.Projects, old.TimeEntries, old.Tags, old.Tasks)
 {
 }
 protected override ISinceParameters UpdateSinceParameters(ISinceParameters old, DateTimeOffset?lastUpdated)
 => old;
 protected override DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <IDatabasePreferences> entities)
 => null;
示例#19
0
 protected abstract ISinceParameters UpdateSinceParameters(ISinceParameters old, DateTimeOffset?lastUpdated);