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
- SchemaImporterExtensionsSection.cs
- ELinqQueryState.cs
- DBCSCodePageEncoding.cs
- FlowDocumentReader.cs
- FileDetails.cs
- _OverlappedAsyncResult.cs
- TypeNameParser.cs
- GeneralTransform3DTo2DTo3D.cs
- PackageStore.cs
- PointLight.cs
- QueryTreeBuilder.cs
- WindowShowOrOpenTracker.cs
- LinkButton.cs
- XamlHttpHandlerFactory.cs
- ProviderSettings.cs
- Socket.cs
- CompareValidator.cs
- AsnEncodedData.cs
- DataTableMapping.cs
- MethodBuilder.cs
- odbcmetadatafactory.cs
- RuntimeTransactionHandle.cs
- SqlDataSourceSelectingEventArgs.cs
- XmlSchemaGroupRef.cs
- UiaCoreProviderApi.cs
- RotateTransform.cs
- RewritingValidator.cs
- DefaultSettingsSection.cs
- HtmlMeta.cs
- FatalException.cs
- DynamicUpdateCommand.cs
- Point3DAnimationUsingKeyFrames.cs
- HandlerMappingMemo.cs
- GeneralTransformGroup.cs
- ValidatedControlConverter.cs
- IDReferencePropertyAttribute.cs
- EntityStoreSchemaGenerator.cs
- Container.cs
- ViewManager.cs
- Package.cs
- InvokePattern.cs
- OutputCacheSettings.cs
- RoutedUICommand.cs
- FixUp.cs
- SupportsEventValidationAttribute.cs
- SwitchAttribute.cs
- XmlParserContext.cs
- WmlControlAdapter.cs
- WinInetCache.cs
- WorkflowInstanceContextProvider.cs
- LoginName.cs
- WebControl.cs
- UmAlQuraCalendar.cs
- ObjectToModelValueConverter.cs
- ComAdminInterfaces.cs
- DependencyObject.cs
- TextRunProperties.cs
- RequestCachePolicy.cs
- HttpClientCertificate.cs
- RegisteredScript.cs
- WindowsContainer.cs
- FirstMatchCodeGroup.cs
- ConfigurationLoaderException.cs
- PropertyNames.cs
- EditorReuseAttribute.cs
- PeerContact.cs
- HelpInfo.cs
- DbConnectionOptions.cs
- ThreadSafeList.cs
- SettingsPropertyNotFoundException.cs
- DesignBinding.cs
- BreakRecordTable.cs
- ParallelTimeline.cs
- ToolBarTray.cs
- WinFormsSpinner.cs
- translator.cs
- JournalEntry.cs
- IdentifierService.cs
- HttpClientCertificate.cs
- BounceEase.cs
- XmlHelper.cs
- HtmlEncodedRawTextWriter.cs
- RequestCacheEntry.cs
- mediaeventshelper.cs
- MDIControlStrip.cs
- PrimitiveType.cs
- UnknownWrapper.cs
- SingleObjectCollection.cs
- HttpSessionStateBase.cs
- RuntimeHelpers.cs
- UIElementCollection.cs
- RtfToken.cs
- DBSchemaRow.cs
- ConfigurationStrings.cs
- ExpressionHelper.cs
- GeneralTransform2DTo3DTo2D.cs
- NodeLabelEditEvent.cs
- SspiWrapper.cs
- HostProtectionPermission.cs
- DetailsViewRowCollection.cs