/
Program.vb
47 lines (42 loc) · 1.74 KB
/
Program.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
Imports System.Configuration
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Security
Imports DevExpress.ExpressApp.Win
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Namespace InfoPanels.Win
Friend NotInheritable Class Program
Private Sub New()
End Sub
''' <summary>
''' The main entry point for the application.
''' </summary>
<STAThread> _
Shared Sub Main()
#If EASYTEST Then
DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register()
#End If
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached
Dim winApplication As New InfoPanelsWindowsFormsApplication()
AddHandler winApplication.CreateCustomTemplate, AddressOf winApplication_CreateCustomTemplate
DevExpress.ExpressApp.Xpo.InMemoryDataStoreProvider.Register()
winApplication.ConnectionString = DevExpress.ExpressApp.Xpo.InMemoryDataStoreProvider.ConnectionString
Try
winApplication.Setup()
winApplication.Start()
Catch e As Exception
winApplication.HandleException(e)
End Try
End Sub
Private Shared Sub winApplication_CreateCustomTemplate(ByVal sender As Object, ByVal e As CreateCustomTemplateEventArgs)
If e.Context = TemplateContext.ApplicationWindow Then
e.Template = New MainForm()
End If
If e.Context = TemplateContext.View Then
e.Template = New DetailViewForm()
End If
End Sub
End Class
End Namespace