-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRepositoryItemCustomEdit.vb
71 lines (58 loc) · 2.26 KB
/
RepositoryItemCustomEdit.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
Imports DevExpress.XtraEditors.Registrator
Imports DevExpress.XtraEditors.Repository
Imports System.Drawing
Imports System.ComponentModel
Imports DevExpress.XtraEditors.ViewInfo
Imports DevExpress.XtraEditors.Drawing
Namespace DXSample
<UserRepositoryItem("RegisterCustomEdit")>
Public Class RepositoryItemCustomEdit
Inherits RepositoryItemComboBox
Shared Sub New()
Call RegisterCustomEdit()
End Sub
Public Sub New()
End Sub
Public Const CustomEditName As String = "CustomEdit"
Public Overrides ReadOnly Property EditorTypeName As String
Get
Return CustomEditName
End Get
End Property
Public Shared Sub RegisterCustomEdit()
Dim image As Image = Nothing
Call EditorRegistrationInfo.Default.Editors.Add(New EditorClassInfo(CustomEditName, GetType(CustomEdit), GetType(RepositoryItemCustomEdit), GetType(ComboBoxViewInfo), New ButtonEditPainter(), True, image))
End Sub
Private showCloseButtonField As Boolean, showClearButtonField As Boolean = False
<DefaultValue(False)>
Public Property ShowCloseButton As Boolean
Get
Return showCloseButtonField
End Get
Set(ByVal value As Boolean)
If showCloseButtonField <> value Then showCloseButtonField = value
End Set
End Property
<DefaultValue(False)>
Public Property ShowClearButton As Boolean
Get
Return showClearButtonField
End Get
Set(ByVal value As Boolean)
If showClearButtonField <> value Then showClearButtonField = value
End Set
End Property
Public Overrides Sub Assign(ByVal item As RepositoryItem)
BeginUpdate()
Try
MyBase.Assign(item)
Dim source As RepositoryItemCustomEdit = TryCast(item, RepositoryItemCustomEdit)
If source Is Nothing Then Return
showCloseButtonField = source.showCloseButtonField
showClearButtonField = source.showClearButtonField
Finally
EndUpdate()
End Try
End Sub
End Class
End Namespace