28 lines
1.0 KiB
VB.net
28 lines
1.0 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.Drawing.Design
|
|
Imports System.Windows.Forms.Design
|
|
Imports DigitalData.Modules.Language
|
|
|
|
Public Class RegexEditor
|
|
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 = Utils.NotNull(value, String.Empty)
|
|
|
|
If oService IsNot Nothing Then
|
|
Using oform As New frmRegexEditor(oRegexString)
|
|
If oService.ShowDialog(oform) = DialogResult.OK Then
|
|
value = oform.RegexString
|
|
End If
|
|
End Using
|
|
End If
|
|
|
|
Return value
|
|
End Function
|
|
End Class
|