Code:
/ 4.0 / 4.0 / 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. 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
- DiffuseMaterial.cs
- SpecularMaterial.cs
- XmlDigitalSignatureProcessor.cs
- WebPartDisplayModeEventArgs.cs
- DataBindingExpressionBuilder.cs
- RadioButtonList.cs
- DataGridPageChangedEventArgs.cs
- XamlReader.cs
- RIPEMD160Managed.cs
- DropShadowBitmapEffect.cs
- xamlnodes.cs
- DataBinding.cs
- CultureInfo.cs
- IPEndPointCollection.cs
- CompletedAsyncResult.cs
- DockingAttribute.cs
- ThreadExceptionEvent.cs
- SegmentInfo.cs
- ImageButton.cs
- xmlsaver.cs
- BaseParser.cs
- OleAutBinder.cs
- DecimalStorage.cs
- HttpStreamFormatter.cs
- AssemblyBuilderData.cs
- ControlUtil.cs
- Unit.cs
- TypeGeneratedEventArgs.cs
- basevalidator.cs
- ProtocolsConfiguration.cs
- ExtendedPropertyDescriptor.cs
- FixedSOMImage.cs
- Privilege.cs
- DataGridViewColumnHeaderCell.cs
- OleDbPermission.cs
- WindowsButton.cs
- ProfileInfo.cs
- ExpressionBuilderContext.cs
- Int16AnimationBase.cs
- DllNotFoundException.cs
- RegularExpressionValidator.cs
- ModelItemCollectionImpl.cs
- PropertyIDSet.cs
- DockPattern.cs
- remotingproxy.cs
- ParameterSubsegment.cs
- NativeMethods.cs
- DataGridToolTip.cs
- PeerReferralPolicy.cs
- PlanCompiler.cs
- XmlSchemaImporter.cs
- TextCompositionManager.cs
- PolyBezierSegmentFigureLogic.cs
- TdsParserStateObject.cs
- WorkflowOperationFault.cs
- BitmapEffectOutputConnector.cs
- DbConnectionFactory.cs
- NativeMethods.cs
- HttpChannelHelper.cs
- ClrPerspective.cs
- ByteStream.cs
- ObjectDataSourceDisposingEventArgs.cs
- ClassValidator.cs
- SwitchElementsCollection.cs
- PackWebResponse.cs
- Quaternion.cs
- SynchronizationHandlesCodeDomSerializer.cs
- Range.cs
- WindowsStatusBar.cs
- GradientBrush.cs
- PipelineModuleStepContainer.cs
- VBCodeProvider.cs
- ErrorFormatterPage.cs
- URLAttribute.cs
- SecurityCriticalDataForSet.cs
- SmiMetaDataProperty.cs
- CheckBox.cs
- PaperSize.cs
- RSAPKCS1SignatureFormatter.cs
- GCHandleCookieTable.cs
- DbgUtil.cs
- SubtreeProcessor.cs
- ConfigurationLocationCollection.cs
- Context.cs
- FocusTracker.cs
- HtmlHistory.cs
- Column.cs
- StylusPointProperty.cs
- SafeNativeMethods.cs
- AmbientEnvironment.cs
- ObjectHandle.cs
- AssemblyName.cs
- ActivationServices.cs
- WebBrowserHelper.cs
- SoapParser.cs
- AccessDataSourceView.cs
- CodeBlockBuilder.cs
- ISAPIApplicationHost.cs
- XmlComment.cs
- AppSettingsReader.cs