/
Form1.cs
35 lines (34 loc) · 1.11 KB
/
Form1.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
namespace TokenEditTest {
public partial class Form1 : XtraForm {
public Form1() {
InitializeComponent();
}
protected override void OnLoad(EventArgs e) {
base.OnLoad(e);
InitTokenEdit();
}
void InitTokenEdit() {
tokenEdit.Properties.CustomDropDownControl = new CustomTokenEditDropDownControl();
for(int i = 0; i < 20; i++) {
string desc = string.Format("Token{0}", i.ToString());
tokenEdit.Properties.Tokens.Add(new TokenEditToken(desc, desc));
}
}
void OnTokenEditValidateToken(object sender, TokenEditValidateTokenEventArgs e) {
e.Value = e.Description;
e.IsValid = true;
}
void OnTokenEditValueChanged(object sender, EventArgs e) {
Text = ((TokenEdit)sender).EditValue.ToString();
}
}
}