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
- QilBinary.cs
- PropertyDescriptorComparer.cs
- DESCryptoServiceProvider.cs
- GridItemPatternIdentifiers.cs
- DbExpressionVisitor_TResultType.cs
- Geometry3D.cs
- TextElementAutomationPeer.cs
- WebChannelFactory.cs
- BaseProcessor.cs
- Content.cs
- XPathNavigatorKeyComparer.cs
- RegexWorker.cs
- MSAANativeProvider.cs
- SR.cs
- SystemInformation.cs
- CompiledELinqQueryState.cs
- TranslateTransform3D.cs
- Timer.cs
- TextChangedEventArgs.cs
- PerformanceCounterLib.cs
- LicenseContext.cs
- InertiaExpansionBehavior.cs
- SourceChangedEventArgs.cs
- PartialCachingAttribute.cs
- DictionaryContent.cs
- ProviderSettings.cs
- BufferModeSettings.cs
- ConnectionConsumerAttribute.cs
- TextTrailingWordEllipsis.cs
- BamlLocalizableResourceKey.cs
- TabItemWrapperAutomationPeer.cs
- EventRoute.cs
- DataFormat.cs
- BindingGroup.cs
- HttpWebResponse.cs
- CultureTable.cs
- WebPartAddingEventArgs.cs
- UserUseLicenseDictionaryLoader.cs
- DrawingCollection.cs
- DesignerTextBoxAdapter.cs
- LocationInfo.cs
- EncodingNLS.cs
- ApplicationDirectory.cs
- DbProviderFactories.cs
- Helpers.cs
- Pens.cs
- EntryWrittenEventArgs.cs
- EditingCoordinator.cs
- XmlDigitalSignatureProcessor.cs
- AllMembershipCondition.cs
- IntPtr.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- ToolStripDropDownClosingEventArgs.cs
- TableRowCollection.cs
- HttpDebugHandler.cs
- InvalidDataException.cs
- ResourceReferenceExpressionConverter.cs
- OdbcDataReader.cs
- GeneralTransform.cs
- TableRow.cs
- FontUnitConverter.cs
- NavigationCommands.cs
- ReferenceSchema.cs
- DelegateArgumentValue.cs
- TreeNodeStyleCollectionEditor.cs
- ClientFormsIdentity.cs
- TraceContextRecord.cs
- Point3DCollectionConverter.cs
- QueryRewriter.cs
- TextRangeAdaptor.cs
- MethodToken.cs
- ApplicationGesture.cs
- HttpCachePolicy.cs
- EventListenerClientSide.cs
- DataPagerFieldCollection.cs
- SecondaryIndexList.cs
- datacache.cs
- RowUpdatingEventArgs.cs
- _NegotiateClient.cs
- XNodeNavigator.cs
- HttpListenerTimeoutManager.cs
- BaseUriHelper.cs
- DataViewManager.cs
- WizardForm.cs
- Internal.cs
- MemberPath.cs
- precedingquery.cs
- TypedTableGenerator.cs
- XmlSchemaComplexType.cs
- GridViewPageEventArgs.cs
- StringValueSerializer.cs
- ToolStripItem.cs
- _ShellExpression.cs
- TableDetailsCollection.cs
- CreateRefExpr.cs
- InstanceValue.cs
- TextRunProperties.cs
- WinEventQueueItem.cs
- HttpProtocolImporter.cs
- SqlCacheDependencySection.cs