Public Class QueriesDialog

    Private Sub QueriesDialog_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        txtNotes.Text = System.IO.File.ReadAllText(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location) & "\resources\queries.txt")
        txtNotes.SelectionStart = Len(txtNotes.Text)

    End Sub

    Private Sub RestoreDefaultsButton_Click(sender As Object, e As EventArgs) Handles RestoreDefaultsButton.Click

        txtNotes.Text = System.IO.File.ReadAllText((System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location) & "\resources\defaultqueries.txt"))

    End Sub

    Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click

        Me.Close()

    End Sub

    Private Sub btnOk_Click(sender As Object, e As EventArgs) Handles btnOk.Click

        If String.IsNullOrWhiteSpace(txtNotes.Text) Then
            MessageBox.Show("Please enter at least one query to continue!", "Invalid Entry", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Exit Sub
        End If

        System.IO.File.WriteAllText(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location) & "\resources\queries.txt", txtNotes.Text)
        Me.Close()

    End Sub
End Class