Exemplo n.º 1
0
        private void handleShortcutTap(SiriShortcutViewModel shortcut)
        {
            if (!shortcut.IsActive)
            {
                if (shortcut.Type == SiriShortcutType.CustomStart)
                {
                    ViewModel.NavigateToCustomTimeEntryShortcut.Execute();
                    return;
                }

                if (shortcut.Type == SiriShortcutType.CustomReport)
                {
                    ViewModel.NavigateToCustomReportShortcut.Execute();
                    return;
                }

                var intent = IosDependencyContainer.Instance.IntentDonationService.CreateIntent(shortcut.Type);
                var vc     = new INUIAddVoiceShortcutViewController(new INShortcut(intent));
                vc.ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
                vc.Delegate = this;
                PresentViewController(vc, true, null);
            }
            else
            {
                var vc = new INUIEditVoiceShortcutViewController(shortcut.VoiceShortcut);
                vc.ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
                vc.Delegate = this;
                PresentViewController(vc, true, null);
            }
        }
        private void siriButtonHandler(object sender, EventArgs args)
        {
            var intent = constructStartTimerIntent(ViewModel.PasteFromClipboard.Value);

            var interaction = new INInteraction(intent, null);

            interaction.DonateInteraction(null);

            var vc = new INUIAddVoiceShortcutViewController(new INShortcut(intent));

            vc.ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
            vc.Delegate = this;
            PresentViewController(vc, true, null);
        }
Exemplo n.º 3
0
        private void siriButtonHandler(object sender, EventArgs args)
        {
            if (!(ViewModel.SelectedWorkspace.Value is IThreadSafeWorkspace workspace))
            {
                return;
            }

            var intent = new ShowReportPeriodIntent();

            intent.Period    = ViewModel.SelectReportPeriod.Value.ToShowReportPeriodReportPeriod();
            intent.Workspace = new INObject(workspace.Id.ToString(), workspace.Name);

            var interaction = new INInteraction(intent, null);

            interaction.DonateInteraction(null);

            var vc = new INUIAddVoiceShortcutViewController(new INShortcut(intent));

            vc.ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
            vc.Delegate = this;
            PresentViewController(vc, true, null);
        }
 public void DidCancel(INUIAddVoiceShortcutViewController controller)
 {
     controller.DismissViewController(true, null);
 }
 public void DidFinish(INUIAddVoiceShortcutViewController controller, INVoiceShortcut voiceShortcut, NSError error)
 {
     controller.DismissViewController(true, null);
     ViewModel.CloseWithDefaultResult();
 }
Exemplo n.º 6
0
        // IINUIAddVoiceShortcutViewControllerDelegate

        public void DidFinish(INUIAddVoiceShortcutViewController controller, INVoiceShortcut voiceShortcut, NSError error)
        {
            refreshSubject.OnNext(Unit.Default);
            controller.DismissViewController(true, null);
        }