Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TraceLog.cs
- mansign.cs
- SetStoryboardSpeedRatio.cs
- PartManifestEntry.cs
- Visitors.cs
- FigureParagraph.cs
- HttpContext.cs
- RawStylusInputReport.cs
- Helper.cs
- OdbcError.cs
- SQLDouble.cs
- XomlDesignerLoader.cs
- InkPresenter.cs
- MultipartIdentifier.cs
- TraceHwndHost.cs
- WindowsUpDown.cs
- SerializationEventsCache.cs
- IdentitySection.cs
- XNodeSchemaApplier.cs
- ChtmlCommandAdapter.cs
- AuthenticationManager.cs
- WebPartChrome.cs
- SharedConnectionInfo.cs
- StringFreezingAttribute.cs
- RawStylusActions.cs
- CodeCatchClause.cs
- AppearanceEditorPart.cs
- CodeArrayIndexerExpression.cs
- ProcessHostFactoryHelper.cs
- FragmentNavigationEventArgs.cs
- DllHostInitializer.cs
- TypedAsyncResult.cs
- PathFigure.cs
- ParsedRoute.cs
- ServiceOperationListItemList.cs
- ParseNumbers.cs
- log.cs
- RegexNode.cs
- WebScriptMetadataInstanceContextProvider.cs
- BamlRecords.cs
- log.cs
- SqlFlattener.cs
- PatternMatcher.cs
- SafeViewOfFileHandle.cs
- MbpInfo.cs
- DataControlButton.cs
- CompiledIdentityConstraint.cs
- ToolStripItemImageRenderEventArgs.cs
- XamlLoadErrorInfo.cs
- ObjectStorage.cs
- X509CertificateInitiatorClientCredential.cs
- PropertyTab.cs
- coordinatorscratchpad.cs
- TextControl.cs
- TemplateKey.cs
- HttpModulesSection.cs
- DefaultDialogButtons.cs
- ObservableCollectionDefaultValueFactory.cs
- ProfilePropertySettingsCollection.cs
- FlowDecision.cs
- MachineSettingsSection.cs
- GridViewColumnHeaderAutomationPeer.cs
- GenericEnumerator.cs
- IISMapPath.cs
- PropertyValueUIItem.cs
- Track.cs
- DBCSCodePageEncoding.cs
- WorkflowShape.cs
- RowToFieldTransformer.cs
- AdapterDictionary.cs
- GatewayIPAddressInformationCollection.cs
- PropertyItemInternal.cs
- AuthorizationRule.cs
- DropShadowEffect.cs
- Int64AnimationBase.cs
- LeftCellWrapper.cs
- DataControlCommands.cs
- TextRangeAdaptor.cs
- WmfPlaceableFileHeader.cs
- BitmapFrameDecode.cs
- Cell.cs
- ExpressionBuilder.cs
- SecurityRuntime.cs
- FontEmbeddingManager.cs
- DataObjectCopyingEventArgs.cs
- CodeExpressionRuleDeclaration.cs
- PreviewPrintController.cs
- BamlLocalizabilityResolver.cs
- OleDbCommandBuilder.cs
- RegexNode.cs
- ComplexBindingPropertiesAttribute.cs
- PackagingUtilities.cs
- IPEndPointCollection.cs
- SystemUnicastIPAddressInformation.cs
- DataBinding.cs
- HashLookup.cs
- OracleDataAdapter.cs
- XmlIgnoreAttribute.cs
- Floater.cs
- WebControlsSection.cs