diff options
-rw-r--r-- | mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs | 35 |
2 files changed, 37 insertions, 3 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index fe429c03a9e..07ae8139d13 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2009-01-16 Mario Carrion <mcarrion@novell.com> + + * ColumnHeader.cs: UIA Support: raising internal event UIATextChanged + when changing Text. + 2009-01-16 Carlos Alberto Cortez <calberto.cortez@ggmail.com> * X11Structs.cs: diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs index 2edaa99d010..db6170ecc2f 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs @@ -293,9 +293,16 @@ namespace System.Windows.Forms public string Text { get { return text; } set { - text = value; - if (owner != null) - owner.Redraw (true); + if (text != value) { + text = value; + if (owner != null) + owner.Redraw (true); + +#if NET_2_0 + // UIA Framework: Raising Value changed event + OnUIATextChanged (); +#endif + } } } @@ -366,5 +373,27 @@ namespace System.Windows.Forms base.Dispose (disposing); } #endregion // Protected Methods + +#if NET_2_0 + + #region UIA Framework: Methods, Properties and Events + + static object UIATextChangedEvent = new object (); + + internal event EventHandler UIATextChanged { + add { Events.AddHandler (UIATextChangedEvent, value); } + remove { Events.RemoveHandler (UIATextChangedEvent, value); } + } + + private void OnUIATextChanged () + { + EventHandler eh = (EventHandler) Events [UIATextChangedEvent]; + if (eh != null) + eh (this, EventArgs.Empty); + } + + #endregion + +#endif } } |