Beispiel #1
0
        private void ShowGameConsole()
        {
            try
            {
                if (!_gamesPanel.Visible)
                {
                    var selectedConsole = Consoles.FirstOrDefault(x => x.Selected);

                    if (selectedConsole == null)
                    {
                        Utils.ShowError($"{nameof(SetSelectedGamePanel)}: Does not exists a console selected.");
                        return;
                    }

                    _console = NConsoleFactory.CreateConsole(selectedConsole.NConsole);

                    _roms = _console.ListRoms();

                    foreach (var item in _roms)
                    {
                        _romList.Items.Add(item.GetRomName());
                    }

                    _gamesPanel.Visible = true;
                    _romList.Focus();
                    _romList.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                Utils.ShowError($"{nameof(ShowGameConsole)}: Couldn't list roms: {ex.Message}");
            }
        }
Beispiel #2
0
 private void CloseGameConsole()
 {
     if (_gamesPanel.Visible)
     {
         _console = null;
         _romList.Items.Clear();
         _gameImage.Image    = null;
         _gamesPanel.Visible = false;
     }
 }