Code:
/ 4.0 / 4.0 / 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.
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
- DelegateBodyWriter.cs
- WindowShowOrOpenTracker.cs
- TemplatePartAttribute.cs
- IndicFontClient.cs
- ClientBuildManager.cs
- DataSourceProvider.cs
- PlatformCulture.cs
- GlyphTypeface.cs
- MatchingStyle.cs
- Debug.cs
- ping.cs
- QueryInterceptorAttribute.cs
- HtmlShimManager.cs
- ConfigurationSectionGroupCollection.cs
- Point.cs
- CqlBlock.cs
- XpsSerializationManager.cs
- EncoderNLS.cs
- SafeFileHandle.cs
- PagerSettings.cs
- XmlDocumentViewSchema.cs
- PackageDigitalSignatureManager.cs
- MediaContext.cs
- IPEndPoint.cs
- EventBuilder.cs
- Utils.cs
- MenuItemBindingCollection.cs
- DiagnosticSection.cs
- DelegateSerializationHolder.cs
- odbcmetadatafactory.cs
- MouseCaptureWithinProperty.cs
- WebPartTransformerCollection.cs
- Simplifier.cs
- ListSortDescription.cs
- TypeViewSchema.cs
- MobileControlsSectionHelper.cs
- SchemaMerger.cs
- XmlSecureResolver.cs
- EventEntry.cs
- PublisherMembershipCondition.cs
- SystemIcons.cs
- EventProxy.cs
- X509Certificate.cs
- WindowsListViewItem.cs
- ClaimTypes.cs
- PagesSection.cs
- DBConcurrencyException.cs
- LinqDataSourceSelectEventArgs.cs
- XmlAttributeCache.cs
- DoubleCollection.cs
- PhysicalAddress.cs
- ResourceAttributes.cs
- BehaviorEditorPart.cs
- ImmutablePropertyDescriptorGridEntry.cs
- EpmSourceTree.cs
- remotingproxy.cs
- DebugInfo.cs
- GeometryDrawing.cs
- IQueryable.cs
- DesignerTransactionCloseEvent.cs
- DataGridViewRowPrePaintEventArgs.cs
- DataControlCommands.cs
- TabPageDesigner.cs
- _LocalDataStoreMgr.cs
- PageBuildProvider.cs
- _ChunkParse.cs
- DbDataAdapter.cs
- GetWinFXPath.cs
- Link.cs
- OracleDateTime.cs
- Buffer.cs
- ChangeDirector.cs
- UInt64.cs
- WindowsTab.cs
- SmtpSection.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- DataServiceQuery.cs
- StorageEntityTypeMapping.cs
- ToolbarAUtomationPeer.cs
- PasswordPropertyTextAttribute.cs
- BrowserCapabilitiesFactory.cs
- IntellisenseTextBox.cs
- BrowsableAttribute.cs
- ServiceXNameTypeConverter.cs
- AxisAngleRotation3D.cs
- ConfigViewGenerator.cs
- FileUtil.cs
- ISCIIEncoding.cs
- LinkUtilities.cs
- HitTestParameters.cs
- Int16KeyFrameCollection.cs
- ProcessingInstructionAction.cs
- DataGridViewColumnCollection.cs
- InternalBufferOverflowException.cs
- ToolboxItemAttribute.cs
- Button.cs
- NativeObjectSecurity.cs
- DragCompletedEventArgs.cs
- MulticastNotSupportedException.cs
- CqlParser.cs