private void BrowseButton_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDlg = new OpenFileDialog();
            var            result      = openFileDlg.ShowDialog();

            if (result == true)
            {
                this.ResetView();
                try
                {
                    var ndsMetaData = this._ndsMetaDataProcessor.ProcessNDSFile(openFileDlg);
                    this.PartialNameTextBox.Text     = ndsMetaData.PartialName;
                    this.NewFileNameTextBox.Text     = this.CreateSafeFilename(ndsMetaData.NewFileName);
                    this.GameIdTextBox.Text          = ndsMetaData.GameId;
                    this.GameTDBMappingTextBox.Text  = ndsMetaData.GameTDBMapping;
                    this.CurrentFileNameTextBox.Text = ndsMetaData.CurrentFileName;
                    this.FileNameTextBox.Text        = ndsMetaData.FilePath;
                    this._ndsMetaData = ndsMetaData;
                }
                catch (NDSFileStreamException ex)
                {
                    this.DisplayError(ex.Message);
                }
                catch (NDSFileException ex)
                {
                    this.DisplayError(ex.Message);
                }
            }
        }
 private void ResetView()
 {
     this.PartialNameTextBox.Text     = "";
     this.NewFileNameTextBox.Text     = "";
     this.GameIdTextBox.Text          = "";
     this.GameTDBMappingTextBox.Text  = "";
     this.CurrentFileNameTextBox.Text = "";
     this.FileNameTextBox.Text        = "Open NDS file...";
     this._ndsMetaData = new NDSMetaData();
 }
 public MainWindow()
 {
     this._ndsMetaData = new NDSMetaData();
     try
     {
         this._ndsMetaDataProcessor = new NDSMetadataProcessor();
     } catch (NDSDatabaseLoadException e)
     {
         this.DisplayError(e.Message);
     }
     this.InitializeComponent();
 }
Exemple #4
0
 public NDSMetadataProcessor()
 {
     this.GamesTDB = new Dictionary <string, string>();
     this.MetaData = new NDSMetaData();
     this.LoadDatabase();
 }