Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / ManipulationStartingEventArgs.cs / 1305600 / ManipulationStartingEventArgs.cs
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Security;
using System.Windows;
using System.Windows.Input.Manipulations;
using System.Windows.Media;
using MS.Internal.PresentationCore;
namespace System.Windows.Input
{
public sealed class ManipulationStartingEventArgs : InputEventArgs
{
internal ManipulationStartingEventArgs(
ManipulationDevice manipulationDevice,
int timestamp)
: base(manipulationDevice, timestamp)
{
RoutedEvent = Manipulation.ManipulationStartingEvent;
Mode = ManipulationModes.All;
IsSingleTouchEnabled = true;
}
public ManipulationModes Mode
{
get { return _mode; }
set
{
if ((value & ~ManipulationModes.All) != 0)
{
throw new ArgumentException(SR.Get(SRID.Manipulation_InvalidManipulationMode), "value");
}
_mode = value;
}
}
///
/// The ManipulationContainer defines the coordinate space of all parameters
/// and values for this manipulation.
///
public IInputElement ManipulationContainer
{
get;
set;
}
///
/// For single-finger rotation, the pivot is used to determine how to rotate.
///
///
/// The values of the the pivot properties should be in the coordinate space of the ManipulationContainer.
///
public ManipulationPivot Pivot
{
get;
set;
}
///
/// Whether one finger can start manipulation or if two or more fingers are required.
///
public bool IsSingleTouchEnabled
{
get;
set;
}
///
/// Method to cancel the Manipulation
///
/// A bool indicating the success of Cancel
public bool Cancel()
{
RequestedCancel = true;
return true;
}
///
/// 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;
}
}
///
/// 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.ManipulationStartingEvent)
{
((EventHandler)genericHandler)(genericTarget, this);
}
else
{
base.InvokeEventHandler(genericHandler, genericTarget);
}
}
[Browsable(false)]
public void SetManipulationParameter(ManipulationParameters2D parameter)
{
if (_parameters == null)
{
_parameters = new List(1);
}
_parameters.Add(parameter);
}
internal IList Parameters
{
get { return _parameters; }
}
private List _parameters;
private ManipulationModes _mode;
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.ComponentModel;
using System.Diagnostics;
using System.Security;
using System.Windows;
using System.Windows.Input.Manipulations;
using System.Windows.Media;
using MS.Internal.PresentationCore;
namespace System.Windows.Input
{
public sealed class ManipulationStartingEventArgs : InputEventArgs
{
internal ManipulationStartingEventArgs(
ManipulationDevice manipulationDevice,
int timestamp)
: base(manipulationDevice, timestamp)
{
RoutedEvent = Manipulation.ManipulationStartingEvent;
Mode = ManipulationModes.All;
IsSingleTouchEnabled = true;
}
public ManipulationModes Mode
{
get { return _mode; }
set
{
if ((value & ~ManipulationModes.All) != 0)
{
throw new ArgumentException(SR.Get(SRID.Manipulation_InvalidManipulationMode), "value");
}
_mode = value;
}
}
///
/// The ManipulationContainer defines the coordinate space of all parameters
/// and values for this manipulation.
///
public IInputElement ManipulationContainer
{
get;
set;
}
///
/// For single-finger rotation, the pivot is used to determine how to rotate.
///
///
/// The values of the the pivot properties should be in the coordinate space of the ManipulationContainer.
///
public ManipulationPivot Pivot
{
get;
set;
}
///
/// Whether one finger can start manipulation or if two or more fingers are required.
///
public bool IsSingleTouchEnabled
{
get;
set;
}
///
/// Method to cancel the Manipulation
///
/// A bool indicating the success of Cancel
public bool Cancel()
{
RequestedCancel = true;
return true;
}
///
/// 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;
}
}
///
/// 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.ManipulationStartingEvent)
{
((EventHandler)genericHandler)(genericTarget, this);
}
else
{
base.InvokeEventHandler(genericHandler, genericTarget);
}
}
[Browsable(false)]
public void SetManipulationParameter(ManipulationParameters2D parameter)
{
if (_parameters == null)
{
_parameters = new List(1);
}
_parameters.Add(parameter);
}
internal IList Parameters
{
get { return _parameters; }
}
private List _parameters;
private ManipulationModes _mode;
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
- LocalValueEnumerator.cs
- SqlDataSourceEnumerator.cs
- OdbcRowUpdatingEvent.cs
- DataException.cs
- X509ChainPolicy.cs
- DefaultEvaluationContext.cs
- Encoding.cs
- IdentifierElement.cs
- WinInetCache.cs
- DoubleAnimationClockResource.cs
- NewItemsContextMenuStrip.cs
- AssemblySettingAttributes.cs
- TableCell.cs
- HideDisabledControlAdapter.cs
- TraceRecord.cs
- InstanceKey.cs
- _TLSstream.cs
- MSHTMLHostUtil.cs
- Int32Rect.cs
- HelpEvent.cs
- Sql8ConformanceChecker.cs
- BinaryKeyIdentifierClause.cs
- Model3DGroup.cs
- ISessionStateStore.cs
- ServiceDescriptionSerializer.cs
- CTreeGenerator.cs
- SchemaSetCompiler.cs
- LineServices.cs
- SoapIgnoreAttribute.cs
- PresentationTraceSources.cs
- NativeMethods.cs
- DummyDataSource.cs
- Hex.cs
- LayoutTable.cs
- ItemDragEvent.cs
- _NetworkingPerfCounters.cs
- DesignerAutoFormat.cs
- CommandID.cs
- UniqueContractNameValidationBehavior.cs
- StringKeyFrameCollection.cs
- DependencyObjectValidator.cs
- EventLogTraceListener.cs
- SettingsProperty.cs
- DataControlButton.cs
- TargetInvocationException.cs
- DataServiceResponse.cs
- MenuItem.cs
- CatalogPart.cs
- WebAdminConfigurationHelper.cs
- KoreanLunisolarCalendar.cs
- EncodingTable.cs
- DataServiceQueryProvider.cs
- EditorZoneBase.cs
- XmlHierarchyData.cs
- DataTemplateKey.cs
- DataGridViewComboBoxColumn.cs
- WsiProfilesElement.cs
- ControllableStoryboardAction.cs
- HttpDictionary.cs
- RequestCacheManager.cs
- RadialGradientBrush.cs
- SamlAction.cs
- XmlSerializableReader.cs
- HttpCacheVary.cs
- HttpApplication.cs
- FileRegion.cs
- EngineSiteSapi.cs
- DataPagerFieldItem.cs
- LocalServiceSecuritySettingsElement.cs
- IdentitySection.cs
- XmlCharCheckingWriter.cs
- ThreadNeutralSemaphore.cs
- BaseCollection.cs
- PersistNameAttribute.cs
- DependencyPropertyConverter.cs
- InputLanguage.cs
- TextBox.cs
- FamilyMap.cs
- Propagator.Evaluator.cs
- GeometryModel3D.cs
- DataRecord.cs
- GeneralTransform.cs
- BrowserDefinitionCollection.cs
- WorkflowMarkupSerializationException.cs
- SapiAttributeParser.cs
- LOSFormatter.cs
- TreeNodeBindingCollection.cs
- XmlSchemaObjectTable.cs
- PrtCap_Public.cs
- NativeMethods.cs
- RequestResizeEvent.cs
- SwitchAttribute.cs
- HelpInfo.cs
- TrackingParameters.cs
- SQLConvert.cs
- Properties.cs
- ComponentConverter.cs
- DocumentViewerBase.cs
- TrueReadOnlyCollection.cs
- SystemResourceKey.cs