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
- ClientSettingsProvider.cs
- ToolStripArrowRenderEventArgs.cs
- XPathNavigatorKeyComparer.cs
- ObjectViewQueryResultData.cs
- PropertyEntry.cs
- AsyncResult.cs
- ImageCodecInfoPrivate.cs
- DataViewManager.cs
- TraceSection.cs
- UInt16.cs
- ByeOperation11AsyncResult.cs
- TreeNodeBinding.cs
- TextBoxView.cs
- TraceUtils.cs
- BaseDataBoundControl.cs
- Int32RectConverter.cs
- KoreanCalendar.cs
- RegistryConfigurationProvider.cs
- SafeTokenHandle.cs
- TraceRecord.cs
- SourceItem.cs
- ProxyFragment.cs
- HtmlTableCellCollection.cs
- DefaultEventAttribute.cs
- PeerNameResolver.cs
- TextContainerHelper.cs
- SqlComparer.cs
- CngProperty.cs
- FacetDescriptionElement.cs
- TimersDescriptionAttribute.cs
- VirtualizingStackPanel.cs
- Boolean.cs
- ProfileSettings.cs
- RegistrySecurity.cs
- QueryContinueDragEvent.cs
- shaper.cs
- DetailsViewRowCollection.cs
- PixelFormats.cs
- DefaultPropertyAttribute.cs
- ButtonBaseAutomationPeer.cs
- InternalCache.cs
- ReadOnlyHierarchicalDataSourceView.cs
- UnsafeNativeMethods.cs
- XComponentModel.cs
- Parser.cs
- ProcessThreadCollection.cs
- HiddenField.cs
- SoundPlayerAction.cs
- Misc.cs
- HttpCacheVaryByContentEncodings.cs
- _NetworkingPerfCounters.cs
- ColumnWidthChangingEvent.cs
- TdsParserSafeHandles.cs
- DataGridViewLinkColumn.cs
- NavigationPropertyAccessor.cs
- SafeNativeMethods.cs
- LongCountAggregationOperator.cs
- TdsParserHelperClasses.cs
- Math.cs
- precedingsibling.cs
- NativeBuffer.cs
- UIElement3DAutomationPeer.cs
- InProcStateClientManager.cs
- GcHandle.cs
- ExpressionParser.cs
- Events.cs
- DataGridRow.cs
- TrackBar.cs
- SqlMultiplexer.cs
- MethodBuilderInstantiation.cs
- PrintDialogException.cs
- SpecularMaterial.cs
- MemoryMappedFile.cs
- XmlSchemaComplexContent.cs
- ETagAttribute.cs
- ListViewSelectEventArgs.cs
- ConfigurationProperty.cs
- CompiledAction.cs
- HttpConfigurationContext.cs
- _ContextAwareResult.cs
- UnmanagedBitmapWrapper.cs
- PropertyPathWorker.cs
- ChannelSinkStacks.cs
- EventLogLink.cs
- TextRangeEditLists.cs
- DataGridViewColumnHeaderCell.cs
- DataServiceCollectionOfT.cs
- PeerConnector.cs
- ImageIndexConverter.cs
- FontStyleConverter.cs
- ObjectReferenceStack.cs
- BigInt.cs
- ListViewItemEventArgs.cs
- ObjectFullSpanRewriter.cs
- FSWPathEditor.cs
- CodeMemberMethod.cs
- TimelineClockCollection.cs
- ProtectedConfiguration.cs
- ColorContext.cs
- ExpressionEditorSheet.cs