Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- ExtensionWindowResizeGrip.cs
- CodeBlockBuilder.cs
- EventRecord.cs
- WeakReferenceList.cs
- RegexTree.cs
- InheritanceService.cs
- DataGridColumn.cs
- ConsoleKeyInfo.cs
- ContainsRowNumberChecker.cs
- ExpressionTextBoxAutomationPeer.cs
- PersistStreamTypeWrapper.cs
- InputLanguageProfileNotifySink.cs
- Pair.cs
- returneventsaver.cs
- SafeProcessHandle.cs
- mediaeventargs.cs
- DataServiceOperationContext.cs
- NamedPermissionSet.cs
- DbProviderServices.cs
- GeneratedContractType.cs
- ControlPersister.cs
- AdRotator.cs
- HttpResponseHeader.cs
- _ShellExpression.cs
- WinEventTracker.cs
- PageAdapter.cs
- AddInController.cs
- UnsafePeerToPeerMethods.cs
- LinkConverter.cs
- PrintPreviewDialog.cs
- SigningCredentials.cs
- ViewStateChangedEventArgs.cs
- ILGenerator.cs
- PageThemeCodeDomTreeGenerator.cs
- StatusBar.cs
- SqlInternalConnectionSmi.cs
- QueryStringParameter.cs
- ClientBuildManager.cs
- GZipDecoder.cs
- Char.cs
- RegexMatch.cs
- ExpandableObjectConverter.cs
- InternalConfigHost.cs
- TextEditor.cs
- LicenseContext.cs
- TriggerActionCollection.cs
- ScrollableControlDesigner.cs
- XPathDocumentNavigator.cs
- ACL.cs
- RootAction.cs
- CAGDesigner.cs
- OutputCacheProfile.cs
- TagPrefixCollection.cs
- Aggregates.cs
- CustomValidator.cs
- DecimalConverter.cs
- COSERVERINFO.cs
- RepeatButton.cs
- BuilderPropertyEntry.cs
- SoapIncludeAttribute.cs
- UniqueConstraint.cs
- WindowsClaimSet.cs
- PartitionedDataSource.cs
- CompiledIdentityConstraint.cs
- IIS7WorkerRequest.cs
- DataGridViewBindingCompleteEventArgs.cs
- LinkedResourceCollection.cs
- PocoEntityKeyStrategy.cs
- SizeAnimationUsingKeyFrames.cs
- ReaderWriterLockWrapper.cs
- MessageDirection.cs
- WebPartConnectionsCancelEventArgs.cs
- remotingproxy.cs
- Attributes.cs
- DatatypeImplementation.cs
- EventProviderTraceListener.cs
- SectionRecord.cs
- RotateTransform.cs
- CollaborationHelperFunctions.cs
- QilCloneVisitor.cs
- JumpPath.cs
- ByteFacetDescriptionElement.cs
- CompiledQueryCacheEntry.cs
- ScriptDescriptor.cs
- ZipQueryOperator.cs
- FixedDocumentPaginator.cs
- NumberFormatInfo.cs
- DataGridViewDesigner.cs
- LayoutDump.cs
- _DomainName.cs
- SmtpNegotiateAuthenticationModule.cs
- BamlTreeUpdater.cs
- DataListItemCollection.cs
- figurelength.cs
- SizeConverter.cs
- NetworkAddressChange.cs
- BooleanFunctions.cs
- FunctionDetailsReader.cs
- LoadItemsEventArgs.cs
- ParallelTimeline.cs