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
- Timer.cs
- StreamGeometry.cs
- Random.cs
- basenumberconverter.cs
- DataRecordInfo.cs
- DataSourceCacheDurationConverter.cs
- Fault.cs
- ImmutablePropertyDescriptorGridEntry.cs
- Transform.cs
- ScriptingProfileServiceSection.cs
- UniqueID.cs
- LinkedResource.cs
- wmiutil.cs
- cookie.cs
- Stackframe.cs
- ConfigurationConverterBase.cs
- PointCollectionConverter.cs
- ResourceManager.cs
- StubHelpers.cs
- EntityKey.cs
- SemanticValue.cs
- BitStack.cs
- EndPoint.cs
- DictionaryBase.cs
- SafeMarshalContext.cs
- ServiceMetadataPublishingElement.cs
- CompModSwitches.cs
- CharAnimationUsingKeyFrames.cs
- InputBindingCollection.cs
- _UriTypeConverter.cs
- EDesignUtil.cs
- ControlPager.cs
- WebPartCatalogCloseVerb.cs
- XPathQilFactory.cs
- CheckBoxPopupAdapter.cs
- ExternalFile.cs
- ClientApiGenerator.cs
- PixelFormatConverter.cs
- BadImageFormatException.cs
- PixelFormat.cs
- ApplicationId.cs
- ParameterCollection.cs
- SR.cs
- GPPOINT.cs
- ConditionChanges.cs
- BitmapDownload.cs
- SQLUtility.cs
- CallContext.cs
- BrowserCapabilitiesCompiler.cs
- LineServicesCallbacks.cs
- PackageFilter.cs
- OdbcConnectionOpen.cs
- DataControlFieldCollection.cs
- RuleSetDialog.cs
- LowerCaseStringConverter.cs
- RawStylusInputCustomData.cs
- JsonServiceDocumentSerializer.cs
- SecurityTokenProvider.cs
- ItemsControl.cs
- XmlSchemaAttributeGroupRef.cs
- MobileControlPersister.cs
- DependencyObjectPropertyDescriptor.cs
- EditorZoneBase.cs
- XPathDocumentNavigator.cs
- PropertySet.cs
- DoubleAnimationUsingPath.cs
- EntityTransaction.cs
- TagPrefixCollection.cs
- SqlServer2KCompatibilityCheck.cs
- FileFormatException.cs
- X509Utils.cs
- PerformanceCounterLib.cs
- InfoCardRSACryptoProvider.cs
- Faults.cs
- SoapAttributeOverrides.cs
- KeyToListMap.cs
- SiteOfOriginContainer.cs
- DeclaredTypeElement.cs
- ADConnectionHelper.cs
- LogicalCallContext.cs
- SafeBuffer.cs
- FileIOPermission.cs
- SwitchLevelAttribute.cs
- StringExpressionSet.cs
- ValidationVisibilityAttribute.cs
- Interlocked.cs
- Point3DConverter.cs
- DesignerCategoryAttribute.cs
- GroupItem.cs
- DesignTimeParseData.cs
- ToolStripItemEventArgs.cs
- OptimisticConcurrencyException.cs
- StructuredType.cs
- HttpAsyncResult.cs
- __Filters.cs
- HttpListener.cs
- SvcMapFile.cs
- DefaultTextStore.cs
- ClientSettingsSection.cs
- MultiTargetingUtil.cs