Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- SqlDataSourceEnumerator.cs
- SingleSelectRootGridEntry.cs
- WebServiceEndpoint.cs
- FragmentQuery.cs
- Timer.cs
- ImageSourceValueSerializer.cs
- RandomNumberGenerator.cs
- StrokeIntersection.cs
- CancellationState.cs
- DesignerCalendarAdapter.cs
- StringUtil.cs
- DynamicValueConverter.cs
- CodeVariableReferenceExpression.cs
- ConfigurationManagerHelperFactory.cs
- DocumentViewerBaseAutomationPeer.cs
- WebPartConnection.cs
- HiddenField.cs
- Site.cs
- InplaceBitmapMetadataWriter.cs
- CustomPopupPlacement.cs
- WebPartTracker.cs
- PiiTraceSource.cs
- NumberSubstitution.cs
- BamlMapTable.cs
- TypeSystem.cs
- RightsManagementInformation.cs
- PolicyImporterElementCollection.cs
- LineProperties.cs
- WebPartDisplayModeCollection.cs
- SessionParameter.cs
- BinaryFormatter.cs
- OracleTimeSpan.cs
- SchemaMerger.cs
- EdmComplexTypeAttribute.cs
- BinaryConverter.cs
- TreeViewCancelEvent.cs
- SchemaNames.cs
- GenericEnumerator.cs
- SessionPageStatePersister.cs
- Win32SafeHandles.cs
- TableLayoutPanelCellPosition.cs
- CreatingCookieEventArgs.cs
- WmlObjectListAdapter.cs
- HostedHttpContext.cs
- RectAnimationUsingKeyFrames.cs
- ConfigurationValues.cs
- Viewport3DAutomationPeer.cs
- ControllableStoryboardAction.cs
- BuildProvidersCompiler.cs
- LinqDataSourceInsertEventArgs.cs
- RootProfilePropertySettingsCollection.cs
- CompilerErrorCollection.cs
- SqlError.cs
- _Events.cs
- UnsafeNativeMethods.cs
- ParentUndoUnit.cs
- ResourceIDHelper.cs
- ValueProviderWrapper.cs
- AttributeProviderAttribute.cs
- BitmapEffectCollection.cs
- TreeNodeStyle.cs
- RealizationContext.cs
- PackageStore.cs
- CommonRemoteMemoryBlock.cs
- BindingRestrictions.cs
- MasterPageParser.cs
- CodeStatement.cs
- UriParserTemplates.cs
- AuthenticationService.cs
- TransportContext.cs
- InternalResources.cs
- TemplateFactory.cs
- SpellerStatusTable.cs
- CloudCollection.cs
- HintTextConverter.cs
- PrivateFontCollection.cs
- LocalFileSettingsProvider.cs
- AsyncDataRequest.cs
- ThreadWorkerController.cs
- SecurityContextTokenValidationException.cs
- GACIdentityPermission.cs
- TransformerConfigurationWizardBase.cs
- ParameterElementCollection.cs
- DataTrigger.cs
- _OverlappedAsyncResult.cs
- CommandBindingCollection.cs
- WebMessageFormatHelper.cs
- InfoCardMetadataExchangeClient.cs
- SnapshotChangeTrackingStrategy.cs
- MappingMetadataHelper.cs
- XmlAttributeOverrides.cs
- CollectionViewProxy.cs
- OptionalColumn.cs
- FacetValues.cs
- CqlLexerHelpers.cs
- LockRecursionException.cs
- MessagePropertyVariants.cs
- SplashScreenNativeMethods.cs
- DesignerWebPartChrome.cs
- TypeValidationEventArgs.cs