Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / MouseOverProperty.cs / 2 / MouseOverProperty.cs
using System;
using MS.Internal.KnownBoxes;
using System.Windows.Input;
namespace System.Windows
{
/////////////////////////////////////////////////////////////////////////
internal class MouseOverProperty : ReverseInheritProperty
{
/////////////////////////////////////////////////////////////////////
internal MouseOverProperty() : base(
UIElement.IsMouseOverPropertyKey,
CoreFlags.IsMouseOverCache,
CoreFlags.IsMouseOverChanged)
{
}
/////////////////////////////////////////////////////////////////////
internal override void FireNotifications(UIElement uie, ContentElement ce, UIElement3D uie3D, bool oldValue)
{
// Before we fire the mouse event we need to figure if the notification is still relevant.
// This is because it is possible that the mouse state has changed during the previous
// property engine callout. Example: Consider a MessageBox being displayed during the
// IsMouseOver OnPropertyChanged override.
bool shouldFireNotification = false;
if (uie != null)
{
shouldFireNotification = (!oldValue && uie.IsMouseOver) || (oldValue && !uie.IsMouseOver);
}
else if (ce != null)
{
shouldFireNotification = (!oldValue && ce.IsMouseOver) || (oldValue && !ce.IsMouseOver);
}
else if (uie3D != null)
{
shouldFireNotification = (!oldValue && uie3D.IsMouseOver) || (oldValue && !uie3D.IsMouseOver);
}
if (shouldFireNotification)
{
MouseEventArgs mouseEventArgs = new MouseEventArgs(Mouse.PrimaryDevice, Environment.TickCount, Mouse.PrimaryDevice.StylusDevice);
mouseEventArgs.RoutedEvent = oldValue ? Mouse.MouseLeaveEvent : Mouse.MouseEnterEvent;
if (uie != null)
{
uie.RaiseEvent(mouseEventArgs);
}
else if (ce != null)
{
ce.RaiseEvent(mouseEventArgs);
}
else if (uie3D != null)
{
uie3D.RaiseEvent(mouseEventArgs);
}
}
}
}
}
// 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
- ImportCatalogPart.cs
- EllipticalNodeOperations.cs
- AssemblyFilter.cs
- SqlOuterApplyReducer.cs
- XsdDuration.cs
- SelectorAutomationPeer.cs
- SQLRoleProvider.cs
- EventDescriptorCollection.cs
- DoubleStorage.cs
- SqlPersonalizationProvider.cs
- SegmentInfo.cs
- ColumnMap.cs
- WaitHandle.cs
- IpcClientChannel.cs
- ZoomPercentageConverter.cs
- SmiXetterAccessMap.cs
- OleDbDataAdapter.cs
- SchemaEntity.cs
- TemplateManager.cs
- UIHelper.cs
- VBCodeProvider.cs
- CodeSnippetExpression.cs
- ObjectStateEntryDbDataRecord.cs
- Point.cs
- Stylesheet.cs
- ManagedCodeMarkers.cs
- CodeObject.cs
- JsonCollectionDataContract.cs
- WebResourceUtil.cs
- ScriptResourceHandler.cs
- _PooledStream.cs
- AutomationEvent.cs
- SqlUtils.cs
- TreeBuilderXamlTranslator.cs
- DataGridColumnHeadersPresenter.cs
- CodeIdentifier.cs
- Converter.cs
- LinearKeyFrames.cs
- PagedDataSource.cs
- TemplatedMailWebEventProvider.cs
- WindowsGraphicsWrapper.cs
- ProtocolsConfigurationEntry.cs
- XmlCollation.cs
- SQLGuidStorage.cs
- SqlFacetAttribute.cs
- XPathEmptyIterator.cs
- IsolationInterop.cs
- DataGridViewRowsRemovedEventArgs.cs
- WindowsListViewGroupHelper.cs
- COM2Enum.cs
- basecomparevalidator.cs
- MenuDesigner.cs
- ObjectQueryState.cs
- SubMenuStyle.cs
- EtwTrackingBehavior.cs
- ReachFixedPageSerializer.cs
- SqlDependencyListener.cs
- GlobalDataBindingHandler.cs
- ApplicationServiceManager.cs
- TextElement.cs
- HitTestParameters3D.cs
- DesignerTextWriter.cs
- DataGridSortCommandEventArgs.cs
- CompressedStack.cs
- TransformerInfo.cs
- SQLSingleStorage.cs
- AxHost.cs
- TargetControlTypeCache.cs
- ManifestResourceInfo.cs
- CodeCommentStatement.cs
- DataGridViewSelectedRowCollection.cs
- validationstate.cs
- QilStrConcat.cs
- Identity.cs
- ContainsRowNumberChecker.cs
- DragAssistanceManager.cs
- PostBackTrigger.cs
- ExceptionValidationRule.cs
- CacheOutputQuery.cs
- UriTemplateMatchException.cs
- AutomationPatternInfo.cs
- AssemblyResourceLoader.cs
- PathFigureCollection.cs
- MetadataUtilsSmi.cs
- TableCell.cs
- Vars.cs
- TextRunCacheImp.cs
- QilGenerator.cs
- HttpWebRequest.cs
- __TransparentProxy.cs
- TypeConverterValueSerializer.cs
- NamespaceInfo.cs
- XD.cs
- DataGridViewImageCell.cs
- BitmapPalettes.cs
- CommonEndpointBehaviorElement.cs
- PartialCachingAttribute.cs
- SpotLight.cs
- TypeToken.cs
- UnconditionalPolicy.cs