Exemplo n.º 1
0
 private void SessionOnSessionStateChanged(object sender, SessionStateChangedEventArgs sessionStateChangedEventArgs)
 {
     if (session.CurrentProject?.Package != currentPackage)
     {
         UpdateCurrentGameSettings();
     }
 }
        private async Task AssertStateChange(PowerShellContextState expectedState)
        {
            SessionStateChangedEventArgs newState =
                await this.stateChangeQueue.DequeueAsync();

            Assert.Equal(expectedState, newState.NewSessionState);
        }
 private async void LoginButton_OnSessionStateChanged(object sender, SessionStateChangedEventArgs e)
 {
     if (e.SessionState == FacebookSessionState.Opened)
     {
         await RetriveUserInfo();
     }
 }
Exemplo n.º 4
0
        public void DisplaySessionProgress(object sender, EventArgs e)
        {
            StringBuilder outputText = new StringBuilder();

            if (e is SessionStateChangedEventArgs)
            {
                SessionStateChangedEventArgs args = (SessionStateChangedEventArgs)e;

                if (args.SessionState == SyncSessionState.Synchronizing)
                {
                    outputText.AppendLine(String.Empty);
                    outputText.Append("** SyncAgent is synchronizing");
                }

                else
                {
                    outputText.Append("** SyncAgent is ready to synchronize");
                }
            }

            else if (e is SessionProgressEventArgs)
            {
                SessionProgressEventArgs args = (SessionProgressEventArgs)e;
                outputText.Append("Percent complete: " + args.PercentCompleted + " (" + args.SyncStage + ")");
            }

            else
            {
                outputText.AppendLine("Unknown event occurred");
            }

            Console.WriteLine(outputText.ToString());
        }
 private void OnSessionStateChanged(object sender, SessionStateChangedEventArgs e)
 {
     if (e.SessionState == FacebookSessionState.Opened)
     {
         Frame.Navigate(typeof(FacebookAuthentication), Session.ActiveSession.CurrentAccessTokenData);
     }
 }
 void powerShellContext_SessionStateChanged(object sender, SessionStateChangedEventArgs e)
 {
     // Skip all transitions except those back to 'Ready'
     if (e.NewSessionState == PowerShellContextState.Ready)
     {
         this.sessionStateQueue.Enqueue(e);
     }
 }
 async void powerShellContext_SessionStateChanged(object sender, SessionStateChangedEventArgs e)
 {
     // Skip all transitions except those back to 'Ready'
     if (e.NewSessionState == PowerShellContextState.Ready)
     {
         await this.sessionStateQueue.EnqueueAsync(e).ConfigureAwait(false);
     }
 }
        private async Task AssertStateChange(
            PowerShellContextState expectedState,
            PowerShellExecutionResult expectedResult = PowerShellExecutionResult.Completed)
        {
            SessionStateChangedEventArgs newState =
                await this.sessionStateQueue.DequeueAsync(new CancellationTokenSource(10000).Token).ConfigureAwait(false);

            Assert.Equal(expectedState, newState.NewSessionState);
            Assert.Equal(expectedResult, newState.ExecutionResult);
        }
Exemplo n.º 9
0
        private async Task AssertStateChange(
            PowerShellContextState expectedState,
            PowerShellExecutionResult expectedResult = PowerShellExecutionResult.Completed)
        {
            SessionStateChangedEventArgs newState =
                await this.sessionStateQueue.DequeueAsync();

            Assert.Equal(expectedState, newState.NewSessionState);
            Assert.Equal(expectedResult, newState.ExecutionResult);
        }
Exemplo n.º 10
0
        private async void OnSessionStateChanged(object sender, SessionStateChangedEventArgs e)
        {
            switch (e.SessionState)
            {
            case FacebookSessionState.Opened:
                this.DisplayLoading(true);

                try
                {
                    var registration = new Registration()
                    {
                        FacebookAccessToken     = this.loginButton.CurrentSession.AccessToken,
                        FacebookTokenExpiration = this.loginButton.CurrentSession.Expires,
                    };

                    var token = await this.api.Login(registration);

                    if (null != token)
                    {
                        var fb = new FacebookInfo()
                        {
                            AccessToken = this.loginButton.CurrentSession.AccessToken,
                            ProfileId   = this.loginButton.CurrentSession.FacebookId,
                        };

                        this.data.Set(fb);

                        this.GeoLocation();

                        this.Frame.Navigate(typeof(WantSection));
                    }
                }
                catch
                {
                    this.api_CannotConnectToServers(this, EventArgs.Empty);
                }
                break;

            case FacebookSessionState.Closed:
                this.api.Logout();
                break;
            }

            this.DisplayLoading(false);
        }
 private void OnSessionStateChanged(object sender, SessionStateChangedEventArgs e)
 {
     this.stateChangeQueue.EnqueueAsync(e).Wait();
 }
Exemplo n.º 12
0
 private void SessionStateChanged(object sender, SessionStateChangedEventArgs e)
 {
     UpdateCommands();
 }
 private void OnSessionStateChanged(object sender, SessionStateChangedEventArgs e)
 {
     this.stateChangeQueue.Enqueue(e);
 }