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
- Splitter.cs
- ParserHooks.cs
- ContextMenu.cs
- RenderingEventArgs.cs
- DataListItemEventArgs.cs
- InternalControlCollection.cs
- CompilationUtil.cs
- ClipboardProcessor.cs
- BinaryEditor.cs
- DataServiceException.cs
- UserNamePasswordValidator.cs
- WizardDesigner.cs
- grammarelement.cs
- PostBackTrigger.cs
- SourceSwitch.cs
- URIFormatException.cs
- SystemNetHelpers.cs
- elementinformation.cs
- RemoteHelper.cs
- ClientType.cs
- ConfigXmlElement.cs
- Vector3D.cs
- Action.cs
- VisualBasicSettingsConverter.cs
- AnnotationHelper.cs
- PageCache.cs
- LineVisual.cs
- XslTransformFileEditor.cs
- Debug.cs
- ContextBase.cs
- DataServiceBuildProvider.cs
- ConfigUtil.cs
- RequiredFieldValidator.cs
- RelatedCurrencyManager.cs
- OlePropertyStructs.cs
- DataGridViewComboBoxEditingControl.cs
- BuildResult.cs
- QilScopedVisitor.cs
- DocumentOrderQuery.cs
- ToolStripDropDownButton.cs
- SecurityResources.cs
- Socket.cs
- KnownIds.cs
- BamlRecords.cs
- XmlSchemaExporter.cs
- ResourceType.cs
- DecoderExceptionFallback.cs
- RoleGroup.cs
- ConfigurationElementCollection.cs
- COM2IDispatchConverter.cs
- CryptoConfig.cs
- Msec.cs
- DrawingVisualDrawingContext.cs
- Vector3DAnimationUsingKeyFrames.cs
- AccessorTable.cs
- WebColorConverter.cs
- SurrogateEncoder.cs
- XhtmlTextWriter.cs
- Pair.cs
- DataGridTableCollection.cs
- ParseElementCollection.cs
- WebPartConnection.cs
- DocumentScope.cs
- SmtpNetworkElement.cs
- MimeObjectFactory.cs
- MaterialGroup.cs
- EventLog.cs
- AdornerHitTestResult.cs
- ScrollBarRenderer.cs
- TypedTableBase.cs
- InsufficientMemoryException.cs
- TemplatePagerField.cs
- OpacityConverter.cs
- DataGridViewCellPaintingEventArgs.cs
- RuntimeConfig.cs
- SecurityTokenRequirement.cs
- PersonalizableAttribute.cs
- MediaSystem.cs
- ScrollBar.cs
- WindowsListViewGroupHelper.cs
- SchemaManager.cs
- Events.cs
- NativeActivityContext.cs
- ToolStripRenderEventArgs.cs
- DynamicControl.cs
- ServicesUtilities.cs
- KeyedCollection.cs
- _Semaphore.cs
- ImageFormatConverter.cs
- FontResourceCache.cs
- MouseCaptureWithinProperty.cs
- PageRequestManager.cs
- BuildManagerHost.cs
- AuditLogLocation.cs
- CompiledXpathExpr.cs
- AsymmetricKeyExchangeFormatter.cs
- ParseHttpDate.cs
- WaitHandle.cs
- localization.cs
- ReadOnlyPermissionSet.cs