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
- ActivityPreviewDesigner.cs
- HttpRuntimeSection.cs
- FieldNameLookup.cs
- HtmlElementCollection.cs
- LoginUtil.cs
- PcmConverter.cs
- StringAttributeCollection.cs
- NumericPagerField.cs
- Soap12ServerProtocol.cs
- APCustomTypeDescriptor.cs
- WebPartEditVerb.cs
- ParseElementCollection.cs
- XappLauncher.cs
- TableDetailsCollection.cs
- SymbolUsageManager.cs
- CodeAccessPermission.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- HwndSourceParameters.cs
- XmlSchemaAnyAttribute.cs
- StringUtil.cs
- RuleCache.cs
- RadioButton.cs
- TextTreeInsertElementUndoUnit.cs
- BindingMAnagerBase.cs
- QueryOptionExpression.cs
- SQLBytesStorage.cs
- BaseDataBoundControl.cs
- PointLightBase.cs
- BaseUriHelper.cs
- BuildProviderUtils.cs
- IisTraceWebEventProvider.cs
- RadioButtonAutomationPeer.cs
- HttpServerVarsCollection.cs
- SequenceDesigner.xaml.cs
- HostUtils.cs
- AuthenticateEventArgs.cs
- SmtpReplyReaderFactory.cs
- WebControlsSection.cs
- WebPartRestoreVerb.cs
- BaseParaClient.cs
- IODescriptionAttribute.cs
- SrgsDocumentParser.cs
- LocalBuilder.cs
- CorrelationTokenInvalidatedHandler.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- TextChange.cs
- SchemaMapping.cs
- ObjectIDGenerator.cs
- WbemProvider.cs
- mediaeventargs.cs
- SmtpReplyReaderFactory.cs
- Ray3DHitTestResult.cs
- RegexMatch.cs
- EntityTransaction.cs
- XmlValidatingReader.cs
- Vector3DCollectionValueSerializer.cs
- ThrowHelper.cs
- BuildProvider.cs
- ProfileSettingsCollection.cs
- DataGridHeaderBorder.cs
- ResourceReader.cs
- InvokeProviderWrapper.cs
- safemediahandle.cs
- CharacterString.cs
- AddressingVersion.cs
- UnknownWrapper.cs
- InputBinder.cs
- AppSettingsExpressionBuilder.cs
- GridViewAutoFormat.cs
- NamespaceInfo.cs
- IgnoreFileBuildProvider.cs
- HelpInfo.cs
- HScrollProperties.cs
- DriveNotFoundException.cs
- NestedContainer.cs
- AssemblyBuilder.cs
- Matrix3DStack.cs
- SHA384CryptoServiceProvider.cs
- WhereQueryOperator.cs
- PeerValidationBehavior.cs
- XMLUtil.cs
- SchemaNotation.cs
- InputReport.cs
- ColorMatrix.cs
- ViewBase.cs
- SortKey.cs
- ResourceExpressionBuilder.cs
- EmbeddedObject.cs
- Int16AnimationUsingKeyFrames.cs
- XPathItem.cs
- SerializableAuthorizationContext.cs
- Behavior.cs
- SystemIPInterfaceProperties.cs
- TextRangeEditTables.cs
- RadioButton.cs
- SafeEventHandle.cs
- PolygonHotSpot.cs
- TreeNodeConverter.cs
- ExpressionSelection.cs
- DataGridViewColumnHeaderCell.cs