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
- XmlDomTextWriter.cs
- Stopwatch.cs
- altserialization.cs
- PeerInputChannel.cs
- TransformerConfigurationWizardBase.cs
- FixedDSBuilder.cs
- EditCommandColumn.cs
- Italic.cs
- FileSystemEventArgs.cs
- URL.cs
- PrintDialogException.cs
- SecurityDescriptor.cs
- FormsAuthentication.cs
- HtmlInputRadioButton.cs
- ScalarOps.cs
- ExpressionBuilder.cs
- ISFTagAndGuidCache.cs
- FrameworkReadOnlyPropertyMetadata.cs
- ListViewDeletedEventArgs.cs
- CapacityStreamGeometryContext.cs
- AutomationProperties.cs
- MobileListItemCollection.cs
- TrayIconDesigner.cs
- MD5HashHelper.cs
- SafeNativeMethods.cs
- BitmapSource.cs
- KeyTimeConverter.cs
- BezierSegment.cs
- MinMaxParagraphWidth.cs
- TableLayoutRowStyleCollection.cs
- DecoderNLS.cs
- DataGridColumnCollection.cs
- AnimationException.cs
- UserControlBuildProvider.cs
- EditorAttributeInfo.cs
- InfoCardProofToken.cs
- HuffCodec.cs
- OptimalBreakSession.cs
- CoTaskMemUnicodeSafeHandle.cs
- BinHexEncoder.cs
- TableColumnCollectionInternal.cs
- TextModifier.cs
- WriteableBitmap.cs
- ConfigurationManagerHelperFactory.cs
- XmlSchemaCollection.cs
- WSSecurityOneDotOneReceiveSecurityHeader.cs
- BitmapFrame.cs
- VerificationAttribute.cs
- DataGrid.cs
- MarshalByValueComponent.cs
- MetadataArtifactLoaderComposite.cs
- AttributeQuery.cs
- GridViewRowCollection.cs
- DesignerLabelAdapter.cs
- IndentedWriter.cs
- ArglessEventHandlerProxy.cs
- InfoCardRequestException.cs
- ImageMapEventArgs.cs
- FormsAuthenticationEventArgs.cs
- StickyNote.cs
- AssemblyAttributes.cs
- PlainXmlDeserializer.cs
- PageTheme.cs
- ChangeTracker.cs
- WebPartTracker.cs
- BatchWriter.cs
- WorkflowFileItem.cs
- AutoCompleteStringCollection.cs
- ComponentSerializationService.cs
- LongPath.cs
- BoundField.cs
- DefaultParameterValueAttribute.cs
- BindMarkupExtensionSerializer.cs
- SyntaxCheck.cs
- TextViewSelectionProcessor.cs
- CustomAttribute.cs
- WindowInteractionStateTracker.cs
- MarkupCompiler.cs
- ListView.cs
- AdCreatedEventArgs.cs
- XmlAnyElementAttribute.cs
- Polyline.cs
- CompensationHandlingFilter.cs
- SQLGuidStorage.cs
- CounterSampleCalculator.cs
- DesignerAttribute.cs
- BaseCollection.cs
- AppDomainProtocolHandler.cs
- EntityDataSourceSelectingEventArgs.cs
- XamlReaderHelper.cs
- ObjectToModelValueConverter.cs
- Debug.cs
- ListViewCancelEventArgs.cs
- OracleConnectionStringBuilder.cs
- DataTemplateKey.cs
- ListViewItem.cs
- XPathExpr.cs
- Attributes.cs
- HttpStreamMessageEncoderFactory.cs
- ThreadLocal.cs