Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Automation / Peers / ButtonAutomationPeer.cs / 1 / 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; return null; } 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. 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; return null; } 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
- LogSwitch.cs
- ReferenceAssemblyAttribute.cs
- TypeInformation.cs
- CommonGetThemePartSize.cs
- QueryAsyncResult.cs
- RecommendedAsConfigurableAttribute.cs
- StateMachine.cs
- StorageModelBuildProvider.cs
- NavigatorInput.cs
- ProviderSettings.cs
- SeverityFilter.cs
- SafeLibraryHandle.cs
- RandomNumberGenerator.cs
- MatrixTransform.cs
- ZipIOLocalFileHeader.cs
- EntityDataSourceViewSchema.cs
- SqlCommandBuilder.cs
- Track.cs
- AttachedAnnotation.cs
- OdbcInfoMessageEvent.cs
- SelfIssuedAuthAsymmetricKey.cs
- BitmapFrame.cs
- DependencyPropertyDescriptor.cs
- CompilerScope.cs
- ChannelServices.cs
- MemoryPressure.cs
- EdmItemCollection.OcAssemblyCache.cs
- CommandSet.cs
- TextEmbeddedObject.cs
- SiteMapNodeItem.cs
- EventItfInfo.cs
- HeaderedContentControl.cs
- OrderPreservingPipeliningMergeHelper.cs
- BuildManager.cs
- RangeValueProviderWrapper.cs
- SessionEndedEventArgs.cs
- RedirectionProxy.cs
- SqlInternalConnectionSmi.cs
- VirtualPathProvider.cs
- XmlWriterSettings.cs
- DataGridViewSelectedCellCollection.cs
- TripleDESCryptoServiceProvider.cs
- PathSegmentCollection.cs
- ChangeConflicts.cs
- SplitterEvent.cs
- XpsSerializationManagerAsync.cs
- QueuePathDialog.cs
- ListContractAdapter.cs
- SqlTypeConverter.cs
- EnterpriseServicesHelper.cs
- KeyNotFoundException.cs
- DeclarativeExpressionConditionDeclaration.cs
- SelfIssuedSamlTokenFactory.cs
- PropertyDescriptorCollection.cs
- MultiTrigger.cs
- CmsInterop.cs
- ExpressionTable.cs
- CompiledRegexRunner.cs
- XmlMemberMapping.cs
- NullRuntimeConfig.cs
- QuestionEventArgs.cs
- NavigatingCancelEventArgs.cs
- TabControl.cs
- _OSSOCK.cs
- SecurityAttributeGenerationHelper.cs
- base64Transforms.cs
- WindowsSysHeader.cs
- SystemFonts.cs
- ChannelManagerBase.cs
- SystemEvents.cs
- JsonFormatGeneratorStatics.cs
- SeekableReadStream.cs
- Accessible.cs
- TypeBuilder.cs
- DesignerEventService.cs
- PermissionSetEnumerator.cs
- WebPartUserCapability.cs
- XmlSchema.cs
- SqlDeflator.cs
- Exceptions.cs
- Tracer.cs
- OpCodes.cs
- ManagedWndProcTracker.cs
- RegexRunnerFactory.cs
- Buffer.cs
- PageClientProxyGenerator.cs
- ObservableDictionary.cs
- MSAAEventDispatcher.cs
- WebPartsPersonalizationAuthorization.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
- GradientStop.cs
- RelationshipType.cs
- AuthStoreRoleProvider.cs
- Compiler.cs
- SaveFileDialogDesigner.cs
- HeaderLabel.cs
- SQLInt16.cs
- EmptyEnumerable.cs
- SpAudioStreamWrapper.cs
- ArgumentElement.cs