-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefGlobal_ACLibImportWizard.bas
More file actions
226 lines (179 loc) · 6.41 KB
/
defGlobal_ACLibImportWizard.bas
File metadata and controls
226 lines (179 loc) · 6.41 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
Attribute VB_Name = "defGlobal_ACLibImportWizard"
'---------------------------------------------------------------------------------------
' Package: defGlobal_ACLibImportWizard
'---------------------------------------------------------------------------------------
'
' Global definitions for wizard
'
' Author:
' Josef Poetzl
'
'---------------------------------------------------------------------------------------
Option Compare Database
Option Explicit
' Integrierte Erweiterungen
Private Const EXTENSION_KEY_ACLIBFILEMANAGER As String = "ACLibFileManager"
Private Const EXTENSION_KEY_ACLIBCONFIGURATION As String = "ACLibConfiguration"
Public Enum CodeLibElementType 'angelehnt an Enum vbext_ComponentType
clet_StdModule = 1 ' = vbext_ComponentType.vbext_ct_StdModule
clet_ClassModule = 2 ' = vbext_ComponentType.vbext_ct_ClassModule
clet_Form = 101 ' = vbext_ComponentType.vbext_ct_Document + 1
clet_Report = 102 ' = vbext_ComponentType.vbext_ct_Document + 2
clet_Package = 256 ' = Package (don't import file, only interpret codelib block)
End Enum
Public Enum CodeLibImportMode
clim_ImportMissingItems = 0 ' überschreibt keine vorhandene Access-Objekte in der Anwendung
clim_ImportSelectedOnly = 1 ' nur die ausgewählte Datei wird importiert (keine Abhängigkeistprüfung)
clim_ImportAllUsedItems = 2 ' auch vorhandene Access-Objekte werden überschrieben
End Enum
Public Type CodeLibInfoReference
Name As String
Major As Long
Minor As Long
GUID As String
End Type
Public Type CodeLibInfo
Name As String
Type As CodeLibElementType
RepositoryFile As String
LocalFile As String
RepositoryFileReplacement As String
Dependency() As String
References() As CodeLibInfoReference
TestFiles() As String
ExampleFiles() As String
ExecuteList() As String
LicenseFile As String
Description As String
ForceRemoveIfExists As Boolean
End Type
'Standard-Icon
Public ACLibIconFileName As String 'Nur Dateiname inkl. Dateierweiterung, aber ohne vollständigen Pfad
Public Property Get CurrentACLibFileManager() As ACLibFileManager
On Error GoTo HandleErr
Set CurrentACLibFileManager = CurrentApplication.Extensions(EXTENSION_KEY_ACLIBFILEMANAGER)
ExitHere:
On Error Resume Next
Exit Property
HandleErr:
Select Case HandleError(Err.Number, "CurrentACLibFileManager", Err.Description, ACLibErrorHandlerMode.aclibErrRaise)
Case ACLibErrorResumeMode.aclibErrResume
Resume
Case ACLibErrorResumeMode.aclibErrResumeNext
Resume Next
Case Else
Resume ExitHere
End Select
End Property
Public Property Get CurrentACLibConfiguration() As ACLibConfiguration
On Error GoTo HandleErr
Set CurrentACLibConfiguration = CurrentApplication.Extensions(EXTENSION_KEY_ACLIBCONFIGURATION)
ExitHere:
On Error Resume Next
Exit Property
HandleErr:
Select Case HandleError(Err.Number, "CurrentACLibConfiguration", Err.Description, ACLibErrorHandlerMode.aclibErrRaise)
Case ACLibErrorResumeMode.aclibErrResume
Resume
Case ACLibErrorResumeMode.aclibErrResumeNext
Resume Next
Case Else
Resume ExitHere
End Select
End Property
'---------------------------------------------------------------------------------------
' Function: GetACLibFileManager
'---------------------------------------------------------------------------------------
'/**
' <summary>
' Gibt die Filemanager-Referenz nach außen weiter
' </summary>
' <returns>ACLibFileManager</returns>
' <remarks>
' Über diese Function können andere Add-Ins oder die Anwendung
' auf den Filemanager des Import-Wizard zugreifen.
' </remarks>
'**/
'---------------------------------------------------------------------------------------
Public Function GetACLibFileManager() As ACLibFileManager
On Error GoTo HandleErr
Set GetACLibFileManager = CurrentACLibFileManager
ExitHere:
On Error Resume Next
Exit Function
HandleErr:
Select Case HandleError(Err.Number, "GetACLibFileManager", Err.Description, ACLibErrorHandlerMode.aclibErrRaise)
Case ACLibErrorResumeMode.aclibErrResume
Resume
Case ACLibErrorResumeMode.aclibErrResumeNext
Resume Next
Case Else
Resume ExitHere
End Select
End Function
Public Function RefreshAllCodeLibAccessObjects( _
Optional ByVal ImportMode As CodeLibImportMode = CodeLibImportMode.clim_ImportAllUsedItems) As Variant
On Error GoTo HandleErr
CurrentACLibFileManager.RefreshAll ImportMode, True
ExitHere:
Exit Function
HandleErr:
Select Case HandleError(Err.Number, "RefreshAllCodeLibAccessObjects", Err.Description, ACLibErrorHandlerMode.aclibErrRaise)
Case ACLibErrorResumeMode.aclibErrResume
Resume
Case ACLibErrorResumeMode.aclibErrResumeNext
Resume Next
Case Else
Resume ExitHere
End Select
End Function
Public Function RefreshAllCodeLibAccessModules( _
Optional ByVal ImportMode As CodeLibImportMode = CodeLibImportMode.clim_ImportAllUsedItems) As Variant
On Error GoTo HandleErr
CurrentACLibFileManager.RefreshAllModules ImportMode, True
ExitHere:
Exit Function
HandleErr:
Select Case HandleError(Err.Number, "RefreshAllCodeLibAccessModules", Err.Description, ACLibErrorHandlerMode.aclibErrRaise)
Case ACLibErrorResumeMode.aclibErrResume
Resume
Case ACLibErrorResumeMode.aclibErrResumeNext
Resume Next
Case Else
Resume ExitHere
End Select
End Function
Public Function ExportAllCodeLibElements() As Variant
On Error GoTo HandleErr
CurrentACLibFileManager.ExportAll
MsgBox "Export abgeschlossen", vbInformation
ExitHere:
On Error Resume Next
Exit Function
HandleErr:
Select Case HandleError(Err.Number, "ExportAllCodeLibElements", Err.Description, ACLibErrorHandlerMode.aclibErrMsgBox)
Case ACLibErrorResumeMode.aclibErrResume
Resume
Case ACLibErrorResumeMode.aclibErrResumeNext
Resume Next
Case Else
Resume ExitHere
End Select
End Function
Public Function ExportAllCodeLibModules() As Variant
On Error GoTo HandleErr
CurrentACLibFileManager.ExportAllModules
MsgBox "Export abgeschlossen", vbInformation
ExitHere:
On Error Resume Next
Exit Function
HandleErr:
Select Case HandleError(Err.Number, "ExportAllCodeLibElements", Err.Description, ACLibErrorHandlerMode.aclibErrMsgBox)
Case ACLibErrorResumeMode.aclibErrResume
Resume
Case ACLibErrorResumeMode.aclibErrResumeNext
Resume Next
Case Else
Resume ExitHere
End Select
End Function