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
- PreviewControlDesigner.cs
- UserControlCodeDomTreeGenerator.cs
- OrderToken.cs
- XComponentModel.cs
- RoleExceptions.cs
- SqlFileStream.cs
- PhysicalAddress.cs
- RtfControlWordInfo.cs
- ControlIdConverter.cs
- XmlAtomicValue.cs
- IteratorAsyncResult.cs
- LicenseManager.cs
- DatatypeImplementation.cs
- PinnedBufferMemoryStream.cs
- BindingValueChangedEventArgs.cs
- RequestCacheEntry.cs
- ExceptionUtility.cs
- IriParsingElement.cs
- FragmentQueryKB.cs
- QueryStatement.cs
- StateDesigner.Helpers.cs
- _BasicClient.cs
- CaseInsensitiveComparer.cs
- SmtpDigestAuthenticationModule.cs
- XhtmlBasicLiteralTextAdapter.cs
- JsonReaderDelegator.cs
- Accessible.cs
- BamlResourceContent.cs
- Stack.cs
- Select.cs
- ExpressionBinding.cs
- XmlDataDocument.cs
- CommandHelper.cs
- ConfigurationManagerHelperFactory.cs
- DesignerForm.cs
- PlatformCulture.cs
- SelectionPatternIdentifiers.cs
- XsltArgumentList.cs
- SchemaImporterExtension.cs
- DbDataReader.cs
- RouteValueExpressionBuilder.cs
- EffectiveValueEntry.cs
- PassportAuthentication.cs
- ResourcesBuildProvider.cs
- CodeSnippetTypeMember.cs
- PingOptions.cs
- ToolStripScrollButton.cs
- DataGridViewCellStyle.cs
- DBSchemaTable.cs
- DetailsViewRowCollection.cs
- InstancePersistenceEvent.cs
- FileLoadException.cs
- UnsafeNativeMethods.cs
- RepeatInfo.cs
- XmlSchemaAnnotated.cs
- TextTrailingCharacterEllipsis.cs
- __Filters.cs
- arclist.cs
- Array.cs
- ExternalDataExchangeService.cs
- ExpressionEditor.cs
- XPathNavigator.cs
- ImmutableCollection.cs
- EntityViewGenerator.cs
- PropertyItemInternal.cs
- GrammarBuilder.cs
- RedistVersionInfo.cs
- XmlSequenceWriter.cs
- ComponentCollection.cs
- DataListItem.cs
- TextControlDesigner.cs
- Point.cs
- Button.cs
- WebProxyScriptElement.cs
- GraphicsPath.cs
- MetadataItemSerializer.cs
- DataGridViewElement.cs
- CodeDirectoryCompiler.cs
- MenuItemBindingCollection.cs
- SolidColorBrush.cs
- CompilationRelaxations.cs
- WorkflowInstance.cs
- RawKeyboardInputReport.cs
- ReadOnlyHierarchicalDataSource.cs
- GridViewColumnCollection.cs
- RecognizedWordUnit.cs
- InternalDuplexChannelFactory.cs
- CharEnumerator.cs
- DSASignatureFormatter.cs
- LoginView.cs
- TargetControlTypeCache.cs
- DataGridViewAccessibleObject.cs
- SafeCancelMibChangeNotify.cs
- Header.cs
- HuffmanTree.cs
- AccessDataSourceView.cs
- InheritanceContextChangedEventManager.cs
- DataTemplateKey.cs
- DiagnosticTraceSource.cs
- UrlMappingsModule.cs