private void finishGame(bool i_IsVictory, string i_FinishMessage)
 {
     updateMissionControls();
     MessageBox.Show(i_FinishMessage);
     if (i_IsVictory)
     {
         shareScore();
     }
     m_GameController.ResetMissions();
     m_GameController        = null;
     buttonStartGame.Enabled = true;
     updateMissionControls();
     updateVisibilityOfControls(m_ListOfFeature1InnerControls, false);
     updateVisibilityOfControls(m_ListOfFeature1Controls, true);
 }
 private void createANewGameController()
 {
     m_GameController = BeSocialGameController.Instance(this.m_SelectedMissionStrategy);
     m_GameController.Model.PostText       = textBoxPost.Text;
     m_GameController.Model.SelectedFriend = listBoxFriends.SelectedItem as User;
     if (!string.IsNullOrEmpty(textBoxURL.Text))
     {
         if (radioButtonLink.Checked == true)
         {
             m_GameController.Model.LinkUrl = textBoxURL.Text;
         }
         else if (radioButtonPicture.Checked == true)
         {
             m_GameController.Model.PictureUrl = textBoxURL.Text;
         }
     }
     m_GameController.m_EndTurn += this.Turn_Ended;
     updateMissionControls();
 }
        private void buttonEndGame_Click(object sender, EventArgs e)
        {
            try
            {
                if (m_GameController == null)
                {
                    throw new Exception("The game must be started first");
                }

                bool   isVictory = false;
                string message   = string.Format(
                    @"You've decided to end the game.
Your score is {0}.
See you next time",
                    m_GameController.PlayerScore);
                finishGame(isVictory, message);
                m_GameController = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Oops, something went wrong");
            }
        }