Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- SqlUtils.cs
- PropertyPushdownHelper.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- formatter.cs
- SelectedDatesCollection.cs
- SimpleApplicationHost.cs
- RoleGroup.cs
- DictionaryBase.cs
- SymbolUsageManager.cs
- ClientSettings.cs
- Lease.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- EntityDataSource.cs
- path.cs
- BrowserCapabilitiesCodeGenerator.cs
- DisplayInformation.cs
- Typography.cs
- TypeName.cs
- WindowsPen.cs
- ResourceContainerWrapper.cs
- RequestCacheValidator.cs
- PropertyEntry.cs
- CommentGlyph.cs
- DocumentsTrace.cs
- BitmapEffectInputConnector.cs
- OdbcParameter.cs
- TextEditorParagraphs.cs
- PropertyGeneratedEventArgs.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- SiteOfOriginPart.cs
- ListChangedEventArgs.cs
- ListViewItemSelectionChangedEvent.cs
- FormViewModeEventArgs.cs
- ParsedAttributeCollection.cs
- WebService.cs
- XmlTextEncoder.cs
- WpfWebRequestHelper.cs
- ColorTransformHelper.cs
- GeneralTransform2DTo3D.cs
- InvalidCardException.cs
- Variable.cs
- RegexRunner.cs
- ProfessionalColors.cs
- CompilerResults.cs
- DataControlImageButton.cs
- TransactionScopeDesigner.cs
- HttpConfigurationContext.cs
- Label.cs
- TextDecorationLocationValidation.cs
- ProfilePropertyMetadata.cs
- TraceRecord.cs
- ScrollChrome.cs
- DesignerVerb.cs
- TextViewBase.cs
- AnnotationService.cs
- XmlSerializerAssemblyAttribute.cs
- StateMachineWorkflowInstance.cs
- StorageRoot.cs
- StrokeIntersection.cs
- CodeNamespaceImportCollection.cs
- XMLSchema.cs
- ApplyTemplatesAction.cs
- BufferBuilder.cs
- Sentence.cs
- XmlSerializerAssemblyAttribute.cs
- IdentityNotMappedException.cs
- CustomAssemblyResolver.cs
- ScaleTransform3D.cs
- LostFocusEventManager.cs
- BamlBinaryWriter.cs
- OdbcReferenceCollection.cs
- WebServiceMethodData.cs
- DataListItemEventArgs.cs
- ContentPlaceHolderDesigner.cs
- TextElementEditingBehaviorAttribute.cs
- TriState.cs
- SecurityAlgorithmSuiteConverter.cs
- DrawingImage.cs
- EdmType.cs
- TemplateLookupAction.cs
- PhysicalFontFamily.cs
- ConfigurationValues.cs
- GeneratedContractType.cs
- OleDbException.cs
- PseudoWebRequest.cs
- DataContractSerializerOperationGenerator.cs
- EntityClassGenerator.cs
- MenuBindingsEditor.cs
- URLAttribute.cs
- ProfileBuildProvider.cs
- QueryCursorEventArgs.cs
- LocatorGroup.cs
- PeerCollaborationPermission.cs
- Script.cs
- ValidationHelpers.cs
- PersonalizableTypeEntry.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- LockedAssemblyCache.cs
- ContextMenu.cs
- TextInfo.cs