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
- BrowserInteropHelper.cs
- dsa.cs
- ObjectViewEntityCollectionData.cs
- MimeTypePropertyAttribute.cs
- MouseGestureConverter.cs
- DockEditor.cs
- RoleService.cs
- TextEditorCopyPaste.cs
- ServiceDescription.cs
- QueryGeneratorBase.cs
- ClockController.cs
- RenderDataDrawingContext.cs
- FederatedMessageSecurityOverHttpElement.cs
- _Semaphore.cs
- ObjectResult.cs
- BamlWriter.cs
- HttpProcessUtility.cs
- DataRow.cs
- TemplatedAdorner.cs
- XmlHierarchicalEnumerable.cs
- MDIControlStrip.cs
- GPStream.cs
- RestrictedTransactionalPackage.cs
- ProxyElement.cs
- Double.cs
- WarningException.cs
- FontWeight.cs
- TypeDescriptionProviderAttribute.cs
- StoragePropertyMapping.cs
- DateTime.cs
- IxmlLineInfo.cs
- AutomationPatternInfo.cs
- NotCondition.cs
- COM2Enum.cs
- DataGridViewMethods.cs
- DataSet.cs
- xmlglyphRunInfo.cs
- ChainOfDependencies.cs
- ModelPropertyImpl.cs
- ObjectResult.cs
- SemaphoreSecurity.cs
- DataListItemCollection.cs
- SecurityTokenAttachmentMode.cs
- Vector3DValueSerializer.cs
- SortableBindingList.cs
- BlockCollection.cs
- TlsnegoTokenAuthenticator.cs
- Object.cs
- OneOfTypeConst.cs
- Base64Stream.cs
- EventDescriptorCollection.cs
- PathFigure.cs
- EntityDataSourceWrapper.cs
- ScrollProperties.cs
- LogicalExpressionTypeConverter.cs
- Bitmap.cs
- ControlTemplate.cs
- WindowsFormsLinkLabel.cs
- FileAuthorizationModule.cs
- DataPagerFieldCommandEventArgs.cs
- Encoder.cs
- CalendarModeChangedEventArgs.cs
- BitConverter.cs
- ExpressionEvaluator.cs
- ToolStripRendererSwitcher.cs
- SqlFactory.cs
- _HeaderInfo.cs
- connectionpool.cs
- InvalidAsynchronousStateException.cs
- GradientBrush.cs
- xamlnodes.cs
- QueryGeneratorBase.cs
- PopupRoot.cs
- TableItemStyle.cs
- CompilationPass2Task.cs
- RuntimeWrappedException.cs
- MonitorWrapper.cs
- _ChunkParse.cs
- CheckableControlBaseAdapter.cs
- HttpModule.cs
- FixedSOMLineRanges.cs
- AliasGenerator.cs
- SQLCharsStorage.cs
- FlowchartStart.xaml.cs
- XPathMultyIterator.cs
- ProfileBuildProvider.cs
- PointLightBase.cs
- TextParaClient.cs
- BooleanSwitch.cs
- Vector3DAnimation.cs
- EditingContext.cs
- ListViewGroupItemCollection.cs
- EnumerableRowCollectionExtensions.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- HtmlControlPersistable.cs
- PropertyMap.cs
- EnumerableCollectionView.cs
- IdentitySection.cs
- FunctionDescription.cs
- Encoder.cs