Exemplo n.º 1
0
        private void StartToolkit_OnClicked(object sender, EventArgs e)
        {
            Button           button = (sender as Button);
            ControlGameEntry entry  = (button.Parent as ControlGameEntry);
            var game = entry.GetGame();

            GameStorage.Instance.SetSelectedGame(game);

            if (CheckBox_SelectAsDefault.Checked)
            {
                var selectedIndex = Convert.ToInt32(entry.Tag);
                SaveDefaultGame(selectedIndex);
            }

            DialogResult = DialogResult.OK;
            Close();
        }
Exemplo n.º 2
0
        public void Init()
        {
            CheckBox_SelectAsDefault.Checked = ToolkitSettings.SkipGameSelector;
            var games = GameStorage.Instance.Games;

            for (int i = 0; i < games.Count; i++)
            {
                ControlGameEntry entry = new ControlGameEntry();
                entry.Tag = i;
                entry.InitialiseEntry(games[i]);
                FlowPanel_GamesList.Controls.Add(entry);
                entry.GetStartButton().Click += StartToolkit_OnClicked;
            }

            var size = this.Size;

            size.Width  = (FlowPanel_GamesList.Size.Width + 48);
            size.Height = (FlowPanel_GamesList.Size.Height + 24);
            this.Size   = size;
        }