示例#1
0
 /// <summary>
 /// Interface to delete the question.
 /// </summary>
 /// <param name="questionItem">Question item.</param>
 public async void DeleteQuestion(QuestionItem questionItem)
 {
     try
     {
         Task deleteQuestion = theQuestionInfo.DeleteQuestion(questionItem);
         await UIUtilities.ShowIndeterminateProgressIfNecessary(deleteQuestion, string.Format("Deleting task: [{0}] ...", questionItem.QuestionText));
     }
     finally
     {
         NavigationController.PopViewControllerAnimated(true);
     }
 }
示例#2
0
        /// <summary>
        /// Interface to save the question.
        /// </summary>
        /// <param name="questionItem">Question item.</param>
        public async void SaveQuestion(QuestionItem questionItem)
        {
            try
            {
                Task saveTask = theQuestionInfo.Save(questionItem);

                if (theQuestionInfo.CurrentUIMode == UIModes.Adding)
                {
                    await UIUtilities.ShowIndeterminateProgressIfNecessary(saveTask, string.Format("Adding task: [{0}] ...", questionItem.QuestionText));
                }
                else
                {
                    await UIUtilities.ShowIndeterminateProgressIfNecessary(saveTask, string.Format("Updating task: [{0}] ...", questionItem.QuestionText));
                }

                await RefreshAsync();
            }
            finally
            {
                NavigationController.PopViewControllerAnimated(true);
            }
        }