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
- DataServiceCollectionOfT.cs
- TransformedBitmap.cs
- Imaging.cs
- MemberDomainMap.cs
- WindowsScroll.cs
- Drawing.cs
- LiteralSubsegment.cs
- ObjectStateManager.cs
- Ports.cs
- StringUtil.cs
- CompilerParameters.cs
- WindowInteractionStateTracker.cs
- CheckBox.cs
- CodeFieldReferenceExpression.cs
- DSASignatureDeformatter.cs
- DispatchWrapper.cs
- RuntimeIdentifierPropertyAttribute.cs
- TypedAsyncResult.cs
- ComplexPropertyEntry.cs
- CommentAction.cs
- ExpressionDumper.cs
- DataGridViewTopRowAccessibleObject.cs
- GenericArgumentsUpdater.cs
- WebPartEventArgs.cs
- Vector3DCollection.cs
- DelegatingConfigHost.cs
- ReleaseInstanceMode.cs
- TraceSection.cs
- FontUnit.cs
- EventlogProvider.cs
- TimelineCollection.cs
- SqlConnection.cs
- RepeatButtonAutomationPeer.cs
- SelectionListComponentEditor.cs
- FacetDescription.cs
- ClientTarget.cs
- FormViewInsertedEventArgs.cs
- StateMachineHelpers.cs
- TreeIterators.cs
- PreservationFileWriter.cs
- WebPartMenu.cs
- PeerTransportElement.cs
- ListViewDataItem.cs
- SimpleLine.cs
- FixedSOMLineRanges.cs
- ViewLoader.cs
- DocumentPaginator.cs
- MatrixTransform3D.cs
- ClientCultureInfo.cs
- UIElement.cs
- InputScope.cs
- HttpRuntime.cs
- ProtectedConfiguration.cs
- GenericTypeParameterBuilder.cs
- WebSysDefaultValueAttribute.cs
- WebBrowserHelper.cs
- HttpHandlerAction.cs
- EntityTransaction.cs
- ApplicationProxyInternal.cs
- InputLanguage.cs
- VersionValidator.cs
- Errors.cs
- IQueryable.cs
- EnumerableRowCollectionExtensions.cs
- XPathException.cs
- PartitionResolver.cs
- BufferedOutputAsyncStream.cs
- ApplicationFileParser.cs
- HtmlInputControl.cs
- OleDbPermission.cs
- Sql8ExpressionRewriter.cs
- DesignBindingEditor.cs
- TextCompositionEventArgs.cs
- updatecommandorderer.cs
- StringFunctions.cs
- TimerElapsedEvenArgs.cs
- StackSpiller.Generated.cs
- WasAdminWrapper.cs
- UniqueSet.cs
- FilterEventArgs.cs
- StringConcat.cs
- PageRanges.cs
- RawStylusInputCustomDataList.cs
- SettingsProviderCollection.cs
- SpotLight.cs
- ByteStream.cs
- ModelPerspective.cs
- WebPartZoneCollection.cs
- GeneralTransform3D.cs
- SessionEndingCancelEventArgs.cs
- DataBindEngine.cs
- PropertyInformationCollection.cs
- ForwardPositionQuery.cs
- AssemblyResourceLoader.cs
- MenuItemStyle.cs
- OdbcParameter.cs
- FileSystemInfo.cs
- UIAgentMonitorHandle.cs
- SerializableAuthorizationContext.cs
- ArgumentOutOfRangeException.cs