예제 #1
0
        // only works on devices, not the iOS Simulator?
        public void Speak()
        {
            context.Fetch();              // re-populates with updated values

            var text = taskDialog.Name + ". " + taskDialog.Notes;

            if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
            {
                var speechSynthesizer = new AVSpeechSynthesizer();

                var speechUtterance = new AVSpeechUtterance(text)
                {
                    Rate            = AVSpeechUtterance.MaximumSpeechRate / 4,
                    Voice           = AVSpeechSynthesisVoice.FromLanguage("en-AU"),
                    Volume          = 0.5f,
                    PitchMultiplier = 1.0f
                };

                speechSynthesizer.SpeakUtterance(speechUtterance);
            }
            else
            {
                Console.WriteLine("Speech requires iOS 7");
            }
        }
예제 #2
0
        public void SaveProperty()
        {
            _bindingContext.Fetch(); //re-populates the updated values

            currentProperty.Name        = propertyDialog.Name;
            currentProperty.Description = propertyDialog.Description;

            if (currentProperty.ID > 0)
            {
                currentProperty.DateModified = DateTime.Now;
            }
            else
            {
                currentProperty.DateAdded = DateTime.Now;
            }

            if (currentProperty.SellerId <= 0)
            {
                currentProperty.SellerId = 1;                                //TODO: On implementing user registration it can be updated
            }
            _propertyManager.Save(currentProperty);

            NavigationController.PopViewController(true);
            //_bindingContext.Dispose(); //by documentation it should be disposed but appears to cause crash sometimes
        }
예제 #3
0
 public void SaveTask()
 {
     context.Fetch();              // re-populates with updated values
     currentTask.Name  = taskDialog.Name;
     currentTask.Notes = taskDialog.Notes;
     currentTask.Done  = taskDialog.Done;
     BL.Managers.TaskManager.SaveTask(currentTask);
     NavigationController.PopViewControllerAnimated(true);
     //	context.Dispose (); // documentation suggests this is required, but appears to cause a crash sometimes
 }
예제 #4
0
 public void SaveTask()
 {
     context.Fetch();              // re-populates with updated values
     currentTask.Name  = taskDialog.Name;
     currentTask.Notes = taskDialog.Notes;
     currentTask.Done  = taskDialog.Done;
     BL.Managers.TaskManager.SaveTask(currentTask);
     NavigationController.PopViewControllerAnimated(true);
     //context.Dispose (); // per documentation
 }
예제 #5
0
 public void SaveTask()
 {
     context.Fetch();              // re-populates with updated values
     currentTask.Name  = taskDialog.Name;
     currentTask.Notes = taskDialog.Notes;
     currentTask.Done  = taskDialog.Done;
     AppDelegate.Current.TaskMgr.SaveTodo(currentTask);
     NavigationController.PopViewController(true);
     context.Dispose();              // per documentation
 }
예제 #6
0
        public async void SaveTask()
        {
            context.Fetch();              // re-populates with updated values
            currentTaskItem.Name  = taskItemDialog.Name;
            currentTaskItem.Notes = taskItemDialog.Notes;
            currentTaskItem.Done  = taskItemDialog.Done;
            await BootStrapper.Resolve <ITaskItemManager>().SaveTask(currentTaskItem);

            NavigationController.PopViewController(true);
            //context.Dispose (); // per documentation
        }