This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
/
RepositoryItemCustomCheckedComboBoxEdit.cs
66 lines (60 loc) · 1.98 KB
/
RepositoryItemCustomCheckedComboBoxEdit.cs
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
using DevExpress.Accessibility;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraEditors.Drawing;
using DevExpress.XtraEditors.Registrator;
using DevExpress.XtraEditors.Repository;
using DevExpress.XtraEditors.ViewInfo;
using System;
using System.Collections.Generic;
namespace CustomEdit
{
[UserRepositoryItem("Register")]
public class RepositoryItemCustomCheckedComboBoxEdit : RepositoryItemCheckedComboBoxEdit
{
CheckStyles _checkStyle = CheckStyles.Standard;
public CheckStyles CheckStyle {
get { return _checkStyle; }
set
{
if (_checkStyle != value)
{
_checkStyle = value;
OnPropertiesChanged();
}
}
}
internal const string EditorName = "CustomCheckedComboBoxEdit";
static RepositoryItemCustomCheckedComboBoxEdit()
{
Register();
}
public RepositoryItemCustomCheckedComboBoxEdit() {}
public static void Register()
{
EditorRegistrationInfo.Default.Editors.Add(new EditorClassInfo(EditorName, typeof(CustomCheckedComboBoxEdit), typeof(RepositoryItemCustomCheckedComboBoxEdit),
typeof(PopupContainerEditViewInfo), new ButtonEditPainter(), true, null, typeof(PopupEditAccessible)));
}
public override string EditorTypeName
{
get
{
return EditorName;
}
}
public override void Assign(RepositoryItem item)
{
BeginUpdate();
try
{
base.Assign(item);
RepositoryItemCustomCheckedComboBoxEdit source = item as RepositoryItemCustomCheckedComboBoxEdit;
if (source == null) return;
CheckStyle = source.CheckStyle;
}
finally
{
EndUpdate();
}
}
}
}