Esempio n. 1
0
        private void RegisterPhasedWork()
        {
            // RegisterIntentHandler uses the intent manager, which is only
            // available after login. Queue this registration for the
            // RegisterSpokes phase.
            mApplicationPhases.QueueSynchronousWork(
                phase: ApplicationPhase.RegisterSpokes,
                action: RegisterIntentHandler,
                exceptionMapper: x => NotificationMessages.GetErrorMessage(x, NotificationMessageKeys.ApplicationInitialization));

            // Use the ExtensibilityHelper to add a button into the header bar.
            mApplicationPhases.QueueSynchronousWork(
                phase: ApplicationPhase.AfterUIPresented,
                action: CreateHeaderCommand,
                exceptionMapper: x => NotificationMessages.GetErrorMessage(x, NotificationMessageKeys.ApplicationInitialization));

            // Add an event listener to the hosting web page that uses the
            // IJsonSubsetMessageHandler to process JSON messages sent to it.
            mApplicationPhases.QueueSynchronousWork(
                phase: ApplicationPhase.AfterUIPresented,
                action: InjectPostMessageToHandlerToHostPage,
                exceptionMapper: x => NotificationMessages.GetErrorMessage(x, NotificationMessageKeys.ApplicationInitialization));

            // LoginViaBrowserStack uses the IUserCredentials, which is only
            // available after login. Queue this login for the
            // RegisterSpokes phase.
            mApplicationPhases.QueueAsynchronousWork(
                phase: ApplicationPhase.RegisterSpokes,
                action: LoginViaBrowserStack);
        }
Esempio n. 2
0
        private static bool LoginFailure(Action <Notification> callback,
                                         Exception exception, bool presentedToUser)
        {
            if (!presentedToUser)
            {
                callback(NotificationMessages.GetErrorMessage(exception,
                                                              NotificationMessageKeys.ApplicationInitialization));
            }

            return(true);
        }
Esempio n. 3
0
        private void RegisterPhasedWork()
        {
            // IntentManager is only available after we're logged in.
            mApplicationPhases.QueueSynchronousWork(
                phase: ApplicationPhase.RegisterSpokes,
                action: RegisterIntentHandler,
                exceptionMapper: x => NotificationMessages.GetErrorMessage(x, NotificationMessageKeys.ApplicationInitialization));

            // Use the ExtensibilityHelper to add a button into the header bar.
            mApplicationPhases.QueueSynchronousWork(
                phase: ApplicationPhase.AfterUIPresented,
                action: CreateHeaderCommand,
                exceptionMapper: x => NotificationMessages.GetErrorMessage(x, NotificationMessageKeys.ApplicationInitialization));
        }
Esempio n. 4
0
        private void RegisterPhasedWork()
        {
            // IntentManager is only available after we're logged in.
            mApplicationPhases.QueueSynchronousWork(
                phase: ApplicationPhase.RegisterSpokes,
                action: RegisterIntentHandler,
                exceptionMapper: x => NotificationMessages.GetErrorMessage(x, NotificationMessageKeys.ApplicationInitialization));

            // Use the ExtensibilityHelper to add a button into the header bar.
            mApplicationPhases.QueueSynchronousWork(
                phase: ApplicationPhase.AfterUIPresented,
                action: CreateHeaderCommand,
                exceptionMapper: x => NotificationMessages.GetErrorMessage(x, NotificationMessageKeys.ApplicationInitialization));

            // Add an event listener to the hosting web page that uses the
            // IJsonSubsetIntentHandler to process JSON messages sent to it.
            mApplicationPhases.QueueSynchronousWork(
                phase: ApplicationPhase.AfterUIPresented,
                action: InjectPostMessageToIntentHandlerToHostPage,
                exceptionMapper: x => NotificationMessages.GetErrorMessage(x, NotificationMessageKeys.ApplicationInitialization));
        }