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
- DocumentViewerBaseAutomationPeer.cs
- CompositeActivityDesigner.cs
- Cloud.cs
- EncoderExceptionFallback.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- ArraySortHelper.cs
- ManagementScope.cs
- TypeSystem.cs
- SoapFault.cs
- LinqDataView.cs
- ScrollItemPatternIdentifiers.cs
- ILGenerator.cs
- XmlChoiceIdentifierAttribute.cs
- ObjectResult.cs
- CheckBoxStandardAdapter.cs
- PingReply.cs
- DocumentApplicationJournalEntry.cs
- StrongNameHelpers.cs
- FileVersion.cs
- ITextView.cs
- X509SecurityTokenAuthenticator.cs
- ThicknessConverter.cs
- SamlConditions.cs
- RegistryConfigurationProvider.cs
- PropertyGroupDescription.cs
- DataGridViewCellMouseEventArgs.cs
- oledbmetadatacollectionnames.cs
- UIElementIsland.cs
- Debug.cs
- PageAdapter.cs
- HttpCapabilitiesBase.cs
- DataStreams.cs
- _SingleItemRequestCache.cs
- Terminate.cs
- RefreshEventArgs.cs
- OrderedEnumerableRowCollection.cs
- XmlAttributeProperties.cs
- ResourcePool.cs
- VersionedStream.cs
- DataSetFieldSchema.cs
- Visitors.cs
- RtfToXamlReader.cs
- XmlLanguageConverter.cs
- DataSourceXmlAttributeAttribute.cs
- SchemaTableOptionalColumn.cs
- SecurityDescriptor.cs
- PackageDigitalSignatureManager.cs
- RowUpdatedEventArgs.cs
- InputReferenceExpression.cs
- PeerUnsafeNativeCryptMethods.cs
- FileStream.cs
- XpsSerializationManagerAsync.cs
- RenderData.cs
- XmlSchemaAny.cs
- HeaderCollection.cs
- EncodingDataItem.cs
- DateTimeOffsetAdapter.cs
- DataGridViewIntLinkedList.cs
- PropertyIdentifier.cs
- SessionPageStateSection.cs
- XmlSchemaDocumentation.cs
- Monitor.cs
- TrackingServices.cs
- DescendantQuery.cs
- RefExpr.cs
- FileSecurity.cs
- OrderByLifter.cs
- SortKey.cs
- JoinCqlBlock.cs
- MimeObjectFactory.cs
- FocusTracker.cs
- SystemIPAddressInformation.cs
- GB18030Encoding.cs
- TouchDevice.cs
- BufferedWebEventProvider.cs
- IUnknownConstantAttribute.cs
- WorkflowApplicationAbortedEventArgs.cs
- XmlEncoding.cs
- IriParsingElement.cs
- SafeThreadHandle.cs
- MainMenu.cs
- TextReader.cs
- DbProviderFactory.cs
- RemotingException.cs
- GetPageNumberCompletedEventArgs.cs
- IisTraceWebEventProvider.cs
- ResourceDescriptionAttribute.cs
- NamespaceInfo.cs
- PromptStyle.cs
- BitmapFrame.cs
- DataRecord.cs
- PseudoWebRequest.cs
- ContainerAction.cs
- DockPattern.cs
- MergeLocalizationDirectives.cs
- TemplateParser.cs
- ResourceManagerWrapper.cs
- EmptyStringExpandableObjectConverter.cs
- ObjectQuery.cs
- Converter.cs