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
- VirtualizedContainerService.cs
- TypeDescriptor.cs
- sitestring.cs
- DataMemberConverter.cs
- TaiwanCalendar.cs
- FontStretchConverter.cs
- InstanceDataCollectionCollection.cs
- KeyGesture.cs
- RegexCode.cs
- HealthMonitoringSectionHelper.cs
- _SSPIWrapper.cs
- StylusTouchDevice.cs
- DataSourceConverter.cs
- ConfigXmlDocument.cs
- _ScatterGatherBuffers.cs
- _Events.cs
- QilReference.cs
- PrimitiveXmlSerializers.cs
- TokenBasedSet.cs
- UniqueEventHelper.cs
- NameValuePair.cs
- EditBehavior.cs
- Sql8ConformanceChecker.cs
- _NTAuthentication.cs
- SqlConnectionStringBuilder.cs
- IntMinMaxAggregationOperator.cs
- OutputCacheSettings.cs
- SafeNativeMethodsOther.cs
- ButtonColumn.cs
- HtmlTitle.cs
- ContainerActivationHelper.cs
- StaticFileHandler.cs
- NavigateEvent.cs
- SqlDataSourceFilteringEventArgs.cs
- RecognizedAudio.cs
- SystemTcpConnection.cs
- PersonalizableTypeEntry.cs
- SqlDataSourceStatusEventArgs.cs
- Collection.cs
- SecureConversationSecurityTokenParameters.cs
- ContentHostHelper.cs
- NonParentingControl.cs
- EventProperty.cs
- Literal.cs
- XslTransformFileEditor.cs
- CodeParameterDeclarationExpression.cs
- ChannelSinkStacks.cs
- BooleanFacetDescriptionElement.cs
- DefaultPrintController.cs
- GenerateTemporaryTargetAssembly.cs
- SQLMoney.cs
- NameNode.cs
- PeerObject.cs
- DoubleCollectionValueSerializer.cs
- Decorator.cs
- XslNumber.cs
- AnchoredBlock.cs
- CodeExpressionStatement.cs
- PointValueSerializer.cs
- PropertyPath.cs
- Regex.cs
- TemplateControl.cs
- SupportsEventValidationAttribute.cs
- EncryptedXml.cs
- SafeNativeMethods.cs
- WebRequestModuleElement.cs
- RoleManagerSection.cs
- XmlBoundElement.cs
- ReferenceSchema.cs
- CfgArc.cs
- NameObjectCollectionBase.cs
- EDesignUtil.cs
- SafeCertificateStore.cs
- ModelTreeEnumerator.cs
- PagerSettings.cs
- DataGrid.cs
- MergablePropertyAttribute.cs
- PropertyRecord.cs
- SchemaType.cs
- ServiceMemoryGates.cs
- StreamBodyWriter.cs
- SafeEventLogWriteHandle.cs
- RootAction.cs
- GridViewCellAutomationPeer.cs
- DataBoundControlHelper.cs
- DelegatingConfigHost.cs
- ScrollViewer.cs
- DataControlPagerLinkButton.cs
- RelationshipType.cs
- TrackingMemoryStreamFactory.cs
- ValidationRule.cs
- DebuggerAttributes.cs
- WinFormsSpinner.cs
- Parser.cs
- TrustManagerMoreInformation.cs
- ManipulationPivot.cs
- CallbackTimeoutsBehavior.cs
- HttpProfileBase.cs
- HostExecutionContextManager.cs
- WebPartConnectionsCancelVerb.cs