Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / StylusOverProperty.cs / 1 / 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
- PointAnimationUsingPath.cs
- bidPrivateBase.cs
- TranslateTransform.cs
- ToolStripMenuItem.cs
- LingerOption.cs
- columnmapkeybuilder.cs
- DeclaredTypeElementCollection.cs
- ContainsSearchOperator.cs
- ProxyDataContractResolver.cs
- TrustLevelCollection.cs
- LocalFileSettingsProvider.cs
- QilFunction.cs
- CryptoConfig.cs
- RemoteDebugger.cs
- UserControl.cs
- CollectionAdapters.cs
- MissingFieldException.cs
- InvalidEnumArgumentException.cs
- Statements.cs
- ClientBuildManager.cs
- XmlIgnoreAttribute.cs
- ValidationError.cs
- Thread.cs
- SimpleWebHandlerParser.cs
- HttpCapabilitiesEvaluator.cs
- CriticalHandle.cs
- ResourceContainerWrapper.cs
- WinEventTracker.cs
- CustomPeerResolverService.cs
- WebPartTransformerAttribute.cs
- AddressAccessDeniedException.cs
- DeflateStream.cs
- ComNativeDescriptor.cs
- CryptoHandle.cs
- SelectionHighlightInfo.cs
- XmlQualifiedNameTest.cs
- PrimitiveSchema.cs
- ServicePointManagerElement.cs
- DefaultWorkflowTransactionService.cs
- HuffmanTree.cs
- XmlSignificantWhitespace.cs
- EventOpcode.cs
- RootBrowserWindowAutomationPeer.cs
- XmlSerializer.cs
- DriveNotFoundException.cs
- ControlParameter.cs
- XmlSchemaSequence.cs
- CapiHashAlgorithm.cs
- MessageQueueException.cs
- ArraySubsetEnumerator.cs
- TraceProvider.cs
- _TransmitFileOverlappedAsyncResult.cs
- FrameworkContextData.cs
- TextViewBase.cs
- ReadOnlyHierarchicalDataSource.cs
- AuthenticationManager.cs
- AddressAlreadyInUseException.cs
- HostingPreferredMapPath.cs
- Encoder.cs
- BamlReader.cs
- PersistencePipeline.cs
- ServiceMetadataContractBehavior.cs
- GregorianCalendar.cs
- SizeKeyFrameCollection.cs
- URL.cs
- ListBoxAutomationPeer.cs
- BrowserInteropHelper.cs
- NotFiniteNumberException.cs
- XPathNavigatorKeyComparer.cs
- DataObjectCopyingEventArgs.cs
- StateBag.cs
- Helper.cs
- PerspectiveCamera.cs
- PenLineCapValidation.cs
- CorrelationManager.cs
- AnimationClock.cs
- TemplatePagerField.cs
- XmlTypeAttribute.cs
- InvalidTimeZoneException.cs
- DbConnectionPool.cs
- CommandDesigner.cs
- WS2007HttpBindingCollectionElement.cs
- Crc32Helper.cs
- ValidatorUtils.cs
- Latin1Encoding.cs
- UDPClient.cs
- FileSystemInfo.cs
- TableHeaderCell.cs
- AsyncResult.cs
- MailAddress.cs
- ItemDragEvent.cs
- NextPreviousPagerField.cs
- SHA512CryptoServiceProvider.cs
- wgx_exports.cs
- NullableDoubleAverageAggregationOperator.cs
- DbParameterCollection.cs
- Activity.cs
- MenuCommand.cs
- DbMetaDataFactory.cs
- TextTreeTextElementNode.cs