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
- SectionVisual.cs
- ContractReference.cs
- XmlQueryContext.cs
- TokenBasedSet.cs
- XmlBinaryWriter.cs
- basecomparevalidator.cs
- StringFunctions.cs
- Accessors.cs
- InputManager.cs
- GridViewSelectEventArgs.cs
- RadioButtonDesigner.cs
- SymbolMethod.cs
- SqlOuterApplyReducer.cs
- DataGridHeaderBorder.cs
- XmlSerializerVersionAttribute.cs
- TreeBuilderBamlTranslator.cs
- MasterPageBuildProvider.cs
- Control.cs
- _AutoWebProxyScriptWrapper.cs
- ScrollPattern.cs
- ParserStreamGeometryContext.cs
- GenericEnumConverter.cs
- SelectionEditor.cs
- ResourceCategoryAttribute.cs
- XmlUtil.cs
- EDesignUtil.cs
- CompoundFileReference.cs
- DesignUtil.cs
- CustomBindingElementCollection.cs
- DoWorkEventArgs.cs
- HelpEvent.cs
- DesignerHelpers.cs
- LinqDataSourceContextEventArgs.cs
- BoundsDrawingContextWalker.cs
- odbcmetadatacollectionnames.cs
- StyleXamlParser.cs
- WebServiceHost.cs
- _ProxyRegBlob.cs
- ControlBuilderAttribute.cs
- SectionRecord.cs
- FloaterBaseParagraph.cs
- SqlBuilder.cs
- DataObjectMethodAttribute.cs
- GuidelineSet.cs
- ConcurrentBag.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- WebReferencesBuildProvider.cs
- BitmapMetadataEnumerator.cs
- MetaData.cs
- DelimitedListTraceListener.cs
- StorageAssociationTypeMapping.cs
- TextOnlyOutput.cs
- TextEditorContextMenu.cs
- BuildDependencySet.cs
- CallSiteOps.cs
- TcpAppDomainProtocolHandler.cs
- HiddenFieldPageStatePersister.cs
- ResourceManagerWrapper.cs
- QueryParameter.cs
- parserscommon.cs
- StorageTypeMapping.cs
- AbandonedMutexException.cs
- GridViewUpdatedEventArgs.cs
- DoubleUtil.cs
- XmlSchemaAttribute.cs
- DockPatternIdentifiers.cs
- CloseCryptoHandleRequest.cs
- WindowsEditBox.cs
- BaseCAMarshaler.cs
- DataGridTextBox.cs
- TextServicesDisplayAttribute.cs
- XamlFigureLengthSerializer.cs
- RoleManagerModule.cs
- EventLogEntry.cs
- ToolStripItemGlyph.cs
- ClientTargetSection.cs
- PropertyTabChangedEvent.cs
- TextContainerChangeEventArgs.cs
- EndpointAddressMessageFilter.cs
- PointKeyFrameCollection.cs
- NativeMethods.cs
- Verify.cs
- ToggleProviderWrapper.cs
- XMLUtil.cs
- ProcessThread.cs
- HttpConfigurationContext.cs
- SchemaImporterExtension.cs
- TextMarkerSource.cs
- MetadataException.cs
- DrawingContextDrawingContextWalker.cs
- WizardPanelChangingEventArgs.cs
- ImageBrush.cs
- DynamicValidator.cs
- DbTransaction.cs
- DocumentCollection.cs
- ThreadSafeList.cs
- SqlDataSourceCustomCommandPanel.cs
- WebPartCancelEventArgs.cs
- CookieParameter.cs
- EntryPointNotFoundException.cs