Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // // 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
- TagMapCollection.cs
- InputScopeNameConverter.cs
- serverconfig.cs
- BitFlagsGenerator.cs
- SystemMulticastIPAddressInformation.cs
- FieldNameLookup.cs
- InProcStateClientManager.cs
- XmlNodeComparer.cs
- DesignBindingConverter.cs
- CommentEmitter.cs
- DataSourceIDConverter.cs
- HttpResponseHeader.cs
- DataServiceQuery.cs
- QilSortKey.cs
- SoapException.cs
- CodeLabeledStatement.cs
- PageMediaType.cs
- Track.cs
- TabRenderer.cs
- Message.cs
- cookiecontainer.cs
- InteropBitmapSource.cs
- MembershipSection.cs
- UnSafeCharBuffer.cs
- PropertyEmitterBase.cs
- CopyNodeSetAction.cs
- DispatcherSynchronizationContext.cs
- ValidationPropertyAttribute.cs
- XmlBindingWorker.cs
- SafeThemeHandle.cs
- JoinTreeSlot.cs
- NativeCompoundFileAPIs.cs
- PrintController.cs
- DefaultPrintController.cs
- ProcessThreadCollection.cs
- AssemblyInfo.cs
- SystemGatewayIPAddressInformation.cs
- BooleanFunctions.cs
- ToolboxControl.cs
- DbBuffer.cs
- ResourceDescriptionAttribute.cs
- SqlGenericUtil.cs
- SchemaElementLookUpTable.cs
- RightsManagementEncryptionTransform.cs
- TableRowCollection.cs
- MessageUtil.cs
- ExtensionWindowHeader.cs
- processwaithandle.cs
- HtmlInputCheckBox.cs
- StaticExtensionConverter.cs
- ThreadExceptionEvent.cs
- EventLogStatus.cs
- ServiceContractAttribute.cs
- SchemaElementLookUpTableEnumerator.cs
- RevocationPoint.cs
- WebBrowserNavigatedEventHandler.cs
- linebase.cs
- DbSetClause.cs
- COM2PropertyDescriptor.cs
- ToolStripSeparator.cs
- ToolStripHighContrastRenderer.cs
- Vector3DAnimation.cs
- HttpValueCollection.cs
- SmiEventSink.cs
- LedgerEntryCollection.cs
- DBParameter.cs
- LogExtentCollection.cs
- UserControlBuildProvider.cs
- TransactionFlowElement.cs
- LayoutInformation.cs
- InvalidWMPVersionException.cs
- PnrpPermission.cs
- ResourceSetExpression.cs
- ConfigXmlText.cs
- MultilineStringConverter.cs
- SrgsDocument.cs
- ColorConvertedBitmapExtension.cs
- LocalFileSettingsProvider.cs
- LoginUtil.cs
- UnsafeNativeMethods.cs
- CodeCommentStatement.cs
- OpenTypeCommon.cs
- SpAudioStreamWrapper.cs
- RegexGroupCollection.cs
- MaskedTextBox.cs
- PrintDialog.cs
- ComponentEditorForm.cs
- StringBuilder.cs
- RadialGradientBrush.cs
- MULTI_QI.cs
- MarkupObject.cs
- Permission.cs
- FilterQuery.cs
- QueryAccessibilityHelpEvent.cs
- EntityViewGenerator.cs
- IncrementalReadDecoders.cs
- NegationPusher.cs
- DataServiceRequestArgs.cs
- Atom10FormatterFactory.cs
- RegexCompilationInfo.cs