PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Source Code/PowerSong/ApplicationEvents.vb

#
Visual Basic | 26 lines | 15 code | 9 blank | 2 comment | 0 complexity | 40b0a253332201fca5c21e034e30cde0 MD5 | raw file
 1Namespace My
 2
 3    Partial Friend Class MyApplication
 4
 5        Private Sub MyApplication_StartupNextInstance(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs) Handles Me.StartupNextInstance
 6
 7            ' Bring to foreground
 8            e.BringToForeground = True
 9
10            ' Check if a file needs to be opened
11            If e.CommandLine.Count > 0 Then
12                Dim FileName As String = e.CommandLine.Item(0)
13                LoadExternalFile(FileName)
14            End If
15
16        End Sub
17
18        Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
19            Call (New frmException(e.Exception)).ShowDialog()
20            e.ExitApplication = False
21        End Sub
22
23    End Class
24
25End Namespace
26