This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
/
MyLayoutControlItemPropertyWrapper.cs
104 lines (93 loc) · 3.46 KB
/
MyLayoutControlItemPropertyWrapper.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
using DevExpress.XtraLayout;
using DevExpress.XtraEditors.Mask;
using System.ComponentModel;
using DevExpress.XtraEditors;
namespace DXSample {
public class MyLayoutControlItemPropertyWrapper : LayoutControlItemWrapper {
protected TextEdit Editor { get { return Item.Control as TextEdit; } }
[Category("Mask")]
[DefaultValue(AutoCompleteType.Default)]
public AutoCompleteType AutoComplete {
get {
if (Editor != null) return Editor.Properties.Mask.AutoComplete;
else return AutoCompleteType.Default;
}
set { if (Editor != null) Editor.Properties.Mask.AutoComplete = value; }
}
[Category("Mask")]
[DefaultValue(false)]
public bool BeepOnError {
get {
if (Editor != null) return Editor.Properties.Mask.BeepOnError;
else return false;
}
set { if (Editor != null) Editor.Properties.Mask.BeepOnError = value; }
}
[Category("Mask")]
[DefaultValue("")]
public string EditMask {
get {
if (Editor != null) return Editor.Properties.Mask.EditMask;
else return string.Empty;
}
set { if (Editor != null) Editor.Properties.Mask.EditMask = value; }
}
[Category("Mask")]
[DefaultValue(true)]
public bool IgnoreMaskBlank {
get {
if (Editor != null) return Editor.Properties.Mask.IgnoreMaskBlank;
else return true;
}
set { if (Editor != null) Editor.Properties.Mask.IgnoreMaskBlank = true; }
}
[Category("Mask")]
[DefaultValue(MaskType.None)]
public MaskType MaskType {
get {
if (Editor != null) return Editor.Properties.Mask.MaskType;
else return MaskType.None;
}
set { if (Editor != null) Editor.Properties.Mask.MaskType = value; }
}
[Category("Mask")]
[DefaultValue('\0')]
public char PlaceHolder {
get {
if (Editor != null) return Editor.Properties.Mask.PlaceHolder;
else return '\0';
}
set { if (Editor != null) Editor.Properties.Mask.PlaceHolder = '\0'; }
}
[Category("Mask")]
[DefaultValue(true)]
public bool SaveLiteral {
get {
if (Editor != null) return Editor.Properties.Mask.SaveLiteral;
else return true;
}
set { if (Editor != null) Editor.Properties.Mask.SaveLiteral = value; }
}
[Category("Mask")]
[DefaultValue(true)]
public bool ShowPlaceHolders {
get {
if (Editor != null) return Editor.Properties.Mask.ShowPlaceHolders;
else return true;
}
set { if (Editor != null) Editor.Properties.Mask.ShowPlaceHolders = value; }
}
[Category("Mask")]
[DefaultValue(false)]
public bool UseMaskAsDisplayFormat {
get {
if (Editor != null) return Editor.Properties.Mask.UseMaskAsDisplayFormat;
else return false;
}
set { if (Editor != null) Editor.Properties.Mask.UseMaskAsDisplayFormat = value; }
}
public override BasePropertyGridObjectWrapper Clone() {
return new MyLayoutControlItemPropertyWrapper();
}
}
}