Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / ButtonAutomationPeer.cs / 1305600 / ButtonAutomationPeer.cs
using System; 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.Input; using System.Windows.Interop; using System.Windows.Media; using System.Windows.Threading; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class ButtonAutomationPeer : ButtonBaseAutomationPeer, IInvokeProvider { /// public ButtonAutomationPeer(Button owner): base(owner) {} /// override protected string GetClassNameCore() { return "Button"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Button; } /// override public object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.Invoke) return this; else return base.GetPattern(patternInterface); } void IInvokeProvider.Invoke() { if(!IsEnabled()) throw new ElementNotEnabledException(); // Async call of click event // In ClickHandler opens a dialog and suspend the execution we don't want to block this thread Dispatcher.BeginInvoke(DispatcherPriority.Input, new DispatcherOperationCallback(delegate(object param) { ((Button)Owner).AutomationButtonBaseClick(); return null; }), null); } } } // 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
- CollectionType.cs
- PropVariant.cs
- EntitySetDataBindingList.cs
- ThreadWorkerController.cs
- TypeConverterHelper.cs
- PeerDuplexChannelListener.cs
- Win32SafeHandles.cs
- AuthenticodeSignatureInformation.cs
- ObjectStateManagerMetadata.cs
- PrivacyNoticeBindingElementImporter.cs
- BitmapEffectGroup.cs
- BStrWrapper.cs
- CompositeFontInfo.cs
- AuthorizationSection.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- XmlEventCache.cs
- BinaryParser.cs
- TextContainerChangedEventArgs.cs
- WebPartHelpVerb.cs
- SqlProviderManifest.cs
- CalculatedColumn.cs
- RightsManagementEncryptionTransform.cs
- ListCardsInFileRequest.cs
- UInt32Storage.cs
- CLSCompliantAttribute.cs
- RadialGradientBrush.cs
- FontSource.cs
- ArraySortHelper.cs
- SelectedCellsCollection.cs
- PartialCachingControl.cs
- CodeGenerator.cs
- DataReaderContainer.cs
- ISessionStateStore.cs
- Translator.cs
- ClientCredentials.cs
- ADConnectionHelper.cs
- ResourceIDHelper.cs
- ItemCheckedEvent.cs
- VersionedStreamOwner.cs
- XmlBinaryWriterSession.cs
- VisualStates.cs
- _KerberosClient.cs
- DetailsViewUpdatedEventArgs.cs
- control.ime.cs
- ToolStripLabel.cs
- _TransmitFileOverlappedAsyncResult.cs
- DocumentSchemaValidator.cs
- WarningException.cs
- BoundField.cs
- JournalEntry.cs
- InvalidFilterCriteriaException.cs
- GridViewColumnHeader.cs
- _NegotiateClient.cs
- ExpressionCopier.cs
- DockAndAnchorLayout.cs
- SizeAnimationUsingKeyFrames.cs
- TextServicesCompartmentEventSink.cs
- ColorBlend.cs
- PropertyKey.cs
- DataSvcMapFile.cs
- XmlDataCollection.cs
- CodeValidator.cs
- ContainerUtilities.cs
- WCFModelStrings.Designer.cs
- SurrogateSelector.cs
- StringDictionary.cs
- Merger.cs
- ImageListImage.cs
- DataObject.cs
- RoleManagerModule.cs
- HttpStreamMessage.cs
- CheckableControlBaseAdapter.cs
- WebBrowserNavigatingEventHandler.cs
- HttpException.cs
- CrossSiteScriptingValidation.cs
- SystemInformation.cs
- IntranetCredentialPolicy.cs
- SerializationStore.cs
- XmlValidatingReaderImpl.cs
- XmlDigitalSignatureProcessor.cs
- FunctionCommandText.cs
- CodeIterationStatement.cs
- ImmutablePropertyDescriptorGridEntry.cs
- FactoryMaker.cs
- GC.cs
- URLString.cs
- HideDisabledControlAdapter.cs
- AutomationPeer.cs
- BasicCellRelation.cs
- BindingListCollectionView.cs
- QuaternionRotation3D.cs
- NonPrimarySelectionGlyph.cs
- SqlPersistenceProviderFactory.cs
- mansign.cs
- OlePropertyStructs.cs
- DocumentSequenceHighlightLayer.cs
- SecurityTokenResolver.cs
- PenContexts.cs
- TextBoxLine.cs
- NamedPipeTransportSecurity.cs