コード例 #1
0
        private void RefreshGameList()
        {
            Hide();
            ProgressWPF form = new ProgressWPF();

            form.ShowDialog();
            DialogResult = DialogResult.Retry;
            Close();
        }
コード例 #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            BringToFront();

            GameList.GameListChanged += GameList_GameListChanged;

            _gameList.BackgroundImage = SettingsManager.BackgroundImage;
            Location = new Point(Settings.Default.Window_x, Settings.Default.Window_y);
            Size     = new Size(Settings.Default.window_width, Settings.Default.window_height);

            //If we don't have a dat file, we need to create one. The progress form is responsible for that.
            if (Settings.Default.MAME_EXE == "")
            {
                SettingsManager.GetMamePath(true, true);
            }

            try
            {
                if (!File.Exists("IV-Play.dat") && !string.IsNullOrEmpty(Settings.Default.MAME_EXE))
                {
                    ProgressWPF progressForm = new ProgressWPF();
                    progressForm.ShowDialog();
                }
                else
                {
                    XmlParser.ReadDat();
                }
            }
            catch (Exception)
            {
            }

            //Now that we know where MAME is we can load the default art assets
            _gameList.LoadDefaultArtAssets();

            //Load our games. Setting a filter is important because it also populates the list
            //a blank string will return everything.
            _gameList.LoadGames(XmlParser.ParsedGames);
            _gameList.LoadSettings();
            _gameList.Filter = "";

            UpdateTitleBar();

            //InfoParser infoParser = new InfoParser(@"D:\Games\Emulators\MAME\command.dat");
        }