Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / MouseOverProperty.cs / 1 / 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
- ClientTargetCollection.cs
- KnownBoxes.cs
- validation.cs
- PropertySegmentSerializationProvider.cs
- HostedBindingBehavior.cs
- DoubleStorage.cs
- LogFlushAsyncResult.cs
- MultiAsyncResult.cs
- SubMenuStyleCollection.cs
- InstanceNormalEvent.cs
- GrammarBuilderWildcard.cs
- Point3DAnimation.cs
- FileDetails.cs
- RoutedEventHandlerInfo.cs
- FlowPosition.cs
- NavigationCommands.cs
- NavigationPropertyEmitter.cs
- HandlerWithFactory.cs
- OdbcCommandBuilder.cs
- QilPatternFactory.cs
- COM2TypeInfoProcessor.cs
- DateTimeUtil.cs
- InvalidPrinterException.cs
- HttpProcessUtility.cs
- DecimalConstantAttribute.cs
- EdmProviderManifest.cs
- PictureBox.cs
- TypeElementCollection.cs
- TextFormatterImp.cs
- HyperLinkColumn.cs
- Command.cs
- DbConvert.cs
- OdbcConnectionStringbuilder.cs
- Condition.cs
- TextEndOfParagraph.cs
- TemplateControlParser.cs
- OpenTypeLayout.cs
- TreeSet.cs
- Pair.cs
- IndentTextWriter.cs
- WebSysDefaultValueAttribute.cs
- MarkupExtensionSerializer.cs
- HandlerMappingMemo.cs
- RepeatInfo.cs
- EventSetterHandlerConverter.cs
- ColumnResizeUndoUnit.cs
- PointLight.cs
- ContentTextAutomationPeer.cs
- EmptyCollection.cs
- Table.cs
- LogicalExpr.cs
- ProxyManager.cs
- CodeTypeMemberCollection.cs
- RunWorkerCompletedEventArgs.cs
- TextDecorationLocationValidation.cs
- ClientTargetSection.cs
- StrongNameIdentityPermission.cs
- TraceContextEventArgs.cs
- _ListenerRequestStream.cs
- HostedController.cs
- XPathConvert.cs
- ExceptionUtil.cs
- CompilerGlobalScopeAttribute.cs
- Mouse.cs
- MSAAWinEventWrap.cs
- XsdBuildProvider.cs
- EventHandlerList.cs
- RelOps.cs
- Matrix3DStack.cs
- CodeCatchClauseCollection.cs
- UriTemplatePathSegment.cs
- PenCursorManager.cs
- OutputCacheSettingsSection.cs
- ValuePatternIdentifiers.cs
- TextContainerChangeEventArgs.cs
- CalculatedColumn.cs
- Quaternion.cs
- SymLanguageType.cs
- SaveFileDialog.cs
- CalendarDay.cs
- SymLanguageType.cs
- DateTimeFormatInfo.cs
- Debug.cs
- SspiNegotiationTokenAuthenticator.cs
- QueryReaderSettings.cs
- GradientBrush.cs
- Crypto.cs
- ExtentKey.cs
- TableCellCollection.cs
- FlowDocument.cs
- securitycriticaldata.cs
- MouseButton.cs
- Constants.cs
- OrthographicCamera.cs
- PersonalizableAttribute.cs
- DataBindingExpressionBuilder.cs
- MaterialGroup.cs
- CallContext.cs
- ImageSource.cs
- EventBuilder.cs