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
- Cursor.cs
- COM2AboutBoxPropertyDescriptor.cs
- ComUdtElement.cs
- SqlBuilder.cs
- MenuAutomationPeer.cs
- BasicHttpSecurityElement.cs
- AutomationPatternInfo.cs
- FixedStringLookup.cs
- ExpressionCopier.cs
- FontStyles.cs
- SoapFormatExtensions.cs
- FileNotFoundException.cs
- AsymmetricSignatureDeformatter.cs
- Int32Collection.cs
- SafeHandles.cs
- RefreshEventArgs.cs
- XmlArrayAttribute.cs
- OptimalBreakSession.cs
- PageCodeDomTreeGenerator.cs
- _ConnectStream.cs
- XmlWhitespace.cs
- Util.cs
- TextElementAutomationPeer.cs
- Stackframe.cs
- MsmqInputMessage.cs
- ITextView.cs
- EditorPart.cs
- TrayIconDesigner.cs
- MessageSecurityOverMsmq.cs
- SocketManager.cs
- WmlFormAdapter.cs
- ObjectManager.cs
- SafeReversePInvokeHandle.cs
- BamlWriter.cs
- TextModifierScope.cs
- LogReserveAndAppendState.cs
- SkewTransform.cs
- DataSvcMapFileSerializer.cs
- PersonalizationStateInfoCollection.cs
- PermissionRequestEvidence.cs
- OutKeywords.cs
- SettingsPropertyValue.cs
- HttpCookiesSection.cs
- CallbackValidator.cs
- TextParaLineResult.cs
- WindowCollection.cs
- LayoutManager.cs
- DynamicActivityXamlReader.cs
- ExceptionUtil.cs
- SecurityTokenParameters.cs
- AdapterDictionary.cs
- BitmapEffectGroup.cs
- HtmlUtf8RawTextWriter.cs
- WsatServiceCertificate.cs
- ParentQuery.cs
- EnvelopedPkcs7.cs
- MessagePropertyFilter.cs
- WebPartTransformerCollection.cs
- ReachDocumentReferenceCollectionSerializerAsync.cs
- ImageField.cs
- TcpConnectionPoolSettingsElement.cs
- CreatingCookieEventArgs.cs
- Run.cs
- ScrollChrome.cs
- DES.cs
- ObjectTag.cs
- ConfigurationManagerInternal.cs
- CommunicationException.cs
- ActiveXMessageFormatter.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- EventSourceCreationData.cs
- AttachmentCollection.cs
- TreeViewAutomationPeer.cs
- DocumentReferenceCollection.cs
- WhileDesigner.cs
- MetadataItemEmitter.cs
- TimeoutHelper.cs
- SettingsPropertyNotFoundException.cs
- ExeContext.cs
- SqlServices.cs
- SimpleBitVector32.cs
- DataGridViewCellStyleEditor.cs
- OrderedDictionary.cs
- SiteMapDataSourceView.cs
- OrderingInfo.cs
- WinEventTracker.cs
- RegexGroup.cs
- FullTrustAssembliesSection.cs
- URLAttribute.cs
- SmtpClient.cs
- ThicknessAnimationUsingKeyFrames.cs
- SourceLocationProvider.cs
- COAUTHINFO.cs
- Pool.cs
- ObjectReferenceStack.cs
- DataGridViewImageCell.cs
- hresults.cs
- MultipartContentParser.cs
- DataViewManager.cs
- BookmarkUndoUnit.cs