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
- HelpKeywordAttribute.cs
- DBCommand.cs
- UnmanagedBitmapWrapper.cs
- XmlValidatingReaderImpl.cs
- WebPartVerbCollection.cs
- NeutralResourcesLanguageAttribute.cs
- ViewEventArgs.cs
- FixedHighlight.cs
- EdgeProfileValidation.cs
- Variable.cs
- ObjectDataSourceStatusEventArgs.cs
- PresentationTraceSources.cs
- XmlSchemaElement.cs
- MsmqQueue.cs
- RequiredFieldValidator.cs
- _LocalDataStoreMgr.cs
- InspectionWorker.cs
- LinqDataSourceContextEventArgs.cs
- OverflowException.cs
- COM2Enum.cs
- PolyLineSegment.cs
- IncrementalCompileAnalyzer.cs
- addressfiltermode.cs
- StylusTip.cs
- UnknownBitmapDecoder.cs
- AppDomainManager.cs
- PersianCalendar.cs
- MailAddressCollection.cs
- CompilerCollection.cs
- Permission.cs
- QueryInterceptorAttribute.cs
- FilterException.cs
- SHA512.cs
- SByteConverter.cs
- TreeNodeCollection.cs
- BitFlagsGenerator.cs
- MatrixAnimationBase.cs
- StylusSystemGestureEventArgs.cs
- _TLSstream.cs
- DataGridDetailsPresenter.cs
- AsymmetricKeyExchangeFormatter.cs
- CustomPopupPlacement.cs
- MessagePropertyDescription.cs
- XamlFigureLengthSerializer.cs
- PrivilegeNotHeldException.cs
- Pen.cs
- PrimitiveType.cs
- MaterialGroup.cs
- KeyToListMap.cs
- HtmlToClrEventProxy.cs
- MappingItemCollection.cs
- querybuilder.cs
- Process.cs
- Context.cs
- ShaderRenderModeValidation.cs
- DocumentXPathNavigator.cs
- RSAOAEPKeyExchangeDeformatter.cs
- unitconverter.cs
- ForeignKeyConstraint.cs
- OdbcUtils.cs
- UriSection.cs
- FlowPosition.cs
- InvokeMethodActivityDesigner.cs
- TranslateTransform.cs
- TransactionManager.cs
- RootBrowserWindow.cs
- ReaderContextStackData.cs
- TraceContext.cs
- InvalidFilterCriteriaException.cs
- RepeaterItemCollection.cs
- KernelTypeValidation.cs
- GlyphElement.cs
- CriticalHandle.cs
- AndCondition.cs
- NameHandler.cs
- RuntimeConfigLKG.cs
- Parameter.cs
- WorkerRequest.cs
- Selection.cs
- Registry.cs
- UnicastIPAddressInformationCollection.cs
- CustomTypeDescriptor.cs
- XPathMessageFilterElementComparer.cs
- TempEnvironment.cs
- Image.cs
- FileCodeGroup.cs
- FormsAuthenticationEventArgs.cs
- WinEventTracker.cs
- MessageLogger.cs
- ControlCachePolicy.cs
- TimeSpanParse.cs
- DataFormats.cs
- DataObjectAttribute.cs
- SqlNodeAnnotations.cs
- BufferedGraphicsContext.cs
- HtmlButton.cs
- RootProfilePropertySettingsCollection.cs
- GeneralTransform3DCollection.cs
- RightsManagementEncryptionTransform.cs
- ConstNode.cs