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
- TagMapCollection.cs
- ObjectQueryExecutionPlan.cs
- MenuEventArgs.cs
- XsdCachingReader.cs
- CounterCreationData.cs
- FormatterServices.cs
- DataGridViewToolTip.cs
- storepermissionattribute.cs
- WebPartConnectionsConnectVerb.cs
- WebBrowserHelper.cs
- AtomicFile.cs
- ChannelManager.cs
- ContentFilePart.cs
- HttpProfileBase.cs
- validationstate.cs
- FloatSumAggregationOperator.cs
- CodeGenerator.cs
- NullableLongSumAggregationOperator.cs
- MLangCodePageEncoding.cs
- DateTimeFormatInfo.cs
- PackageStore.cs
- DbXmlEnabledProviderManifest.cs
- ControlDesigner.cs
- UIElementAutomationPeer.cs
- SessionIDManager.cs
- ExecutionContext.cs
- _StreamFramer.cs
- DataServiceQuery.cs
- GridViewRowPresenterBase.cs
- BindingEntityInfo.cs
- VectorCollectionValueSerializer.cs
- InfoCardAsymmetricCrypto.cs
- AnchorEditor.cs
- TypedReference.cs
- JavaScriptString.cs
- LocatorGroup.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- HttpCapabilitiesEvaluator.cs
- ImageSource.cs
- TrackingMemoryStream.cs
- StringCollection.cs
- WebServiceMethodData.cs
- IpcChannelHelper.cs
- CodeDirectionExpression.cs
- GeometryCombineModeValidation.cs
- DocComment.cs
- ArrangedElement.cs
- Visual3D.cs
- MatrixStack.cs
- SocketConnection.cs
- AstTree.cs
- AstNode.cs
- PointCollectionConverter.cs
- SpoolingTask.cs
- Crypto.cs
- ConsoleTraceListener.cs
- ObjRef.cs
- ValueExpressions.cs
- DataExpression.cs
- SiteOfOriginPart.cs
- WebPartZoneCollection.cs
- TableCellCollection.cs
- InputLangChangeEvent.cs
- WebConfigurationManager.cs
- DataRowCollection.cs
- CardSpaceException.cs
- CatalogPart.cs
- DesignerProperties.cs
- GroupBox.cs
- Label.cs
- AuthorizationRule.cs
- DataSourceHelper.cs
- TimelineClockCollection.cs
- PersonalizationState.cs
- FileEnumerator.cs
- ResolveInfo.cs
- SafeFileMappingHandle.cs
- DiscoveryOperationContextExtension.cs
- ServiceX509SecurityTokenProvider.cs
- DataGridViewDataErrorEventArgs.cs
- CodeStatementCollection.cs
- UrlPath.cs
- DataRecordInternal.cs
- QuaternionAnimation.cs
- TableLayoutPanelResizeGlyph.cs
- SQLInt16Storage.cs
- MetabaseServerConfig.cs
- ClientConfigurationHost.cs
- DataRecordObjectView.cs
- FixedSOMTextRun.cs
- RectangleHotSpot.cs
- DefaultProxySection.cs
- SizeAnimationBase.cs
- BasicHttpSecurity.cs
- MiniAssembly.cs
- AssemblyName.cs
- TransactionChannelListener.cs
- FunctionImportMapping.cs
- PropertyMapper.cs
- ProviderUtil.cs