This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
/
WebApplication.vb
112 lines (104 loc) · 6.14 KB
/
WebApplication.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Web
Imports DevExpress.ExpressApp.Xpo
Namespace WorkflowExample.Web
Partial Public Class WorkflowExampleAspNetApplication
Inherits WebApplication
Private module1 As DevExpress.ExpressApp.SystemModule.SystemModule
Private module2 As DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule
Private module3 As WorkflowExample.Module.WorkflowExampleModule
Private conditionalAppearanceModule1 As DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule
Private workflowModule1 As DevExpress.ExpressApp.Workflow.WorkflowModule
Private securityModule1 As DevExpress.ExpressApp.Security.SecurityModule
Private securityStrategyComplex1 As DevExpress.ExpressApp.Security.SecurityStrategyComplex
Private authenticationStandard1 As DevExpress.ExpressApp.Security.AuthenticationStandard
Private sqlConnection1 As System.Data.SqlClient.SqlConnection
Public Sub New()
InitializeComponent()
End Sub
Protected Overrides Sub CreateDefaultObjectSpaceProvider(ByVal args As CreateCustomObjectSpaceProviderEventArgs)
args.ObjectSpaceProvider = New XPObjectSpaceProviderThreadSafe(args.ConnectionString, args.Connection)
End Sub
Private Sub WorkflowExampleAspNetApplication_DatabaseVersionMismatch(ByVal sender As Object, ByVal e As DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs) Handles Me.DatabaseVersionMismatch
#If EASYTEST Then
e.Updater.Update()
e.Handled = True
#Else
If System.Diagnostics.Debugger.IsAttached Then
e.Updater.Update()
e.Handled = True
Else
Dim message As String = "The application cannot connect to the specified database, because the latter doesn't exist or its version is older than that of the application." & vbCrLf &
"This error occurred because the automatic database update was disabled when the application was started without debugging." & vbCrLf &
"To avoid this error, you should either start the application under Visual Studio in debug mode, or modify the " &
"source code of the 'DatabaseVersionMismatch' event handler to enable automatic database update, " &
"or manually create a database using the 'DBUpdater' tool." & vbCrLf &
"Anyway, refer to the following help topics for more detailed information:" & vbCrLf &
"'Update Application and Database Versions' at http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument2795.htm" & vbCrLf &
"'Database Security References' at http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument3237.htm" & vbCrLf &
"If this doesn't help, please contact our Support Team at http://www.devexpress.com/Support/Center/"
If e.CompatibilityError IsNot Nothing AndAlso e.CompatibilityError.Exception IsNot Nothing Then
message &= vbCrLf & vbCrLf & "Inner exception: " & e.CompatibilityError.Exception.Message
End If
Throw New InvalidOperationException(message)
End If
#End If
End Sub
Private Sub InitializeComponent()
Me.module1 = New DevExpress.ExpressApp.SystemModule.SystemModule()
Me.module2 = New DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule()
Me.module3 = New WorkflowExample.Module.WorkflowExampleModule()
Me.sqlConnection1 = New System.Data.SqlClient.SqlConnection()
Me.conditionalAppearanceModule1 = New DevExpress.ExpressApp.ConditionalAppearance.ConditionalAppearanceModule()
Me.workflowModule1 = New DevExpress.ExpressApp.Workflow.WorkflowModule()
Me.securityModule1 = New DevExpress.ExpressApp.Security.SecurityModule()
Me.securityStrategyComplex1 = New DevExpress.ExpressApp.Security.SecurityStrategyComplex()
Me.authenticationStandard1 = New DevExpress.ExpressApp.Security.AuthenticationStandard()
DirectCast(Me, System.ComponentModel.ISupportInitialize).BeginInit()
'
' sqlConnection1
'
Me.sqlConnection1.ConnectionString = "Integrated Security=SSPI;Pooling=false;Data Source=.\SQLEXPRESS;Initial Catalog=W" &
"orkflowExample"
Me.sqlConnection1.FireInfoMessageEventOnUserErrors = False
'
' workflowModule1
'
Me.workflowModule1.RunningWorkflowInstanceInfoType = GetType(DevExpress.ExpressApp.Workflow.Xpo.XpoRunningWorkflowInstanceInfo)
Me.workflowModule1.StartWorkflowRequestType = GetType(DevExpress.ExpressApp.Workflow.Xpo.XpoStartWorkflowRequest)
Me.workflowModule1.UserActivityVersionType = GetType(DevExpress.ExpressApp.Workflow.Versioning.XpoUserActivityVersion)
Me.workflowModule1.WorkflowControlCommandRequestType = GetType(DevExpress.ExpressApp.Workflow.Xpo.XpoWorkflowInstanceControlCommandRequest)
Me.workflowModule1.WorkflowDefinitionType = GetType(DevExpress.ExpressApp.Workflow.Xpo.XpoWorkflowDefinition)
Me.workflowModule1.WorkflowInstanceKeyType = GetType(DevExpress.Workflow.Xpo.XpoInstanceKey)
Me.workflowModule1.WorkflowInstanceType = GetType(DevExpress.Workflow.Xpo.XpoWorkflowInstance)
'
' securityStrategyComplex1
'
Me.securityStrategyComplex1.Authentication = Me.authenticationStandard1
Me.securityStrategyComplex1.RoleType = GetType(DevExpress.ExpressApp.Security.Strategy.SecuritySystemRole)
Me.securityStrategyComplex1.UserType = GetType(DevExpress.ExpressApp.Security.Strategy.SecuritySystemUser)
'
' authenticationStandard1
'
Me.authenticationStandard1.LogonParametersType = GetType(DevExpress.ExpressApp.Security.AuthenticationStandardLogonParameters)
'
' WorkflowExampleAspNetApplication
'
Me.ApplicationName = "WorkflowExample"
Me.Connection = Me.sqlConnection1
Me.Modules.Add(Me.module1)
Me.Modules.Add(Me.module2)
Me.Modules.Add(Me.conditionalAppearanceModule1)
Me.Modules.Add(Me.workflowModule1)
Me.Modules.Add(Me.module3)
Me.Modules.Add(Me.securityModule1)
Me.Security = Me.securityStrategyComplex1
'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause:
'ORIGINAL LINE: this.DatabaseVersionMismatch += new System.EventHandler<DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs>(this.WorkflowExampleAspNetApplication_DatabaseVersionMismatch);
DirectCast(Me, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
End Class
End Namespace