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
- XmlReaderSettings.cs
- ValidateNames.cs
- MetadataUtil.cs
- hresults.cs
- MenuEventArgs.cs
- CryptoKeySecurity.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ProviderConnectionPoint.cs
- PointHitTestParameters.cs
- ThumbButtonInfoCollection.cs
- TextSimpleMarkerProperties.cs
- FloatUtil.cs
- XamlLoadErrorInfo.cs
- OciHandle.cs
- TagMapCollection.cs
- ThumbAutomationPeer.cs
- MulticastNotSupportedException.cs
- ColorKeyFrameCollection.cs
- _BaseOverlappedAsyncResult.cs
- EncodingDataItem.cs
- TraceEventCache.cs
- WinHttpWebProxyFinder.cs
- CompoundFileStorageReference.cs
- GridViewDeleteEventArgs.cs
- HtmlButton.cs
- Descriptor.cs
- XmlSchemaAttributeGroupRef.cs
- DeleteIndexBinder.cs
- itemelement.cs
- StrokeIntersection.cs
- DispatcherEventArgs.cs
- SqlRemoveConstantOrderBy.cs
- CubicEase.cs
- CollectionViewGroupInternal.cs
- SvcMapFileSerializer.cs
- Process.cs
- GeneralTransformGroup.cs
- CodeDirectiveCollection.cs
- Size3D.cs
- WeakHashtable.cs
- WebEventTraceProvider.cs
- MarkedHighlightComponent.cs
- UndoManager.cs
- SizeChangedEventArgs.cs
- TdsEnums.cs
- PageContentCollection.cs
- Codec.cs
- ParagraphResult.cs
- CustomCategoryAttribute.cs
- Label.cs
- DataGridViewMethods.cs
- IIS7WorkerRequest.cs
- EntityDataSourceConfigureObjectContext.cs
- ArrayList.cs
- LinqDataSourceDisposeEventArgs.cs
- PackagingUtilities.cs
- QuestionEventArgs.cs
- PeerObject.cs
- StringToken.cs
- Form.cs
- XmlSchemaAll.cs
- ScriptingJsonSerializationSection.cs
- HuffmanTree.cs
- WhitespaceRuleReader.cs
- ValueQuery.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- SamlAssertionDirectKeyIdentifierClause.cs
- DataGridViewCellPaintingEventArgs.cs
- WpfGeneratedKnownTypes.cs
- SharedDp.cs
- RoleService.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- GeometryHitTestResult.cs
- Update.cs
- sqlcontext.cs
- filewebrequest.cs
- SessionPageStateSection.cs
- DiscardableAttribute.cs
- DropDownButton.cs
- SqlInternalConnectionTds.cs
- PhysicalFontFamily.cs
- ListViewItemEventArgs.cs
- MarkupObject.cs
- SRGSCompiler.cs
- Splitter.cs
- FederatedMessageSecurityOverHttpElement.cs
- SyndicationContent.cs
- StrongNameUtility.cs
- ChannelHandler.cs
- XmlQueryCardinality.cs
- CompleteWizardStep.cs
- BaseAddressPrefixFilterElement.cs
- ExeConfigurationFileMap.cs
- SortedSetDebugView.cs
- ConsumerConnectionPointCollection.cs
- ColumnMapTranslator.cs
- _BasicClient.cs
- Point3DAnimationUsingKeyFrames.cs
- SecurityDescriptor.cs
- DependencyPropertyKind.cs