Example #1
0
 private async void bRESIGN_Click(object sender, EventArgs e)
 {
     if (
         MessageBox.Show("Do you really want to resign?", "Resign confirmation", MessageBoxButtons.YesNo,
                         MessageBoxIcon.Question) == DialogResult.Yes)
     {
         if (_isOnline)
         {
             await _onlineGameController.Server.Commands.Resign(this._gameInfo);
         }
         else
         {
             _uiConnector.Resign();
         }
     }
 }
Example #2
0
        public override async Task <bool> CanCloseViewModelAsync()
        {
            if (this.Game.Controller.Phase.Type == GamePhaseType.Finished)
            {
                await base.CanCloseViewModelAsync();

                return(true);
            }
            if (await DialogService.ShowConfirmationDialogAsync(Localizer.ExitOnline_Text, Localizer.ExitOnline_Caption, Localizer.ExitOnline_Confirm, Localizer.Exit_ReturnToGame))
            {
                UiConnector.Resign();
                await base.CanCloseViewModelAsync();

                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
        ////////////////
        // Mvx Commands Implementation
        ////////////////

        /// <summary>
        /// Resignation from UI
        /// </summary>
        private void Resign()
        {
            UiConnector.Resign();
        }