Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Input / Stylus / StylusSystemGestureEventArgs.cs / 1 / StylusSystemGestureEventArgs.cs
using System; using System.Collections; using System.ComponentModel; using System.Windows.Media; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Input { ///////////////////////////////////////////////////////////////////////// ////// The StylusSystemGestureEventArgs class provides access to the logical /// Stylus device for all derived event args. /// public class StylusSystemGestureEventArgs : StylusEventArgs { ///////////////////////////////////////////////////////////////////// ////// Initializes a new instance of the StylusSystemGestureEventArgs class. /// /// /// The logical Stylus device associated with this event. /// /// /// The time when the input occured. /// /// /// The type of system gesture. /// public StylusSystemGestureEventArgs( StylusDevice stylusDevice, int timestamp, SystemGesture systemGesture) : base(stylusDevice, timestamp) { if (systemGesture != SystemGesture.Tap && systemGesture != SystemGesture.RightTap && systemGesture != SystemGesture.Drag && systemGesture != SystemGesture.RightDrag && systemGesture != SystemGesture.HoldEnter && systemGesture != SystemGesture.HoldLeave && systemGesture != SystemGesture.HoverEnter && systemGesture != SystemGesture.HoverLeave && systemGesture != SystemGesture.None) { throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, "systemGesture")); } _id = systemGesture; } ///////////////////////////////////////////////////////////////////// ////// Initializes a new instance of the StylusSystemGestureEventArgs class. /// /// /// The logical Stylus device associated with this event. /// /// /// The time when the input occured. /// /// /// The type of system gesture. /// /// /// The X location reported with this system gesture. In tablet /// device coordinates. /// /// /// The Y location reported with this system gesture. In tablet /// device coordinates. /// /// /// The button state at the time of the system gesture. /// Note: A flick gesture will pass the flick data in the parameter. /// internal StylusSystemGestureEventArgs( StylusDevice stylusDevice, int timestamp, SystemGesture systemGesture, int gestureX, int gestureY, int buttonState) : base(stylusDevice, timestamp) { if (systemGesture != SystemGesture.Tap && systemGesture != SystemGesture.RightTap && systemGesture != SystemGesture.Drag && systemGesture != SystemGesture.RightDrag && systemGesture != SystemGesture.HoldEnter && systemGesture != SystemGesture.HoldLeave && systemGesture != SystemGesture.HoverEnter && systemGesture != SystemGesture.HoverLeave && systemGesture != SystemGesture.Flick && systemGesture != SystemGesture.None) { throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, "systemGesture")); } _id = systemGesture; _buttonState = buttonState; _gestureX = gestureX; _gestureY = gestureY; } ///////////////////////////////////////////////////////////////////// ////// Field to retrieve which gesture occurred. /// public SystemGesture SystemGesture { get { return _id; } } ///////////////////////////////////////////////////////////////////// ////// Field to retrieve the button state reported with this /// system gesture. /// /// NOTE: For a Flick gesture this param contains the flick /// and not the button state. /// internal int ButtonState { get { return _buttonState; } } ///////////////////////////////////////////////////////////////////// ////// Field to retrieve the X location of the system gesture. /// This is in tablet device coordinates. /// internal int GestureX { get { return _gestureX; } } ///////////////////////////////////////////////////////////////////// ////// Field to retrieve the Y location of the system gesture. /// This is in tablet device coordinates. /// internal int GestureY { get { return _gestureY; } } ///////////////////////////////////////////////////////////////////// ////// 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) { StylusSystemGestureEventHandler handler = (StylusSystemGestureEventHandler) genericHandler; handler(genericTarget, this); } ///////////////////////////////////////////////////////////////////// SystemGesture _id; int _buttonState; int _gestureX; int _gestureY; } } // 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
- DurableInstancingOptions.cs
- DocumentOrderQuery.cs
- Transactions.cs
- _HelperAsyncResults.cs
- TypeConverter.cs
- ToolZone.cs
- _ChunkParse.cs
- PointConverter.cs
- VirtualizedContainerService.cs
- BufferedGraphicsContext.cs
- TransactionFlowOption.cs
- PassportAuthentication.cs
- PrintDialog.cs
- CodeDirectoryCompiler.cs
- TaiwanLunisolarCalendar.cs
- SafeHandle.cs
- Keywords.cs
- KeyEvent.cs
- RequestCache.cs
- Win32SafeHandles.cs
- HtmlFormParameterReader.cs
- HttpModulesSection.cs
- FatalException.cs
- DeferredTextReference.cs
- ReliableReplySessionChannel.cs
- bidPrivateBase.cs
- MappingModelBuildProvider.cs
- DoubleIndependentAnimationStorage.cs
- ResXFileRef.cs
- DesignerTransactionCloseEvent.cs
- Int64AnimationUsingKeyFrames.cs
- SessionEndedEventArgs.cs
- querybuilder.cs
- EtwProvider.cs
- EncryptedPackage.cs
- AsyncStreamReader.cs
- XDRSchema.cs
- ToolStripSeparator.cs
- documentsequencetextpointer.cs
- xsdvalidator.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- Base64Stream.cs
- Document.cs
- DetailsView.cs
- ComponentSerializationService.cs
- StorageModelBuildProvider.cs
- KeyedCollection.cs
- SchemaImporterExtensionsSection.cs
- ClientType.cs
- PrincipalPermission.cs
- FileUtil.cs
- SafeProcessHandle.cs
- WeakReferenceEnumerator.cs
- AssemblyEvidenceFactory.cs
- SqlWorkflowPersistenceService.cs
- SingleAnimationUsingKeyFrames.cs
- BamlTreeMap.cs
- DataGridViewSortCompareEventArgs.cs
- PropertyPushdownHelper.cs
- IdentityHolder.cs
- Configuration.cs
- EventSetter.cs
- MarkerProperties.cs
- _ChunkParse.cs
- Size3DValueSerializer.cs
- NativeBuffer.cs
- cookiecontainer.cs
- StrongName.cs
- httpapplicationstate.cs
- CompilerWrapper.cs
- QilExpression.cs
- Perspective.cs
- WorkflowValidationFailedException.cs
- AnnotationComponentChooser.cs
- CharEntityEncoderFallback.cs
- LoginView.cs
- TextElementEnumerator.cs
- EncodingFallbackAwareXmlTextWriter.cs
- VisualProxy.cs
- XmlnsCache.cs
- HTMLTagNameToTypeMapper.cs
- ObjectListCommandEventArgs.cs
- OracleParameter.cs
- Messages.cs
- AdornerHitTestResult.cs
- ISAPIWorkerRequest.cs
- DictionaryContent.cs
- CancelEventArgs.cs
- UpDownEvent.cs
- OutOfProcStateClientManager.cs
- XpsS0ValidatingLoader.cs
- SoapSchemaMember.cs
- Latin1Encoding.cs
- Compiler.cs
- FreezableOperations.cs
- DispatcherFrame.cs
- DataGridRelationshipRow.cs
- VisualBrush.cs
- WebPartConnectionsConfigureVerb.cs
- RequestQueue.cs