Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- BackStopAuthenticationModule.cs
- DigestComparer.cs
- HyperlinkAutomationPeer.cs
- ImpersonateTokenRef.cs
- WindowsAuthenticationEventArgs.cs
- TextDecorationUnitValidation.cs
- PropertyDescriptorGridEntry.cs
- NamedObject.cs
- GlobalProxySelection.cs
- XmlSortKeyAccumulator.cs
- TypeBinaryExpression.cs
- DebugTracing.cs
- URL.cs
- StyleTypedPropertyAttribute.cs
- _UriSyntax.cs
- Console.cs
- WinEventTracker.cs
- X509SubjectKeyIdentifierClause.cs
- UmAlQuraCalendar.cs
- ImageButton.cs
- SqlMethods.cs
- ScriptDescriptor.cs
- HelloOperation11AsyncResult.cs
- ResourceContainer.cs
- ActiveXHelper.cs
- IntSecurity.cs
- OutOfProcStateClientManager.cs
- GraphicsContainer.cs
- TableColumn.cs
- DocComment.cs
- Publisher.cs
- AsyncStreamReader.cs
- Gdiplus.cs
- WebPartPersonalization.cs
- PasswordRecovery.cs
- ValidatedControlConverter.cs
- SettingsBindableAttribute.cs
- EmptyStringExpandableObjectConverter.cs
- SafePEFileHandle.cs
- ResolveNameEventArgs.cs
- CompareInfo.cs
- TextEffectCollection.cs
- PropertyDescriptorGridEntry.cs
- AdRotator.cs
- TreeView.cs
- UDPClient.cs
- AttachedPropertiesService.cs
- DecimalAnimationBase.cs
- ellipse.cs
- ScriptModule.cs
- DataGridViewCellCollection.cs
- _SafeNetHandles.cs
- Graphics.cs
- MsmqAuthenticationMode.cs
- PeerTransportSecurityElement.cs
- XmlElementAttributes.cs
- NetTcpBindingElement.cs
- MarkupExtensionParser.cs
- ZipIOExtraField.cs
- DragEventArgs.cs
- FunctionParameter.cs
- MultiPageTextView.cs
- SystemMulticastIPAddressInformation.cs
- StoryFragments.cs
- StickyNoteContentControl.cs
- TextFormatterContext.cs
- OledbConnectionStringbuilder.cs
- UTF32Encoding.cs
- TileBrush.cs
- SafeNativeMethods.cs
- XmlWrappingReader.cs
- ObjectHandle.cs
- AddInPipelineAttributes.cs
- CodeSubDirectoriesCollection.cs
- NetworkStream.cs
- XPathNavigatorReader.cs
- xmlsaver.cs
- ColumnWidthChangingEvent.cs
- RootAction.cs
- Icon.cs
- ZipIOFileItemStream.cs
- DataRowComparer.cs
- ConnectionInterfaceCollection.cs
- LoadedOrUnloadedOperation.cs
- SchemaType.cs
- InputLanguageManager.cs
- ThreadExceptionEvent.cs
- HttpResponseHeader.cs
- XmlSchemaImporter.cs
- ThrowHelper.cs
- XmlSchemaAttributeGroup.cs
- ReflectionPermission.cs
- SplitContainer.cs
- SafeNativeMethods.cs
- XmlEncoding.cs
- SendOperation.cs
- CompositeControl.cs
- BrowserCapabilitiesCompiler.cs
- ConfigurationValues.cs
- OutputCacheProfile.cs