Exemple #1
0
        private void MnuGameClick(CheckBox c)
        {
            foreach (Games game in Game.GamesAvailable)
            {
                if (c.Content.ToString() == game.Name)
                {
                    if (c.IsChecked == true)
                    {
                        game.IsEnabled = true;
                        // disable all games in list (class)
                        foreach (Games g in Game.GamesAvailable)
                        {
                            if (g.Name != game.Name)
                            {
                                g.IsEnabled = false;
                            }
                        }
                        // uncheck all checkbox select one process (check box)
                        foreach (CheckBox i in _enumBoxsGames)
                        {
                            if (i.Content.ToString() != game.Name)
                            {
                                i.IsChecked = false;
                                // destroy object(s) if exist and jump game(s)
                                // destroy all object(s) draw
                                MyDelegates.DestroyObjectInGame(i.Content.ToString());
                            }
                        }
                    }
                    else
                    {
                        game.IsEnabled = false;

                        // destroy all object(s) draw
                        MyDelegates.DestroyObjectInGame(game.Name);
                    }
                }
            }
        }