コード例 #1
0
ファイル: StartPage.xaml.cs プロジェクト: Viciouz/tttClient
        private void BtnConnectClick(object sender, RoutedEventArgs e)
        {
            _api = new ApiClient { Url = txt_url.Text };
            MetaData.Url = txt_url.Text;
            btn_connect.Content = "loading";
            btn_connect.Background = Brushes.Yellow;
            EnableUi(false);

            var bw = new BackgroundWorker();
            bw.DoWork += ValidateUri;
            bw.RunWorkerCompleted += Completed;

            bw.RunWorkerAsync();
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: Viciouz/tttClient
        public void Initiate()
        {
            _api = new ApiClient();
            _api.Url = MetaData.Url;

            lbl_gameId.Content = "GameId: " + GameId;
            lbl_playerId.Content = "PlayerId: " + PlayerId;
            rect_player.Fill = PlayerId == 1 ? Brushes.RoyalBlue : Brushes.Red;

            SetTimer();
            SetGame();
            UpdateUi();

            _squareSize = SquareSize(_game.Vsize, _game.Hsize);
        }