Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- DataViewSettingCollection.cs
- _AutoWebProxyScriptWrapper.cs
- FakeModelPropertyImpl.cs
- TextTreeNode.cs
- WinEventWrap.cs
- ScriptReferenceBase.cs
- StringKeyFrameCollection.cs
- StatusStrip.cs
- QilInvokeLateBound.cs
- ProfilePropertySettings.cs
- SessionStateContainer.cs
- GatewayIPAddressInformationCollection.cs
- SchemaLookupTable.cs
- SerializerDescriptor.cs
- AutomationPropertyInfo.cs
- ViewPort3D.cs
- SqlBuffer.cs
- NamedPermissionSet.cs
- ExpressionBuilder.cs
- DCSafeHandle.cs
- ObjectIDGenerator.cs
- InvalidCommandTreeException.cs
- Italic.cs
- _ConnectionGroup.cs
- GeometryValueSerializer.cs
- OptimalBreakSession.cs
- EditorPartChrome.cs
- GeometryCombineModeValidation.cs
- AssemblyAssociatedContentFileAttribute.cs
- TextOptionsInternal.cs
- PermissionSetEnumerator.cs
- RegistryConfigurationProvider.cs
- DateTimeFormatInfo.cs
- RoleManagerModule.cs
- ObjRef.cs
- PersonalizationProviderCollection.cs
- Block.cs
- StringDictionary.cs
- NumericUpDownAccelerationCollection.cs
- XmlCharCheckingReader.cs
- ApplicationFileParser.cs
- CheckBoxDesigner.cs
- BindingList.cs
- SafeFileMapViewHandle.cs
- NonVisualControlAttribute.cs
- DataGridViewComboBoxEditingControl.cs
- SystemNetworkInterface.cs
- TreeNodeCollection.cs
- SafeRightsManagementSessionHandle.cs
- Enumerable.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- PersistenceContextEnlistment.cs
- ReadOnlyDictionary.cs
- FontStyles.cs
- HttpCacheParams.cs
- ActivityExecutor.cs
- BatchStream.cs
- smtpconnection.cs
- NetTcpBindingElement.cs
- MsmqInputChannelListenerBase.cs
- ToolStripManager.cs
- TablePattern.cs
- DSACryptoServiceProvider.cs
- RelationshipSet.cs
- baseaxisquery.cs
- OdbcDataAdapter.cs
- TdsParameterSetter.cs
- Converter.cs
- CatalogPartChrome.cs
- RegistryExceptionHelper.cs
- ParameterCollection.cs
- PropertyEntry.cs
- ComboBox.cs
- X509Chain.cs
- PolicyLevel.cs
- WindowVisualStateTracker.cs
- SafeSecurityHelper.cs
- XXXInfos.cs
- WindowsListViewSubItem.cs
- EpmTargetTree.cs
- RegexStringValidator.cs
- DocumentXmlWriter.cs
- SchemaEntity.cs
- BaseParser.cs
- Bezier.cs
- TextContainerHelper.cs
- OdbcConnectionOpen.cs
- References.cs
- ProviderCollection.cs
- PtsHost.cs
- Effect.cs
- PowerModeChangedEventArgs.cs
- WindowsHyperlink.cs
- SqlFileStream.cs
- EntityCommandExecutionException.cs
- VectorAnimation.cs
- DataGridViewCellConverter.cs
- CodeExporter.cs
- ElapsedEventArgs.cs
- TextEndOfLine.cs