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
- ListViewItemEventArgs.cs
- SecUtil.cs
- IRCollection.cs
- ApplicationInterop.cs
- counter.cs
- Guid.cs
- TextCollapsingProperties.cs
- SafeViewOfFileHandle.cs
- TextEndOfParagraph.cs
- BridgeDataReader.cs
- WinEventWrap.cs
- FieldBuilder.cs
- SurrogateEncoder.cs
- InternalConfigConfigurationFactory.cs
- RectConverter.cs
- InfoCardProofToken.cs
- Logging.cs
- SchemaDeclBase.cs
- SemanticResultValue.cs
- HtmlInputHidden.cs
- SqlDataSourceEnumerator.cs
- CustomErrorCollection.cs
- SharedConnectionWorkflowTransactionService.cs
- MetadataStore.cs
- XhtmlTextWriter.cs
- ContextMarshalException.cs
- SecuritySessionSecurityTokenProvider.cs
- LogSwitch.cs
- CounterCreationData.cs
- Matrix3D.cs
- FormViewInsertEventArgs.cs
- ScriptControlDescriptor.cs
- DynamicDocumentPaginator.cs
- ADMembershipProvider.cs
- SqlConnectionPoolGroupProviderInfo.cs
- InvokeGenerator.cs
- ToolStripSystemRenderer.cs
- ProxyWebPartConnectionCollection.cs
- ReferenceConverter.cs
- TextEndOfParagraph.cs
- WebEventTraceProvider.cs
- CodeDOMProvider.cs
- SchemaSetCompiler.cs
- FamilyTypefaceCollection.cs
- CatalogPartChrome.cs
- WebPartTracker.cs
- State.cs
- AxHost.cs
- AvTrace.cs
- FilterException.cs
- FrameworkPropertyMetadata.cs
- ComponentManagerBroker.cs
- StreamingContext.cs
- Emitter.cs
- JpegBitmapEncoder.cs
- ReadOnlyMetadataCollection.cs
- DataTableMapping.cs
- PropertyTabChangedEvent.cs
- SourceFilter.cs
- EnumerableCollectionView.cs
- Pen.cs
- ChangePassword.cs
- XmlSchemaSubstitutionGroup.cs
- WebPartAddingEventArgs.cs
- ByteStream.cs
- ChangeNode.cs
- QuotedPrintableStream.cs
- AssemblyBuilder.cs
- Grid.cs
- AdornerPresentationContext.cs
- ByteBufferPool.cs
- DataGridPagerStyle.cs
- FixedDocumentSequencePaginator.cs
- BindingList.cs
- PopupEventArgs.cs
- XmlDictionary.cs
- XLinq.cs
- TimeSpanConverter.cs
- PerformanceCounterCategory.cs
- Transform.cs
- ApplicationProxyInternal.cs
- PowerStatus.cs
- PromptBuilder.cs
- Transactions.cs
- UnsignedPublishLicense.cs
- CacheChildrenQuery.cs
- input.cs
- DbMetaDataFactory.cs
- DataGridItem.cs
- BufferedWebEventProvider.cs
- HttpCachePolicy.cs
- ColorBlend.cs
- BasePattern.cs
- PropertyIDSet.cs
- AsyncPostBackTrigger.cs
- MouseOverProperty.cs
- WCFBuildProvider.cs
- XmlNamespaceDeclarationsAttribute.cs
- MobileControlsSectionHelper.cs
- CommandField.cs