Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // //// 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
- TrackingMemoryStream.cs
- _LocalDataStoreMgr.cs
- ipaddressinformationcollection.cs
- ConsoleCancelEventArgs.cs
- ForceCopyBuildProvider.cs
- XNodeNavigator.cs
- MetadataPropertyAttribute.cs
- DesignerDeviceConfig.cs
- _ListenerResponseStream.cs
- RuleInfoComparer.cs
- ResponseStream.cs
- MasterPageCodeDomTreeGenerator.cs
- RequestResizeEvent.cs
- OleDragDropHandler.cs
- ChangeInterceptorAttribute.cs
- ObjectCloneHelper.cs
- InvalidEnumArgumentException.cs
- ThreadStaticAttribute.cs
- MutexSecurity.cs
- Switch.cs
- MsmqBindingFilter.cs
- _AcceptOverlappedAsyncResult.cs
- InputScopeManager.cs
- CqlWriter.cs
- ObjectViewFactory.cs
- StorageModelBuildProvider.cs
- pingexception.cs
- TdsParameterSetter.cs
- Formatter.cs
- SizeChangedEventArgs.cs
- HtmlInputButton.cs
- SimpleTypeResolver.cs
- SqlTriggerContext.cs
- ConstraintEnumerator.cs
- SystemIPv4InterfaceProperties.cs
- StringUtil.cs
- IMembershipProvider.cs
- DbConnectionOptions.cs
- SynchronizedDispatch.cs
- Codec.cs
- OdbcConnectionOpen.cs
- ActivityInstanceReference.cs
- IntranetCredentialPolicy.cs
- WebEventTraceProvider.cs
- DbMetaDataFactory.cs
- HttpSessionStateBase.cs
- CreateUserWizardStep.cs
- ZipIOBlockManager.cs
- GeneralTransform3D.cs
- SmuggledIUnknown.cs
- HttpCacheParams.cs
- SchemaSetCompiler.cs
- XmlSchemaDatatype.cs
- ConnectorSelectionGlyph.cs
- CalendarDay.cs
- ActivityExecutionContextCollection.cs
- TransactionProtocol.cs
- PTConverter.cs
- oledbconnectionstring.cs
- UIntPtr.cs
- NavigationEventArgs.cs
- TextDocumentView.cs
- InputLanguageEventArgs.cs
- MimeFormatExtensions.cs
- ProcessModule.cs
- KoreanLunisolarCalendar.cs
- SingleKeyFrameCollection.cs
- Splitter.cs
- ISAPIApplicationHost.cs
- Int32Converter.cs
- ProviderConnectionPoint.cs
- TabControlEvent.cs
- DataBindingExpressionBuilder.cs
- Logging.cs
- ItemsControlAutomationPeer.cs
- XmlSubtreeReader.cs
- UriTemplateCompoundPathSegment.cs
- EmbeddedMailObject.cs
- TableItemPatternIdentifiers.cs
- CompiledXpathExpr.cs
- DomainUpDown.cs
- DataProtection.cs
- WmpBitmapDecoder.cs
- VoiceObjectToken.cs
- FontFamilyIdentifier.cs
- ByeMessage11.cs
- ResourcesBuildProvider.cs
- GlyphsSerializer.cs
- AlternateView.cs
- EmissiveMaterial.cs
- WorkflowMessageEventHandler.cs
- sitestring.cs
- EmbeddedObject.cs
- ListControl.cs
- ImageListStreamer.cs
- DesignTimeXamlWriter.cs
- XamlPointCollectionSerializer.cs
- HttpHandlersSection.cs
- TextEditorTables.cs
- DigitShape.cs