Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Automation / Peers / ButtonBaseAutomationPeer.cs / 1 / ButtonBaseAutomationPeer.cs
using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Input; using System.Windows.Interop; using System.Windows.Media; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public abstract class ButtonBaseAutomationPeer: FrameworkElementAutomationPeer { /// protected ButtonBaseAutomationPeer(ButtonBase owner): base(owner) {} /// override protected string GetAcceleratorKeyCore() { string acceleratorKey = base.GetAcceleratorKeyCore(); if (acceleratorKey == string.Empty) { RoutedUICommand uiCommand = ((ButtonBase)Owner).Command as RoutedUICommand; if (uiCommand != null && !string.IsNullOrEmpty(uiCommand.Text)) { acceleratorKey = uiCommand.Text; } } return acceleratorKey; } /// protected override string GetAutomationIdCore() { string result = base.GetAutomationIdCore(); if (string.IsNullOrEmpty(result)) { ButtonBase owner = (ButtonBase)Owner; RoutedCommand command = owner.Command as RoutedCommand; if (command != null) { string commandName = command.Name; if (!string.IsNullOrEmpty(commandName)) { result = commandName; } } } return result ?? string.Empty; } // Return the base without the AccessKey character /// override protected string GetNameCore() { string result = base.GetNameCore(); ButtonBase bb = (ButtonBase)Owner; if (!string.IsNullOrEmpty(result)) { if (bb.Content is string) { result = AccessText.RemoveAccessKeyMarker(result); } } else { RoutedUICommand uiCommand = bb.Command as RoutedUICommand; if (uiCommand != null && !string.IsNullOrEmpty(uiCommand.Text)) { result = uiCommand.Text; } } return result; } } } // 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
- PropertyBuilder.cs
- Interlocked.cs
- OdbcRowUpdatingEvent.cs
- HttpProfileGroupBase.cs
- WebServiceResponse.cs
- WindowVisualStateTracker.cs
- TextParagraphCache.cs
- SingleKeyFrameCollection.cs
- AlphaSortedEnumConverter.cs
- ParserHooks.cs
- NavigatorOutput.cs
- CdpEqualityComparer.cs
- EntityDesignPluralizationHandler.cs
- Delegate.cs
- FormsAuthenticationEventArgs.cs
- SqlAggregateChecker.cs
- ResolveNextArgumentWorkItem.cs
- HttpPostServerProtocol.cs
- CancellationToken.cs
- HitTestParameters.cs
- KeyInterop.cs
- XsltOutput.cs
- cookie.cs
- LocalBuilder.cs
- PropertyGridView.cs
- SiteMapPath.cs
- HtmlMeta.cs
- SystemIcmpV6Statistics.cs
- HebrewCalendar.cs
- Currency.cs
- LinkConverter.cs
- InheritanceContextHelper.cs
- DataServiceClientException.cs
- SmiRecordBuffer.cs
- ReadContentAsBinaryHelper.cs
- StrongNameUtility.cs
- Int64Converter.cs
- QueryExtender.cs
- storepermission.cs
- Grid.cs
- SubordinateTransaction.cs
- basenumberconverter.cs
- DirectoryObjectSecurity.cs
- RadioButtonList.cs
- InternalTransaction.cs
- XmlSchemaInclude.cs
- ProfessionalColorTable.cs
- ActionFrame.cs
- BitVector32.cs
- SQLChars.cs
- WebPartConnectionsEventArgs.cs
- ReverseQueryOperator.cs
- PackUriHelper.cs
- Triplet.cs
- DocumentCollection.cs
- AuthenticatingEventArgs.cs
- QilReplaceVisitor.cs
- StrictModeSecurityHeaderElementInferenceEngine.cs
- WebConfigurationManager.cs
- MimeFormatter.cs
- ExecutedRoutedEventArgs.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- ObjectDataSourceChooseTypePanel.cs
- RequestQueue.cs
- UnsafeNativeMethodsPenimc.cs
- _NestedSingleAsyncResult.cs
- UInt16Converter.cs
- RouteUrlExpressionBuilder.cs
- RolePrincipal.cs
- EndpointBehaviorElement.cs
- HiddenFieldPageStatePersister.cs
- FixUp.cs
- ObjectDataSourceDisposingEventArgs.cs
- CustomAttributeBuilder.cs
- FlagsAttribute.cs
- SqlSupersetValidator.cs
- XamlSerializerUtil.cs
- FilteredSchemaElementLookUpTable.cs
- KeyNotFoundException.cs
- SequentialOutput.cs
- SessionEndingEventArgs.cs
- PeerInputChannel.cs
- PriorityRange.cs
- AxHostDesigner.cs
- DirectoryNotFoundException.cs
- SvcMapFileLoader.cs
- TransformerConfigurationWizardBase.cs
- CodeExpressionCollection.cs
- DocumentViewerHelper.cs
- QueryComponents.cs
- EventLevel.cs
- ErrorFormatterPage.cs
- SafeRightsManagementQueryHandle.cs
- TemplateField.cs
- XPathPatternParser.cs
- ZoneLinkButton.cs
- StrokeCollection.cs
- Subset.cs
- DesignerView.Commands.cs
- Range.cs