Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Input / Stylus / StylusEventArgs.cs / 1 / 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. 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
- XmlCountingReader.cs
- InstanceCollisionException.cs
- DllNotFoundException.cs
- ColorMatrix.cs
- FormatConvertedBitmap.cs
- ADMembershipProvider.cs
- CodeTypeMemberCollection.cs
- InkSerializer.cs
- InstanceNotReadyException.cs
- WebServiceParameterData.cs
- IgnoreFileBuildProvider.cs
- Rotation3D.cs
- MetaForeignKeyColumn.cs
- AccessText.cs
- SqlMetaData.cs
- TemplateKeyConverter.cs
- DisposableCollectionWrapper.cs
- RoleGroup.cs
- CustomCredentialPolicy.cs
- Calendar.cs
- HttpListenerPrefixCollection.cs
- CacheChildrenQuery.cs
- XmlHierarchicalEnumerable.cs
- DataSvcMapFile.cs
- ConfigUtil.cs
- unsafenativemethodstextservices.cs
- ListChangedEventArgs.cs
- PropVariant.cs
- TabPanel.cs
- ToolStripContentPanel.cs
- Clause.cs
- ContextMenuStrip.cs
- SourceElementsCollection.cs
- LostFocusEventManager.cs
- AtomServiceDocumentSerializer.cs
- StyleHelper.cs
- TypeConverterBase.cs
- SettingsContext.cs
- HwndStylusInputProvider.cs
- HttpFileCollectionWrapper.cs
- DoubleStorage.cs
- LinqDataSourceDisposeEventArgs.cs
- PathBox.cs
- DocComment.cs
- ClassImporter.cs
- WmlListAdapter.cs
- TaskFileService.cs
- ZeroOpNode.cs
- DetailsViewCommandEventArgs.cs
- LiteralControl.cs
- DesignerVerb.cs
- FloaterParaClient.cs
- MaxValueConverter.cs
- ThreadExceptionEvent.cs
- securitycriticaldata.cs
- PerspectiveCamera.cs
- PriorityQueue.cs
- EmissiveMaterial.cs
- SiteMembershipCondition.cs
- HwndSourceKeyboardInputSite.cs
- SQLMoney.cs
- ModelItemCollection.cs
- GB18030Encoding.cs
- EntityKeyElement.cs
- HyperLinkColumn.cs
- IPHostEntry.cs
- XmlSchemaImporter.cs
- InternalRelationshipCollection.cs
- ImageSource.cs
- Package.cs
- TextShapeableCharacters.cs
- CommandPlan.cs
- RewritingSimplifier.cs
- FrugalList.cs
- TextSelectionProcessor.cs
- DataColumnMapping.cs
- SafeBitVector32.cs
- HtmlInputHidden.cs
- Transform3DGroup.cs
- CryptoHelper.cs
- ReferenceSchema.cs
- DetailsViewInsertedEventArgs.cs
- AdornerHitTestResult.cs
- TransactionException.cs
- PropertyGridView.cs
- SqlProcedureAttribute.cs
- CqlWriter.cs
- WebCategoryAttribute.cs
- DecimalConstantAttribute.cs
- NetStream.cs
- FileSystemEventArgs.cs
- GridView.cs
- Validator.cs
- COM2PropertyPageUITypeConverter.cs
- OrCondition.cs
- CustomWebEventKey.cs
- ClientData.cs
- IItemContainerGenerator.cs
- EntityDataSourceStatementEditor.cs
- ProcessHostFactoryHelper.cs