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
- BrowserCapabilitiesFactory35.cs
- ObfuscateAssemblyAttribute.cs
- StagingAreaInputItem.cs
- cookieexception.cs
- EventProviderWriter.cs
- Context.cs
- DateTimeParse.cs
- SafeViewOfFileHandle.cs
- SrgsElement.cs
- SvcMapFile.cs
- Tuple.cs
- DSACryptoServiceProvider.cs
- PrinterUnitConvert.cs
- Logging.cs
- StateMachine.cs
- ApplicationSecurityInfo.cs
- MobileResource.cs
- ExtensionQuery.cs
- LayoutDump.cs
- WhitespaceRuleReader.cs
- DetailsViewUpdateEventArgs.cs
- WindowsGraphicsWrapper.cs
- Membership.cs
- SqlClientFactory.cs
- MobileSysDescriptionAttribute.cs
- SettingsPropertyIsReadOnlyException.cs
- SoapIgnoreAttribute.cs
- NameValuePair.cs
- ContainerParagraph.cs
- TraceRecord.cs
- FontStyles.cs
- mactripleDES.cs
- IPAddressCollection.cs
- ToolStripPanelRow.cs
- XamlReaderHelper.cs
- SqlLiftWhereClauses.cs
- WebBrowser.cs
- TemporaryBitmapFile.cs
- IRCollection.cs
- SafeFileHandle.cs
- ServicesUtilities.cs
- NullRuntimeConfig.cs
- Vector.cs
- SqlVisitor.cs
- UrlMappingsSection.cs
- SqlDataReader.cs
- MatchingStyle.cs
- XmlBinaryReaderSession.cs
- BatchWriter.cs
- ManagementInstaller.cs
- DataGridViewColumn.cs
- OleDbStruct.cs
- XmlEnumAttribute.cs
- StandardTransformFactory.cs
- grammarelement.cs
- DocumentXPathNavigator.cs
- XslAst.cs
- TextSerializer.cs
- SchemaNames.cs
- AlgoModule.cs
- HTMLTextWriter.cs
- BulletDecorator.cs
- DetailsViewDeleteEventArgs.cs
- DataServiceRequestOfT.cs
- BoundPropertyEntry.cs
- Stopwatch.cs
- NonBatchDirectoryCompiler.cs
- SHA256.cs
- MultiView.cs
- LinqDataSourceContextEventArgs.cs
- ApplicationDirectoryMembershipCondition.cs
- Msec.cs
- ErrorWrapper.cs
- COM2ExtendedBrowsingHandler.cs
- MenuItemCollection.cs
- DataGridViewCellLinkedList.cs
- DataObjectFieldAttribute.cs
- SiteMapNodeCollection.cs
- FileDialogCustomPlace.cs
- ConfigXmlWhitespace.cs
- SingleTagSectionHandler.cs
- ContainerControl.cs
- XsltArgumentList.cs
- DelegateSerializationHolder.cs
- ConsumerConnectionPointCollection.cs
- NegatedCellConstant.cs
- SmtpNtlmAuthenticationModule.cs
- ArrayConverter.cs
- RightsManagementErrorHandler.cs
- TitleStyle.cs
- TextRangeEdit.cs
- EventPropertyMap.cs
- TextUtf8RawTextWriter.cs
- EntityDataSourceChangingEventArgs.cs
- Win32Native.cs
- FontStyle.cs
- ForeignKeyFactory.cs
- Line.cs
- SelectionEditingBehavior.cs
- SoapCommonClasses.cs