Code:
/ 4.0 / 4.0 / 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. 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
- ReliableSessionBindingElementImporter.cs
- TableAdapterManagerHelper.cs
- RijndaelManagedTransform.cs
- TextAutomationPeer.cs
- XmlnsPrefixAttribute.cs
- ActiveXMessageFormatter.cs
- AdornerHitTestResult.cs
- BlurBitmapEffect.cs
- EntityDataSourceEntityTypeFilterItem.cs
- DbDataSourceEnumerator.cs
- DataBindingCollection.cs
- CodeExporter.cs
- PersonalizationProvider.cs
- EventMappingSettings.cs
- PermissionRequestEvidence.cs
- RadioButton.cs
- Int32AnimationUsingKeyFrames.cs
- Decoder.cs
- LogicalExpressionTypeConverter.cs
- XPathNodeInfoAtom.cs
- HttpRawResponse.cs
- ReadOnlyCollection.cs
- SymmetricKeyWrap.cs
- TextDecorationUnitValidation.cs
- XmlAttributeCollection.cs
- ExpandoObject.cs
- httpapplicationstate.cs
- ArrayTypeMismatchException.cs
- FixedSOMSemanticBox.cs
- ChildrenQuery.cs
- TransformProviderWrapper.cs
- ResXResourceWriter.cs
- XPathNavigatorException.cs
- IMembershipProvider.cs
- CriticalHandle.cs
- SpanIndex.cs
- QuaternionAnimation.cs
- DockProviderWrapper.cs
- TreeViewItem.cs
- DLinqAssociationProvider.cs
- EncoderNLS.cs
- WebPartTransformerAttribute.cs
- DrawTreeNodeEventArgs.cs
- MappingItemCollection.cs
- HyperLink.cs
- PropertyGridEditorPart.cs
- DateTimeParse.cs
- SimpleTextLine.cs
- EllipticalNodeOperations.cs
- UserControlBuildProvider.cs
- ConstructorBuilder.cs
- EncoderBestFitFallback.cs
- DataSourceViewSchemaConverter.cs
- RegexBoyerMoore.cs
- WorkflowViewStateService.cs
- QueryOperator.cs
- SQLSingleStorage.cs
- ModulesEntry.cs
- PinnedBufferMemoryStream.cs
- ParamArrayAttribute.cs
- Invariant.cs
- StaticResourceExtension.cs
- XmlChildNodes.cs
- _LocalDataStoreMgr.cs
- RankException.cs
- TcpTransportSecurity.cs
- SmiRequestExecutor.cs
- SslStream.cs
- DbConnectionInternal.cs
- HierarchicalDataSourceIDConverter.cs
- IdnElement.cs
- ItemCheckedEvent.cs
- ArglessEventHandlerProxy.cs
- GroupAggregateExpr.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- DataTransferEventArgs.cs
- NameTable.cs
- StatusBar.cs
- TypeListConverter.cs
- PackUriHelper.cs
- WebHttpSecurityModeHelper.cs
- Identity.cs
- ObjectDataSourceDisposingEventArgs.cs
- DataGridViewComboBoxEditingControl.cs
- ScriptRef.cs
- DBDataPermissionAttribute.cs
- CompressionTransform.cs
- TextFormatter.cs
- XPathNodePointer.cs
- WebPartTransformerCollection.cs
- TextTreeRootTextBlock.cs
- CodeIdentifier.cs
- TextUtf8RawTextWriter.cs
- QilLoop.cs
- DBPropSet.cs
- PathFigure.cs
- PropertyIdentifier.cs
- RuleEngine.cs
- PageParserFilter.cs
- _HTTPDateParse.cs