Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / StylusOverProperty.cs / 1305600 / StylusOverProperty.cs
using System; using System.Windows.Input; using MS.Internal.KnownBoxes; namespace System.Windows { ///////////////////////////////////////////////////////////////////////// internal class StylusOverProperty : ReverseInheritProperty { ///////////////////////////////////////////////////////////////////// internal StylusOverProperty() : base( UIElement.IsStylusOverPropertyKey, CoreFlags.IsStylusOverCache, CoreFlags.IsStylusOverChanged) { } ///////////////////////////////////////////////////////////////////// internal override void FireNotifications(UIElement uie, ContentElement ce, UIElement3D uie3D, bool oldValue) { // This is all very sketchy... // // Tablet can support multiple stylus devices concurrently. They can each // be over a different element. They all update the IsStylusOver property, // which calls into here, but ends up using the "current" stylus device, // instead of each using their own device. Worse, all of these will end up // writing to the same bits in the UIElement. They are going to step all over // each other. if(Stylus.CurrentStylusDevice == null) { return; } StylusEventArgs stylusEventArgs = new StylusEventArgs(Stylus.CurrentStylusDevice, Environment.TickCount); stylusEventArgs.RoutedEvent = oldValue ? Stylus.StylusLeaveEvent : Stylus.StylusEnterEvent; if (uie != null) { uie.RaiseEvent(stylusEventArgs); } else if (ce != null) { ce.RaiseEvent(stylusEventArgs); } else if (uie3D != null) { uie3D.RaiseEvent(stylusEventArgs); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Windows.Input; using MS.Internal.KnownBoxes; namespace System.Windows { ///////////////////////////////////////////////////////////////////////// internal class StylusOverProperty : ReverseInheritProperty { ///////////////////////////////////////////////////////////////////// internal StylusOverProperty() : base( UIElement.IsStylusOverPropertyKey, CoreFlags.IsStylusOverCache, CoreFlags.IsStylusOverChanged) { } ///////////////////////////////////////////////////////////////////// internal override void FireNotifications(UIElement uie, ContentElement ce, UIElement3D uie3D, bool oldValue) { // This is all very sketchy... // // Tablet can support multiple stylus devices concurrently. They can each // be over a different element. They all update the IsStylusOver property, // which calls into here, but ends up using the "current" stylus device, // instead of each using their own device. Worse, all of these will end up // writing to the same bits in the UIElement. They are going to step all over // each other. if(Stylus.CurrentStylusDevice == null) { return; } StylusEventArgs stylusEventArgs = new StylusEventArgs(Stylus.CurrentStylusDevice, Environment.TickCount); stylusEventArgs.RoutedEvent = oldValue ? Stylus.StylusLeaveEvent : Stylus.StylusEnterEvent; if (uie != null) { uie.RaiseEvent(stylusEventArgs); } else if (ce != null) { ce.RaiseEvent(stylusEventArgs); } else if (uie3D != null) { uie3D.RaiseEvent(stylusEventArgs); } } } } // 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
- KeyInterop.cs
- PasswordBox.cs
- LocalizationParserHooks.cs
- BufferModesCollection.cs
- TemplatedWizardStep.cs
- MouseWheelEventArgs.cs
- WebBrowserNavigatedEventHandler.cs
- DetailsViewInsertedEventArgs.cs
- XmlComment.cs
- ViewEventArgs.cs
- BindableTemplateBuilder.cs
- ClockController.cs
- WebBaseEventKeyComparer.cs
- SystemWebCachingSectionGroup.cs
- HtmlTextViewAdapter.cs
- SerializationFieldInfo.cs
- SoapElementAttribute.cs
- RunInstallerAttribute.cs
- DeviceContext2.cs
- Line.cs
- ConstraintCollection.cs
- ProxyWebPart.cs
- PageContent.cs
- safesecurityhelperavalon.cs
- PositiveTimeSpanValidatorAttribute.cs
- BamlVersionHeader.cs
- AsymmetricAlgorithm.cs
- WhereaboutsReader.cs
- Vector3DValueSerializer.cs
- ArithmeticException.cs
- SocketElement.cs
- TraceUtility.cs
- DoubleAnimationBase.cs
- TextTreeInsertElementUndoUnit.cs
- OdbcCommand.cs
- ListParagraph.cs
- SettingsPropertyIsReadOnlyException.cs
- messageonlyhwndwrapper.cs
- PartialTrustHelpers.cs
- GetUserPreferenceRequest.cs
- FlatButtonAppearance.cs
- OrderedParallelQuery.cs
- PartialArray.cs
- DateTimeParse.cs
- TraceContextRecord.cs
- SafeCryptContextHandle.cs
- ProcessInfo.cs
- Scene3D.cs
- CatalogZoneDesigner.cs
- XPathDocumentBuilder.cs
- ComplexTypeEmitter.cs
- _StreamFramer.cs
- OdbcEnvironmentHandle.cs
- SignedPkcs7.cs
- DataSourceControlBuilder.cs
- HwndHostAutomationPeer.cs
- MeshGeometry3D.cs
- MatrixCamera.cs
- SqlWebEventProvider.cs
- PersonalizationDictionary.cs
- BitmapEffectInput.cs
- Evaluator.cs
- IdleTimeoutMonitor.cs
- ProgressBarAutomationPeer.cs
- WebPartConnectionsCancelVerb.cs
- DecoderReplacementFallback.cs
- CacheVirtualItemsEvent.cs
- CleanUpVirtualizedItemEventArgs.cs
- Monitor.cs
- UnmanagedMemoryStream.cs
- PermissionToken.cs
- ComEventsMethod.cs
- XmlSchemaDatatype.cs
- EmbeddedMailObjectCollectionEditor.cs
- BinaryObjectInfo.cs
- AuthenticationConfig.cs
- CacheDependency.cs
- Compiler.cs
- InputEventArgs.cs
- coordinator.cs
- MissingMethodException.cs
- BackStopAuthenticationModule.cs
- ApplicationSecurityInfo.cs
- FormsAuthenticationTicket.cs
- KeyGesture.cs
- TreeNode.cs
- MimePart.cs
- UnsafeNativeMethods.cs
- GenericParameterDataContract.cs
- DecoderNLS.cs
- SecurityDocument.cs
- EditorPart.cs
- MetadataFile.cs
- SecurityManager.cs
- Codec.cs
- MsmqIntegrationValidationBehavior.cs
- ISAPIWorkerRequest.cs
- XmlMembersMapping.cs
- DataGridViewSelectedCellCollection.cs
- Inflater.cs