Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / Stylus / StylusEventArgs.cs / 1305600 / StylusEventArgs.cs
using System;
using System.Collections;
using System.Windows.Media;
namespace System.Windows.Input
{
/////////////////////////////////////////////////////////////////////////
///
/// The StylusEventArgs class provides access to the logical
/// Stylus device for all derived event args.
///
public class StylusEventArgs : InputEventArgs
{
/////////////////////////////////////////////////////////////////////
///
/// Initializes a new instance of the StylusEventArgs class.
///
///
/// The logical Stylus device associated with this event.
///
///
/// The time when the input occured.
///
public StylusEventArgs(StylusDevice stylus, int timestamp) : base(stylus, timestamp)
{
if( stylus == null )
{
throw new System.ArgumentNullException("stylus");
}
}
/////////////////////////////////////////////////////////////////////
///
/// Read-only access to the stylus device associated with this
/// event.
///
public StylusDevice StylusDevice
{
get
{
return (StylusDevice)this.Device;
}
}
/////////////////////////////////////////////////////////////////////
///
/// Calculates the position of the stylus relative to a particular element.
///
public Point GetPosition(IInputElement relativeTo)
{
return StylusDevice.GetPosition(relativeTo);
}
/////////////////////////////////////////////////////////////////////
///
/// Indicates the stylus is not touching the surface.
///
public bool InAir
{
get
{
return StylusDevice.InAir;
}
}
/////////////////////////////////////////////////////////////////////
///
/// Indicates stylusDevice is in the inverted state.
///
public bool Inverted
{
get
{
return StylusDevice.Inverted;
}
}
/////////////////////////////////////////////////////////////////////
///
/// Returns a StylusPointCollection for processing the data from input.
/// This method creates a new StylusPointCollection and copies the data.
///
public StylusPointCollection GetStylusPoints(IInputElement relativeTo)
{
return StylusDevice.GetStylusPoints(relativeTo);
}
/////////////////////////////////////////////////////////////////////
///
/// Returns a StylusPointCollection for processing the data from input.
/// This method creates a new StylusPointCollection and copies the data.
///
public StylusPointCollection GetStylusPoints(IInputElement relativeTo, StylusPointDescription subsetToReformatTo)
{
return StylusDevice.GetStylusPoints(relativeTo, subsetToReformatTo);
}
/////////////////////////////////////////////////////////////////////
///
/// The mechanism used to call the type-specific handler on the
/// target.
///
///
/// The generic handler to call in a type-specific way.
///
///
/// The target to call the handler on.
///
protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
{
StylusEventHandler handler = (StylusEventHandler) genericHandler;
handler(genericTarget, this);
}
/////////////////////////////////////////////////////////////////////
internal RawStylusInputReport InputReport
{
get { return _inputReport; }
set { _inputReport = value; }
}
/////////////////////////////////////////////////////////////////////
RawStylusInputReport _inputReport;
}
}
// 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
- MetadataExporter.cs
- Point4D.cs
- MD5CryptoServiceProvider.cs
- GroupBoxAutomationPeer.cs
- BmpBitmapEncoder.cs
- CompiledQueryCacheKey.cs
- BitmapEffectRenderDataResource.cs
- EntityDataSourceSelectedEventArgs.cs
- GifBitmapEncoder.cs
- XmlSchemaDocumentation.cs
- HttpHeaderCollection.cs
- MDIWindowDialog.cs
- TextRange.cs
- ProxyFragment.cs
- FunctionGenerator.cs
- SqlDataAdapter.cs
- HttpException.cs
- ClassicBorderDecorator.cs
- KeyboardEventArgs.cs
- CommandEventArgs.cs
- sitestring.cs
- ProviderException.cs
- SelectedGridItemChangedEvent.cs
- TransformProviderWrapper.cs
- TextElementEditingBehaviorAttribute.cs
- ScriptingRoleServiceSection.cs
- StorageEntityTypeMapping.cs
- BitmapEffectInput.cs
- Bidi.cs
- RecordConverter.cs
- RoleManagerEventArgs.cs
- Matrix3DStack.cs
- FontSourceCollection.cs
- FixedPageProcessor.cs
- Form.cs
- DrawingBrush.cs
- ExceptionWrapper.cs
- MediaCommands.cs
- TextRangeEditLists.cs
- ObjectQueryState.cs
- XmlEntity.cs
- BitStream.cs
- HWStack.cs
- MissingMethodException.cs
- RuntimeConfigLKG.cs
- FixedSOMPage.cs
- AncillaryOps.cs
- MessageBox.cs
- FormViewInsertEventArgs.cs
- SystemIPv4InterfaceProperties.cs
- HttpModulesSection.cs
- InputScopeAttribute.cs
- MatrixAnimationUsingPath.cs
- Logging.cs
- TraceHandler.cs
- SoapFormatter.cs
- RuntimeEnvironment.cs
- ObjectConverter.cs
- RegistrationServices.cs
- System.Data.OracleClient_BID.cs
- Parsers.cs
- OptimalBreakSession.cs
- ChannelToken.cs
- RangeBaseAutomationPeer.cs
- AnimationTimeline.cs
- ServicePointManagerElement.cs
- GlyphCache.cs
- LinqDataSource.cs
- OracleEncoding.cs
- ActivationServices.cs
- BinaryFormatter.cs
- ToolboxItem.cs
- ErrorFormatter.cs
- TraceListeners.cs
- DataGridView.cs
- OpCodes.cs
- ArgumentValidation.cs
- Clipboard.cs
- IndexedGlyphRun.cs
- Pts.cs
- UIAgentInitializationException.cs
- AxWrapperGen.cs
- GetPageCompletedEventArgs.cs
- adornercollection.cs
- PrivilegeNotHeldException.cs
- MultilineStringConverter.cs
- SafeJobHandle.cs
- Subtree.cs
- RectAnimationBase.cs
- InfocardChannelParameter.cs
- PointHitTestParameters.cs
- SQLByte.cs
- RenderOptions.cs
- _NativeSSPI.cs
- SwitchLevelAttribute.cs
- BitHelper.cs
- StylusCollection.cs
- Operator.cs
- SequenceDesigner.cs
- ISCIIEncoding.cs