-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplication.xaml.vb
64 lines (53 loc) · 2.42 KB
/
Application.xaml.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
''*******************************************************************''
'' Active Query Builder Component Suite ''
'' ''
'' Copyright © 2006-2025 Active Database Software ''
'' ALL RIGHTS RESERVED ''
'' ''
'' CONSULT THE LICENSE AGREEMENT FOR INFORMATION ON ''
'' RESTRICTIONS. ''
''*******************************************************************''
Imports GeneralAssembly
Imports GeneralAssembly.Windows
''' <summary>
''' Interaction logic for App.xaml
''' </summary>
Partial Public Class App
Inherits Application
Public Shared Name As String = "Active Query Builder Demo"
Public Shared Connections As New ConnectionList()
Public Shared XmlFiles As New ConnectionList()
Public Sub New()
Dim i = ControlFactory.Instance ' force call static constructor of control factory
'if new version, import upgrade from previous version
If My.Settings.Default.CallUpgrade Then
My.Settings.Default.Upgrade()
My.Settings.Default.CallUpgrade = False
End If
If My.Settings.Default.Connections IsNot Nothing Then
Connections = My.Settings.Default.Connections
Connections.RemoveObsoleteConnectionInfos()
Connections.RestoreData()
End If
If My.Settings.Default.XmlFiles IsNot Nothing Then
XmlFiles = My.Settings.Default.XmlFiles
XmlFiles.RemoveObsoleteConnectionInfos()
XmlFiles.RestoreData()
End If
End Sub
Private Sub App_OnExit(sender As Object, e As ExitEventArgs)
Connections.SaveData()
XmlFiles.SaveData()
My.Settings.Default.Connections = Connections
My.Settings.Default.XmlFiles = XmlFiles
My.Settings.Default.Save()
End Sub
Private Sub App_OnDispatcherUnhandledException(sender As Object, e As DispatcherUnhandledExceptionEventArgs)
Dim errorWindow = New ExceptionWindow With {
.Owner = Current.MainWindow,
.Message = e.Exception.Message,
.StackTrace = e.Exception.StackTrace
}
errorWindow.ShowDialog()
End Sub
End Class