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
- HttpDictionary.cs
- GlobalDataBindingHandler.cs
- Internal.cs
- Process.cs
- CompositeDataBoundControl.cs
- Function.cs
- EmptyStringExpandableObjectConverter.cs
- SerialErrors.cs
- DataGridViewTopRowAccessibleObject.cs
- DelegateSerializationHolder.cs
- InsufficientMemoryException.cs
- CurrentChangingEventManager.cs
- XmlSchemaSimpleContentExtension.cs
- MatrixTransform.cs
- SplitterCancelEvent.cs
- WindowsImpersonationContext.cs
- NamespaceList.cs
- DbRetry.cs
- BuildProviderAppliesToAttribute.cs
- MetabaseServerConfig.cs
- InternalTypeHelper.cs
- Condition.cs
- DisplayNameAttribute.cs
- TreeNodeBinding.cs
- ActivationWorker.cs
- TemplateEditingVerb.cs
- StrongName.cs
- SendMailErrorEventArgs.cs
- EditorZoneBase.cs
- ComAwareEventInfo.cs
- SortDescription.cs
- OutgoingWebResponseContext.cs
- assertwrapper.cs
- DebugView.cs
- Message.cs
- SimpleHandlerBuildProvider.cs
- IndicShape.cs
- PublisherMembershipCondition.cs
- AnnotationStore.cs
- WebPartManager.cs
- StrongNamePublicKeyBlob.cs
- StringValidator.cs
- RelationshipWrapper.cs
- XmlIlVisitor.cs
- TemplateColumn.cs
- dtdvalidator.cs
- WorkflowOperationErrorHandler.cs
- KnownBoxes.cs
- OleDbDataAdapter.cs
- PenLineCapValidation.cs
- DoubleLinkList.cs
- RegexStringValidatorAttribute.cs
- Color.cs
- AQNBuilder.cs
- PageContent.cs
- XmlILModule.cs
- PagerSettings.cs
- MetadataUtilsSmi.cs
- DocumentPageView.cs
- LogicalTreeHelper.cs
- FloaterBaseParagraph.cs
- Int32AnimationUsingKeyFrames.cs
- Directory.cs
- Input.cs
- HtmlTextArea.cs
- EmptyReadOnlyDictionaryInternal.cs
- PageSettings.cs
- _DomainName.cs
- CustomWebEventKey.cs
- MethodExpression.cs
- IDReferencePropertyAttribute.cs
- Listbox.cs
- Stream.cs
- XmlBindingWorker.cs
- XmlLanguage.cs
- CodePageEncoding.cs
- ModelTypeConverter.cs
- EqualityComparer.cs
- SqlLiftIndependentRowExpressions.cs
- ListViewContainer.cs
- ConfigurationProperty.cs
- ResXResourceReader.cs
- UiaCoreApi.cs
- ActivityExecutor.cs
- FixedTextView.cs
- PagesSection.cs
- InputLanguageManager.cs
- AutoGeneratedFieldProperties.cs
- PointConverter.cs
- XmlIgnoreAttribute.cs
- TrustLevelCollection.cs
- PathGradientBrush.cs
- ServiceMetadataExtension.cs
- PropertyEntry.cs
- HMACRIPEMD160.cs
- Matrix3D.cs
- RuntimeResourceSet.cs
- PropertyMetadata.cs
- CalendarDay.cs
- PtsHost.cs