Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / UIAutomation / Win32Providers / MS / Internal / AutomationProxies / WindowsToolbarAsMenu.cs / 1 / 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
- VisualTreeFlattener.cs
- InputLangChangeRequestEvent.cs
- DataReceivedEventArgs.cs
- ObjectParameter.cs
- ExecutedRoutedEventArgs.cs
- ArrayEditor.cs
- ConfigXmlWhitespace.cs
- PublisherMembershipCondition.cs
- ToolStripContainer.cs
- StringBuilder.cs
- UserValidatedEventArgs.cs
- DelegateArgument.cs
- TypeGeneratedEventArgs.cs
- WorkflowQueue.cs
- webclient.cs
- CallContext.cs
- EventKeyword.cs
- ClientFormsAuthenticationCredentials.cs
- ToggleButtonAutomationPeer.cs
- CheckableControlBaseAdapter.cs
- ObsoleteAttribute.cs
- DbConnectionInternal.cs
- DbBuffer.cs
- InputLangChangeEvent.cs
- TransactionValidationBehavior.cs
- ServiceBusyException.cs
- SqlWriter.cs
- SecurityContextSecurityTokenParameters.cs
- StringComparer.cs
- MouseButton.cs
- IISMapPath.cs
- DataControlFieldCollection.cs
- Viewport3DAutomationPeer.cs
- Renderer.cs
- HttpApplicationFactory.cs
- PreviewPrintController.cs
- XamlClipboardData.cs
- TableLayoutPanelCellPosition.cs
- FixedPageProcessor.cs
- SpotLight.cs
- DocumentSequenceHighlightLayer.cs
- KeyedCollection.cs
- SystemIPInterfaceStatistics.cs
- CalendarDay.cs
- PrintControllerWithStatusDialog.cs
- ContentValidator.cs
- ExpressionWriter.cs
- ColorConverter.cs
- Brush.cs
- TransformConverter.cs
- KeyEvent.cs
- CryptoProvider.cs
- PrintSystemException.cs
- DocumentViewer.cs
- EntityDataSourceDesigner.cs
- DbProviderManifest.cs
- QuotaThrottle.cs
- StringUtil.cs
- CommandID.cs
- DataGridViewRowsRemovedEventArgs.cs
- XmlWrappingWriter.cs
- DirectoryRootQuery.cs
- CacheEntry.cs
- XmlCharCheckingWriter.cs
- HtmlShimManager.cs
- ListControlConvertEventArgs.cs
- HtmlTextViewAdapter.cs
- EmptyReadOnlyDictionaryInternal.cs
- infer.cs
- UnsafeNativeMethodsTablet.cs
- OdbcEnvironmentHandle.cs
- AttributeProviderAttribute.cs
- EventManager.cs
- ImageMapEventArgs.cs
- TextBounds.cs
- TimeSpanConverter.cs
- ApplicationFileCodeDomTreeGenerator.cs
- InstallerTypeAttribute.cs
- BooleanStorage.cs
- TdsParserSafeHandles.cs
- PolicyManager.cs
- ChannelCacheDefaults.cs
- XpsSerializationException.cs
- mediaeventshelper.cs
- PackageRelationshipSelector.cs
- nulltextnavigator.cs
- SiteMapDataSourceView.cs
- ValueConversionAttribute.cs
- FileIOPermission.cs
- CuspData.cs
- Figure.cs
- BCLDebug.cs
- FlagsAttribute.cs
- ApplicationId.cs
- GradientStop.cs
- AsynchronousChannel.cs
- CacheSection.cs
- IPAddressCollection.cs
- BufferedGenericXmlSecurityToken.cs
- AxWrapperGen.cs