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
- FileEnumerator.cs
- Size.cs
- VisualStyleTypesAndProperties.cs
- LoadedOrUnloadedOperation.cs
- MainMenu.cs
- FilteredReadOnlyMetadataCollection.cs
- AsynchronousChannel.cs
- StrokeCollectionDefaultValueFactory.cs
- DataServiceProcessingPipeline.cs
- CaseDesigner.xaml.cs
- SecurityUtils.cs
- ChineseLunisolarCalendar.cs
- XmlRawWriter.cs
- SqlDataSourceView.cs
- TimerElapsedEvenArgs.cs
- PropertyEmitter.cs
- InProcStateClientManager.cs
- ParamArrayAttribute.cs
- MatrixAnimationUsingKeyFrames.cs
- TextProperties.cs
- StructuredType.cs
- RuntimeArgumentHandle.cs
- ThreadExceptionDialog.cs
- Shape.cs
- CapabilitiesPattern.cs
- _UriTypeConverter.cs
- ValidationError.cs
- StyleSheetDesigner.cs
- StreamWithDictionary.cs
- httpserverutility.cs
- MDIWindowDialog.cs
- DataGrid.cs
- MissingManifestResourceException.cs
- TimeManager.cs
- contentDescriptor.cs
- AutoGeneratedField.cs
- SoapProtocolReflector.cs
- DeferredReference.cs
- SafeRegistryKey.cs
- PageAdapter.cs
- FilterEventArgs.cs
- SessionIDManager.cs
- LowerCaseStringConverter.cs
- RuleRefElement.cs
- DataGridViewCellCollection.cs
- ComplusEndpointConfigContainer.cs
- UniqueIdentifierService.cs
- SourceLineInfo.cs
- UserInitiatedNavigationPermission.cs
- SqlColumnizer.cs
- Convert.cs
- HebrewCalendar.cs
- DetailsViewUpdatedEventArgs.cs
- Method.cs
- TextRangeEditLists.cs
- HttpInputStream.cs
- DynamicILGenerator.cs
- TabPage.cs
- UMPAttributes.cs
- LinqTreeNodeEvaluator.cs
- CreateWorkflowOwnerCommand.cs
- Triplet.cs
- EndpointAddressProcessor.cs
- NotifyInputEventArgs.cs
- DataDocumentXPathNavigator.cs
- TraceListeners.cs
- TransformerConfigurationWizardBase.cs
- UnsafeNativeMethods.cs
- XmlNodeReader.cs
- ThreadAbortException.cs
- QilLiteral.cs
- AssemblyCacheEntry.cs
- FontInfo.cs
- SubMenuStyle.cs
- PageAdapter.cs
- PermissionToken.cs
- ViewValidator.cs
- MatrixTransform.cs
- SynchronizationLockException.cs
- PathData.cs
- FixedDocumentPaginator.cs
- RemotingException.cs
- XsdBuilder.cs
- AttachedPropertyMethodSelector.cs
- GCHandleCookieTable.cs
- dataSvcMapFileLoader.cs
- EarlyBoundInfo.cs
- HotCommands.cs
- DocumentSequenceHighlightLayer.cs
- BulletedListEventArgs.cs
- UIElementCollection.cs
- ModulesEntry.cs
- HandlerMappingMemo.cs
- DispatcherExceptionFilterEventArgs.cs
- SrgsText.cs
- ApplicationSecurityInfo.cs
- SplitterEvent.cs
- PersonalizationState.cs
- TextTrailingWordEllipsis.cs
- AxisAngleRotation3D.cs