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
- While.cs
- SafeBitVector32.cs
- ToolStripItemClickedEventArgs.cs
- sqlinternaltransaction.cs
- DoubleAnimationBase.cs
- QueryMath.cs
- HttpApplicationFactory.cs
- TypeConverterHelper.cs
- DataRecord.cs
- WebBrowserUriTypeConverter.cs
- PropertyKey.cs
- EntityDataSourceContainerNameConverter.cs
- Button.cs
- FontFaceLayoutInfo.cs
- DateTimeStorage.cs
- IntellisenseTextBox.designer.cs
- AppDomain.cs
- TreeNodeConverter.cs
- FilteredSchemaElementLookUpTable.cs
- Pen.cs
- Overlapped.cs
- JsonWriter.cs
- TimeZoneNotFoundException.cs
- LinqDataSourceContextEventArgs.cs
- SqlGenerator.cs
- HandlerElementCollection.cs
- ValidateNames.cs
- SimpleBitVector32.cs
- DynamicObjectAccessor.cs
- AssertSection.cs
- BoolLiteral.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- WindowsListViewGroup.cs
- WindowCollection.cs
- InvalidEnumArgumentException.cs
- ViewStateException.cs
- Trigger.cs
- SettingsProviderCollection.cs
- EntryIndex.cs
- ContextMenuStripGroupCollection.cs
- OperatorExpressions.cs
- NativeMethods.cs
- LabelLiteral.cs
- FakeModelPropertyImpl.cs
- __ComObject.cs
- CacheRequest.cs
- HttpResponseHeader.cs
- SystemInformation.cs
- BmpBitmapDecoder.cs
- ElementProxy.cs
- SessionStateSection.cs
- DecimalAnimation.cs
- ScriptDescriptor.cs
- XmlSerializerAssemblyAttribute.cs
- TextLineResult.cs
- ShutDownListener.cs
- UnlockInstanceCommand.cs
- TextInfo.cs
- NegatedCellConstant.cs
- Path.cs
- ConnectionManagementElementCollection.cs
- SiteMapHierarchicalDataSourceView.cs
- XPathNavigator.cs
- AnimationStorage.cs
- SortDescription.cs
- EdmValidator.cs
- Int64AnimationBase.cs
- WorkflowDesignerMessageFilter.cs
- UnsafeNativeMethods.cs
- Glyph.cs
- DiagnosticTraceSource.cs
- DBNull.cs
- OpacityConverter.cs
- DataGridRelationshipRow.cs
- PngBitmapDecoder.cs
- ScrollViewer.cs
- StateMachine.cs
- PersistenceContextEnlistment.cs
- CodeSnippetStatement.cs
- EventDescriptor.cs
- Splitter.cs
- AlternateViewCollection.cs
- StylusPlugin.cs
- SqlMethodCallConverter.cs
- ScrollChrome.cs
- MetadataCacheItem.cs
- TextBoxBase.cs
- IgnoreFileBuildProvider.cs
- SmtpMail.cs
- Vector3D.cs
- oledbmetadatacolumnnames.cs
- ImageListUtils.cs
- Control.cs
- DataColumnCollection.cs
- TriggerBase.cs
- RegexInterpreter.cs
- UInt64Converter.cs
- DesignerAttribute.cs
- ServerIdentity.cs
- DefaultValueConverter.cs