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
- HtmlTableCell.cs
- FontWeights.cs
- PersonalizationState.cs
- BindingListCollectionView.cs
- ControlBindingsCollection.cs
- AttributeExtensions.cs
- Accessors.cs
- ServiceModelSecurityTokenRequirement.cs
- WebPartVerb.cs
- OracleCommand.cs
- CustomAssemblyResolver.cs
- TokenFactoryFactory.cs
- TableHeaderCell.cs
- Pen.cs
- TextTrailingWordEllipsis.cs
- ArrayConverter.cs
- TaskFormBase.cs
- WebControlsSection.cs
- FixedSOMSemanticBox.cs
- TabletCollection.cs
- InvalidProgramException.cs
- XmlHelper.cs
- XmlLanguageConverter.cs
- CategoryList.cs
- OutKeywords.cs
- FixedSOMLineRanges.cs
- QueryCoreOp.cs
- PageThemeParser.cs
- XmlEnumAttribute.cs
- MsmqProcessProtocolHandler.cs
- PagerSettings.cs
- SourceElementsCollection.cs
- UniqueContractNameValidationBehavior.cs
- ObjectDesignerDataSourceView.cs
- Soap.cs
- LinqExpressionNormalizer.cs
- VisualTreeHelper.cs
- SessionPageStatePersister.cs
- ElementUtil.cs
- CodeEventReferenceExpression.cs
- MouseBinding.cs
- WizardPanel.cs
- DataSourceCache.cs
- DbConnectionPool.cs
- MetafileHeader.cs
- WebPartConnectVerb.cs
- FacetDescriptionElement.cs
- BaseDataBoundControl.cs
- ArgumentDesigner.xaml.cs
- SqlUtils.cs
- DetailsView.cs
- mediaeventargs.cs
- GatewayIPAddressInformationCollection.cs
- StylusOverProperty.cs
- XmlUtf8RawTextWriter.cs
- RecommendedAsConfigurableAttribute.cs
- ViewManager.cs
- QilUnary.cs
- CompilerCollection.cs
- MatrixIndependentAnimationStorage.cs
- EventLogEntryCollection.cs
- Vector.cs
- Int64Animation.cs
- _BufferOffsetSize.cs
- RoleBoolean.cs
- PathSegment.cs
- ChooseAction.cs
- ThreadWorkerController.cs
- FileInfo.cs
- CacheRequest.cs
- DynamicRenderer.cs
- SchemaNamespaceManager.cs
- SpecularMaterial.cs
- AuthenticationModulesSection.cs
- IncomingWebRequestContext.cs
- SimpleApplicationHost.cs
- EntityContainer.cs
- cryptoapiTransform.cs
- Literal.cs
- SplashScreen.cs
- UiaCoreApi.cs
- MonthChangedEventArgs.cs
- TextShapeableCharacters.cs
- ToolStripItemClickedEventArgs.cs
- ContextActivityUtils.cs
- EdmProviderManifest.cs
- HealthMonitoringSection.cs
- LinearGradientBrush.cs
- IImplicitResourceProvider.cs
- HttpResponseHeader.cs
- DiagnosticsConfigurationHandler.cs
- RepeaterCommandEventArgs.cs
- WebPartTransformerCollection.cs
- TextCharacters.cs
- InheritanceAttribute.cs
- Documentation.cs
- ZipIOFileItemStream.cs
- SimpleBitVector32.cs
- D3DImage.cs
- RawTextInputReport.cs