44 lines
1.8 KiB
VB.net
44 lines
1.8 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.Drawing.Design
|
|
Imports System.Windows.Forms.Design
|
|
Imports DD_ProcessManager.InputProperties
|
|
Imports DigitalData.GUIs.Common
|
|
|
|
Public Class ClassSQLEditor
|
|
Inherits UITypeEditor
|
|
|
|
Public Overrides Function GetEditStyle(context As ITypeDescriptorContext) As UITypeEditorEditStyle
|
|
Return UITypeEditorEditStyle.Modal
|
|
End Function
|
|
|
|
Public Overrides Function EditValue(context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object
|
|
Dim oService As IWindowsFormsEditorService = TryCast(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService)
|
|
|
|
Dim oValueObject = DirectCast(value, SQLValue)
|
|
Dim oSQLString As String = oValueObject.Value
|
|
Dim oSQLConnection As Integer = oValueObject.ConnectionId
|
|
|
|
If oService IsNot Nothing AndAlso oSQLString IsNot Nothing Then
|
|
'CURRENT_DESIGN_TYPE = "INPUT_INDEX"
|
|
Using oForm As New frmSQLEditor(LOGCONFIG, DatabaseECM)
|
|
oForm.SQLCommand = oSQLString
|
|
oForm.SQLConnection = oSQLConnection
|
|
|
|
oForm.PlaceholdersManualPrefix = "CTRL"
|
|
oForm.PlaceholdersManualTitle = "Controls"
|
|
oForm.PlaceholdersManual = CURRENT_CONTROL_NAME_LIST.
|
|
ToDictionary(Function(name) name, Function(name) name)
|
|
|
|
If oService.ShowDialog(oForm) = DialogResult.OK Then
|
|
Dim sql As New SQLValue(oForm.SQLCommand, oForm.SQLConnection)
|
|
' CURRENT_CONN_ID_FINAL_INDEX = oForm.SQLConnection
|
|
' CURRENT_CONN_ID = oForm.SQLConnection
|
|
value = sql
|
|
End If
|
|
End Using
|
|
End If
|
|
|
|
Return value
|
|
End Function
|
|
End Class
|