Bugzilla – Attachment 244826 Details for
Bug 428698
StatusBarPanel: Begin implementation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Uploaded a patch to support GridItem pattern.
griditem.patch (text/plain), 9.31 KB, created by
Neville Gao
on 2008-10-10 09:51:27 UTC
(
hide
)
Description:
Uploaded a patch to support GridItem pattern.
Filename:
MIME Type:
Creator:
Neville Gao
Created:
2008-10-10 09:51:27 UTC
Size:
9.31 KB
patch
obsolete
>Index: Mono.UIAutomation.Winforms.mdp >=================================================================== >--- Mono.UIAutomation.Winforms.mdp (revision 115408) >+++ Mono.UIAutomation.Winforms.mdp (working copy) >@@ -152,6 +152,8 @@ > <File name="Mono.UIAutomation.Winforms.Behaviors/ListView/MultipleViewProviderBehavior.cs" subtype="Code" buildaction="Compile" /> > <File name="Mono.UIAutomation.Winforms/IScrollBehaviorSubject.cs" subtype="Code" buildaction="Compile" /> > <File name="Mono.UIAutomation.Winforms/ScrollBehaviorObserver.cs" subtype="Code" buildaction="Compile" /> >+ <File name="Mono.UIAutomation.Winforms.Behaviors/StatusBar/StatusBarPanelGridItemProviderBehavior.cs" subtype="Code" buildaction="Compile" /> >+ <File name="Mono.UIAutomation.Winforms.Events/StatusBar/StatusBarPanelGridItemPatternColumnEvent.cs" subtype="Code" buildaction="Compile" /> > </Contents> > <References> > <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> >Index: Mono.UIAutomation.Winforms/StatusBarProvider.cs >=================================================================== >--- Mono.UIAutomation.Winforms/StatusBarProvider.cs (revision 115409) >+++ Mono.UIAutomation.Winforms/StatusBarProvider.cs (working copy) >@@ -185,6 +185,8 @@ > > SetBehavior (ValuePatternIdentifiers.Pattern, > new StatusBarPanelValueProviderBehavior (this)); >+ SetBehavior (GridItemPatternIdentifiers.Pattern, >+ new StatusBarPanelGridItemProviderBehavior (this, statusBarPanel)); > } > > #endregion >Index: Mono.UIAutomation.Winforms.Behaviors/StatusBar/StatusBarPanelGridItemProviderBehavior.cs >=================================================================== >--- Mono.UIAutomation.Winforms.Behaviors/StatusBar/StatusBarPanelGridItemProviderBehavior.cs (revision 0) >+++ Mono.UIAutomation.Winforms.Behaviors/StatusBar/StatusBarPanelGridItemProviderBehavior.cs (revision 0) >@@ -0,0 +1,127 @@ >+// Permission is hereby granted, free of charge, to any person obtaining >+// a copy of this software and associated documentation files (the >+// "Software"), to deal in the Software without restriction, including >+// without limitation the rights to use, copy, modify, merge, publish, >+// distribute, sublicense, and/or sell copies of the Software, and to >+// permit persons to whom the Software is furnished to do so, subject to >+// the following conditions: >+// >+// The above copyright notice and this permission notice shall be >+// included in all copies or substantial portions of the Software. >+// >+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, >+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF >+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND >+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE >+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION >+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION >+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. >+// >+// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) >+// >+// Authors: >+// Neville Gao <nevillegao@gmail.com> >+// >+ >+using System; >+using System.Windows.Automation; >+using System.Windows.Automation.Provider; >+using SWF = System.Windows.Forms; >+using Mono.UIAutomation.Winforms; >+using Mono.UIAutomation.Winforms.Events; >+using Mono.UIAutomation.Winforms.Events.StatusBar; >+ >+namespace Mono.UIAutomation.Winforms.Behaviors.StatusBar >+{ >+ internal class StatusBarPanelGridItemProviderBehavior : ProviderBehavior, IGridItemProvider >+ { >+ #region Constructor >+ >+ public StatusBarPanelGridItemProviderBehavior (StatusBarProvider.StatusBarPanelProvider provider, >+ SWF.StatusBarPanel statusBarPanel) >+ : base (provider) >+ { >+ this.statusBarPanel = statusBarPanel; >+ } >+ >+ #endregion >+ >+ #region IProviderBehavior Interface >+ >+ public override AutomationPattern ProviderPattern { >+ get { return GridItemPatternIdentifiers.Pattern; } >+ } >+ >+ public override void Connect (SWF.Control control) >+ { >+ // NOTE: Row Property NEVER changes. >+ // NOTE: RowSpan Property NEVER changes. >+ // NOTE: ColumnSpan Property NEVER changes. >+ // NOTE: ContainingGrid Property NEVER changes. >+ Provider.SetEvent (ProviderEventType.GridItemPatternColumnProperty, >+ new StatusBarPanelGridItemPatternColumnEvent (Provider)); >+ } >+ >+ public override void Disconnect (SWF.Control control) >+ { >+ Provider.SetEvent (ProviderEventType.GridItemPatternRowProperty, >+ null); >+ Provider.SetEvent (ProviderEventType.GridItemPatternColumnProperty, >+ null); >+ Provider.SetEvent (ProviderEventType.GridItemPatternRowSpanProperty, >+ null); >+ Provider.SetEvent (ProviderEventType.GridItemPatternColumnProperty, >+ null); >+ Provider.SetEvent (ProviderEventType.GridItemPatternContainingGridProperty, >+ null); >+ } >+ >+ public override object GetPropertyValue (int propertyId) >+ { >+ if (propertyId == GridItemPatternIdentifiers.RowProperty.Id) >+ return Row; >+ else if (propertyId == GridItemPatternIdentifiers.ColumnProperty.Id) >+ return Column; >+ else if (propertyId == GridItemPatternIdentifiers.RowSpanProperty.Id) >+ return RowSpan; >+ else if (propertyId == GridItemPatternIdentifiers.ColumnSpanProperty.Id) >+ return ColumnSpan; >+ else if (propertyId == GridItemPatternIdentifiers.ContainingGridProperty.Id) >+ return ContainingGrid; >+ else >+ return base.GetPropertyValue (propertyId); >+ } >+ >+ #endregion >+ >+ #region IGridItemProvider Members >+ >+ public int Row { >+ get { return 0; } >+ } >+ >+ public int Column { >+ get { return statusBarPanel.Parent.Panels.IndexOf (statusBarPanel); } >+ } >+ >+ public int RowSpan { >+ get { return 1; } >+ } >+ >+ public int ColumnSpan { >+ get { return 1; } >+ } >+ >+ public IRawElementProviderSimple ContainingGrid { >+ get { return ProviderFactory.GetProvider (statusBarPanel.Parent); } >+ } >+ >+ #endregion >+ >+ #region Private Fields >+ >+ private SWF.StatusBarPanel statusBarPanel; >+ >+ #endregion >+ } >+} >Index: Mono.UIAutomation.Winforms.Events/StatusBar/StatusBarPanelGridItemPatternColumnEvent.cs >=================================================================== >--- Mono.UIAutomation.Winforms.Events/StatusBar/StatusBarPanelGridItemPatternColumnEvent.cs (revision 0) >+++ Mono.UIAutomation.Winforms.Events/StatusBar/StatusBarPanelGridItemPatternColumnEvent.cs (revision 0) >@@ -0,0 +1,80 @@ >+// Permission is hereby granted, free of charge, to any person obtaining >+// a copy of this software and associated documentation files (the >+// "Software"), to deal in the Software without restriction, including >+// without limitation the rights to use, copy, modify, merge, publish, >+// distribute, sublicense, and/or sell copies of the Software, and to >+// permit persons to whom the Software is furnished to do so, subject to >+// the following conditions: >+// >+// The above copyright notice and this permission notice shall be >+// included in all copies or substantial portions of the Software. >+// >+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, >+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF >+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND >+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE >+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION >+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION >+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. >+// >+// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) >+// >+// Authors: >+// Neville Gao <nevillegao@gmail.com> >+// >+ >+using System; >+using System.Windows.Automation; >+using System.Windows.Automation.Provider; >+using SWF = System.Windows.Forms; >+using System.ComponentModel; >+ >+namespace Mono.UIAutomation.Winforms.Events.StatusBar >+{ >+ internal class StatusBarPanelGridItemPatternColumnEvent : BaseAutomationPropertyEvent >+ { >+ #region Constructor >+ >+ public StatusBarPanelGridItemPatternColumnEvent (IRawElementProviderSimple provider) >+ : base (provider, GridItemPatternIdentifiers.ColumnProperty) >+ { >+ } >+ >+ #endregion >+ >+ #region IConnectable Overrides >+ >+ public override void Connect (SWF.Control control) >+ { >+ try { >+ Helper.AddPrivateEvent (typeof (SWF.StatusBar.StatusBarPanelCollection), >+ ((SWF.StatusBar) control).Panels, >+ "UIACollectionChanged", >+ this, >+ "OnColumnChanged"); >+ } catch (NotSupportedException) { } >+ } >+ >+ public override void Disconnect (SWF.Control control) >+ { >+ try { >+ Helper.RemovePrivateEvent (typeof (SWF.StatusBar.StatusBarPanelCollection), >+ ((SWF.StatusBar) control).Panels, >+ "UIACollectionChanged", >+ this, >+ "OnColumnChanged"); >+ } catch (NotSupportedException) { } >+ } >+ >+ #endregion >+ >+ #region Private Methods >+ >+ protected void OnColumnChanged (object sender, CollectionChangeEventArgs e) >+ { >+ RaiseAutomationPropertyChangedEvent (); >+ } >+ >+ #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 428698
:
244505
|
244826
|
245908