Code:
/ 4.0 / 4.0 / 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. 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
- RefreshPropertiesAttribute.cs
- UniqueSet.cs
- VsPropertyGrid.cs
- UIElementHelper.cs
- ExtenderControl.cs
- ImageSourceConverter.cs
- RowToFieldTransformer.cs
- Image.cs
- TaskFormBase.cs
- ServiceModelExtensionCollectionElement.cs
- BitConverter.cs
- IndexedString.cs
- WeakReferenceList.cs
- StylusPointPropertyInfoDefaults.cs
- _FtpDataStream.cs
- SatelliteContractVersionAttribute.cs
- IDispatchConstantAttribute.cs
- ExpressionBindingCollection.cs
- _SslState.cs
- TypeDescriptor.cs
- PerSessionInstanceContextProvider.cs
- X509ChainPolicy.cs
- XPathDocumentBuilder.cs
- StoragePropertyMapping.cs
- WebPartDisplayMode.cs
- EpmSourceTree.cs
- Html32TextWriter.cs
- BitmapEditor.cs
- UniformGrid.cs
- InternalConfigHost.cs
- DataGridViewUtilities.cs
- InternalMappingException.cs
- PageAsyncTask.cs
- HttpCookie.cs
- ListControl.cs
- SupportsEventValidationAttribute.cs
- LoadItemsEventArgs.cs
- MenuItemStyle.cs
- IPEndPoint.cs
- DataFormats.cs
- GraphicsPathIterator.cs
- DropShadowBitmapEffect.cs
- AnnotationService.cs
- PolygonHotSpot.cs
- __ConsoleStream.cs
- Stream.cs
- InputLangChangeRequestEvent.cs
- EndpointAddressElementBase.cs
- _Rfc2616CacheValidators.cs
- WorkflowInlining.cs
- DirectoryInfo.cs
- ClientOperationFormatterProvider.cs
- MailMessageEventArgs.cs
- SessionParameter.cs
- HttpDictionary.cs
- OperationAbortedException.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- QueryResult.cs
- EntityType.cs
- SRDisplayNameAttribute.cs
- PlatformCulture.cs
- FastEncoder.cs
- FileChangesMonitor.cs
- FlowNode.cs
- RequestCacheManager.cs
- Convert.cs
- Schedule.cs
- XmlSchemaRedefine.cs
- NestedContainer.cs
- ProviderIncompatibleException.cs
- ContextStack.cs
- IBuiltInEvidence.cs
- BuildResultCache.cs
- SetterBaseCollection.cs
- DetailsView.cs
- FixedPageStructure.cs
- AlphabetConverter.cs
- SystemSounds.cs
- ValidatorCollection.cs
- SHA1Cng.cs
- Line.cs
- IisTraceListener.cs
- EditorZone.cs
- WebColorConverter.cs
- XslAst.cs
- MetadataPropertyCollection.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- CodeRegionDirective.cs
- IsolationInterop.cs
- FontStyles.cs
- ScrollChrome.cs
- LogFlushAsyncResult.cs
- Viewport2DVisual3D.cs
- CqlLexerHelpers.cs
- CodeNamespaceCollection.cs
- Literal.cs
- ResourceExpressionBuilder.cs
- ZipIOExtraFieldZip64Element.cs
- DataGridViewLayoutData.cs
- AccessViolationException.cs