示例#1
0
 private void UpdateAll()
 {
     if (!Synchronisator.AddAsync(ItamsData).IsCompleted)
     {
         Synchronisator.LoadingStartedInvoke();
     }
 }
示例#2
0
        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();
            }
        }
示例#3
0
        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();
            }
        }