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
- xml.cs
- ConstraintStruct.cs
- DesignerToolboxInfo.cs
- WebConfigurationHost.cs
- RawStylusInput.cs
- GenericWebPart.cs
- TheQuery.cs
- ExpressionTable.cs
- ServicePointManager.cs
- ExtensionFile.cs
- TextModifier.cs
- Panel.cs
- DesignerInterfaces.cs
- EntityDataSourceSelectedEventArgs.cs
- Figure.cs
- Policy.cs
- TimeoutException.cs
- JsonByteArrayDataContract.cs
- MobileUserControlDesigner.cs
- LoginName.cs
- RadioButtonFlatAdapter.cs
- Latin1Encoding.cs
- DBConcurrencyException.cs
- XPathNavigatorKeyComparer.cs
- EntityProviderFactory.cs
- SecurityTokenProvider.cs
- JsonReaderDelegator.cs
- SimpleWorkerRequest.cs
- SpecularMaterial.cs
- EtwTrace.cs
- WebServiceResponse.cs
- Mouse.cs
- Matrix3D.cs
- CodeTryCatchFinallyStatement.cs
- ReadWriteObjectLock.cs
- BasicExpressionVisitor.cs
- CurrentTimeZone.cs
- TabletDevice.cs
- SemanticResultKey.cs
- MatchingStyle.cs
- AsymmetricKeyExchangeDeformatter.cs
- PreloadHost.cs
- Stackframe.cs
- AssertFilter.cs
- FunctionNode.cs
- XmlSchemaAll.cs
- HttpFileCollection.cs
- ParagraphVisual.cs
- WebResourceAttribute.cs
- Visitors.cs
- Perspective.cs
- ToolStripManager.cs
- Sql8ExpressionRewriter.cs
- DataGridViewTextBoxCell.cs
- CLSCompliantAttribute.cs
- SvcMapFile.cs
- Int32CollectionConverter.cs
- DataGridViewCellStyleConverter.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ArrayElementGridEntry.cs
- ExtendedProtectionPolicyTypeConverter.cs
- ElementProxy.cs
- WorkflowView.cs
- XsltOutput.cs
- GeometryDrawing.cs
- ConnectionConsumerAttribute.cs
- SplitContainer.cs
- CharKeyFrameCollection.cs
- TextPattern.cs
- mongolianshape.cs
- Pen.cs
- CompiledRegexRunnerFactory.cs
- StylusPointProperties.cs
- BufferedReceiveElement.cs
- XmlArrayItemAttribute.cs
- EnumerableRowCollection.cs
- AutoResetEvent.cs
- externdll.cs
- DispatcherSynchronizationContext.cs
- BooleanFacetDescriptionElement.cs
- EventBuilder.cs
- PreviewKeyDownEventArgs.cs
- UpdateCommand.cs
- MouseEvent.cs
- ProjectionCamera.cs
- _SslSessionsCache.cs
- LicenseException.cs
- Shape.cs
- XmlSerializationWriter.cs
- PathParser.cs
- RootBrowserWindowProxy.cs
- BuildProviderAppliesToAttribute.cs
- HostingEnvironmentException.cs
- XsltOutput.cs
- TreeNode.cs
- TextBreakpoint.cs
- PlanCompiler.cs
- ProgramNode.cs
- UndoManager.cs
- SynchronousChannelMergeEnumerator.cs