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
- RegistryDataKey.cs
- DefaultWorkflowSchedulerService.cs
- DrawTreeNodeEventArgs.cs
- SocketAddress.cs
- CustomCredentialPolicy.cs
- WebPartRestoreVerb.cs
- DocumentPageHost.cs
- IndependentAnimationStorage.cs
- CompiledQuery.cs
- KnownBoxes.cs
- DataGridViewLayoutData.cs
- MiniConstructorInfo.cs
- WorkflowElementDialog.cs
- ServicePointManagerElement.cs
- FormatSelectingMessageInspector.cs
- SafeArrayTypeMismatchException.cs
- UnsafeNativeMethods.cs
- OpacityConverter.cs
- SessionStateSection.cs
- XmlAtomErrorReader.cs
- Vector.cs
- WebPartEventArgs.cs
- SurrogateChar.cs
- AspCompat.cs
- TextTreeExtractElementUndoUnit.cs
- XmlQualifiedNameTest.cs
- SessionStateContainer.cs
- Byte.cs
- TypeLibConverter.cs
- CodeStatement.cs
- MasterPageCodeDomTreeGenerator.cs
- JoinGraph.cs
- DbException.cs
- ContractNamespaceAttribute.cs
- connectionpool.cs
- NavigationProperty.cs
- TableRowCollection.cs
- BindingContext.cs
- DiagnosticStrings.cs
- HtmlImage.cs
- XXXInfos.cs
- DataGridViewComboBoxCell.cs
- SecurityElement.cs
- HelpProvider.cs
- HideDisabledControlAdapter.cs
- PackagingUtilities.cs
- TypeRestriction.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- UInt16Storage.cs
- RtfControlWordInfo.cs
- BitmapDecoder.cs
- NetCodeGroup.cs
- FontFamily.cs
- ProxyWebPart.cs
- InputBinding.cs
- SettingsPropertyValueCollection.cs
- SafeArchiveContext.cs
- HtmlWindow.cs
- ExceptionRoutedEventArgs.cs
- IImplicitResourceProvider.cs
- Header.cs
- RoleExceptions.cs
- FormViewAutoFormat.cs
- InkCanvasAutomationPeer.cs
- DeleteBookmarkScope.cs
- odbcmetadatacolumnnames.cs
- Stylesheet.cs
- ProfileGroupSettings.cs
- ExtendedProperty.cs
- GraphicsContainer.cs
- FormatException.cs
- TraceSwitch.cs
- wgx_commands.cs
- DataControlImageButton.cs
- TypeElement.cs
- TextElementCollectionHelper.cs
- ValueSerializerAttribute.cs
- SqlFormatter.cs
- ResXDataNode.cs
- OpenFileDialog.cs
- externdll.cs
- Cursors.cs
- NamespaceList.cs
- SingletonChannelAcceptor.cs
- ZipFileInfoCollection.cs
- SrgsRulesCollection.cs
- GenericPrincipal.cs
- BamlLocalizableResource.cs
- DateTimeParse.cs
- ProtocolsConfiguration.cs
- LocalizedNameDescriptionPair.cs
- GenericTypeParameterBuilder.cs
- IDispatchConstantAttribute.cs
- NativeMethods.cs
- Container.cs
- AppDomainInfo.cs
- NavigatingCancelEventArgs.cs
- ClrProviderManifest.cs
- SqlVisitor.cs
- ContractComponent.cs