Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / MS / Internal / Automation / SynchronizedInputAdaptor.cs / 1305600 / SynchronizedInputAdaptor.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Synchronized Input pattern adaptor // History: // 07/28/2009 : [....] - created // //--------------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Automation; using System.Windows.Automation.Provider; using MS.Internal; using SR = MS.Internal.PresentationCore.SR; using SRID = MS.Internal.PresentationCore.SRID; namespace MS.Internal.Automation { ////// Represents a synchronized input provider that supports the synchronized input pattern across /// UIElements, ContentElements and UIElement3D. /// internal class SynchronizedInputAdaptor : ISynchronizedInputProvider { ////// Constructor /// /// UIElement or ContentElement or UIElement3D this adaptor is associated with. internal SynchronizedInputAdaptor(DependencyObject owner) { Invariant.Assert(owner != null); _owner = owner; } ////// This method is called by automation framework to trigger synchronized input processing. /// /// Synchronized input type void ISynchronizedInputProvider.StartListening(SynchronizedInputType inputType) { UIElement e = _owner as UIElement; if (e != null) { if (!e.StartListeningSynchronizedInput(inputType)) { throw new InvalidOperationException(SR.Get(SRID.Automation_RecursivePublicCall)); } } else { ContentElement ce = _owner as ContentElement; if (ce != null) { if (!ce.StartListeningSynchronizedInput(inputType)) { throw new InvalidOperationException(SR.Get(SRID.Automation_RecursivePublicCall)); } } else { UIElement3D e3D = (UIElement3D)_owner; if (!e3D.StartListeningSynchronizedInput(inputType)) { throw new InvalidOperationException(SR.Get(SRID.Automation_RecursivePublicCall)); } } } } /////// Cancel synchronized input processing. /// void ISynchronizedInputProvider.Cancel() { UIElement e = _owner as UIElement; if (e != null) { e.CancelSynchronizedInput(); } else { ContentElement ce = _owner as ContentElement; if (ce != null) { ce.CancelSynchronizedInput(); } else { UIElement3D e3D = (UIElement3D)_owner; e3D.CancelSynchronizedInput(); } } } private readonly DependencyObject _owner; } } // 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
- LocalizableAttribute.cs
- DeferredSelectedIndexReference.cs
- KnownTypeHelper.cs
- DataListItemEventArgs.cs
- OleDbConnectionFactory.cs
- DataSourceSelectArguments.cs
- GlyphTypeface.cs
- WindowsToolbarAsMenu.cs
- Axis.cs
- ModuleConfigurationInfo.cs
- ConfigurationLockCollection.cs
- VScrollProperties.cs
- PropertyGridDesigner.cs
- _FixedSizeReader.cs
- DynamicRendererThreadManager.cs
- SuppressMessageAttribute.cs
- XmlIlGenerator.cs
- WsdlBuildProvider.cs
- ThreadStartException.cs
- DataGridHeaderBorder.cs
- ToolTipAutomationPeer.cs
- SynchronizedKeyedCollection.cs
- UdpDiscoveryEndpointProvider.cs
- HTMLTextWriter.cs
- XmlDataSourceNodeDescriptor.cs
- ImagingCache.cs
- RawMouseInputReport.cs
- FileDetails.cs
- CompositionCommandSet.cs
- Delegate.cs
- MutexSecurity.cs
- Attachment.cs
- ExternalCalls.cs
- DbMetaDataFactory.cs
- DefaultEvaluationContext.cs
- GuidTagList.cs
- WebServiceClientProxyGenerator.cs
- FixedTextSelectionProcessor.cs
- ImageMapEventArgs.cs
- StaticDataManager.cs
- InplaceBitmapMetadataWriter.cs
- ReferencedCollectionType.cs
- AttributeSetAction.cs
- MissingFieldException.cs
- TreeViewImageIndexConverter.cs
- DataGridViewUtilities.cs
- GenericPrincipal.cs
- MediaContext.cs
- SafeCryptContextHandle.cs
- HtmlElementEventArgs.cs
- BitmapEffectGroup.cs
- RegexGroupCollection.cs
- KeyInstance.cs
- DocumentXmlWriter.cs
- XsdDateTime.cs
- FlowPosition.cs
- WinEventWrap.cs
- RuleSetCollection.cs
- RepeatButton.cs
- HotCommands.cs
- Native.cs
- CssClassPropertyAttribute.cs
- MSHTMLHost.cs
- ErrorStyle.cs
- Literal.cs
- WindowsAuthenticationModule.cs
- PaperSource.cs
- PageHandlerFactory.cs
- ExtenderControl.cs
- X509SubjectKeyIdentifierClause.cs
- RenderDataDrawingContext.cs
- BuildResultCache.cs
- CapacityStreamGeometryContext.cs
- FormViewInsertedEventArgs.cs
- ConfigXmlAttribute.cs
- EventSinkActivity.cs
- Select.cs
- UserControlAutomationPeer.cs
- SystemUnicastIPAddressInformation.cs
- AsymmetricSecurityProtocolFactory.cs
- CompilerTypeWithParams.cs
- CodeExporter.cs
- GPRECT.cs
- PersistenceTypeAttribute.cs
- EmptyEnumerable.cs
- SQLRoleProvider.cs
- RegisteredExpandoAttribute.cs
- ContentPathSegment.cs
- WebBrowser.cs
- TextDecorationCollection.cs
- EncryptedKey.cs
- RawStylusInputCustomData.cs
- InputManager.cs
- XmlReader.cs
- ExtractCollection.cs
- ProcessModelSection.cs
- GeometryDrawing.cs
- SizeFConverter.cs
- ParameterElementCollection.cs
- TemplateControlCodeDomTreeGenerator.cs