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
- ComponentEditorPage.cs
- TypeDelegator.cs
- UIPropertyMetadata.cs
- ISAPIRuntime.cs
- ValidationErrorCollection.cs
- AesManaged.cs
- ParentUndoUnit.cs
- Command.cs
- EntityClassGenerator.cs
- UnmanagedMemoryStreamWrapper.cs
- AttributeCollection.cs
- Nodes.cs
- PreservationFileReader.cs
- ImageButton.cs
- ColumnWidthChangedEvent.cs
- TargetException.cs
- MediaTimeline.cs
- _ProxyChain.cs
- AffineTransform3D.cs
- SymbolType.cs
- StringSorter.cs
- CalendarButton.cs
- MemberExpression.cs
- X509CertificateTokenFactoryCredential.cs
- SoapMessage.cs
- Pair.cs
- QueryCursorEventArgs.cs
- AssemblyCollection.cs
- FirstMatchCodeGroup.cs
- TypeTypeConverter.cs
- SerializerProvider.cs
- CopyEncoder.cs
- FragmentQueryKB.cs
- NameValueConfigurationCollection.cs
- ClientViaElement.cs
- SystemColors.cs
- DetailsViewDeleteEventArgs.cs
- TableItemStyle.cs
- AdRotator.cs
- ExpressionConverter.cs
- util.cs
- MultipartContentParser.cs
- NegationPusher.cs
- CorePropertiesFilter.cs
- PrintController.cs
- TextElementEnumerator.cs
- SoapReflectionImporter.cs
- SystemWebCachingSectionGroup.cs
- TypeConverterValueSerializer.cs
- DesignerDataView.cs
- XdrBuilder.cs
- SystemParameters.cs
- QueueNameHelper.cs
- SynchronizedRandom.cs
- SecurityHeaderTokenResolver.cs
- SafeSerializationManager.cs
- XmlProcessingInstruction.cs
- Subtree.cs
- ArcSegment.cs
- ComplexType.cs
- HostingPreferredMapPath.cs
- BaseCAMarshaler.cs
- CryptoHelper.cs
- Positioning.cs
- RoutedCommand.cs
- UdpMessageProperty.cs
- SR.cs
- KeyFrames.cs
- DecoderReplacementFallback.cs
- NetStream.cs
- HtmlButton.cs
- BaseUriHelper.cs
- InputLangChangeEvent.cs
- RubberbandSelector.cs
- NameSpaceEvent.cs
- XmlValidatingReaderImpl.cs
- FunctionDetailsReader.cs
- SqlDependencyListener.cs
- StatusBarDrawItemEvent.cs
- XmlExtensionFunction.cs
- LowerCaseStringConverter.cs
- DuplexClientBase.cs
- RegexCapture.cs
- ToolStripCollectionEditor.cs
- httpstaticobjectscollection.cs
- AffineTransform3D.cs
- TextClipboardData.cs
- KeyedHashAlgorithm.cs
- CompositeActivityValidator.cs
- FunctionNode.cs
- DateTimeFormatInfoScanner.cs
- NotifyCollectionChangedEventArgs.cs
- QueryCacheKey.cs
- OpenTypeLayoutCache.cs
- XmlTypeMapping.cs
- ResXBuildProvider.cs
- TableLayoutPanelDesigner.cs
- TextRangeBase.cs
- ResourceLoader.cs
- StatusBarAutomationPeer.cs