-
Notifications
You must be signed in to change notification settings - Fork 80
/
ProtectedContentEdit.cs
40 lines (38 loc) · 2.04 KB
/
ProtectedContentEdit.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
using DevExpress.Accessibility;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Drawing;
using DevExpress.XtraEditors.Registrator;
using DevExpress.XtraEditors.Repository;
using DevExpress.XtraEditors.ViewInfo;
namespace WindowsFormsApplication {
public class ProtectedContentEdit : TextEdit {
public ProtectedContentEdit() : base() {
Enabled = false;
}
internal const string EditorName = "ProtectedContentEdit";
internal const string ProtectedContentText = "*******";
static ProtectedContentEdit() { RepositoryItemProtectedContentTextEdit.Register(); }
public override string EditorTypeName => EditorName;
}
public class RepositoryItemProtectedContentTextEdit : RepositoryItemTextEdit {
static RepositoryItemProtectedContentTextEdit() { Register(); }
public RepositoryItemProtectedContentTextEdit() { ExportMode = ExportMode.DisplayText; }
internal static void Register() {
if(!EditorRegistrationInfo.Default.Editors.Contains(ProtectedContentEdit.EditorName)) {
EditorRegistrationInfo.Default.Editors
.Add(new EditorClassInfo(ProtectedContentEdit.EditorName,
typeof(ProtectedContentEdit),
typeof(RepositoryItemProtectedContentTextEdit),
typeof(TextEditViewInfo),
new TextEditPainter(),
designTimeVisible: true,
EditImageIndexes.TextEdit,
typeof(TextEditAccessible)));
}
}
public override string GetDisplayText(FormatInfo format, object editValue) { return ProtectedContentEdit.ProtectedContentText; }
public override string EditorTypeName => ProtectedContentEdit.EditorName;
public override bool ReadOnly { get { return true; } set { } }
}
}