Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / 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. 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
- WindowsTokenRoleProvider.cs
- DbConnectionPoolCounters.cs
- ImageSource.cs
- BitSet.cs
- HtmlShimManager.cs
- StateMachineSubscription.cs
- ItemsControlAutomationPeer.cs
- GridViewSelectEventArgs.cs
- SqlUtils.cs
- FeatureSupport.cs
- RegexBoyerMoore.cs
- SwitchCase.cs
- RowUpdatingEventArgs.cs
- XmlSignatureManifest.cs
- ConnectionStringsExpressionBuilder.cs
- UrlPath.cs
- RowUpdatingEventArgs.cs
- GroupBoxDesigner.cs
- SqlGenericUtil.cs
- ServiceManager.cs
- XPathNodeIterator.cs
- OperatingSystem.cs
- HtmlInputHidden.cs
- TypeBuilderInstantiation.cs
- BuildProvider.cs
- AppDomainShutdownMonitor.cs
- ScrollProviderWrapper.cs
- HttpContext.cs
- COM2ExtendedBrowsingHandler.cs
- XmlSchemaGroup.cs
- PeerEndPoint.cs
- XamlTreeBuilder.cs
- SettingsBindableAttribute.cs
- Compiler.cs
- PersistStreamTypeWrapper.cs
- SmtpNegotiateAuthenticationModule.cs
- WebReference.cs
- QuaternionKeyFrameCollection.cs
- XPathQueryGenerator.cs
- FontNamesConverter.cs
- ListQueryResults.cs
- ManifestResourceInfo.cs
- OptimizedTemplateContentHelper.cs
- TextRangeEditLists.cs
- ProfileProvider.cs
- StateManagedCollection.cs
- URIFormatException.cs
- PageEventArgs.cs
- Emitter.cs
- HtmlControl.cs
- CodeTypeParameterCollection.cs
- CommandField.cs
- TypeInitializationException.cs
- SizeConverter.cs
- State.cs
- SettingsPropertyCollection.cs
- PropertyConverter.cs
- GeneralTransform3DGroup.cs
- FormViewModeEventArgs.cs
- CheckBoxField.cs
- EntityModelBuildProvider.cs
- CodeTryCatchFinallyStatement.cs
- Transform3DGroup.cs
- GlyphShapingProperties.cs
- VerticalAlignConverter.cs
- MailWriter.cs
- GridView.cs
- Int32Converter.cs
- MachineKeySection.cs
- MeshGeometry3D.cs
- SQLInt16.cs
- ExtensionSimplifierMarkupObject.cs
- Object.cs
- Image.cs
- SingleConverter.cs
- Message.cs
- ArrayTypeMismatchException.cs
- BuildManagerHost.cs
- SafeNativeMethods.cs
- DataSourceCacheDurationConverter.cs
- UnmanagedBitmapWrapper.cs
- Tuple.cs
- ObjectViewEntityCollectionData.cs
- WpfWebRequestHelper.cs
- HierarchicalDataBoundControlAdapter.cs
- StrokeSerializer.cs
- OuterGlowBitmapEffect.cs
- Gdiplus.cs
- SinglePhaseEnlistment.cs
- BufferedReadStream.cs
- DataServiceQueryOfT.cs
- VariantWrapper.cs
- LambdaCompiler.cs
- Point3DConverter.cs
- RegexStringValidatorAttribute.cs
- BamlMapTable.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- PageAsyncTask.cs
- FrameworkReadOnlyPropertyMetadata.cs
- SecurityTokenProvider.cs