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
- DbDataReader.cs
- SymbolResolver.cs
- CriticalFinalizerObject.cs
- Evidence.cs
- ShapingEngine.cs
- StylusPointProperty.cs
- Rotation3DKeyFrameCollection.cs
- TableStyle.cs
- SlipBehavior.cs
- RadialGradientBrush.cs
- AppDomainInstanceProvider.cs
- PageVisual.cs
- ISCIIEncoding.cs
- TypeSystem.cs
- HttpWriter.cs
- Stylesheet.cs
- DataGridColumnReorderingEventArgs.cs
- SqlCrossApplyToCrossJoin.cs
- SocketAddress.cs
- ComEventsSink.cs
- CategoryGridEntry.cs
- DesigntimeLicenseContextSerializer.cs
- EventLogPermissionEntry.cs
- FontDialog.cs
- AccessDataSourceDesigner.cs
- PointKeyFrameCollection.cs
- DecimalAnimationBase.cs
- XmlAnyAttributeAttribute.cs
- DBConcurrencyException.cs
- FormConverter.cs
- Interlocked.cs
- QueueProcessor.cs
- _UriTypeConverter.cs
- TextServicesLoader.cs
- MatrixAnimationUsingKeyFrames.cs
- SurrogateSelector.cs
- NamespaceQuery.cs
- HelpProvider.cs
- ObjectItemCachedAssemblyLoader.cs
- StringPropertyBuilder.cs
- LogFlushAsyncResult.cs
- Config.cs
- RoleGroupCollection.cs
- InputLanguageEventArgs.cs
- PrintDialogException.cs
- Convert.cs
- Function.cs
- BStrWrapper.cs
- ValidationError.cs
- ToggleButton.cs
- PolicyLevel.cs
- X509SecurityTokenProvider.cs
- ComplexTypeEmitter.cs
- FtpWebResponse.cs
- NotifyParentPropertyAttribute.cs
- WebConfigurationHost.cs
- DesignerEventService.cs
- AudioException.cs
- Predicate.cs
- KeyTime.cs
- BindableTemplateBuilder.cs
- RegularExpressionValidator.cs
- CollectionBase.cs
- Border.cs
- DesignerActionHeaderItem.cs
- DbFunctionCommandTree.cs
- Pkcs7Signer.cs
- SqlMethodCallConverter.cs
- SafeRightsManagementEnvironmentHandle.cs
- QueryContinueDragEvent.cs
- SystemGatewayIPAddressInformation.cs
- Decimal.cs
- RealizedColumnsBlock.cs
- SetStoryboardSpeedRatio.cs
- GeometryCombineModeValidation.cs
- RefreshEventArgs.cs
- ArrayConverter.cs
- DbDataRecord.cs
- DefaultObjectMappingItemCollection.cs
- XmlNode.cs
- FormViewCommandEventArgs.cs
- RegexCompiler.cs
- SrgsGrammarCompiler.cs
- RemotingException.cs
- FontFamilyIdentifier.cs
- BooleanAnimationUsingKeyFrames.cs
- DataServiceQuery.cs
- PageHandlerFactory.cs
- XmlDownloadManager.cs
- LineBreak.cs
- WhitespaceSignificantCollectionAttribute.cs
- Number.cs
- TemplateControl.cs
- InputScopeAttribute.cs
- AccessControlEntry.cs
- ImageIndexEditor.cs
- SystemWebCachingSectionGroup.cs
- ForeignKeyConstraint.cs
- ValidatedControlConverter.cs
- ServiceDeploymentInfo.cs