Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TryCatchDesigner.xaml.cs
- AttachInfo.cs
- ObjRef.cs
- TargetFrameworkUtil.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- PageAsyncTaskManager.cs
- Point3DAnimationBase.cs
- FormViewPagerRow.cs
- ClientUriBehavior.cs
- ServiceChannelFactory.cs
- XmlSchemaCollection.cs
- _LocalDataStore.cs
- Win32SafeHandles.cs
- CaseInsensitiveComparer.cs
- AndAlso.cs
- SafeSecurityHelper.cs
- EventMemberCodeDomSerializer.cs
- XpsS0ValidatingLoader.cs
- ControlBuilder.cs
- Int32KeyFrameCollection.cs
- XsdValidatingReader.cs
- DelegateSerializationHolder.cs
- GorillaCodec.cs
- TraceSection.cs
- MimeFormatter.cs
- CounterSampleCalculator.cs
- NamespaceMapping.cs
- DataGridHeaderBorder.cs
- HtmlTable.cs
- TabRenderer.cs
- log.cs
- xamlnodes.cs
- ZoneIdentityPermission.cs
- DataGridHeaderBorder.cs
- CheckBoxAutomationPeer.cs
- Inline.cs
- LayoutExceptionEventArgs.cs
- SystemWebCachingSectionGroup.cs
- SqlParameterizer.cs
- ToolStripItemClickedEventArgs.cs
- SafePEFileHandle.cs
- MembershipValidatePasswordEventArgs.cs
- PassportAuthenticationEventArgs.cs
- SimpleBitVector32.cs
- CacheSection.cs
- ControlParameter.cs
- ExtensionDataReader.cs
- RemotingSurrogateSelector.cs
- AnnotationAuthorChangedEventArgs.cs
- MultipleViewPatternIdentifiers.cs
- WebUtility.cs
- TextFormatter.cs
- ManagementOperationWatcher.cs
- _FtpControlStream.cs
- ToolStripContainer.cs
- CompoundFileDeflateTransform.cs
- StaticSiteMapProvider.cs
- Peer.cs
- ContextItem.cs
- StringAttributeCollection.cs
- GatewayDefinition.cs
- ListView.cs
- ExtensionSimplifierMarkupObject.cs
- CompressEmulationStream.cs
- RequiredFieldValidator.cs
- DiscoveryDocumentSearchPattern.cs
- DragEvent.cs
- DataGridViewAdvancedBorderStyle.cs
- DynamicRendererThreadManager.cs
- MtomMessageEncoder.cs
- ResourceContainer.cs
- SQLInt32Storage.cs
- CompilationRelaxations.cs
- Object.cs
- TripleDES.cs
- ADMembershipProvider.cs
- SelectionChangedEventArgs.cs
- GetPageCompletedEventArgs.cs
- EntityType.cs
- PartialList.cs
- DefaultSerializationProviderAttribute.cs
- ToolStripComboBox.cs
- PeerFlooder.cs
- Assert.cs
- RequestReplyCorrelator.cs
- MultiByteCodec.cs
- HTTPRemotingHandler.cs
- ObjectReaderCompiler.cs
- CompilerErrorCollection.cs
- HttpApplicationStateWrapper.cs
- FrameworkTemplate.cs
- Marshal.cs
- SystemWebCachingSectionGroup.cs
- MgmtConfigurationRecord.cs
- RoleGroup.cs
- LongMinMaxAggregationOperator.cs
- OutputCacheProfile.cs
- InputLanguageCollection.cs
- ColorAnimation.cs
- URLIdentityPermission.cs