Example #1
0
        private async Task UsingHint(HintType hintType)
        {
            var res = await Playground.UseHint(hintType);

            if (res.Item1.Equals("success", StringComparison.InvariantCultureIgnoreCase))
            {
                this.Close();
            }
            else
            {
                MessageBox.Show(res.Item2, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        public async void AcceptInvite(bool accept)
        {
            if (accept)
            {
                var gameSession = await gameSessionService.CreateGameSession(UserProfile.Id, textBox1.Text, level.Id);

                await HubService.StartGame(textBox1.Text, gameSession.Id);

                Playground playground = new Playground(gameSession);
                playground.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show($"Пользователь {textBox1.Text} отклонил ваше приглашение!", "Приглашения", MessageBoxButtons.OK, MessageBoxIcon.Information);
                pictureBox1.Visible = false;
            }
        }