Beispiel #1
0
        public void setState(CompanionAppService.State state)
        {
            this.IsEnabled = true;
            switch (state)
            {
            case CompanionAppService.State.NEEDS_LOGIN:
                inputEmail.IsEnabled    = true;
                inputPassword.IsEnabled = true;
                inputCode.IsEnabled     = false;
                buttonNext.IsEnabled    = true;
                buttonSend.IsEnabled    = false;
                buttonCancel.IsEnabled  = true;
                break;

            case CompanionAppService.State.NEEDS_CONFIRMATION:
                inputEmail.IsEnabled    = false;
                inputPassword.IsEnabled = false;
                inputCode.IsEnabled     = true;
                buttonNext.IsEnabled    = true;
                buttonSend.IsEnabled    = false;
                buttonCancel.IsEnabled  = true;
                break;

            case CompanionAppService.State.READY:
                inputEmail.IsEnabled    = false;
                inputPassword.IsEnabled = false;
                inputCode.IsEnabled     = false;
                buttonNext.IsEnabled    = false;
                buttonSend.IsEnabled    = true;
                buttonCancel.IsEnabled  = true;
                break;
            }
        }
Beispiel #2
0
        private void companionApiStatusChanged(CompanionAppService.State oldState, CompanionAppService.State newState)
        {
            setStatusInfo();

            if (oldState == CompanionAppService.State.AwaitingCallback &&
                newState == CompanionAppService.State.Authorized)
            {
                SpeechService.Instance.Say(null, string.Format(Properties.EddiResources.frontier_api_ok, EDDI.Instance.Cmdr.name), 0);
                SpeechService.Instance.Say(null, Properties.EddiResources.frontier_api_close_browser, 0);
            }
            else if (oldState == CompanionAppService.State.LoggedOut &&
                     newState == CompanionAppService.State.AwaitingCallback)
            {
                SpeechService.Instance.Say(null, Properties.EddiResources.frontier_api_please_authenticate, 0);
            }
        }