diff options
author | Nikita Voronchev <nikita.voronchev@ru.axxonsoft.com> | 2019-11-28 01:59:04 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-11-28 01:59:04 +0300 |
commit | 7db23898467cc19ea24e3370d20b00e6e7f89381 (patch) | |
tree | 6519ea5804f0ca36b4e40ea654e52655fe3cb33a /mcs/class | |
parent | f135312b4467ae6b602747af2273a3f42fe61c45 (diff) |
[WinForms][UIA] Add to the PropertyGrid new internal event to track grid items expanded state update (#17731)
This PR is needed for the https://github.com/mono/uia2atk/pull/6 one.
Diffstat (limited to 'mcs/class')
-rw-r--r-- | mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyGrid.cs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyGrid.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyGrid.cs index d35331b2b02..5996403372b 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyGrid.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyGrid.cs @@ -566,11 +566,13 @@ namespace System.Windows.Forms internal void OnExpandItem (GridEntry item) { property_grid_view.ExpandItem (item); + OnExpandedItemChanged (EventArgs.Empty); } internal void OnCollapseItem (GridEntry item) { property_grid_view.CollapseItem (item); + OnExpandedItemChanged (EventArgs.Empty); } internal DialogResult ShowError (string text) @@ -1081,7 +1083,7 @@ namespace System.Windows.Forms if (eh != null) eh (this, e); } - + protected virtual void OnPropertyTabChanged (PropertyTabChangedEventArgs e) { PropertyTabChangedEventHandler eh = (PropertyTabChangedEventHandler)(Events [PropertyTabChangedEvent]); @@ -1119,6 +1121,13 @@ namespace System.Windows.Forms base.OnVisibleChanged (e); } + protected void OnExpandedItemChanged (EventArgs e) + { + EventHandler eh = (EventHandler)(Events [ExpandedItemChangedEvent]); + if (eh != null) + eh (this, e); + } + protected override bool ProcessDialogKey (Keys keyData) { return base.ProcessDialogKey (keyData); } @@ -1140,6 +1149,7 @@ namespace System.Windows.Forms static object PropertyValueChangedEvent = new object (); static object SelectedGridItemChangedEvent = new object (); static object SelectedObjectsChangedEvent = new object (); + static object ExpandedItemChangedEvent = new object (); public event EventHandler PropertySortChanged { add { Events.AddHandler (PropertySortChangedEvent, value); } @@ -1165,6 +1175,12 @@ namespace System.Windows.Forms add { Events.AddHandler (SelectedObjectsChangedEvent, value); } remove { Events.RemoveHandler (SelectedObjectsChangedEvent, value); } } + + // UIA Framework Note: Used to track changes of expanded state of grid items + internal event EventHandler ExpandedItemChanged { + add { Events.AddHandler (ExpandedItemChangedEvent, value); } + remove { Events.RemoveHandler (ExpandedItemChangedEvent, value); } + } [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] |