Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / MouseOverProperty.cs / 1305600 / 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. 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
- FramingChannels.cs
- Triplet.cs
- ThemeDictionaryExtension.cs
- WebConfigurationHostFileChange.cs
- AvTraceFormat.cs
- ValueQuery.cs
- InertiaExpansionBehavior.cs
- Transform.cs
- ScrollBarRenderer.cs
- ArglessEventHandlerProxy.cs
- BuildResult.cs
- Color.cs
- SoapExtension.cs
- XmlSerializerAssemblyAttribute.cs
- CaseExpr.cs
- DynamicMetaObjectBinder.cs
- handlecollector.cs
- WinEventHandler.cs
- RowBinding.cs
- BamlResourceSerializer.cs
- RuntimeConfigLKG.cs
- BindingNavigatorDesigner.cs
- UnionExpr.cs
- DiagnosticTraceSchemas.cs
- WinFormsSecurity.cs
- RemotingConfigParser.cs
- SafeUserTokenHandle.cs
- MetricEntry.cs
- CodeDefaultValueExpression.cs
- ScrollableControl.cs
- AudioFileOut.cs
- View.cs
- HttpGetProtocolReflector.cs
- WindowsBrush.cs
- RelationshipManager.cs
- CheckBox.cs
- DropSource.cs
- FontUnitConverter.cs
- InkCanvasSelectionAdorner.cs
- PathGeometry.cs
- PeerNearMe.cs
- ProcessHostServerConfig.cs
- DataGridTextBox.cs
- Point3DAnimationBase.cs
- CurrentChangingEventArgs.cs
- Query.cs
- ObjectQuery.cs
- WebPermission.cs
- WebBrowser.cs
- SendAgentStatusRequest.cs
- RequestQueue.cs
- Int64.cs
- TypeDependencyAttribute.cs
- IPAddressCollection.cs
- XmlObjectSerializerContext.cs
- InputBuffer.cs
- XmlAttributes.cs
- PriorityQueue.cs
- EnumDataContract.cs
- FieldBuilder.cs
- Transform.cs
- UserNamePasswordValidator.cs
- NumericPagerField.cs
- CompositeDataBoundControl.cs
- wgx_sdk_version.cs
- Ray3DHitTestResult.cs
- PathHelper.cs
- SqlTypesSchemaImporter.cs
- TextBox.cs
- MulticastDelegate.cs
- InstallerTypeAttribute.cs
- IntPtr.cs
- HttpHostedTransportConfiguration.cs
- TableLayoutPanelCellPosition.cs
- ConfigurationManagerHelper.cs
- XmlJsonWriter.cs
- TreeNodeBindingCollection.cs
- SystemTcpStatistics.cs
- ExpressionNormalizer.cs
- Window.cs
- KeyPressEvent.cs
- StateChangeEvent.cs
- XmlName.cs
- SynchronizedDispatch.cs
- UpdateProgress.cs
- __ConsoleStream.cs
- ReflectionTypeLoadException.cs
- CreateUserErrorEventArgs.cs
- TextFormatterHost.cs
- AutomationPattern.cs
- GenericUriParser.cs
- GlobalizationAssembly.cs
- AuthorizationRuleCollection.cs
- DataSourceDesigner.cs
- SecUtil.cs
- ErrorHandler.cs
- DataTransferEventArgs.cs
- safePerfProviderHandle.cs
- ScrollProperties.cs
- HttpEncoder.cs