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
- SecurityTokenValidationException.cs
- GroupItemAutomationPeer.cs
- CursorConverter.cs
- HandleCollector.cs
- ClientFormsIdentity.cs
- TableCellAutomationPeer.cs
- ImageCodecInfo.cs
- SystemIPGlobalProperties.cs
- Keyboard.cs
- Encoder.cs
- TreeNode.cs
- SafePointer.cs
- StreamInfo.cs
- OutputCacheEntry.cs
- MergeFilterQuery.cs
- ViewgenGatekeeper.cs
- GlobalAllocSafeHandle.cs
- XD.cs
- LoginStatusDesigner.cs
- StrokeNodeData.cs
- RequestCachePolicy.cs
- FieldMetadata.cs
- TypeLibConverter.cs
- Html32TextWriter.cs
- Stylus.cs
- TracePayload.cs
- Monitor.cs
- SourceChangedEventArgs.cs
- ErrorRuntimeConfig.cs
- UnitControl.cs
- path.cs
- ClaimSet.cs
- NetPeerTcpBindingCollectionElement.cs
- RijndaelCryptoServiceProvider.cs
- RequestChannel.cs
- XmlHierarchicalDataSourceView.cs
- XmlSiteMapProvider.cs
- DataSourceXmlSerializationAttribute.cs
- ByteStream.cs
- BindingExpressionUncommonField.cs
- TextProperties.cs
- ChannelManagerBase.cs
- HMACRIPEMD160.cs
- loginstatus.cs
- InputMethodStateTypeInfo.cs
- FormView.cs
- AppDomain.cs
- MatrixAnimationBase.cs
- MulticastNotSupportedException.cs
- DesigntimeLicenseContext.cs
- SubclassTypeValidatorAttribute.cs
- XmlLanguage.cs
- GenericTypeParameterConverter.cs
- FixedSOMPageConstructor.cs
- StaticContext.cs
- CompiledIdentityConstraint.cs
- XmlReflectionMember.cs
- OrderedDictionary.cs
- SlotInfo.cs
- ConnectionManagementSection.cs
- PriorityQueue.cs
- ValidationResults.cs
- TextElementEnumerator.cs
- PopupRootAutomationPeer.cs
- SessionParameter.cs
- WorkflowTraceTransfer.cs
- DockPanel.cs
- SyntaxCheck.cs
- TreeNodeClickEventArgs.cs
- StreamGeometryContext.cs
- EntityViewGenerationAttribute.cs
- RegexGroup.cs
- PageRanges.cs
- ContractSearchPattern.cs
- EditingCoordinator.cs
- PropertyPushdownHelper.cs
- SBCSCodePageEncoding.cs
- ToolboxBitmapAttribute.cs
- validation.cs
- RootBuilder.cs
- NumberSubstitution.cs
- UniqueID.cs
- Separator.cs
- DesigntimeLicenseContext.cs
- TraceContext.cs
- TabControlCancelEvent.cs
- RowVisual.cs
- SafeRightsManagementHandle.cs
- WeakReferenceEnumerator.cs
- BitVec.cs
- FormatException.cs
- RotateTransform3D.cs
- DataSourceXmlSerializationAttribute.cs
- CodeAccessSecurityEngine.cs
- EventMappingSettingsCollection.cs
- LocationSectionRecord.cs
- VerticalAlignConverter.cs
- Literal.cs
- WebPartCatalogCloseVerb.cs
- InnerItemCollectionView.cs