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
- TextParaClient.cs
- DataAccessException.cs
- ItemMap.cs
- AdjustableArrowCap.cs
- EdmRelationshipRoleAttribute.cs
- SQlBooleanStorage.cs
- TransactedReceiveData.cs
- RegexCaptureCollection.cs
- DefaultSection.cs
- SQLInt64.cs
- HighlightOverlayGlyph.cs
- TableLayout.cs
- QilInvokeEarlyBound.cs
- CopyAttributesAction.cs
- ListViewItemMouseHoverEvent.cs
- SqlCacheDependencySection.cs
- SerializableAttribute.cs
- MetadataItem_Static.cs
- ImageCodecInfo.cs
- DateTimeConverter.cs
- BehaviorEditorPart.cs
- WorkflowDesignerColors.cs
- ComboBoxItem.cs
- SAPICategories.cs
- DNS.cs
- ParameterElement.cs
- InternalRelationshipCollection.cs
- PackWebRequest.cs
- DataGridViewCellEventArgs.cs
- RequestBringIntoViewEventArgs.cs
- DocumentOrderQuery.cs
- ProcessRequestArgs.cs
- CompilationUtil.cs
- DataGridColumnHeader.cs
- SyndicationSerializer.cs
- WeakEventTable.cs
- AssemblyAttributes.cs
- CharAnimationUsingKeyFrames.cs
- EdmItemError.cs
- AnimationClock.cs
- PasswordDeriveBytes.cs
- DrawingCollection.cs
- ColorAnimationBase.cs
- SecurityTokenProvider.cs
- ButtonChrome.cs
- DynamicRendererThreadManager.cs
- InvalidPrinterException.cs
- ImageUrlEditor.cs
- IndependentAnimationStorage.cs
- SafeProcessHandle.cs
- AdRotator.cs
- FormViewDeletedEventArgs.cs
- RoleGroup.cs
- StoragePropertyMapping.cs
- ReliabilityContractAttribute.cs
- IgnoreSectionHandler.cs
- RuleProcessor.cs
- InkCanvasSelectionAdorner.cs
- ChtmlLinkAdapter.cs
- SemanticTag.cs
- NotSupportedException.cs
- HostedHttpRequestAsyncResult.cs
- UserControlCodeDomTreeGenerator.cs
- ScrollItemPattern.cs
- BufferBuilder.cs
- CrossContextChannel.cs
- ThrowHelper.cs
- NetworkInformationPermission.cs
- EdmFunctionAttribute.cs
- EditorZone.cs
- StringInfo.cs
- UserMapPath.cs
- AvTraceDetails.cs
- Attributes.cs
- ToolStripLocationCancelEventArgs.cs
- WeakReference.cs
- GridView.cs
- PageVisual.cs
- TextReturnReader.cs
- ProxyWebPart.cs
- ToolstripProfessionalRenderer.cs
- RenderDataDrawingContext.cs
- NetCodeGroup.cs
- DecoderExceptionFallback.cs
- XPathQueryGenerator.cs
- ProjectionCamera.cs
- MLangCodePageEncoding.cs
- EntityDataSourceMemberPath.cs
- ButtonBase.cs
- ScrollContentPresenter.cs
- BufferAllocator.cs
- DesignerTransactionCloseEvent.cs
- ContentControl.cs
- XmlCodeExporter.cs
- IgnoreSectionHandler.cs
- RegexCapture.cs
- OleTxTransactionInfo.cs
- Row.cs
- HttpProfileGroupBase.cs
- PropertyBuilder.cs