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
- TextTabProperties.cs
- TableItemStyle.cs
- DecodeHelper.cs
- DataObjectFieldAttribute.cs
- ReachPrintTicketSerializerAsync.cs
- IPCCacheManager.cs
- ExceptionUtility.cs
- AdCreatedEventArgs.cs
- CallTemplateAction.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- DefaultValueConverter.cs
- HwndStylusInputProvider.cs
- TextWriterTraceListener.cs
- CombinedGeometry.cs
- ResizeGrip.cs
- IdnElement.cs
- DynamicPropertyReader.cs
- DifferencingCollection.cs
- WebDisplayNameAttribute.cs
- DataSourceHelper.cs
- ToolStripInSituService.cs
- BookmarkTable.cs
- UserControlCodeDomTreeGenerator.cs
- PTManager.cs
- RichTextBoxContextMenu.cs
- JapaneseCalendar.cs
- ToolStripTextBox.cs
- XslNumber.cs
- PaintValueEventArgs.cs
- StringResourceManager.cs
- TableItemPatternIdentifiers.cs
- Asn1Utilities.cs
- KnownTypesHelper.cs
- OLEDB_Util.cs
- MobileCapabilities.cs
- Scene3D.cs
- Listbox.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- Sql8ExpressionRewriter.cs
- WorkflowNamespace.cs
- UxThemeWrapper.cs
- XmlTextReaderImpl.cs
- RootCodeDomSerializer.cs
- DataGridViewDataConnection.cs
- SessionParameter.cs
- XmlTypeAttribute.cs
- WSDualHttpBinding.cs
- MSG.cs
- HtmlTableRowCollection.cs
- RuleInfoComparer.cs
- GridViewSelectEventArgs.cs
- TraceEventCache.cs
- RelationshipConverter.cs
- RelationshipEntry.cs
- SqlXmlStorage.cs
- DefaultHttpHandler.cs
- URLString.cs
- StructureChangedEventArgs.cs
- ScrollItemProviderWrapper.cs
- XPathChildIterator.cs
- MessageRpc.cs
- TextEffectCollection.cs
- TreeViewHitTestInfo.cs
- ViewStateException.cs
- SafeNativeMethodsMilCoreApi.cs
- RadialGradientBrush.cs
- SystemIPInterfaceStatistics.cs
- BorderGapMaskConverter.cs
- IntSecurity.cs
- OrderByLifter.cs
- QuaternionKeyFrameCollection.cs
- WebPartExportVerb.cs
- brushes.cs
- XmlSchemaAnyAttribute.cs
- MemberDescriptor.cs
- LowerCaseStringConverter.cs
- SoundPlayer.cs
- UserPersonalizationStateInfo.cs
- SapiRecoContext.cs
- WindowsEditBox.cs
- StringAnimationBase.cs
- EntityDataReader.cs
- CapabilitiesAssignment.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ButtonFieldBase.cs
- ListDictionaryInternal.cs
- ConditionedDesigner.cs
- DataColumnMapping.cs
- HttpHandlerActionCollection.cs
- oledbmetadatacolumnnames.cs
- Formatter.cs
- Int32RectValueSerializer.cs
- ThicknessAnimationUsingKeyFrames.cs
- BuildManagerHost.cs
- HashFinalRequest.cs
- SurrogateChar.cs
- AnnotationComponentManager.cs
- EnumValidator.cs
- ApplicationTrust.cs
- CryptoStream.cs