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
- ConnectionStringSettings.cs
- CompositeScriptReference.cs
- SspiSafeHandles.cs
- TransactionTable.cs
- Style.cs
- XhtmlBasicObjectListAdapter.cs
- EditorZoneBase.cs
- EmitterCache.cs
- CodeDomConfigurationHandler.cs
- NotImplementedException.cs
- SessionStateItemCollection.cs
- RowToParametersTransformer.cs
- HwndSourceParameters.cs
- SByteConverter.cs
- NativeObjectSecurity.cs
- EntityDataSourceUtil.cs
- InvokeProviderWrapper.cs
- ColorAnimationUsingKeyFrames.cs
- MexBindingElement.cs
- GuidTagList.cs
- FocusTracker.cs
- BooleanConverter.cs
- AutomationPropertyInfo.cs
- TemplateInstanceAttribute.cs
- CommandPlan.cs
- CodeObjectCreateExpression.cs
- Icon.cs
- XmlSecureResolver.cs
- FilterRepeater.cs
- ScriptReferenceBase.cs
- _FixedSizeReader.cs
- PropVariant.cs
- EdmComplexPropertyAttribute.cs
- StylusDownEventArgs.cs
- Rect3D.cs
- WhitespaceRule.cs
- DecoderExceptionFallback.cs
- DispatcherTimer.cs
- Vector3DConverter.cs
- DataGridViewColumn.cs
- StoragePropertyMapping.cs
- TraceUtility.cs
- AssociatedControlConverter.cs
- DataGridTable.cs
- DesigntimeLicenseContext.cs
- GenerateHelper.cs
- RestHandler.cs
- BlockCollection.cs
- CodeAssignStatement.cs
- ToolStripDropDownClosingEventArgs.cs
- PathGeometry.cs
- XmlReader.cs
- BaseCAMarshaler.cs
- CredentialCache.cs
- XmlTypeAttribute.cs
- PaperSource.cs
- ServicePointManagerElement.cs
- UserNameSecurityTokenAuthenticator.cs
- LineMetrics.cs
- XmlNamespaceManager.cs
- ClientRolePrincipal.cs
- XhtmlBasicValidatorAdapter.cs
- KeyManager.cs
- EncodingDataItem.cs
- BindableAttribute.cs
- MouseOverProperty.cs
- ConfigurationSectionGroup.cs
- CodeStatement.cs
- XmlBoundElement.cs
- SchemaMapping.cs
- XPathParser.cs
- WindowsImpersonationContext.cs
- BufferedStream.cs
- Bind.cs
- TextTreePropertyUndoUnit.cs
- WebPartUserCapability.cs
- MonitorWrapper.cs
- PropertyConverter.cs
- RuntimeCompatibilityAttribute.cs
- HwndSource.cs
- MenuItem.cs
- RSAPKCS1SignatureDeformatter.cs
- WebPartConnectionCollection.cs
- CodeDomLocalizationProvider.cs
- ListDesigner.cs
- BaseUriHelper.cs
- SoapReflectionImporter.cs
- DocumentViewerBase.cs
- SecurityMode.cs
- IPAddress.cs
- RowBinding.cs
- WpfWebRequestHelper.cs
- DesignerActionHeaderItem.cs
- WindowsListViewItemStartMenu.cs
- UnionQueryOperator.cs
- KeyGestureConverter.cs
- TreeNodeCollectionEditor.cs
- WarningException.cs
- Debug.cs
- connectionpool.cs