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
- FormViewDeletedEventArgs.cs
- Literal.cs
- HyperLinkColumn.cs
- ASCIIEncoding.cs
- DateTimeFormat.cs
- BamlTreeMap.cs
- IChannel.cs
- RequestStatusBarUpdateEventArgs.cs
- NameSpaceExtractor.cs
- Psha1DerivedKeyGenerator.cs
- UnknownBitmapDecoder.cs
- FixedSOMTable.cs
- Paragraph.cs
- WizardPanel.cs
- ClientScriptItemCollection.cs
- WebPartConnectionsEventArgs.cs
- Win32.cs
- XmlElementAttribute.cs
- XmlSchemaIdentityConstraint.cs
- SafeArrayTypeMismatchException.cs
- FrameworkPropertyMetadata.cs
- UpdateManifestForBrowserApplication.cs
- XmlSchemaNotation.cs
- initElementDictionary.cs
- ConfigurationPermission.cs
- CheckBoxRenderer.cs
- SQLChars.cs
- DragEvent.cs
- TextFindEngine.cs
- EntityDataSourceContextCreatingEventArgs.cs
- BasePropertyDescriptor.cs
- InternalMappingException.cs
- SessionPageStateSection.cs
- PlanCompilerUtil.cs
- SocketCache.cs
- SchemaTypeEmitter.cs
- securestring.cs
- DataComponentGenerator.cs
- ClaimSet.cs
- Transform.cs
- LinkButton.cs
- ExpandCollapseProviderWrapper.cs
- SizeValueSerializer.cs
- AutomationPatternInfo.cs
- _ConnectOverlappedAsyncResult.cs
- TableLayoutPanel.cs
- ImplicitInputBrush.cs
- HttpHandlerAction.cs
- StylusLogic.cs
- ServicePoint.cs
- BitmapSource.cs
- SecurityImpersonationBehavior.cs
- ChildDocumentBlock.cs
- PaperSource.cs
- NativeActivityContext.cs
- WebPartActionVerb.cs
- PhysicalAddress.cs
- DetailsViewUpdateEventArgs.cs
- HttpAsyncResult.cs
- PropertyGridDesigner.cs
- ConfigurationFileMap.cs
- ExpressionQuoter.cs
- WmlPanelAdapter.cs
- OdbcConnectionOpen.cs
- Preprocessor.cs
- CompareInfo.cs
- AQNBuilder.cs
- ClrProviderManifest.cs
- XamlStackWriter.cs
- RecognizedPhrase.cs
- Exceptions.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- HttpCachePolicyWrapper.cs
- XMLSchema.cs
- DesignTimeDataBinding.cs
- EmptyEnumerator.cs
- AsyncCompletedEventArgs.cs
- InternalRelationshipCollection.cs
- HttpGetServerProtocol.cs
- EntityDataReader.cs
- SpecialFolderEnumConverter.cs
- ContextMenuAutomationPeer.cs
- ParallelQuery.cs
- NullableDoubleAverageAggregationOperator.cs
- XPathAncestorQuery.cs
- Parallel.cs
- StylusSystemGestureEventArgs.cs
- XmlDataCollection.cs
- AppLevelCompilationSectionCache.cs
- StateMachine.cs
- ProfilePropertyNameValidator.cs
- WsiProfilesElementCollection.cs
- MulticastIPAddressInformationCollection.cs
- ErrorProvider.cs
- DataSourceCache.cs
- XmlnsCompatibleWithAttribute.cs
- InvalidWMPVersionException.cs
- ExtentJoinTreeNode.cs
- Renderer.cs
- ArgumentDesigner.xaml.cs