Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- HttpHandlerActionCollection.cs
- CursorConverter.cs
- IntersectQueryOperator.cs
- FlowDocument.cs
- DecimalAnimationBase.cs
- FixedHyperLink.cs
- CommandConverter.cs
- XmlSortKey.cs
- ProcessHost.cs
- DependencyProperty.cs
- PeerToPeerException.cs
- RegistryPermission.cs
- TextServicesCompartmentEventSink.cs
- Transform3D.cs
- MsmqHostedTransportConfiguration.cs
- ChannelSinkStacks.cs
- MessagePropertyDescriptionCollection.cs
- UIntPtr.cs
- SqlOuterApplyReducer.cs
- DataGridViewColumnCollectionDialog.cs
- ProcessHostFactoryHelper.cs
- InputLangChangeRequestEvent.cs
- RegexCharClass.cs
- ButtonAutomationPeer.cs
- EncodingTable.cs
- MenuItemBinding.cs
- PartBasedPackageProperties.cs
- ExceptionHandlersDesigner.cs
- DetectEofStream.cs
- XmlElement.cs
- XmlLanguage.cs
- CodeConstructor.cs
- MissingMethodException.cs
- SelectionRange.cs
- PropertyMetadata.cs
- DateTimeConverter.cs
- GroupBoxRenderer.cs
- NoneExcludedImageIndexConverter.cs
- Config.cs
- HebrewCalendar.cs
- DiscoveryEndpointElement.cs
- DragEvent.cs
- listviewsubitemcollectioneditor.cs
- RemoteWebConfigurationHost.cs
- XPathAncestorIterator.cs
- TextBoxLine.cs
- Int32Collection.cs
- OpenFileDialog.cs
- UrlRoutingHandler.cs
- QueryableFilterUserControl.cs
- TypeConstant.cs
- BindingListCollectionView.cs
- EndEvent.cs
- StateManagedCollection.cs
- Internal.cs
- TypeSystemProvider.cs
- PresentationSource.cs
- ContextInformation.cs
- SchemaComplexType.cs
- TypeInitializationException.cs
- Endpoint.cs
- HttpCapabilitiesBase.cs
- DataGridViewComboBoxCell.cs
- CompModHelpers.cs
- CodeStatementCollection.cs
- CodePageUtils.cs
- UrlPath.cs
- ToolStripDropDownClosedEventArgs.cs
- HuffModule.cs
- StatusBarPanel.cs
- HebrewNumber.cs
- IdnElement.cs
- WinEventTracker.cs
- AndCondition.cs
- CodeTryCatchFinallyStatement.cs
- dsa.cs
- MemberAccessException.cs
- TextEditorParagraphs.cs
- ActivityExecutionFilter.cs
- NavigationProgressEventArgs.cs
- FileDialogCustomPlace.cs
- XmlNullResolver.cs
- Enumerable.cs
- WebPartConnectionsConnectVerb.cs
- Translator.cs
- QilLoop.cs
- WebPartEventArgs.cs
- ReadOnlyTernaryTree.cs
- ITreeGenerator.cs
- ClosableStream.cs
- ActivityTypeDesigner.xaml.cs
- ValidationVisibilityAttribute.cs
- CheckBoxPopupAdapter.cs
- PrintController.cs
- TextEffectCollection.cs
- SdlChannelSink.cs
- WebMessageEncodingElement.cs
- SymLanguageType.cs
- CanonicalFormWriter.cs
- HashJoinQueryOperatorEnumerator.cs