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
- VisualBasicImportReference.cs
- IERequestCache.cs
- InheritanceAttribute.cs
- ActivitySurrogate.cs
- LoginStatusDesigner.cs
- MembershipPasswordException.cs
- Formatter.cs
- Selection.cs
- ValidationSummary.cs
- ErrorEventArgs.cs
- ProfilePropertySettingsCollection.cs
- login.cs
- ServiceSecurityAuditElement.cs
- BidOverLoads.cs
- OuterGlowBitmapEffect.cs
- IsolatedStorageFileStream.cs
- ClientUIRequest.cs
- SafeWaitHandle.cs
- MessageBox.cs
- IPPacketInformation.cs
- SimpleHandlerBuildProvider.cs
- DataStreams.cs
- NavigateEvent.cs
- ComboBoxRenderer.cs
- RTTrackingProfile.cs
- Transform3D.cs
- EditorPart.cs
- OdbcError.cs
- CursorEditor.cs
- CultureSpecificStringDictionary.cs
- ViewStateModeByIdAttribute.cs
- NullToBooleanConverter.cs
- EntityViewGenerationAttribute.cs
- VectorCollection.cs
- Vector3DIndependentAnimationStorage.cs
- SqlClientMetaDataCollectionNames.cs
- AssemblyBuilderData.cs
- SystemMulticastIPAddressInformation.cs
- BitArray.cs
- WCFServiceClientProxyGenerator.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- RectangleHotSpot.cs
- ContainerParagraph.cs
- ItemAutomationPeer.cs
- ColorConvertedBitmapExtension.cs
- TemplateBamlTreeBuilder.cs
- FlowDecisionLabelFeature.cs
- WindowsScroll.cs
- AxisAngleRotation3D.cs
- DataServiceConfiguration.cs
- EndpointInfo.cs
- TaskHelper.cs
- ListCollectionView.cs
- XamlSerializer.cs
- basecomparevalidator.cs
- DataGridViewRowHeaderCell.cs
- AttributeAction.cs
- CorrelationResolver.cs
- WebPartDisplayModeCollection.cs
- HashCodeCombiner.cs
- DeviceFilterDictionary.cs
- CopyNamespacesAction.cs
- DataErrorValidationRule.cs
- DbBuffer.cs
- PathSegment.cs
- BufferModeSettings.cs
- FixedPageProcessor.cs
- TableParagraph.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- ISCIIEncoding.cs
- DataPager.cs
- UdpUtility.cs
- MouseOverProperty.cs
- XmlSiteMapProvider.cs
- LinqDataSource.cs
- GridViewRowEventArgs.cs
- XmlFormatExtensionAttribute.cs
- FlowStep.cs
- CombinedGeometry.cs
- MessageBox.cs
- HtmlInputCheckBox.cs
- BindableAttribute.cs
- TextEmbeddedObject.cs
- ToolStripSystemRenderer.cs
- PackagePart.cs
- CapacityStreamGeometryContext.cs
- StreamWriter.cs
- EventLogInformation.cs
- DbProviderFactory.cs
- AdornerPresentationContext.cs
- RegexCharClass.cs
- HostedNamedPipeTransportManager.cs
- _ShellExpression.cs
- ModifiableIteratorCollection.cs
- FakeModelItemImpl.cs
- MatrixCamera.cs
- GlobalItem.cs
- TextFormatterHost.cs
- XmlSerializerAssemblyAttribute.cs
- ComponentCollection.cs