private void OpenDatabaseView_Show( DatabaseMode theMode) { // Instantiate an instance OpenDatabaseView theView = new OpenDatabaseView(theMode); theView.textboxDatabaseFile.Leave += new EventHandler(OpenDatabaseView_textboxDatabaseFile_Leave); theView.buttonDatabaseFile.Click += new EventHandler(OpenDatabaseView_buttonDatabaseFile_Click); theView.textboxSourceDirectory.Leave += new EventHandler(OpenDatabaseView_textboxSourceDirectory_Leave); theView.buttonSourceDirectory.Click += new EventHandler(OpenDatabaseView_buttonSourceDirectory_Click); theView.buttonOK.Click += new EventHandler(OpenDatabaseView_buttonOK_Click); switch (theMode) { case DatabaseMode.OpenMusicDatabase: theView.OpenFileDialog.Filter = "Karakidex Music Databases|*.kmdb"; theView.OpenFileDialog.DefaultExt = "kmdb"; break; default: theView.OpenFileDialog.Filter = "Karakidex Karaoke Databases|*.kkdb"; theView.OpenFileDialog.DefaultExt = "kkdb"; break; } // Show the form theView.ShowDialog(this._MainView); }
private void OpenDatabaseView_Show( DatabaseMode theMode, FileInfo theDatabaseFileInfo) { // Instantiate an instance OpenDatabaseView theView = new OpenDatabaseView(theMode); theView.textboxSourceDirectory.Leave += new EventHandler(OpenDatabaseView_textboxSourceDirectory_Leave); theView.buttonSourceDirectory.Click += new EventHandler(OpenDatabaseView_buttonSourceDirectory_Click); theView.buttonDatabaseFile.Click += new EventHandler(OpenDatabaseView_buttonDatabaseFile_Click); theView.buttonOK.Click += new EventHandler(OpenDatabaseView_buttonOK_Click); switch (theView.Mode) { case DatabaseMode.OpenMusicDatabase: theView.Text = "Open Music Database"; theView.OpenFileDialog.Filter = "Karakidex Music Databases|*.kmdb"; theView.OpenFileDialog.DefaultExt = "kmdb"; break; default: theView.Text = "Open Karaoke Database"; theView.OpenFileDialog.Filter = "Karakidex Karaoke Databases|*.kkdb"; theView.OpenFileDialog.DefaultExt = "kkdb"; break; } if (theDatabaseFileInfo.Exists) { theView.textboxDatabaseFile.Text = theDatabaseFileInfo.FullName; theView.textboxSourceDirectory.Text = DatabaseLayer.GetSourceDirectory( new FileInfo(theDatabaseFileInfo.FullName)); Controller.IsViewValid(theView); } // Show the form theView.ShowDialog(this._MainView); }