Bugzilla – Attachment 264690 Details for
Bug 428759
ToolBar: Begin implementation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Updated Invoke() event
toolbar.patch (text/plain), 2.31 KB, created by
Neville Gao
on 2009-01-13 07:39:48 UTC
(
hide
)
Description:
Updated Invoke() event
Filename:
MIME Type:
Creator:
Neville Gao
Created:
2009-01-13 07:39:48 UTC
Size:
2.31 KB
patch
obsolete
>Index: Mono.UIAutomation.Winforms.Behaviors/ToolBar/ToolBarButtonInvokeProviderBehavior.cs >=================================================================== >--- Mono.UIAutomation.Winforms.Behaviors/ToolBar/ToolBarButtonInvokeProviderBehavior.cs (revision 123169) >+++ Mono.UIAutomation.Winforms.Behaviors/ToolBar/ToolBarButtonInvokeProviderBehavior.cs (working copy) >@@ -40,6 +40,8 @@ > public ToolBarButtonInvokeProviderBehavior (ToolBarProvider.ToolBarButtonProvider provider) > : base (provider) > { >+ this.toolBarButton = (SWF.ToolBarButton) Provider.Component; >+ this.toolBar = this.toolBarButton.Parent; > } > > #endregion >@@ -68,9 +70,37 @@ > > public void Invoke () > { >- // TODO: >+ if (toolBar.Enabled == false) >+ throw new ElementNotEnabledException (); >+ >+ PerformClick (); > } > > #endregion >+ >+ #region Private Methods >+ >+ private void PerformClick () >+ { >+ if (toolBar.InvokeRequired == true) { >+ toolBar.BeginInvoke (new SWF.MethodInvoker (PerformClick)); >+ return; >+ } >+ >+ if (toolBarButton.Style == SWF.ToolBarButtonStyle.ToggleButton) { >+ if (!toolBarButton.Pushed) >+ toolBarButton.Pushed = true; >+ else >+ toolBarButton.Pushed = false; >+ } >+ } >+ #endregion >+ >+ #region Private Fields >+ >+ private SWF.ToolBarButton toolBarButton; >+ private SWF.ToolBar toolBar; >+ >+ #endregion > } > } >Index: Mono.UIAutomation.Winforms.Events/ToolBar/ToolBarButtonInvokePatternInvokedEvent.cs >=================================================================== >--- Mono.UIAutomation.Winforms.Events/ToolBar/ToolBarButtonInvokePatternInvokedEvent.cs (revision 123169) >+++ Mono.UIAutomation.Winforms.Events/ToolBar/ToolBarButtonInvokePatternInvokedEvent.cs (working copy) >@@ -46,14 +46,14 @@ > > public override void Connect () > { >-// ((SWF.ToolBar) Provider.Control).ButtonClick += >-// new SWF.ToolBarButtonClickEventHandler (OnButtonClick); >+ ((SWF.ToolBarButton) Provider.Component).Parent.ButtonClick += >+ new SWF.ToolBarButtonClickEventHandler (OnButtonClick); > } > > public override void Disconnect () > { >-// ((SWF.ToolBar) Provider.Control).ButtonClick -= >-// new SWF.ToolBarButtonClickEventHandler (OnButtonClick); >+ ((SWF.ToolBarButton) Provider.Component).Parent.ButtonClick -= >+ new SWF.ToolBarButtonClickEventHandler (OnButtonClick); > } > > #endregion
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 428759
:
257630
|
264052
| 264690