Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UInt32Converter.cs
- DictionaryGlobals.cs
- BinaryUtilClasses.cs
- SafeUserTokenHandle.cs
- NamespaceList.cs
- BitmapEffectDrawing.cs
- ApplicationSettingsBase.cs
- Rectangle.cs
- CqlParserHelpers.cs
- SchemaTypeEmitter.cs
- ScrollItemPattern.cs
- OleDbDataAdapter.cs
- ManagedIStream.cs
- DisposableCollectionWrapper.cs
- ApplicationProxyInternal.cs
- CodeCastExpression.cs
- QilLoop.cs
- ResourceWriter.cs
- SoapSchemaImporter.cs
- ObjectDataSourceDisposingEventArgs.cs
- CorrelationManager.cs
- CanExecuteRoutedEventArgs.cs
- OracleConnection.cs
- CircleHotSpot.cs
- SQLResource.cs
- MeasureData.cs
- TypeElementCollection.cs
- sqlinternaltransaction.cs
- TypeRefElement.cs
- HtmlElement.cs
- SupportsEventValidationAttribute.cs
- MenuItem.cs
- CodeRegionDirective.cs
- UIElement3DAutomationPeer.cs
- WebServiceHandler.cs
- FormatPage.cs
- TextParaClient.cs
- PKCS1MaskGenerationMethod.cs
- PersonalizationState.cs
- ErrorHandlingAcceptor.cs
- DataGridViewColumnCollection.cs
- SqlParameter.cs
- XmlAtomicValue.cs
- httpserverutility.cs
- mda.cs
- Gdiplus.cs
- ObjRef.cs
- Random.cs
- CodeTryCatchFinallyStatement.cs
- ModelTreeEnumerator.cs
- SQLCharsStorage.cs
- DrawingCollection.cs
- ResourceCategoryAttribute.cs
- XmlDataImplementation.cs
- TypeForwardedToAttribute.cs
- ContextStaticAttribute.cs
- SHA512Cng.cs
- XamlReaderHelper.cs
- validation.cs
- SchemaMerger.cs
- XmlILModule.cs
- OdbcCommandBuilder.cs
- Deflater.cs
- SeekStoryboard.cs
- ReadOnlyObservableCollection.cs
- PageCatalogPartDesigner.cs
- Page.cs
- RectAnimationBase.cs
- SqlProviderManifest.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- SizeAnimationBase.cs
- ProfileManager.cs
- Control.cs
- HttpListenerException.cs
- Compilation.cs
- StateManagedCollection.cs
- XmlWhitespace.cs
- LightweightEntityWrapper.cs
- EntityContainerRelationshipSetEnd.cs
- Multiply.cs
- CancellableEnumerable.cs
- SafeBuffer.cs
- Tokenizer.cs
- XmlSerializerAssemblyAttribute.cs
- TripleDES.cs
- FieldNameLookup.cs
- HtmlSelectionListAdapter.cs
- IsolatedStorageFileStream.cs
- querybuilder.cs
- SymbolPair.cs
- Container.cs
- BaseTemplateParser.cs
- VectorCollectionValueSerializer.cs
- XmlAttributeAttribute.cs
- ColumnCollectionEditor.cs
- SoapCodeExporter.cs
- ToolStripAdornerWindowService.cs
- FamilyTypeface.cs
- DataGridViewCellPaintingEventArgs.cs
- SafeHandles.cs