Ejemplo n.º 1
0
        private void ROMOpenButton_Click(object sender, RoutedEventArgs e)
        {
            var od = new System.Windows.Forms.OpenFileDialog
            {
                Multiselect = false,
                Title       = Utils.GetResource("common:dialogROMOpen"),
                Filter      = Utils.GetNDSFilter(),
            };

            if (od.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    ROMUtils.TryLoad(od.FileName);
                    Title = Utils.GetResource("common:program") + " - " + Path.GetFileName(od.FileName);
                    ShowMessage(Utils.GetResource("common:successROMLoad") + ": " + Path.GetFileName(od.FileName) + "\n" + Utils.GetResource("common:buildDateInfo") + " \"" + ROMUtils.GetBuildDate() + "\"");
                    AssetsButton.IsEnabled   = true;
                    KartsButton.IsEnabled    = true;
                    TexturesButton.IsEnabled = true;
                    SoundButton.IsEnabled    = true;
                    TextsButton.IsEnabled    = true;
                    TracksButton.IsEnabled   = true;
                }
                catch (NotMKDSROMException)
                {
                    ShowMessage(Utils.GetResource("common:invalidMKDSROM"));
                }
                catch
                {
                    ShowMessage(Utils.GetResource("common:invalidNDSROM"));
                }
            }
        }