/Source Code/PowerSong/Export and Import/frmImportPresenter.vb
Visual Basic | 49 lines | 33 code | 13 blank | 3 comment | 0 complexity | e1029bdb7c995f08353151908b7eb2f1 MD5 | raw file
- Imports System.Windows.Forms
- Imports PowerSong.SongDatabase
- Imports PowerSong.SongDatabase.ExportImport
-
- Public Class frmImportPresenter
-
- Private FDatabase As Database
-
- Public Sub New(ByVal database As Database)
- InitializeComponent()
- FDatabase = database
- End Sub
-
- Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
-
- ' Check a folder has been selected
- If txtLocation.Text = "" Then
- MsgBox("Please select the location of a Presenter collection of songs.", MsgBoxStyle.Exclamation)
- Exit Sub
- End If
-
- Try
-
- ' Perform the import
- Call (New PresenterImport(FDatabase, chkIncludeSubFolders.Checked)).Import(txtLocation.Text)
-
- ' Finished
- MsgBox("The import was completed without any errors.", MsgBoxStyle.Information)
- Me.DialogResult = System.Windows.Forms.DialogResult.OK
- Me.Close()
-
- Catch ex As Exception
- MsgBox("There was an error during the import:" + Environment.NewLine + ex.Message, MsgBoxStyle.Critical)
- End Try
-
- End Sub
-
- Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
- Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
- Me.Close()
- End Sub
-
- Private Sub btnSelectLocation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectLocation.Click
- If dlgSelectLocation.ShowDialog = Windows.Forms.DialogResult.OK Then
- txtLocation.Text = dlgSelectLocation.SelectedPath
- End If
- End Sub
-
- End Class