private void UpdateAll() { if (!Synchronisator.AddAsync(ItamsData).IsCompleted) { Synchronisator.LoadingStartedInvoke(); } }
private void Update(Func <TaskModel, Task> sendActionAsync, TaskModel task) { //will try to update by scedule _unfinishedAction = UpdateAll; if (!Synchronisator.IsSyncSuccessful) { return; } //uploading the item if (!sendActionAsync(task).IsCompleted) { Synchronisator.LoadingStartedInvoke(); } }
public async Task GetItems() { _unfinishedAction = () => GetItems(); var itemTask = Synchronisator.GetTasksAsync(); if (!itemTask.IsCompleted) { Synchronisator.LoadingStartedInvoke(); ItamsData = await itemTask; } else { ItamsData = itemTask.Result; } if (!Synchronisator.IsSyncSuccessful) { ItamsData = ProgressSaver <HashSet <TaskModel> > .TryGetSessions().Last(); GotItems(); } }