ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/Win32/libWin32/Win32/UI/MaskedHexBox.cs
(Generate patch)

Comparing trunk/Win32/libWin32/Win32/UI/MaskedHexBox.cs (file contents):
Revision 286 by william, Sun Jun 3 16:09:05 2012 UTC vs.
Revision 287 by william, Tue Jun 5 08:52:07 2012 UTC

# Line 9 | Line 9 | using System.Runtime.InteropServices;
9  
10   namespace System.Windows.Forms
11   {
12 +    [DefaultEvent("ValueChanged")]
13      public partial class MaskedHexBox : UserControl
14      {
15          public MaskedHexBox()
# Line 23 | Line 24 | namespace System.Windows.Forms
24              this.isAddressMask = true;
25              txtMaskedHexBox.KeyDown += new KeyEventHandler(txtMaskedHexBox_KeyDown);
26              txtMaskedHexBox.TextAlign = HorizontalAlignment.Right;
27 <
27 >            ValueChanged = null;
28          }
29 +        [Browsable(true)]
30 +        [Category("Property Changed")]
31 +        [Description("Raised when the Value displayed changes.")]
32 +        public event EventHandler<ValueChangedEventArgs> ValueChanged;
33  
34          private void MaskedHexBox_KeyDown(object sender, KeyEventArgs e)
35          {
# Line 78 | Line 83 | namespace System.Windows.Forms
83              get { return this.ToInt64(); }
84              set
85              {
86 +                long old_value = this.Value;
87                  switch (this.TextLength)
88                  {
89                      case 0:
# Line 91 | Line 97 | namespace System.Windows.Forms
97                      case 8: this.Text = string.Format("0x{0:x8}", value); break;
98                      default: this.Text = string.Format("0x{0:x" + this.TextLength + "}", value); break;
99                  }
100 +                long new_value = this.Value;
101 +                if ((new_value!= old_value) && ValueChanged != null)
102 +                    ValueChanged(this, new ValueChangedEventArgs(old_value, new_value));
103              }
104          }
105          private bool _isAddressMask;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines