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
- ParameterElementCollection.cs
- SqlCacheDependency.cs
- ObjectStateEntry.cs
- TemplateKey.cs
- Listbox.cs
- SecurityTokenSerializer.cs
- CrossSiteScriptingValidation.cs
- XPathNodeInfoAtom.cs
- OleDbParameter.cs
- WebConfigurationManager.cs
- NativeRightsManagementAPIsStructures.cs
- ToolStripPanelRenderEventArgs.cs
- validationstate.cs
- ImageSource.cs
- sqlpipe.cs
- SafeRsaProviderHandle.cs
- EventLevel.cs
- FilteredSchemaElementLookUpTable.cs
- RoutingEndpointTrait.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- InstalledFontCollection.cs
- MenuItem.cs
- CurrentChangedEventManager.cs
- GeometryDrawing.cs
- FilteredAttributeCollection.cs
- SoapHeader.cs
- DeadCharTextComposition.cs
- FileVersionInfo.cs
- TriggerActionCollection.cs
- Part.cs
- OletxTransactionHeader.cs
- ImageListImageEditor.cs
- VerticalAlignConverter.cs
- ObjectTypeMapping.cs
- XmlSerializationWriter.cs
- CryptoApi.cs
- MouseCaptureWithinProperty.cs
- StandardOleMarshalObject.cs
- StorageMappingFragment.cs
- DataGridViewTextBoxEditingControl.cs
- BinaryWriter.cs
- RegisterResponseInfo.cs
- ShaperBuffers.cs
- shaperfactoryquerycacheentry.cs
- RequestCacheManager.cs
- TreeNode.cs
- TagElement.cs
- Evaluator.cs
- X509SubjectKeyIdentifierClause.cs
- RuntimeResourceSet.cs
- DataRowChangeEvent.cs
- WS2007HttpBindingCollectionElement.cs
- CompilerInfo.cs
- ReliableChannelBinder.cs
- NamedPipeTransportManager.cs
- SQLChars.cs
- Exceptions.cs
- InvalidProgramException.cs
- GenericTypeParameterBuilder.cs
- PropertyFilterAttribute.cs
- OpenTypeMethods.cs
- DataControlImageButton.cs
- SafeFileMappingHandle.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DynamicDiscoveryDocument.cs
- WindowsGraphics.cs
- EntityException.cs
- ListBox.cs
- HandlerMappingMemo.cs
- SqlFactory.cs
- ListViewPagedDataSource.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- WorkflowHostingEndpoint.cs
- EntitySqlQueryCacheKey.cs
- ListViewItemEventArgs.cs
- SerializationSectionGroup.cs
- CodeDefaultValueExpression.cs
- MetafileHeader.cs
- NamedPermissionSet.cs
- Object.cs
- FlowLayoutPanel.cs
- SafeNativeMethods.cs
- DataSpaceManager.cs
- EventLogInformation.cs
- SafeFileHandle.cs
- UniqueID.cs
- DiscoveryOperationContextExtension.cs
- XmlMapping.cs
- DataBinding.cs
- DrawingGroup.cs
- SchemaNames.cs
- DrawItemEvent.cs
- DataPagerFieldCommandEventArgs.cs
- BitmapEncoder.cs
- PerformanceCounterScope.cs
- GroupStyle.cs
- ExceptionHelpers.cs
- SymmetricSecurityProtocolFactory.cs
- ControlParameter.cs
- AnnotationAuthorChangedEventArgs.cs