예제 #1
0
        /// <summary>
        /// The lobby client on on login complete.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="results">
        /// The results.
        /// </param>
        private void LobbyClientOnOnLoginComplete(object sender, LoginResults results)
        {
            this.Dispatcher.BeginInvoke(new Action(
                                            () =>
            {
                ConnectBox.Visibility = Visibility.Hidden;
                ConnectBoxProgressBar.IsIndeterminate = false;
            }));
            switch (results)
            {
            case LoginResults.Success:
                this.SetStateOnline();
                this.Dispatcher.BeginInvoke(new Action(() =>
                {
                    if (GameManager.Get().GameCount == 0)
                    {
                        TabCustomGames.Focus();
                    }
                    else
                    {
                        TabCommunityChat.Focus();
                    }
                }));
                break;

            default:
                this.SetStateOffline();
                break;
            }
        }
예제 #2
0
        /// <summary>
        /// The lobby client on on login complete.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="results">
        /// The results.
        /// </param>
        private void LobbyClientOnOnLoginComplete(object sender, LoginResults results)
        {
            this.Dispatcher.BeginInvoke(new Action(
                                            () =>
            {
                ConnectBox.Visibility = Visibility.Hidden;
                ConnectBoxProgressBar.IsIndeterminate = false;
            }));
            switch (results)
            {
            case LoginResults.Success:
                this.SetStateOnline();
                this.Dispatcher.BeginInvoke(new Action(() =>
                {
                    if (GameManager.Get().GameCount == 0)
                    {
                        TabCustomGames.Focus();
                    }
                    else
                    {
                        TabCommunityChat.Focus();
                    }
                })).Completed += (o, args) => Task.Factory.StartNew(() =>
                {
                    Thread.Sleep(15000);
                    this.Dispatcher.Invoke(new Action(()
                                                      =>
                    {
                        var s =
                            SubscriptionModule.Get
                                ().IsSubscribed;
                        if (s != null && s == false)
                        {
                            if (showedSubscriptionMessageOnce == false)
                            {
                                ShowSubMessage();
                                showedSubscriptionMessageOnce = true;
                            }
                        }
                    }));
                });
                break;

            default:
                this.SetStateOffline();
                break;
            }
        }