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
- RectAnimationBase.cs
- LookupNode.cs
- Operator.cs
- ByteAnimationUsingKeyFrames.cs
- XamlTreeBuilderBamlRecordWriter.cs
- FragmentQueryProcessor.cs
- AutomationPatternInfo.cs
- TypeCacheManager.cs
- ApplicationServicesHostFactory.cs
- Baml2006SchemaContext.cs
- EdmItemCollection.cs
- EventBuilder.cs
- UMPAttributes.cs
- FontInfo.cs
- ValidationRule.cs
- TableLayoutPanel.cs
- APCustomTypeDescriptor.cs
- BoolExpr.cs
- SafeRightsManagementPubHandle.cs
- DispatcherSynchronizationContext.cs
- ClientTargetCollection.cs
- GenericXmlSecurityTokenAuthenticator.cs
- ContentPresenter.cs
- HashCryptoHandle.cs
- CodeCastExpression.cs
- XhtmlBasicLinkAdapter.cs
- SessionState.cs
- HMACMD5.cs
- VirtualDirectoryMapping.cs
- LogEntryHeaderv1Deserializer.cs
- EasingKeyFrames.cs
- SortedDictionary.cs
- HyperLink.cs
- AuthenticodeSignatureInformation.cs
- TextEvent.cs
- OracleDateTime.cs
- Sequence.cs
- MessageCredentialType.cs
- PersonalizableAttribute.cs
- SetterBaseCollection.cs
- GridViewRowPresenterBase.cs
- SHA256.cs
- TypeSemantics.cs
- SpeechDetectedEventArgs.cs
- ClientBuildManagerCallback.cs
- MarkupExtensionParser.cs
- ExpressionEditorAttribute.cs
- TypeName.cs
- CellConstant.cs
- OperationPickerDialog.designer.cs
- XmlException.cs
- LoadedOrUnloadedOperation.cs
- PrintPageEvent.cs
- UseAttributeSetsAction.cs
- UriTemplateDispatchFormatter.cs
- SqlCacheDependency.cs
- OracleParameter.cs
- XmlValidatingReader.cs
- GridProviderWrapper.cs
- UITypeEditor.cs
- versioninfo.cs
- DefaultEventAttribute.cs
- EditCommandColumn.cs
- Parser.cs
- Array.cs
- SemanticResultValue.cs
- DecimalConstantAttribute.cs
- hresults.cs
- BindingGroup.cs
- Authorization.cs
- ActivityWithResult.cs
- FormViewInsertEventArgs.cs
- DiscriminatorMap.cs
- HtmlInputHidden.cs
- XPathNodeInfoAtom.cs
- StylusPointPropertyId.cs
- ListViewCommandEventArgs.cs
- CookieParameter.cs
- DaylightTime.cs
- SqlProcedureAttribute.cs
- DataSourceXmlSerializer.cs
- DataGridViewRowEventArgs.cs
- SecurityDescriptor.cs
- ResolvedKeyFrameEntry.cs
- PeerContact.cs
- TreeView.cs
- AnnotationDocumentPaginator.cs
- Collection.cs
- UnaryQueryOperator.cs
- MenuCommandsChangedEventArgs.cs
- DocumentReferenceCollection.cs
- SmtpFailedRecipientException.cs
- AudioFormatConverter.cs
- _Connection.cs
- NamespaceTable.cs
- ModulesEntry.cs
- BasicCommandTreeVisitor.cs
- MouseGestureValueSerializer.cs
- BitmapEffectRenderDataResource.cs
- HttpRuntime.cs