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
- CuspData.cs
- ComplexType.cs
- AddInContractAttribute.cs
- Vector3DAnimation.cs
- InputScopeManager.cs
- DBAsyncResult.cs
- DateTime.cs
- DataGridPageChangedEventArgs.cs
- UnsafeNativeMethodsMilCoreApi.cs
- SubstitutionList.cs
- ThreadAbortException.cs
- ImplicitInputBrush.cs
- TabPage.cs
- BamlCollectionHolder.cs
- PerformanceCounter.cs
- FamilyMap.cs
- DocumentGridContextMenu.cs
- DateTimeSerializationSection.cs
- XmlDictionaryReaderQuotas.cs
- RunClient.cs
- TextBox.cs
- TextTreeTextNode.cs
- VBIdentifierDesigner.xaml.cs
- NavigationHelper.cs
- DbConnectionOptions.cs
- WaitHandleCannotBeOpenedException.cs
- COM2ExtendedTypeConverter.cs
- AtomicFile.cs
- SetState.cs
- ExpressionEditorAttribute.cs
- FontCollection.cs
- ImageButton.cs
- AlternateViewCollection.cs
- control.ime.cs
- DataStreamFromComStream.cs
- VectorCollectionConverter.cs
- Permission.cs
- DateTimeStorage.cs
- CallSite.cs
- _NativeSSPI.cs
- DesignerVerbCollection.cs
- Rect.cs
- DataGridColumn.cs
- InternalBase.cs
- LogLogRecordHeader.cs
- TrackingMemoryStream.cs
- PermissionSetTriple.cs
- documentation.cs
- DefaultShape.cs
- Internal.cs
- HtmlEncodedRawTextWriter.cs
- PeerApplicationLaunchInfo.cs
- BaseParser.cs
- AnyReturnReader.cs
- ConnectionInterfaceCollection.cs
- MaskedTextBoxDesigner.cs
- Pair.cs
- GridViewCommandEventArgs.cs
- MultiTrigger.cs
- InheritanceRules.cs
- OutputCacheSettingsSection.cs
- Control.cs
- CategoryNameCollection.cs
- PropertyEmitterBase.cs
- OleDbRowUpdatedEvent.cs
- SortQuery.cs
- Accessible.cs
- UnmanagedMemoryStreamWrapper.cs
- ThreadStartException.cs
- InheritanceContextChangedEventManager.cs
- GeometryConverter.cs
- DataServiceQueryProvider.cs
- RouteItem.cs
- FeatureSupport.cs
- CollectionEditorDialog.cs
- MethodToken.cs
- DataColumnCollection.cs
- CaseInsensitiveOrdinalStringComparer.cs
- WindowsScroll.cs
- DirectoryObjectSecurity.cs
- ReadWriteObjectLock.cs
- CalendarDay.cs
- SerializationInfoEnumerator.cs
- MasterPageParser.cs
- nulltextnavigator.cs
- CompiledELinqQueryState.cs
- KeyValuePair.cs
- DetailsViewActionList.cs
- ConversionContext.cs
- MetadataSource.cs
- BitmapEffectDrawingContextState.cs
- CodePrimitiveExpression.cs
- ContractBase.cs
- PropertiesTab.cs
- HandlerWithFactory.cs
- WebPartConnectionCollection.cs
- ISCIIEncoding.cs
- TableCellCollection.cs
- EndPoint.cs
- RelatedPropertyManager.cs