private void DeleteButtonOnClick(object sender, EventArgs e)
 {
     CognitoSyncUtils utils = new CognitoSyncUtils();
     todoId = Intent.GetStringExtra("todoItem");
     utils.DeleteTask(todoId);
     Finish();
 }
Exemplo n.º 2
0
 public void DeleteTask()
 {
     if (currentTask != null)
     {
         context.Fetch();
         CognitoSyncUtils utils = new CognitoSyncUtils();
         utils.DeleteTask(taskDialog.Id);
     }
 }
Exemplo n.º 3
0
 private void SaveButtonOnClick(object sender, EventArgs e)
 {
     var task = new Task()
     {
         Id = todoId,
         Description = descriptionText.Text,
         Title = titleText.Text,
         Completed = taskCompleted.Checked
     };
     CognitoSyncUtils utils = new CognitoSyncUtils();
     utils.SaveTask(task);
     Finish();
 }
 public void SaveTask()
 {
     context.Fetch();
     currentTask = new Task();
     currentTask.Id = taskDialog.Id;
     currentTask.Title = taskDialog.Name;
     currentTask.Description = taskDialog.Description;
     currentTask.Completed = taskDialog.Completed;
     NavigationController.PopViewController(true);
     CognitoSyncUtils utils = new CognitoSyncUtils();
     utils.SaveTask(currentTask);
     Refresh();
     currentTask = null;
 }
Exemplo n.º 5
0
        protected override void OnResume()
        {
            base.OnResume();

            todoId = Intent.GetStringExtra("todoItem");

            if (!string.IsNullOrEmpty(todoId))
            {
                CognitoSyncUtils utils = new CognitoSyncUtils();
                todoTask = utils.GetTask(todoId);
                if (todoTask != null)
                {
                    titleText.SetText(todoTask.Title, TextView.BufferType.Editable);
                    descriptionText.SetText(todoTask.Description, TextView.BufferType.Editable);
                    saveButton.Enabled = true;
                    deleteButton.Enabled = true;
                    taskCompleted.Checked = todoTask.Completed;
                }
            }
        }
Exemplo n.º 6
0
 private void DeleteButtonOnClick(object sender, EventArgs e)
 {
     CognitoSyncUtils utils = new CognitoSyncUtils();
     utils.DeleteTask(todoId);
 }
 private void Refresh()
 {
     CognitoSyncUtils utils = new CognitoSyncUtils();
     utils.Synchronize((exception) =>
     {
         if (exception != null)
         {
             Console.WriteLine("ERROR: " + exception.Message);
             return;
         }
         todoLists = utils.GetTasks();
         if (todoLists != null && todoLists.Count > 0)
         {
             InvokeOnMainThread(() =>
             {
                 Root = new RootElement("Todo List") {
                     new Section() {
                         from t in todoLists
                         select (Element) new CheckboxElement((string.IsNullOrEmpty(t.Title) ? string.Empty : t.Title), t.Completed)
                     }
                 };
             });
         }
     });
 }
        public void DeleteTask()
        {
            if (currentTask != null)
            {
				context.Fetch();
				NavigationController.PopViewController(true);
                CognitoSyncUtils utils = new CognitoSyncUtils();
				utils.DeleteTask(taskDialog.Id);
				Refresh();
				currentTask = null;
            }
        }
Exemplo n.º 9
0
        private void Refresh()
        {
            CognitoSyncUtils utils = new CognitoSyncUtils();
			todoLists = utils.GetTasks();
            utils.Synchronize(() =>
            {
                todoLists = utils.GetTasks();
                if (todoLists != null && todoLists.Count > 0)
                {
                    InvokeOnMainThread(() =>
                    {
                        Root = new RootElement("Todo List") {
				            new Section() {
					            from t in todoLists
					            select (Element) new CheckboxElement((string.IsNullOrEmpty(t.Title) ? string.Empty : t.Title), t.Completed)
				            }
                        };
                    });
                }
            });
        }