Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / ButtonBaseAutomationPeer.cs / 1305600 / 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
- IsolatedStorageFile.cs
- SchemaImporterExtensionsSection.cs
- LabelDesigner.cs
- DynamicResourceExtension.cs
- Simplifier.cs
- OutputCacheProfile.cs
- GreenMethods.cs
- DefaultEventAttribute.cs
- CrossContextChannel.cs
- StdRegProviderWrapper.cs
- InkCollectionBehavior.cs
- LocalizedNameDescriptionPair.cs
- SHA1CryptoServiceProvider.cs
- FirstMatchCodeGroup.cs
- SystemTcpConnection.cs
- FontSizeConverter.cs
- XPathDocumentIterator.cs
- EncryptedPackageFilter.cs
- ASCIIEncoding.cs
- SqlUtil.cs
- PublisherIdentityPermission.cs
- BaseAsyncResult.cs
- UIElement3DAutomationPeer.cs
- InputLanguage.cs
- DynamicValidatorEventArgs.cs
- ResizeGrip.cs
- ClientScriptManager.cs
- UnhandledExceptionEventArgs.cs
- ClientCultureInfo.cs
- State.cs
- TextServicesCompartment.cs
- MetadataItemEmitter.cs
- Section.cs
- HostedTransportConfigurationBase.cs
- BitmapVisualManager.cs
- LocalIdKeyIdentifierClause.cs
- TextTreeTextElementNode.cs
- CacheChildrenQuery.cs
- BindingContext.cs
- ThicknessAnimationUsingKeyFrames.cs
- ItemsControl.cs
- FixedHyperLink.cs
- DynamicILGenerator.cs
- NotifyInputEventArgs.cs
- FieldMetadata.cs
- TypographyProperties.cs
- Span.cs
- AndCondition.cs
- CapabilitiesUse.cs
- NativeMethods.cs
- AssertFilter.cs
- InputLanguage.cs
- DataServiceQueryProvider.cs
- TextParagraphView.cs
- ActivityLocationReferenceEnvironment.cs
- WebResourceAttribute.cs
- LineSegment.cs
- WebExceptionStatus.cs
- ContentDesigner.cs
- FileSystemEnumerable.cs
- RawKeyboardInputReport.cs
- CollectionViewGroup.cs
- ArgumentNullException.cs
- HttpCacheVary.cs
- SqlMultiplexer.cs
- TogglePattern.cs
- GroupBoxRenderer.cs
- ScriptingAuthenticationServiceSection.cs
- Oci.cs
- Section.cs
- HostVisual.cs
- CompressionTransform.cs
- DateTimeOffset.cs
- BitmapEffectInputData.cs
- HttpRawResponse.cs
- PeerCustomResolverElement.cs
- PhysicalAddress.cs
- WebPartZone.cs
- ValidationHelper.cs
- SQLDoubleStorage.cs
- PolygonHotSpot.cs
- Point.cs
- SqlClientMetaDataCollectionNames.cs
- OracleTransaction.cs
- ListViewItem.cs
- WindowsToolbarItemAsMenuItem.cs
- XmlNodeComparer.cs
- AffineTransform3D.cs
- WinFormsUtils.cs
- MeasureItemEvent.cs
- JournalEntryListConverter.cs
- NullableIntSumAggregationOperator.cs
- StringAnimationBase.cs
- HostingEnvironment.cs
- SerializationInfoEnumerator.cs
- ResourcePool.cs
- ModulesEntry.cs
- SslStreamSecurityUpgradeProvider.cs
- UpdatePanelControlTrigger.cs
- SerialReceived.cs