Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / ManipulationStartedEventArgs.cs / 1305600 / ManipulationStartedEventArgs.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 regarding the beginning of a manipulation.
///
public sealed class ManipulationStartedEventArgs : InputEventArgs
{
///
/// Instantiates a new instance of this class.
///
internal ManipulationStartedEventArgs(
ManipulationDevice manipulationDevice,
int timestamp,
IInputElement manipulationContainer,
Point origin)
: base(manipulationDevice, timestamp)
{
RoutedEvent = Manipulation.ManipulationStartedEvent;
ManipulationContainer = manipulationContainer;
ManipulationOrigin = origin;
}
///
/// 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.ManipulationStartedEvent)
{
((EventHandler)genericHandler)(genericTarget, this);
}
else
{
base.InvokeEventHandler(genericHandler, genericTarget);
}
}
///
/// 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;
}
///
/// Preempts further processing and completes the manipulation without any inertia.
///
public void Complete()
{
RequestedComplete = true;
RequestedCancel = false;
}
///
/// Method to cancel the Manipulation
///
/// A bool indicating the success of Cancel
public bool Cancel()
{
RequestedCancel = true;
RequestedComplete = false;
return true;
}
///
/// A handler requested that the manipulation complete.
///
internal bool RequestedComplete
{
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
- _WinHttpWebProxyDataBuilder.cs
- TimelineClockCollection.cs
- RectAnimationBase.cs
- Style.cs
- CodeTypeParameterCollection.cs
- Lease.cs
- CodeTypeReferenceCollection.cs
- ConnectionStringsExpressionBuilder.cs
- RIPEMD160.cs
- DoubleKeyFrameCollection.cs
- HWStack.cs
- FormViewPagerRow.cs
- XmlChildNodes.cs
- PromptEventArgs.cs
- FormatControl.cs
- LayoutUtils.cs
- ImageFormat.cs
- FontFamilyIdentifier.cs
- NominalTypeEliminator.cs
- XMLUtil.cs
- PerformanceCounterLib.cs
- TypeUsage.cs
- StoreAnnotationsMap.cs
- XmlNamespaceDeclarationsAttribute.cs
- RoutedEventArgs.cs
- RightsManagementInformation.cs
- ApplicationSettingsBase.cs
- EncoderNLS.cs
- DataGridViewEditingControlShowingEventArgs.cs
- LinkDesigner.cs
- StorageBasedPackageProperties.cs
- Stopwatch.cs
- ActivationServices.cs
- MouseDevice.cs
- TreeNodeEventArgs.cs
- NavigationWindow.cs
- TextServicesManager.cs
- DataControlFieldCell.cs
- TextStore.cs
- DiscoveryClientReferences.cs
- SystemIPGlobalProperties.cs
- XmlWriter.cs
- LinkLabel.cs
- RecordConverter.cs
- PrimitiveSchema.cs
- ProfileInfo.cs
- DetailsViewPageEventArgs.cs
- RTLAwareMessageBox.cs
- CursorInteropHelper.cs
- ProfileInfo.cs
- GenericXmlSecurityToken.cs
- TileModeValidation.cs
- WpfSharedBamlSchemaContext.cs
- RectAnimationClockResource.cs
- TraceRecord.cs
- EmptyQuery.cs
- _LazyAsyncResult.cs
- XmlCountingReader.cs
- safesecurityhelperavalon.cs
- uribuilder.cs
- GuidConverter.cs
- InternalUserCancelledException.cs
- XmlAttributeAttribute.cs
- Convert.cs
- SmiEventSink_Default.cs
- EndpointDiscoveryBehavior.cs
- PackWebResponse.cs
- StructuredTypeInfo.cs
- EntityProviderFactory.cs
- FrameworkElement.cs
- NullableDoubleSumAggregationOperator.cs
- Cursor.cs
- RequestQueue.cs
- ObjectDataSourceView.cs
- ContactManager.cs
- ExpressionLexer.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- AnnotationAuthorChangedEventArgs.cs
- FileStream.cs
- XmlNamespaceMapping.cs
- DataGridDetailsPresenterAutomationPeer.cs
- BypassElement.cs
- BitArray.cs
- EffectiveValueEntry.cs
- SqlExpressionNullability.cs
- ProfileEventArgs.cs
- ModelItemDictionary.cs
- LogicalExpr.cs
- XmlElement.cs
- DataGridToolTip.cs
- ProgressBarBrushConverter.cs
- SchemaNotation.cs
- Dynamic.cs
- UserPreferenceChangedEventArgs.cs
- XmlBinaryWriterSession.cs
- SqlParameter.cs
- CommandField.cs
- COMException.cs
- LocalizabilityAttribute.cs
- WebRequestModuleElementCollection.cs