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
- ServiceMetadataPublishingElement.cs
- ChannelBuilder.cs
- SafeNativeMethodsOther.cs
- PersonalizationDictionary.cs
- DataGridViewCell.cs
- ListViewItemEventArgs.cs
- SqlCharStream.cs
- xmlfixedPageInfo.cs
- ProcessRequestAsyncResult.cs
- AuthenticationModuleElement.cs
- LocatorPartList.cs
- Track.cs
- ResourcePart.cs
- MemberNameValidator.cs
- XmlSchemaParticle.cs
- StorageMappingItemCollection.cs
- ZipIOExtraFieldElement.cs
- CornerRadiusConverter.cs
- FormsIdentity.cs
- BinarySerializer.cs
- FileUtil.cs
- SerializationException.cs
- SoapExtensionStream.cs
- ConfigXmlWhitespace.cs
- HtmlGenericControl.cs
- StyleSelector.cs
- JsonReaderWriterFactory.cs
- XmlNullResolver.cs
- MetadataProperty.cs
- Int32CollectionConverter.cs
- GetTokenRequest.cs
- ObjectStateEntryDbDataRecord.cs
- OleDbConnectionInternal.cs
- recordstatefactory.cs
- ListBoxItemWrapperAutomationPeer.cs
- Utils.cs
- ModelTypeConverter.cs
- SQLDecimal.cs
- RegexBoyerMoore.cs
- DependencyPropertyValueSerializer.cs
- WebControl.cs
- metadatamappinghashervisitor.cs
- BasePattern.cs
- PluralizationServiceUtil.cs
- documentsequencetextcontainer.cs
- CustomCredentialPolicy.cs
- IdentityNotMappedException.cs
- MessageFormatterConverter.cs
- SqlProvider.cs
- BamlResourceContent.cs
- HttpFileCollectionWrapper.cs
- SqlMultiplexer.cs
- DocumentGrid.cs
- EntityDesignerUtils.cs
- VisualBasicImportReference.cs
- HwndMouseInputProvider.cs
- SQLDecimal.cs
- MarshalByValueComponent.cs
- LifetimeMonitor.cs
- AddingNewEventArgs.cs
- LinqDataSourceInsertEventArgs.cs
- XmlComplianceUtil.cs
- SoapAttributes.cs
- StyleTypedPropertyAttribute.cs
- UInt32Storage.cs
- SchemaCollectionCompiler.cs
- DocumentPaginator.cs
- ItemsPanelTemplate.cs
- Debugger.cs
- NotifyIcon.cs
- HierarchicalDataSourceIDConverter.cs
- BamlLocalizableResource.cs
- Merger.cs
- PagePropertiesChangingEventArgs.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- XmlAggregates.cs
- ConstructorBuilder.cs
- ServiceSecurityAuditElement.cs
- XmlSchemaComplexType.cs
- CacheEntry.cs
- TypeUnloadedException.cs
- TypeDescriptionProviderAttribute.cs
- PrefixQName.cs
- SqlRowUpdatingEvent.cs
- ContentPlaceHolder.cs
- DiscoveryDocumentReference.cs
- MarginsConverter.cs
- ReferencedCollectionType.cs
- Annotation.cs
- SpellerHighlightLayer.cs
- BamlLocalizer.cs
- SiteMapSection.cs
- ListChunk.cs
- __Error.cs
- DateTimeUtil.cs
- ImageSource.cs
- OptimalTextSource.cs
- RectIndependentAnimationStorage.cs
- GraphicsPath.cs
- ConnectionManagementElementCollection.cs