Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / UIAutomation / Win32Providers / MS / Internal / AutomationProxies / WindowsToolbarAsMenu.cs / 1305600 / WindowsToolbarAsMenu.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Some applications implement menus with toolbars. This proxy // will used the IAccessible to expose these toolbars as // menus. This proxy is derived from WindowsToolbar since // the underlying control really is a toolbar and WindowsToolbar // knows how to communicate with then underlying toolbar control // already. // // History: // 01/31/2005 : [....] Created //--------------------------------------------------------------------------- using System; using System.Windows.Automation; using MS.Win32; namespace MS.Internal.AutomationProxies { class WindowsToolbarAsMenu : WindowsToolbar { // ----------------------------------------------------- // // Constructors // // ----------------------------------------------------- #region Constructors internal WindowsToolbarAsMenu(IntPtr hwnd, ProxyFragment parent, int item, Accessible acc) : base( hwnd, parent, item ) { _acc = acc; // Set the control type based on the IAccessible role. AccessibleRole role = acc.Role; if (role == AccessibleRole.MenuBar) { _cControlType = ControlType.MenuBar; _sAutomationId = "MenuBar"; // This string is a non-localizable string } else if (role == AccessibleRole.MenuPopup) { _cControlType = ControlType.Menu; _sAutomationId = "MenuPopup"; // This string is a non-localizable string } else { System.Diagnostics.Debug.Assert(false, "Unexpected role " + role); } } #endregion // ------------------------------------------------------ // // Private Fields // // ----------------------------------------------------- #region Private Fields Accessible _acc; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Some applications implement menus with toolbars. This proxy // will used the IAccessible to expose these toolbars as // menus. This proxy is derived from WindowsToolbar since // the underlying control really is a toolbar and WindowsToolbar // knows how to communicate with then underlying toolbar control // already. // // History: // 01/31/2005 : [....] Created //--------------------------------------------------------------------------- using System; using System.Windows.Automation; using MS.Win32; namespace MS.Internal.AutomationProxies { class WindowsToolbarAsMenu : WindowsToolbar { // ----------------------------------------------------- // // Constructors // // ----------------------------------------------------- #region Constructors internal WindowsToolbarAsMenu(IntPtr hwnd, ProxyFragment parent, int item, Accessible acc) : base( hwnd, parent, item ) { _acc = acc; // Set the control type based on the IAccessible role. AccessibleRole role = acc.Role; if (role == AccessibleRole.MenuBar) { _cControlType = ControlType.MenuBar; _sAutomationId = "MenuBar"; // This string is a non-localizable string } else if (role == AccessibleRole.MenuPopup) { _cControlType = ControlType.Menu; _sAutomationId = "MenuPopup"; // This string is a non-localizable string } else { System.Diagnostics.Debug.Assert(false, "Unexpected role " + role); } } #endregion // ------------------------------------------------------ // // Private Fields // // ----------------------------------------------------- #region Private Fields Accessible _acc; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HtmlInputSubmit.cs
- WindowHideOrCloseTracker.cs
- XslNumber.cs
- SafeSecurityHandles.cs
- AutomationEventArgs.cs
- OrderedDictionary.cs
- ToolStripOverflow.cs
- LinearGradientBrush.cs
- FormsAuthentication.cs
- regiisutil.cs
- TimeSpanConverter.cs
- PerfService.cs
- WebDescriptionAttribute.cs
- ManagementException.cs
- WSSecureConversationDec2005.cs
- NetworkStream.cs
- SecurityState.cs
- RelationshipConverter.cs
- HttpChannelBindingToken.cs
- ComponentChangingEvent.cs
- DataGridViewRowStateChangedEventArgs.cs
- JsonQNameDataContract.cs
- PasswordRecovery.cs
- COM2ExtendedBrowsingHandler.cs
- SharedDp.cs
- OutOfMemoryException.cs
- Debug.cs
- EdmItemCollection.cs
- SerializationFieldInfo.cs
- RuntimeHelpers.cs
- DataTableCollection.cs
- StructuredCompositeActivityDesigner.cs
- FacetDescription.cs
- ChangePassword.cs
- InstanceLockQueryResult.cs
- DeclaredTypeElement.cs
- SortFieldComparer.cs
- IntPtr.cs
- MobileTextWriter.cs
- WindowsGrip.cs
- EqualityComparer.cs
- HitTestDrawingContextWalker.cs
- XmlCompatibilityReader.cs
- SafeProcessHandle.cs
- ListViewEditEventArgs.cs
- ReflectionServiceProvider.cs
- ArrayElementGridEntry.cs
- NaturalLanguageHyphenator.cs
- TextRenderer.cs
- DeflateInput.cs
- ObjectDataSourceView.cs
- SchemaInfo.cs
- DeobfuscatingStream.cs
- UInt64.cs
- TagMapCollection.cs
- SQLDoubleStorage.cs
- BooleanStorage.cs
- HtmlTextArea.cs
- WindowsToolbarAsMenu.cs
- AudioFormatConverter.cs
- C14NUtil.cs
- PaginationProgressEventArgs.cs
- ProcessRequestAsyncResult.cs
- lengthconverter.cs
- ImplicitInputBrush.cs
- EqualityComparer.cs
- ListenerElementsCollection.cs
- AccessibilityApplicationManager.cs
- ReturnValue.cs
- WSHttpBindingCollectionElement.cs
- ScriptRef.cs
- TypeDependencyAttribute.cs
- DescendentsWalkerBase.cs
- MatrixConverter.cs
- UnaryQueryOperator.cs
- ExpressionConverter.cs
- ObjectPropertyMapping.cs
- DecimalStorage.cs
- XmlAnyAttributeAttribute.cs
- XmlHelper.cs
- SafeNativeMethods.cs
- Point3DCollection.cs
- DataGridViewRowEventArgs.cs
- CompilationRelaxations.cs
- BackgroundFormatInfo.cs
- XNodeValidator.cs
- PropertyInformationCollection.cs
- Formatter.cs
- EventMetadata.cs
- CngKeyBlobFormat.cs
- IProducerConsumerCollection.cs
- InternalControlCollection.cs
- DynamicResourceExtensionConverter.cs
- ButtonBaseDesigner.cs
- SqlCacheDependencyDatabase.cs
- WebPartConnectionsEventArgs.cs
- ISAPIWorkerRequest.cs
- FrameworkElementAutomationPeer.cs
- UIElementIsland.cs
- Journaling.cs