Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / ManipulationCompletedEventArgs.cs / 1305600 / ManipulationCompletedEventArgs.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics; using System.Security; using System.Windows; using System.Windows.Media; namespace System.Windows.Input { ////// Provides information about the end of a manipulation. /// public sealed class ManipulationCompletedEventArgs : InputEventArgs { ////// Instantiates a new instance of this class. /// internal ManipulationCompletedEventArgs( ManipulationDevice manipulationDevice, int timestamp, IInputElement manipulationContainer, Point origin, ManipulationDelta total, ManipulationVelocities velocities, bool isInertial) : base(manipulationDevice, timestamp) { if (total == null) { throw new ArgumentNullException("total"); } if (velocities == null) { throw new ArgumentNullException("velocities"); } RoutedEvent = Manipulation.ManipulationCompletedEvent; ManipulationContainer = manipulationContainer; ManipulationOrigin = origin; TotalManipulation = total; FinalVelocities = velocities; IsInertial = isInertial; } ////// Invokes a handler of this event. /// protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { if (genericHandler == null) { throw new ArgumentNullException("genericHandler"); } if (genericTarget == null) { throw new ArgumentNullException("genericTarget"); } if (RoutedEvent == Manipulation.ManipulationCompletedEvent) { ((EventHandler)genericHandler)(genericTarget, this); } else { base.InvokeEventHandler(genericHandler, genericTarget); } } /// /// Whether the event was generated due to inertia. /// public bool IsInertial { get; private set; } ////// Defines the coordinate space of the other properties. /// public IInputElement ManipulationContainer { get; private set; } ////// Returns the value of the origin. /// public Point ManipulationOrigin { get; private set; } ////// Returns the cumulative transformation associated with the manipulation. /// public ManipulationDelta TotalManipulation { get; private set; } ////// Returns the current velocities associated with a manipulation. /// public ManipulationVelocities FinalVelocities { get; private set; } ////// Method to cancel the Manipulation /// ///A bool indicating the success of Cancel public bool Cancel() { if (!IsInertial) { RequestedCancel = true; return true; } return false; } ////// A handler Requested to cancel the Manipulation /// internal bool RequestedCancel { get; private set; } ////// The Manipulators for this manipulation. /// public IEnumerableManipulators { get { if (_manipulators == null) { _manipulators = ((ManipulationDevice)Device).GetManipulatorsReadOnly(); } return _manipulators; } } private IEnumerable _manipulators; } } // 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
- ServiceChannelProxy.cs
- EnumerableWrapperWeakToStrong.cs
- WebEventCodes.cs
- BitmapEffectGroup.cs
- DataObjectFieldAttribute.cs
- PageCatalogPart.cs
- IgnoreFileBuildProvider.cs
- ServicePointManagerElement.cs
- DataServiceConfiguration.cs
- AssociationType.cs
- FacetChecker.cs
- ProfileSettingsCollection.cs
- XmlWriterTraceListener.cs
- PlatformCulture.cs
- SQLDouble.cs
- ColumnResizeAdorner.cs
- DecoderNLS.cs
- LightweightEntityWrapper.cs
- PeerTransportListenAddressConverter.cs
- ThreadAbortException.cs
- TextParentUndoUnit.cs
- ImageIndexConverter.cs
- XmlAtomicValue.cs
- SpecularMaterial.cs
- Context.cs
- XmlElement.cs
- MbpInfo.cs
- ConnectionManagementSection.cs
- ResourceSet.cs
- SynchronizationLockException.cs
- _CommandStream.cs
- DataSourceView.cs
- HtmlInputImage.cs
- CacheSection.cs
- Partitioner.cs
- SendMailErrorEventArgs.cs
- WebPartConnectVerb.cs
- OleDbEnumerator.cs
- ProjectionPlan.cs
- SimpleBitVector32.cs
- safePerfProviderHandle.cs
- OciLobLocator.cs
- OleDbWrapper.cs
- MenuItemBindingCollection.cs
- FontWeights.cs
- NavigationHelper.cs
- CharAnimationUsingKeyFrames.cs
- PropertyRecord.cs
- Interlocked.cs
- Attributes.cs
- DocumentPageTextView.cs
- HttpCookiesSection.cs
- GetWinFXPath.cs
- ApplicationException.cs
- AssociationTypeEmitter.cs
- SynchronousSendBindingElement.cs
- xmlformatgeneratorstatics.cs
- GACMembershipCondition.cs
- OrthographicCamera.cs
- Codec.cs
- HttpVersion.cs
- SHA1CryptoServiceProvider.cs
- RepeatBehavior.cs
- StrongTypingException.cs
- TableSectionStyle.cs
- ProcessInfo.cs
- SmtpTransport.cs
- XamlTypeMapper.cs
- HandlerFactoryCache.cs
- GroupedContextMenuStrip.cs
- LastQueryOperator.cs
- RoutedCommand.cs
- RangeValidator.cs
- ServiceEndpointElement.cs
- WhitespaceRuleReader.cs
- _AutoWebProxyScriptWrapper.cs
- VBIdentifierTrimConverter.cs
- DesignerTextBoxAdapter.cs
- XLinq.cs
- WorkflowApplicationEventArgs.cs
- XmlSignificantWhitespace.cs
- TextBoxView.cs
- CharacterShapingProperties.cs
- BindingSource.cs
- SessionStateItemCollection.cs
- TargetParameterCountException.cs
- ColorAnimationBase.cs
- MetricEntry.cs
- InvokeWebServiceDesigner.cs
- PageCatalogPart.cs
- ThreadInterruptedException.cs
- PerfCounters.cs
- ping.cs
- MasterPage.cs
- DesignerCategoryAttribute.cs
- UpdatePanelTrigger.cs
- BaseUriHelper.cs
- ContainerUIElement3D.cs
- IPAddressCollection.cs
- TextRunTypographyProperties.cs