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
- ColumnMapProcessor.cs
- ComplexTypeEmitter.cs
- DataException.cs
- CompilerGeneratedAttribute.cs
- SQLStringStorage.cs
- GlyphingCache.cs
- GradientStop.cs
- CornerRadiusConverter.cs
- LoggedException.cs
- FastPropertyAccessor.cs
- HtmlUtf8RawTextWriter.cs
- TabletDeviceInfo.cs
- PolicyException.cs
- ResXResourceWriter.cs
- MergeFailedEvent.cs
- MenuBase.cs
- FontFamily.cs
- MarshalDirectiveException.cs
- FileDialog_Vista.cs
- TextDecoration.cs
- GZipDecoder.cs
- SourceInterpreter.cs
- JsonWriter.cs
- PolicyValidationException.cs
- SettingsPropertyValueCollection.cs
- CommandArguments.cs
- AsymmetricKeyExchangeFormatter.cs
- DataGridColumnFloatingHeader.cs
- IPPacketInformation.cs
- MetadataProperty.cs
- TransactionContext.cs
- DebugManager.cs
- ComAdminWrapper.cs
- KnownColorTable.cs
- Accessible.cs
- TextServicesContext.cs
- DataReceivedEventArgs.cs
- ResourceFallbackManager.cs
- SiteMembershipCondition.cs
- DBSqlParser.cs
- SchemaType.cs
- InvalidateEvent.cs
- NativeMethods.cs
- BackgroundWorker.cs
- XmlSchemaAppInfo.cs
- HtmlMeta.cs
- DisableDpiAwarenessAttribute.cs
- KeyNotFoundException.cs
- SqlAliasesReferenced.cs
- PreviewKeyDownEventArgs.cs
- ProxySimple.cs
- TypeInitializationException.cs
- CommentEmitter.cs
- GridViewUpdatedEventArgs.cs
- _NTAuthentication.cs
- RegexCompiler.cs
- Hex.cs
- ListArgumentProvider.cs
- HtmlTextArea.cs
- InteropTrackingRecord.cs
- LocationUpdates.cs
- WmlFormAdapter.cs
- DataGridViewComboBoxCell.cs
- VerticalAlignConverter.cs
- IPAddress.cs
- PackageRelationshipSelector.cs
- RegistryPermission.cs
- TableCell.cs
- SiteMapNodeItem.cs
- X509Chain.cs
- LicenseManager.cs
- AutomationPatternInfo.cs
- DiscoveryExceptionDictionary.cs
- SqlDataReaderSmi.cs
- X500Name.cs
- LoginName.cs
- ModelItem.cs
- FloaterParaClient.cs
- SHA256.cs
- LineProperties.cs
- WindowsListViewScroll.cs
- DecimalStorage.cs
- ConfigXmlSignificantWhitespace.cs
- DataControlCommands.cs
- SchemaMerger.cs
- ComponentDispatcherThread.cs
- KeyedHashAlgorithm.cs
- ByteStorage.cs
- XmlSchemaSimpleTypeUnion.cs
- AuthenticationModuleElementCollection.cs
- SoapIncludeAttribute.cs
- SoapSchemaExporter.cs
- HandleCollector.cs
- ExtensionFile.cs
- TreeNode.cs
- AttachmentService.cs
- Lease.cs
- CompiledIdentityConstraint.cs
- TextTrailingCharacterEllipsis.cs
- HttpListenerException.cs