Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / ManipulationDeltaEventArgs.cs / 1305600 / ManipulationDeltaEventArgs.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 an update on an ocurring manipulation.
///
public sealed class ManipulationDeltaEventArgs : InputEventArgs
{
///
/// Instantiates a new instance of this class.
///
internal ManipulationDeltaEventArgs(
ManipulationDevice manipulationDevice,
int timestamp,
IInputElement manipulationContainer,
Point origin,
ManipulationDelta delta,
ManipulationDelta cumulative,
ManipulationVelocities velocities,
bool isInertial)
: base(manipulationDevice, timestamp)
{
if (delta == null)
{
throw new ArgumentNullException("delta");
}
if (cumulative == null)
{
throw new ArgumentNullException("cumulative");
}
if (velocities == null)
{
throw new ArgumentNullException("velocities");
}
RoutedEvent = Manipulation.ManipulationDeltaEvent;
ManipulationContainer = manipulationContainer;
ManipulationOrigin = origin;
DeltaManipulation = delta;
CumulativeManipulation = cumulative;
Velocities = 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.ManipulationDeltaEvent)
{
((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 CumulativeManipulation
{
get;
private set;
}
///
/// Returns the delta transformation associated with the manipulation.
///
public ManipulationDelta DeltaManipulation
{
get;
private set;
}
///
/// Returns the current velocities associated with a manipulation.
///
public ManipulationVelocities Velocities
{
get;
private set;
}
///
/// Allows a handler to specify that the manipulation has gone beyond certain boundaries.
/// By default, this value will then be used to provide panning feedback on the window, but
/// it can be change by handling the ManipulationBoundaryFeedback event.
///
public void ReportBoundaryFeedback(ManipulationDelta unusedManipulation)
{
if (unusedManipulation == null)
{
throw new ArgumentNullException("unusedManipulation");
}
UnusedManipulation = unusedManipulation;
}
///
/// The value of the unused manipulation information in global coordinate space.
///
internal ManipulationDelta UnusedManipulation
{
get;
private set;
}
///
/// Preempts further processing and completes the manipulation without any inertia.
///
public void Complete()
{
RequestedComplete = true;
RequestedInertia = false;
RequestedCancel = false;
}
///
/// Preempts further processing and completes the manipulation, allowing inertia to continue.
///
public void StartInertia()
{
RequestedComplete = true;
RequestedInertia = true;
RequestedCancel = false;
}
///
/// Method to cancel the Manipulation
///
/// A bool indicating the success of Cancel
public bool Cancel()
{
if (!IsInertial)
{
RequestedCancel = true;
RequestedComplete = false;
RequestedInertia = false;
return true;
}
return false;
}
///
/// A handler requested that the manipulation complete.
///
internal bool RequestedComplete
{
get;
private set;
}
///
/// A handler requested that the manipulation complete with inertia.
///
internal bool RequestedInertia
{
get;
private set;
}
///
/// A handler Requested to cancel the Manipulation
///
internal bool RequestedCancel
{
get;
private set;
}
///
/// The Manipulators for this manipulation.
///
public IEnumerable Manipulators
{
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 an update on an ocurring manipulation.
///
public sealed class ManipulationDeltaEventArgs : InputEventArgs
{
///
/// Instantiates a new instance of this class.
///
internal ManipulationDeltaEventArgs(
ManipulationDevice manipulationDevice,
int timestamp,
IInputElement manipulationContainer,
Point origin,
ManipulationDelta delta,
ManipulationDelta cumulative,
ManipulationVelocities velocities,
bool isInertial)
: base(manipulationDevice, timestamp)
{
if (delta == null)
{
throw new ArgumentNullException("delta");
}
if (cumulative == null)
{
throw new ArgumentNullException("cumulative");
}
if (velocities == null)
{
throw new ArgumentNullException("velocities");
}
RoutedEvent = Manipulation.ManipulationDeltaEvent;
ManipulationContainer = manipulationContainer;
ManipulationOrigin = origin;
DeltaManipulation = delta;
CumulativeManipulation = cumulative;
Velocities = 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.ManipulationDeltaEvent)
{
((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 CumulativeManipulation
{
get;
private set;
}
///
/// Returns the delta transformation associated with the manipulation.
///
public ManipulationDelta DeltaManipulation
{
get;
private set;
}
///
/// Returns the current velocities associated with a manipulation.
///
public ManipulationVelocities Velocities
{
get;
private set;
}
///
/// Allows a handler to specify that the manipulation has gone beyond certain boundaries.
/// By default, this value will then be used to provide panning feedback on the window, but
/// it can be change by handling the ManipulationBoundaryFeedback event.
///
public void ReportBoundaryFeedback(ManipulationDelta unusedManipulation)
{
if (unusedManipulation == null)
{
throw new ArgumentNullException("unusedManipulation");
}
UnusedManipulation = unusedManipulation;
}
///
/// The value of the unused manipulation information in global coordinate space.
///
internal ManipulationDelta UnusedManipulation
{
get;
private set;
}
///
/// Preempts further processing and completes the manipulation without any inertia.
///
public void Complete()
{
RequestedComplete = true;
RequestedInertia = false;
RequestedCancel = false;
}
///
/// Preempts further processing and completes the manipulation, allowing inertia to continue.
///
public void StartInertia()
{
RequestedComplete = true;
RequestedInertia = true;
RequestedCancel = false;
}
///
/// Method to cancel the Manipulation
///
/// A bool indicating the success of Cancel
public bool Cancel()
{
if (!IsInertial)
{
RequestedCancel = true;
RequestedComplete = false;
RequestedInertia = false;
return true;
}
return false;
}
///
/// A handler requested that the manipulation complete.
///
internal bool RequestedComplete
{
get;
private set;
}
///
/// A handler requested that the manipulation complete with inertia.
///
internal bool RequestedInertia
{
get;
private set;
}
///
/// A handler Requested to cancel the Manipulation
///
internal bool RequestedCancel
{
get;
private set;
}
///
/// The Manipulators for this manipulation.
///
public IEnumerable Manipulators
{
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
- ThicknessConverter.cs
- DotExpr.cs
- ListBindableAttribute.cs
- BinHexEncoder.cs
- cache.cs
- SoapParser.cs
- FormViewPageEventArgs.cs
- MenuItem.cs
- DescendantOverDescendantQuery.cs
- MimeBasePart.cs
- ZipIOBlockManager.cs
- HealthMonitoringSection.cs
- GenericXmlSecurityToken.cs
- ModifierKeysConverter.cs
- XmlValidatingReaderImpl.cs
- FacetEnabledSchemaElement.cs
- InternalUserCancelledException.cs
- MetadataArtifactLoaderCompositeFile.cs
- streamingZipPartStream.cs
- SplineKeyFrames.cs
- PropertiesTab.cs
- UrlPath.cs
- ConfigXmlComment.cs
- DataGridParentRows.cs
- TableLayoutPanelCodeDomSerializer.cs
- WindowsAuthenticationModule.cs
- InkCanvasFeedbackAdorner.cs
- MultiBindingExpression.cs
- InvalidContentTypeException.cs
- MultiView.cs
- WebPartsPersonalizationAuthorization.cs
- ExtendedPropertyDescriptor.cs
- AppDomainAttributes.cs
- DetailsViewUpdateEventArgs.cs
- NumericUpDown.cs
- FloatUtil.cs
- CriticalExceptions.cs
- ReachPageContentSerializer.cs
- RowUpdatedEventArgs.cs
- DbInsertCommandTree.cs
- DPAPIProtectedConfigurationProvider.cs
- UInt32Converter.cs
- XmlSchemaDocumentation.cs
- TableItemPatternIdentifiers.cs
- SemaphoreFullException.cs
- SetStoryboardSpeedRatio.cs
- PassportAuthenticationEventArgs.cs
- ContactManager.cs
- SplineKeyFrames.cs
- MetadataItem.cs
- TreePrinter.cs
- SectionXmlInfo.cs
- InternalBufferOverflowException.cs
- TypeHelpers.cs
- AdPostCacheSubstitution.cs
- RelationshipEntry.cs
- PropVariant.cs
- SchemaImporterExtensionElement.cs
- WebBrowserPermission.cs
- Blend.cs
- Literal.cs
- FrameworkTemplate.cs
- XmlAttributeAttribute.cs
- PathFigureCollection.cs
- XmlSchemaDocumentation.cs
- Interlocked.cs
- ArrayList.cs
- DrawingGroup.cs
- CaseKeyBox.ViewModel.cs
- ExceptionHandlers.cs
- RawTextInputReport.cs
- MemberDomainMap.cs
- LabelEditEvent.cs
- FrameworkPropertyMetadata.cs
- TableLayoutRowStyleCollection.cs
- FixedHyperLink.cs
- XPathDocumentNavigator.cs
- ObjectMemberMapping.cs
- TextProperties.cs
- DesignerDataView.cs
- JsonFormatReaderGenerator.cs
- PointLightBase.cs
- SolidColorBrush.cs
- Size3D.cs
- GiveFeedbackEventArgs.cs
- SapiInterop.cs
- GlobalEventManager.cs
- Win32KeyboardDevice.cs
- SystemResourceKey.cs
- FormViewPagerRow.cs
- ServiceEndpointElement.cs
- ContentOperations.cs
- RSAPKCS1KeyExchangeFormatter.cs
- Serializer.cs
- SpotLight.cs
- ColumnMapTranslator.cs
- ColumnHeader.cs
- StubHelpers.cs
- BrowserDefinition.cs
- Annotation.cs