Code:
/ 4.0 / 4.0 / 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.
//----------------------------------------------------------------------------
//
// 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
- ComponentConverter.cs
- StreamInfo.cs
- XmlSchemaAttributeGroupRef.cs
- SystemMulticastIPAddressInformation.cs
- ResourceContainer.cs
- LinkDesigner.cs
- MulticastDelegate.cs
- ServiceRoute.cs
- ConstructorArgumentAttribute.cs
- RegexRunnerFactory.cs
- LogLogRecordEnumerator.cs
- SweepDirectionValidation.cs
- NeutralResourcesLanguageAttribute.cs
- ResourceAttributes.cs
- Light.cs
- ObjectRef.cs
- SqlDataSourceEnumerator.cs
- TemplateGroupCollection.cs
- TrailingSpaceComparer.cs
- RootBrowserWindowAutomationPeer.cs
- CacheEntry.cs
- StandardCommands.cs
- OutputCacheSettingsSection.cs
- StringArrayConverter.cs
- WpfPayload.cs
- PrimitiveXmlSerializers.cs
- UnauthorizedWebPart.cs
- Base64Encoder.cs
- FilteredAttributeCollection.cs
- ClientApiGenerator.cs
- WebPartDescription.cs
- IssuanceLicense.cs
- MediaContext.cs
- MemberInfoSerializationHolder.cs
- EventMap.cs
- QilReference.cs
- CharacterBufferReference.cs
- FixedTextContainer.cs
- MailDefinition.cs
- Matrix3D.cs
- TableCell.cs
- ApplicationHost.cs
- _ProxyRegBlob.cs
- VectorAnimation.cs
- MenuItem.cs
- DataGridViewAutoSizeModeEventArgs.cs
- Brush.cs
- FileSystemEventArgs.cs
- XNodeNavigator.cs
- GenericEnumConverter.cs
- OutputCacheProfile.cs
- GridViewActionList.cs
- EUCJPEncoding.cs
- QilChoice.cs
- Bits.cs
- CompiledQueryCacheEntry.cs
- Timer.cs
- WebBrowserBase.cs
- DetailsViewUpdatedEventArgs.cs
- RootContext.cs
- NotifyParentPropertyAttribute.cs
- ValidatingReaderNodeData.cs
- MyContact.cs
- HttpRequestCacheValidator.cs
- ConfigurationManagerHelper.cs
- HitTestParameters3D.cs
- OperationDescription.cs
- ListViewItemMouseHoverEvent.cs
- PartialList.cs
- HwndSubclass.cs
- MetadataSerializer.cs
- FileSystemWatcher.cs
- DeleteHelper.cs
- PageAdapter.cs
- RemotingException.cs
- StylusButtonEventArgs.cs
- EmptyEnumerator.cs
- SHA384Cng.cs
- QueryStringConverter.cs
- ellipse.cs
- TreeNodeCollection.cs
- StoreAnnotationsMap.cs
- UserMapPath.cs
- cookiecollection.cs
- XhtmlBasicControlAdapter.cs
- ResolveCriteriaCD1.cs
- SourceElementsCollection.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- PropertiesTab.cs
- Message.cs
- QueryOperator.cs
- RightsManagementErrorHandler.cs
- SplitterEvent.cs
- CheckBoxFlatAdapter.cs
- ActivityDesigner.cs
- TableCell.cs
- EdmToObjectNamespaceMap.cs
- ManipulationStartingEventArgs.cs
- PhoneCallDesigner.cs
- WebBrowserHelper.cs