TaskFlow/app/DD_PM_WINDREAM/ClassRegexEditor.vb
2019-04-29 16:18:04 +02:00

28 lines
1.0 KiB
VB.net

Imports System.ComponentModel
Imports System.Drawing.Design
Imports System.Windows.Forms.Design
Public Class ClassRegexEditor
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 oRegexString As String = NotNull(value, String.Empty)
If oService IsNot Nothing Then
Using oform As New frmRegexEditor()
oform.RegexString = oRegexString
If oService.ShowDialog(oform) = DialogResult.OK Then
value = oform.RegexString
End If
End Using
End If
Return value
End Function
End Class