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
- AdornerLayer.cs
- MailBnfHelper.cs
- mediaeventshelper.cs
- MarkedHighlightComponent.cs
- CellPartitioner.cs
- COM2PropertyDescriptor.cs
- _HeaderInfo.cs
- SQLCharsStorage.cs
- Stackframe.cs
- LineInfo.cs
- UnSafeCharBuffer.cs
- KeyValuePair.cs
- FixedTextContainer.cs
- CustomCategoryAttribute.cs
- EventProviderWriter.cs
- SoapServerProtocol.cs
- SystemResourceKey.cs
- XmlQueryOutput.cs
- TagPrefixCollection.cs
- HtmlControl.cs
- RootAction.cs
- ExpressionLink.cs
- ActivityDesignerResources.cs
- Subtree.cs
- IPHostEntry.cs
- HtmlInputHidden.cs
- ConfigurationElement.cs
- IsolatedStorageFileStream.cs
- ListItemCollection.cs
- DbProviderFactoriesConfigurationHandler.cs
- KeyEventArgs.cs
- GetPageCompletedEventArgs.cs
- ContentElement.cs
- DesignOnlyAttribute.cs
- XPathSingletonIterator.cs
- SelectionListComponentEditor.cs
- Panel.cs
- SetIndexBinder.cs
- infer.cs
- AuthenticatingEventArgs.cs
- IndexerNameAttribute.cs
- IApplicationTrustManager.cs
- Attributes.cs
- ConfigurationFileMap.cs
- CultureInfoConverter.cs
- AttributeSetAction.cs
- Pair.cs
- Button.cs
- HttpCookieCollection.cs
- CodeBinaryOperatorExpression.cs
- ListControlDataBindingHandler.cs
- linebase.cs
- CryptoConfig.cs
- IntSumAggregationOperator.cs
- MeshGeometry3D.cs
- EasingKeyFrames.cs
- TargetParameterCountException.cs
- ControlEvent.cs
- SoapWriter.cs
- HitTestParameters3D.cs
- D3DImage.cs
- HwndMouseInputProvider.cs
- InternalPermissions.cs
- DocumentXPathNavigator.cs
- Message.cs
- LoginStatusDesigner.cs
- BamlLocalizableResourceKey.cs
- ScrollData.cs
- PasswordRecovery.cs
- ProcessHostConfigUtils.cs
- CodeTryCatchFinallyStatement.cs
- ObjRef.cs
- RenamedEventArgs.cs
- MessagingDescriptionAttribute.cs
- NamespaceEmitter.cs
- ListBoxItem.cs
- RectAnimation.cs
- ImageClickEventArgs.cs
- VerticalAlignConverter.cs
- KoreanCalendar.cs
- Peer.cs
- SequentialOutput.cs
- UIElementPropertyUndoUnit.cs
- Int64Storage.cs
- CookieProtection.cs
- WindowsTreeView.cs
- BrowserInteropHelper.cs
- SqlUserDefinedAggregateAttribute.cs
- WeakReadOnlyCollection.cs
- SortKey.cs
- DynamicPropertyReader.cs
- XsdCachingReader.cs
- GregorianCalendarHelper.cs
- SqlEnums.cs
- ElementUtil.cs
- MaterializeFromAtom.cs
- XmlResolver.cs
- SQLBoolean.cs
- NetworkStream.cs
- LocalizationComments.cs