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
- HttpWriter.cs
- InvalidCastException.cs
- SqlNodeAnnotation.cs
- AttributeProviderAttribute.cs
- NavigationProperty.cs
- PolyBezierSegmentFigureLogic.cs
- ToolstripProfessionalRenderer.cs
- SqlRemoveConstantOrderBy.cs
- PreservationFileWriter.cs
- Permission.cs
- FontInfo.cs
- WindowPattern.cs
- Int32.cs
- HashCoreRequest.cs
- TextRangeEdit.cs
- ApplicationServicesHostFactory.cs
- ApplicationDirectoryMembershipCondition.cs
- DesignerValidationSummaryAdapter.cs
- TdsParserSafeHandles.cs
- SelectionItemProviderWrapper.cs
- ManifestSignatureInformation.cs
- Form.cs
- Pair.cs
- MetafileHeaderWmf.cs
- MatchingStyle.cs
- WebPartManagerInternals.cs
- SplitterCancelEvent.cs
- WinCategoryAttribute.cs
- WmpBitmapEncoder.cs
- DataDocumentXPathNavigator.cs
- Scheduling.cs
- X509ChainElement.cs
- SafeFileHandle.cs
- LocalizedNameDescriptionPair.cs
- PointAnimationUsingKeyFrames.cs
- Application.cs
- ApplicationDirectory.cs
- LifetimeServices.cs
- RequestCache.cs
- ObjectRef.cs
- ServiceSecurityAuditBehavior.cs
- ScriptingProfileServiceSection.cs
- ObjectConverter.cs
- DataGridViewLayoutData.cs
- Constants.cs
- Internal.cs
- IfAction.cs
- ApplicationBuildProvider.cs
- XmlElementAttributes.cs
- UnionExpr.cs
- ToolStrip.cs
- SByteStorage.cs
- SQLSingleStorage.cs
- BoolExpressionVisitors.cs
- DesignTimeParseData.cs
- SpeechSynthesizer.cs
- XmlDataDocument.cs
- MLangCodePageEncoding.cs
- BitmapEncoder.cs
- RoleManagerModule.cs
- KeyValuePairs.cs
- FontInfo.cs
- URL.cs
- TableParaClient.cs
- PageBreakRecord.cs
- Triplet.cs
- TransformerTypeCollection.cs
- FontDriver.cs
- DocumentPage.cs
- PolicyUtility.cs
- CachingHintValidation.cs
- DataControlButton.cs
- GradientSpreadMethodValidation.cs
- UriSection.cs
- BrowserCapabilitiesFactoryBase.cs
- ColorConverter.cs
- BindToObject.cs
- ReadOnlyObservableCollection.cs
- Decorator.cs
- XsltArgumentList.cs
- XsltLibrary.cs
- ModelTreeEnumerator.cs
- IconBitmapDecoder.cs
- WinInet.cs
- MultipleViewProviderWrapper.cs
- FixedTextView.cs
- AuthenticationModulesSection.cs
- DesignerActionPropertyItem.cs
- MergeLocalizationDirectives.cs
- CursorInteropHelper.cs
- JoinTreeNode.cs
- WebPartDeleteVerb.cs
- Monitor.cs
- StringSource.cs
- ValueQuery.cs
- SoapTypeAttribute.cs
- webeventbuffer.cs
- DataTableClearEvent.cs
- SectionXmlInfo.cs
- DispatchWrapper.cs