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
- ChangesetResponse.cs
- XmlCharType.cs
- TextPenaltyModule.cs
- RegexStringValidator.cs
- EntityDataSourceValidationException.cs
- InputReportEventArgs.cs
- SystemResourceHost.cs
- StronglyTypedResourceBuilder.cs
- XmlSchemaSequence.cs
- AdRotator.cs
- LocalsItemDescription.cs
- RawStylusInputReport.cs
- WebPartUtil.cs
- UInt64Storage.cs
- MessageBox.cs
- DataControlFieldCell.cs
- Camera.cs
- ArrayTypeMismatchException.cs
- ProfessionalColors.cs
- MultiAsyncResult.cs
- CalendarButton.cs
- InsufficientMemoryException.cs
- ScrollContentPresenter.cs
- AnnotationComponentManager.cs
- LateBoundBitmapDecoder.cs
- RSAProtectedConfigurationProvider.cs
- OleAutBinder.cs
- DocumentPageViewAutomationPeer.cs
- AdCreatedEventArgs.cs
- ListViewUpdateEventArgs.cs
- StaticSiteMapProvider.cs
- NumericExpr.cs
- FileDialog.cs
- SkewTransform.cs
- GridViewItemAutomationPeer.cs
- TextTreeRootTextBlock.cs
- OciHandle.cs
- StateManager.cs
- TryExpression.cs
- StaticDataManager.cs
- ExpressionBuilderCollection.cs
- PeerApplication.cs
- HashAlgorithm.cs
- RemotingSurrogateSelector.cs
- Message.cs
- RemotingException.cs
- SectionUpdates.cs
- TimerTable.cs
- CreatingCookieEventArgs.cs
- Debug.cs
- Pointer.cs
- HttpRuntime.cs
- XmlWriterSettings.cs
- Rotation3DKeyFrameCollection.cs
- SqlDataSourceSelectingEventArgs.cs
- HttpCapabilitiesSectionHandler.cs
- Transform3D.cs
- GatewayDefinition.cs
- PreProcessInputEventArgs.cs
- XmlAnyAttributeAttribute.cs
- NavigationProperty.cs
- TableDetailsCollection.cs
- SelectionUIHandler.cs
- WebExceptionStatus.cs
- MobileFormsAuthentication.cs
- GridEntryCollection.cs
- WebEventCodes.cs
- SolidColorBrush.cs
- IOThreadTimer.cs
- LocatorBase.cs
- ReflectionUtil.cs
- DetailsViewDeleteEventArgs.cs
- ToolStripSplitButton.cs
- MarkedHighlightComponent.cs
- XmlRawWriter.cs
- KnownColorTable.cs
- WriteableBitmap.cs
- WebBrowserContainer.cs
- ProviderCollection.cs
- TransformerInfoCollection.cs
- WebSysDisplayNameAttribute.cs
- PropertyPushdownHelper.cs
- SecureConversationSecurityTokenParameters.cs
- HtmlTableCell.cs
- XmlSchemaAttribute.cs
- _FtpDataStream.cs
- RecordConverter.cs
- XmlCharCheckingWriter.cs
- BitmapEffectState.cs
- GifBitmapDecoder.cs
- ExpressionBinding.cs
- StatusStrip.cs
- TextPointerBase.cs
- DataSetMappper.cs
- SchemaElement.cs
- TimeSpanMinutesConverter.cs
- MaterializeFromAtom.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- DbDataAdapter.cs
- RolePrincipal.cs