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
- DataColumnMapping.cs
- XmlTextReaderImpl.cs
- TableFieldsEditor.cs
- StylusDownEventArgs.cs
- CurrentChangingEventManager.cs
- BehaviorService.cs
- DebuggerAttributes.cs
- UnsafeNativeMethodsMilCoreApi.cs
- SamlAttribute.cs
- AnimationStorage.cs
- Pair.cs
- ISFClipboardData.cs
- WpfKnownType.cs
- SpeechRecognizer.cs
- FrameworkContentElement.cs
- Duration.cs
- TcpConnectionPool.cs
- XPathBinder.cs
- KeySpline.cs
- XmlValueConverter.cs
- RealProxy.cs
- PropertyMapper.cs
- TreeViewImageKeyConverter.cs
- CodeSnippetStatement.cs
- PointConverter.cs
- ScriptResourceInfo.cs
- SizeConverter.cs
- SizeAnimationBase.cs
- BitmapInitialize.cs
- SimpleHandlerFactory.cs
- HandlerWithFactory.cs
- BasicSecurityProfileVersion.cs
- Repeater.cs
- WorkflowItemPresenter.cs
- Stroke2.cs
- TriggerAction.cs
- ImageDrawing.cs
- ProfileProvider.cs
- DataGridViewLayoutData.cs
- CollectionType.cs
- FormViewCommandEventArgs.cs
- PrintDialog.cs
- PreApplicationStartMethodAttribute.cs
- NotSupportedException.cs
- InvokeMethod.cs
- MappingItemCollection.cs
- shaperfactoryquerycacheentry.cs
- FloatAverageAggregationOperator.cs
- BitmapEncoder.cs
- DataServiceQueryProvider.cs
- KeySpline.cs
- UriParserTemplates.cs
- ClassGenerator.cs
- StylusShape.cs
- ConstraintManager.cs
- FunctionGenerator.cs
- odbcmetadatafactory.cs
- ActivityBuilderHelper.cs
- CodeThrowExceptionStatement.cs
- CSharpCodeProvider.cs
- BitmapMetadataBlob.cs
- ObjectToIdCache.cs
- UTF7Encoding.cs
- FtpRequestCacheValidator.cs
- Exception.cs
- GenericUriParser.cs
- DataTemplateSelector.cs
- PersonalizationDictionary.cs
- ArrayElementGridEntry.cs
- PrintingPermissionAttribute.cs
- PartialCachingAttribute.cs
- WindowsProgressbar.cs
- XdrBuilder.cs
- NavigationProgressEventArgs.cs
- UnsafeNativeMethodsMilCoreApi.cs
- COMException.cs
- AssemblyHash.cs
- GridViewItemAutomationPeer.cs
- MembershipUser.cs
- Encoder.cs
- CodeDirectionExpression.cs
- StylusTouchDevice.cs
- RadioButton.cs
- ToolboxItemAttribute.cs
- CompilationSection.cs
- DynamicRenderer.cs
- XmlSchemaSet.cs
- OrderedDictionary.cs
- Constraint.cs
- DetailsViewRow.cs
- AdvancedBindingPropertyDescriptor.cs
- SortQuery.cs
- AnalyzedTree.cs
- BuiltInExpr.cs
- WebControlsSection.cs
- DataGridViewColumnConverter.cs
- LassoSelectionBehavior.cs
- ToolStripSplitButton.cs
- HelloOperationAsyncResult.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs