Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- GridViewItemAutomationPeer.cs
- HttpProfileBase.cs
- ExternalDataExchangeClient.cs
- SmiGettersStream.cs
- XmlSchemaInferenceException.cs
- shaperfactoryquerycacheentry.cs
- UseAttributeSetsAction.cs
- As.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- XmlMembersMapping.cs
- PerspectiveCamera.cs
- DbProviderSpecificTypePropertyAttribute.cs
- DbConnectionPoolGroupProviderInfo.cs
- MemoryResponseElement.cs
- MatrixAnimationUsingPath.cs
- Environment.cs
- DesignerTransaction.cs
- XmlObjectSerializerReadContextComplex.cs
- PasswordBox.cs
- SimplePropertyEntry.cs
- SafeNativeMethods.cs
- LinearKeyFrames.cs
- Main.cs
- ContentPropertyAttribute.cs
- CustomValidator.cs
- WindowsScrollBarBits.cs
- DataGridViewCellConverter.cs
- SHA1.cs
- ColorMatrix.cs
- QueueProcessor.cs
- XsltCompileContext.cs
- CodePageUtils.cs
- DateTimePicker.cs
- DynamicDocumentPaginator.cs
- Icon.cs
- NotCondition.cs
- FlowchartDesignerCommands.cs
- DataServiceHost.cs
- Pointer.cs
- Permission.cs
- CursorConverter.cs
- SQLDoubleStorage.cs
- X509ChainElement.cs
- LazyTextWriterCreator.cs
- TextSchema.cs
- VisualBrush.cs
- StopStoryboard.cs
- SQLSingleStorage.cs
- ConnectionManagementElement.cs
- SessionState.cs
- WebPartCatalogAddVerb.cs
- DataGridCellsPanel.cs
- AssemblySettingAttributes.cs
- MetadataItemEmitter.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- TextServicesCompartmentContext.cs
- StreamAsIStream.cs
- TemplateNameScope.cs
- sqlser.cs
- FieldAccessException.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- KeyValueInternalCollection.cs
- RelationshipFixer.cs
- MultiAsyncResult.cs
- WebConfigurationHostFileChange.cs
- ImageKeyConverter.cs
- MaterialCollection.cs
- FixedDocumentPaginator.cs
- WpfSharedXamlSchemaContext.cs
- PingOptions.cs
- Point3DKeyFrameCollection.cs
- HuffmanTree.cs
- RoutedPropertyChangedEventArgs.cs
- ScrollBar.cs
- X509ScopedServiceCertificateElementCollection.cs
- RoutedCommand.cs
- SqlColumnizer.cs
- GridViewCommandEventArgs.cs
- WebConfigurationHost.cs
- Set.cs
- CryptoSession.cs
- ModelItemDictionary.cs
- BitmapEffectvisualstate.cs
- ArgumentException.cs
- FileLogRecordHeader.cs
- BitSet.cs
- Facet.cs
- LayoutEditorPart.cs
- WindowsHyperlink.cs
- QuotedPrintableStream.cs
- CryptoApi.cs
- QuadraticBezierSegment.cs
- DependencyPropertyConverter.cs
- ReaderOutput.cs
- FixedSOMImage.cs
- TreeNodeSelectionProcessor.cs
- OnOperation.cs
- SqlBulkCopy.cs
- SystemColors.cs
- DbConvert.cs