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
- StaticContext.cs
- ConfigXmlAttribute.cs
- StringWriter.cs
- BaseValidatorDesigner.cs
- ProgressBarRenderer.cs
- WebControl.cs
- StateDesigner.cs
- BaseCAMarshaler.cs
- DataSourceControl.cs
- TextRangeEditLists.cs
- SectionVisual.cs
- DynamicExpression.cs
- EventLog.cs
- UserNameSecurityToken.cs
- BaseParser.cs
- RecognitionResult.cs
- MessageLoggingElement.cs
- DerivedKeySecurityToken.cs
- CodeBinaryOperatorExpression.cs
- ListBase.cs
- XmlBinaryReader.cs
- ObjectListItem.cs
- SizeValueSerializer.cs
- TableItemStyle.cs
- CompilerResults.cs
- AdapterUtil.cs
- AppDomainAttributes.cs
- SecUtil.cs
- OdbcConnectionPoolProviderInfo.cs
- PageHandlerFactory.cs
- MemoryFailPoint.cs
- ListControl.cs
- assertwrapper.cs
- LambdaCompiler.Logical.cs
- SafeCryptContextHandle.cs
- NamespaceCollection.cs
- QueryOperationResponseOfT.cs
- UnmanagedBitmapWrapper.cs
- ReadOnlyDataSource.cs
- TransformPatternIdentifiers.cs
- DoubleLinkList.cs
- PointKeyFrameCollection.cs
- XmlSchema.cs
- UiaCoreProviderApi.cs
- DataRelation.cs
- RectConverter.cs
- PropertyMappingExceptionEventArgs.cs
- Speller.cs
- SafeEventLogWriteHandle.cs
- GenericTypeParameterBuilder.cs
- WebPartZone.cs
- SoundPlayer.cs
- Helpers.cs
- xmlNames.cs
- DeleteWorkflowOwnerCommand.cs
- View.cs
- _SSPISessionCache.cs
- CompiledQuery.cs
- XamlUtilities.cs
- SHA384Managed.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- MostlySingletonList.cs
- InputBuffer.cs
- WebPartTransformerAttribute.cs
- ClientRuntimeConfig.cs
- SoapFormatter.cs
- TabControl.cs
- DesignTimeXamlWriter.cs
- _ListenerResponseStream.cs
- Assembly.cs
- ContentElement.cs
- GlyphRunDrawing.cs
- EditorPartCollection.cs
- ColumnProvider.cs
- TextFindEngine.cs
- PersonalizationProviderCollection.cs
- PersonalizationProviderCollection.cs
- MenuCommandService.cs
- SamlSubjectStatement.cs
- BitmapMetadataBlob.cs
- ResolvedKeyFrameEntry.cs
- ProtocolsConfigurationEntry.cs
- ContainerSelectorActiveEvent.cs
- TransactedBatchingElement.cs
- EntityReference.cs
- XmlNavigatorStack.cs
- BamlLocalizableResourceKey.cs
- TokenBasedSet.cs
- WebPartAddingEventArgs.cs
- __FastResourceComparer.cs
- PageContent.cs
- Asn1Utilities.cs
- AsyncSerializedWorker.cs
- ArrangedElement.cs
- DbMetaDataColumnNames.cs
- xsdvalidator.cs
- SimpleBitVector32.cs
- SchemaImporter.cs
- Gdiplus.cs
- Zone.cs