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
- AssemblyHash.cs
- DispatcherHookEventArgs.cs
- XmlReturnWriter.cs
- Token.cs
- CryptoApi.cs
- TPLETWProvider.cs
- ActionMessageFilterTable.cs
- AssemblyCollection.cs
- WebPartZoneBase.cs
- HwndProxyElementProvider.cs
- DataTableCollection.cs
- GridViewRowCollection.cs
- MediaSystem.cs
- HeaderPanel.cs
- QueryCacheManager.cs
- FactoryGenerator.cs
- Preprocessor.cs
- RIPEMD160Managed.cs
- MarginCollapsingState.cs
- Itemizer.cs
- DateTimeOffset.cs
- TypeDescriptionProviderAttribute.cs
- TypeDependencyAttribute.cs
- LayoutEvent.cs
- EntityCommand.cs
- ColorAnimationUsingKeyFrames.cs
- WebRequestModuleElementCollection.cs
- SimpleBitVector32.cs
- VisualStyleRenderer.cs
- CodeParameterDeclarationExpressionCollection.cs
- DataTemplate.cs
- JournalNavigationScope.cs
- SecurityCookieModeValidator.cs
- MulticastIPAddressInformationCollection.cs
- NativeRightsManagementAPIsStructures.cs
- CroppedBitmap.cs
- SqlExpressionNullability.cs
- cookieexception.cs
- TcpTransportSecurityElement.cs
- GridView.cs
- XmlHierarchyData.cs
- unitconverter.cs
- CaseInsensitiveOrdinalStringComparer.cs
- CallbackWrapper.cs
- ExtendedTransformFactory.cs
- Preprocessor.cs
- WinFormsSecurity.cs
- ProbeDuplexAsyncResult.cs
- Hashtable.cs
- Latin1Encoding.cs
- AnonymousIdentificationModule.cs
- cookiecollection.cs
- DataSvcMapFileSerializer.cs
- SelectionWordBreaker.cs
- TokenBasedSet.cs
- BackStopAuthenticationModule.cs
- SafeNativeMethods.cs
- ProcessModelSection.cs
- IfAction.cs
- NamedPermissionSet.cs
- PersonalizationProviderCollection.cs
- AlignmentYValidation.cs
- RequestSecurityTokenResponse.cs
- Typography.cs
- FileRegion.cs
- BaseDataBoundControlDesigner.cs
- ExecutionContext.cs
- InkCanvasSelection.cs
- ZipIOBlockManager.cs
- XmlSerializerVersionAttribute.cs
- xmlglyphRunInfo.cs
- TriggerBase.cs
- selecteditemcollection.cs
- ProgressPage.cs
- SslSecurityTokenParameters.cs
- FunctionImportMapping.cs
- Rfc2898DeriveBytes.cs
- PolyBezierSegmentFigureLogic.cs
- WebPartZone.cs
- SqlNotificationEventArgs.cs
- OutputWindow.cs
- ActivityStateQuery.cs
- ChtmlSelectionListAdapter.cs
- WindowsSpinner.cs
- SchemaMapping.cs
- safesecurityhelperavalon.cs
- DrawingAttributeSerializer.cs
- StrokeNodeOperations.cs
- StateMachineWorkflowInstance.cs
- SqlServices.cs
- MessagePartSpecification.cs
- DiscreteKeyFrames.cs
- EntityDataSourceWrapper.cs
- OLEDB_Util.cs
- ValueExpressions.cs
- SafeSecurityHandles.cs
- RolePrincipal.cs
- PenCursorManager.cs
- BulletChrome.cs
- XmlAutoDetectWriter.cs