Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 public MainWindow()
 {
     this._ndsMetaData = new NDSMetaData();
     try
     {
         this._ndsMetaDataProcessor = new NDSMetadataProcessor();
     } catch (NDSDatabaseLoadException e)
     {
         this.DisplayError(e.Message);
     }
     this.InitializeComponent();
 }
Exemplo n.º 4
0
 public NDSMetadataProcessor()
 {
     this.GamesTDB = new Dictionary <string, string>();
     this.MetaData = new NDSMetaData();
     this.LoadDatabase();
 }