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
- ListViewCancelEventArgs.cs
- WebHeaderCollection.cs
- StringInfo.cs
- DesignerTextViewAdapter.cs
- HtmlInputImage.cs
- ClientData.cs
- DispatcherProcessingDisabled.cs
- AppDomainFactory.cs
- Helpers.cs
- ModulesEntry.cs
- AccessDataSourceView.cs
- ListSortDescription.cs
- CompositeControl.cs
- WindowsIPAddress.cs
- ListViewGroupItemCollection.cs
- WinEventWrap.cs
- UTF32Encoding.cs
- _DigestClient.cs
- FileVersionInfo.cs
- StructuredTypeEmitter.cs
- Style.cs
- DesignerSerializationOptionsAttribute.cs
- Int64Converter.cs
- ReadWriteControlDesigner.cs
- BlockCollection.cs
- SmtpNetworkElement.cs
- SerialPinChanges.cs
- QilExpression.cs
- EnumValidator.cs
- DataChangedEventManager.cs
- InProcStateClientManager.cs
- ImageConverter.cs
- AnyAllSearchOperator.cs
- PopupEventArgs.cs
- StringSource.cs
- ServiceReference.cs
- WCFServiceClientProxyGenerator.cs
- MenuScrollingVisibilityConverter.cs
- InputBinder.cs
- DataSourceProvider.cs
- EnumConverter.cs
- PositiveTimeSpanValidator.cs
- Endpoint.cs
- HtmlWindowCollection.cs
- UnaryExpressionHelper.cs
- TransactionManagerProxy.cs
- HitTestDrawingContextWalker.cs
- XsltContext.cs
- BulletedListEventArgs.cs
- ConnectionManagementElementCollection.cs
- ArgumentsParser.cs
- ErasingStroke.cs
- DataGridViewCellPaintingEventArgs.cs
- WebZone.cs
- TypeContext.cs
- FontFamilyValueSerializer.cs
- PathGradientBrush.cs
- CurrencyManager.cs
- BindStream.cs
- XmlValidatingReaderImpl.cs
- ContentControl.cs
- XmlNodeComparer.cs
- WebException.cs
- ManipulationStartingEventArgs.cs
- Configuration.cs
- EventHandlers.cs
- SqlDataSourceCache.cs
- AnchoredBlock.cs
- DoubleAnimation.cs
- DataRowView.cs
- ToolStripSplitButton.cs
- AssemblyAttributes.cs
- ProviderSettingsCollection.cs
- ControlBuilderAttribute.cs
- RectangleF.cs
- DataServiceConfiguration.cs
- SystemDiagnosticsSection.cs
- WebPartDisplayMode.cs
- Location.cs
- WebPartActionVerb.cs
- GeometryModel3D.cs
- ClientTarget.cs
- ShutDownListener.cs
- _SpnDictionary.cs
- PolicyLevel.cs
- InitializationEventAttribute.cs
- RecordManager.cs
- WebPartDescriptionCollection.cs
- NetworkStream.cs
- Menu.cs
- TextTreeInsertElementUndoUnit.cs
- milexports.cs
- X509SubjectKeyIdentifierClause.cs
- UiaCoreApi.cs
- TraceData.cs
- ListControlStringCollectionEditor.cs
- TitleStyle.cs
- OutputCacheSection.cs
- TabOrder.cs
- VirtualPathUtility.cs