forked from VR2VYE/OpenGD77CPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomNumericUpDown.cs
148 lines (132 loc) · 2.82 KB
/
CustomNumericUpDown.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
using System;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
internal class CustomNumericUpDown : NumericUpDown
{
public void method_0(int int_0)
{
TextBox textBox = base.Controls[1] as TextBox;
if (textBox != null)
{
textBox.MaxLength = int_0;
}
}
string _003CInputString_003Ek__BackingField;
decimal _003CReplaceValue_003Ek__BackingField;
[CompilerGenerated]
public string method_1()
{
return this._003CInputString_003Ek__BackingField;
}
[CompilerGenerated]
public void method_2(string string_0)
{
this._003CInputString_003Ek__BackingField = string_0;
}
[CompilerGenerated]
public decimal method_3()
{
return this._003CReplaceValue_003Ek__BackingField;
}
[CompilerGenerated]
public void method_4(decimal decimal_0)
{
this._003CReplaceValue_003Ek__BackingField = decimal_0;
}
string _003CReplaceString_003Ek__BackingField;
[CompilerGenerated]
public string method_5()
{
return this._003CReplaceString_003Ek__BackingField;
}
[CompilerGenerated]
public void method_6(string string_0)
{
this._003CReplaceString_003Ek__BackingField = string_0;
}
public override void UpButton()
{
decimal value = base.Value;
value += base.Increment;
if (value > base.Maximum)
{
value = base.Minimum;
}
else if (value % base.Increment != 0m)
{
value -= value % base.Increment;
}
base.Value = value;
}
public override void DownButton()
{
decimal value = base.Value;
value -= base.Increment;
if (value < base.Minimum)
{
value = base.Maximum;
}
else if (value % base.Increment != 0m)
{
value += base.Increment - value % base.Increment;
}
base.Value = value;
}
protected override void OnLostFocus(EventArgs e)
{
decimal value = base.Value;
if (value < base.Minimum)
{
value = (base.Value = base.Maximum);
}
else if (value % base.Increment != 0m)
{
value = (base.Value = value - value % base.Increment);
}
base.OnLostFocus(e);
}
protected virtual void vmethod_0(object sender, EventArgs e)
{
}
protected override void OnTextBoxKeyPress(object source, KeyPressEventArgs e)
{
if (!string.IsNullOrEmpty(this.method_1()) && this.method_1().IndexOf(e.KeyChar) < 0)
{
e.Handled = true;
}
else
{
base.OnTextBoxKeyPress(source, e);
}
}
protected override void UpdateEditText()
{
if (this.method_5() != null && this.method_5().Length != 0 && base.Value == this.method_3())
{
this.Text = this.method_5();
}
else
{
base.UpdateEditText();
}
}
protected override void OnMouseWheel(MouseEventArgs e)
{
HandledMouseEventArgs handledMouseEventArgs = e as HandledMouseEventArgs;
if (handledMouseEventArgs != null)
{
handledMouseEventArgs.Handled = true;
}
if (e.Delta < 0)
{
SendKeys.Send("{DOWN}");
}
else
{
SendKeys.Send("{UP}");
}
}
public CustomNumericUpDown():base()
{
}
}