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
- StreamingContext.cs
- UDPClient.cs
- MailWriter.cs
- DataFieldCollectionEditor.cs
- TransformerTypeCollection.cs
- MenuItemStyleCollection.cs
- BitmapEffectRenderDataResource.cs
- Mappings.cs
- XmlSchemaDocumentation.cs
- WindowsPrincipal.cs
- WindowInteractionStateTracker.cs
- ReliableMessagingVersionConverter.cs
- Bitmap.cs
- RadioButtonList.cs
- SqlUserDefinedAggregateAttribute.cs
- DefaultMemberAttribute.cs
- ArraySortHelper.cs
- DomainUpDown.cs
- RectangleConverter.cs
- DefaultValueConverter.cs
- MenuItem.cs
- MachineKeyConverter.cs
- SQLByteStorage.cs
- IIS7UserPrincipal.cs
- TimeSpanStorage.cs
- MetaData.cs
- SerializerWriterEventHandlers.cs
- IISMapPath.cs
- DbModificationCommandTree.cs
- CompiledRegexRunner.cs
- AppDomain.cs
- WaitHandle.cs
- ProxyHelper.cs
- errorpatternmatcher.cs
- InputLanguageCollection.cs
- ResetableIterator.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ThreadStaticAttribute.cs
- FixedTextSelectionProcessor.cs
- ControlPropertyNameConverter.cs
- EDesignUtil.cs
- TypeCacheManager.cs
- VectorAnimationUsingKeyFrames.cs
- MetadataArtifactLoaderFile.cs
- SharedDp.cs
- Journaling.cs
- PrinterUnitConvert.cs
- ErrorActivity.cs
- SQLGuidStorage.cs
- TextSearch.cs
- NetworkInformationPermission.cs
- MediaEntryAttribute.cs
- PerfCounters.cs
- InstanceOwnerException.cs
- DesignerView.cs
- NullToBooleanConverter.cs
- SequenceNumber.cs
- XmlSignificantWhitespace.cs
- UrlRoutingHandler.cs
- RegexRunner.cs
- CodeAssignStatement.cs
- COM2ColorConverter.cs
- ContainerUIElement3D.cs
- GetPageCompletedEventArgs.cs
- WebConfigurationHostFileChange.cs
- SubclassTypeValidator.cs
- GraphicsContainer.cs
- XmlSchemas.cs
- NegationPusher.cs
- SerialReceived.cs
- StreamingContext.cs
- XmlSchemaComplexContent.cs
- XslCompiledTransform.cs
- LineSegment.cs
- AutomationPropertyInfo.cs
- GreenMethods.cs
- WindowPattern.cs
- SimpleApplicationHost.cs
- UpdatePanelTriggerCollection.cs
- AutoSizeToolBoxItem.cs
- CaretElement.cs
- Update.cs
- DataGridColumn.cs
- GlyphingCache.cs
- VectorKeyFrameCollection.cs
- PlaceHolder.cs
- PolicyVersion.cs
- EpmTargetTree.cs
- OrderedDictionary.cs
- FileInfo.cs
- ListViewGroupConverter.cs
- DataBindingExpressionBuilder.cs
- ManagedFilter.cs
- EFDataModelProvider.cs
- TextElementAutomationPeer.cs
- PageVisual.cs
- Matrix3DConverter.cs
- DataRowIndexBuffer.cs
- ZoneMembershipCondition.cs
- SymmetricAlgorithm.cs