Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- Mutex.cs
- PermissionSetTriple.cs
- FixedSOMPageElement.cs
- ContextMarshalException.cs
- ConfigXmlSignificantWhitespace.cs
- Process.cs
- InvalidDataException.cs
- EncoderNLS.cs
- RectAnimation.cs
- HostProtectionException.cs
- XmlAggregates.cs
- BooleanToVisibilityConverter.cs
- SqlFacetAttribute.cs
- BindingMAnagerBase.cs
- CmsInterop.cs
- JsonEnumDataContract.cs
- InternalConfirm.cs
- WebPartEditVerb.cs
- DataListItem.cs
- XmlNodeChangedEventManager.cs
- ColumnWidthChangingEvent.cs
- DependencySource.cs
- SerializerWriterEventHandlers.cs
- PrivateFontCollection.cs
- _ConnectionGroup.cs
- EntityTransaction.cs
- SynchronizingStream.cs
- Exception.cs
- AdjustableArrowCap.cs
- ComboBoxItem.cs
- FlatButtonAppearance.cs
- StringBlob.cs
- DataRelationPropertyDescriptor.cs
- AnnouncementInnerClient11.cs
- ScrollItemPattern.cs
- StylusEditingBehavior.cs
- CellCreator.cs
- CatalogPartCollection.cs
- Tag.cs
- DataExpression.cs
- ConfigurationValidatorBase.cs
- ToolStripContainer.cs
- ForeignKeyFactory.cs
- CookieProtection.cs
- ParallelEnumerableWrapper.cs
- RtfFormatStack.cs
- SqlParameterCollection.cs
- PointAnimationUsingPath.cs
- XmlImplementation.cs
- Model3DCollection.cs
- ProxyElement.cs
- LinqDataView.cs
- ToolStripActionList.cs
- PlaceHolder.cs
- DataError.cs
- StylusPlugin.cs
- SizeAnimationBase.cs
- XMLUtil.cs
- DataGridViewCheckBoxCell.cs
- Quad.cs
- EntityViewGenerationConstants.cs
- TextClipboardData.cs
- Validator.cs
- HttpConfigurationContext.cs
- ZoomingMessageFilter.cs
- XsltArgumentList.cs
- EnumerableRowCollectionExtensions.cs
- CurrentTimeZone.cs
- SQLGuid.cs
- AsnEncodedData.cs
- ContainerCodeDomSerializer.cs
- LoginName.cs
- LookupBindingPropertiesAttribute.cs
- Window.cs
- TimelineCollection.cs
- DataGridItemEventArgs.cs
- DataGrid.cs
- SpeechSeg.cs
- ProcessProtocolHandler.cs
- XhtmlBasicPageAdapter.cs
- Utils.cs
- BindingExpressionUncommonField.cs
- KeyConstraint.cs
- DataStorage.cs
- ServiceContractDetailViewControl.cs
- ListViewInsertEventArgs.cs
- XamlWrapperReaders.cs
- PathSegment.cs
- XmlSchemaAnyAttribute.cs
- Comparer.cs
- BasicHttpSecurityMode.cs
- AssemblyBuilder.cs
- PipelineModuleStepContainer.cs
- TempEnvironment.cs
- XmlNamespaceManager.cs
- sqlpipe.cs
- WeakReferenceEnumerator.cs
- FloaterBaseParaClient.cs
- WebBaseEventKeyComparer.cs
- FunctionDetailsReader.cs