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
- ReaderContextStackData.cs
- AppSettingsReader.cs
- FormViewInsertedEventArgs.cs
- SelectQueryOperator.cs
- XmlDataLoader.cs
- DataServiceClientException.cs
- ScriptDescriptor.cs
- SourceFilter.cs
- CacheDict.cs
- DataKeyArray.cs
- FormViewDeleteEventArgs.cs
- arc.cs
- HttpSessionStateWrapper.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- SqlNodeAnnotations.cs
- StringConverter.cs
- HijriCalendar.cs
- WindowsRegion.cs
- QueryCacheManager.cs
- DateBoldEvent.cs
- TranslateTransform3D.cs
- PropertyIdentifier.cs
- AdornerPresentationContext.cs
- XmlSubtreeReader.cs
- UpDownEvent.cs
- XmlEncodedRawTextWriter.cs
- MexTcpBindingCollectionElement.cs
- AppDomainManager.cs
- WasAdminWrapper.cs
- LinqDataSourceContextEventArgs.cs
- PreservationFileReader.cs
- TagPrefixAttribute.cs
- TabControlCancelEvent.cs
- SelectionBorderGlyph.cs
- SafeFileMappingHandle.cs
- BaseContextMenu.cs
- Pair.cs
- XPathConvert.cs
- SettingsPropertyNotFoundException.cs
- Configuration.cs
- ImageCodecInfo.cs
- SqlNotificationRequest.cs
- XmlWhitespace.cs
- SystemThemeKey.cs
- CorruptingExceptionCommon.cs
- TreeBuilderXamlTranslator.cs
- DbProviderManifest.cs
- NativeMethods.cs
- Error.cs
- StructuredProperty.cs
- X509Utils.cs
- TogglePatternIdentifiers.cs
- LoginUtil.cs
- Link.cs
- QueryActivatableWorkflowsCommand.cs
- AutomationElementIdentifiers.cs
- DiagnosticEventProvider.cs
- SharedRuntimeState.cs
- SafeProcessHandle.cs
- MachineKeySection.cs
- QueryLifecycle.cs
- SecurityPermission.cs
- PointHitTestResult.cs
- HMACSHA512.cs
- ExeConfigurationFileMap.cs
- StylusLogic.cs
- FontWeight.cs
- NumericUpDown.cs
- ClusterUtils.cs
- StsCommunicationException.cs
- CalendarTable.cs
- DATA_BLOB.cs
- DataGrid.cs
- IndexedString.cs
- ExtendedPropertyCollection.cs
- Latin1Encoding.cs
- Matrix3D.cs
- LinkedResourceCollection.cs
- HybridDictionary.cs
- UpDownBase.cs
- CapabilitiesPattern.cs
- CultureNotFoundException.cs
- WebServiceTypeData.cs
- COM2EnumConverter.cs
- MaskedTextBoxDesigner.cs
- ResourceKey.cs
- AstNode.cs
- HtmlTableRow.cs
- XmlByteStreamReader.cs
- ResXFileRef.cs
- SynchronizingStream.cs
- QuaternionAnimation.cs
- ObjectItemCachedAssemblyLoader.cs
- NumberAction.cs
- Drawing.cs
- PopupRootAutomationPeer.cs
- cookieexception.cs
- XmlStringTable.cs
- RandomNumberGenerator.cs
- ApplicationServiceHelper.cs