Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Base / MS / Internal / ComponentModel / PropertyChangeTracker.cs / 1 / PropertyChangeTracker.cs
namespace MS.Internal.ComponentModel { using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Security.Permissions; using System.Windows; ////// A change tracking expression that is used to raise property change events. /// internal class PropertyChangeTracker : Expression { internal PropertyChangeTracker(DependencyObject obj, DependencyProperty property) : base(ExpressionMode.NonSharable | ExpressionMode.ForwardsInvalidations) { Debug.Assert(obj != null && property != null); _object = obj; _property = property; ChangeSources(_object, _property, new DependencySource[] { new DependencySource(obj, property) }); } internal override void OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args) { DependencyProperty dp = args.Property; if (_object == d && _property == dp && Changed != null) { Changed(_object, EventArgs.Empty); } } internal void Close() { _object = null; _property = null; ChangeSources(null, null, null); } internal bool CanClose { get { return Changed == null; } } internal EventHandler Changed; private DependencyObject _object; private DependencyProperty _property; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace MS.Internal.ComponentModel { using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Security.Permissions; using System.Windows; ////// A change tracking expression that is used to raise property change events. /// internal class PropertyChangeTracker : Expression { internal PropertyChangeTracker(DependencyObject obj, DependencyProperty property) : base(ExpressionMode.NonSharable | ExpressionMode.ForwardsInvalidations) { Debug.Assert(obj != null && property != null); _object = obj; _property = property; ChangeSources(_object, _property, new DependencySource[] { new DependencySource(obj, property) }); } internal override void OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args) { DependencyProperty dp = args.Property; if (_object == d && _property == dp && Changed != null) { Changed(_object, EventArgs.Empty); } } internal void Close() { _object = null; _property = null; ChangeSources(null, null, null); } internal bool CanClose { get { return Changed == null; } } internal EventHandler Changed; private DependencyObject _object; private DependencyProperty _property; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlSchemaImporter.cs
- DbConnectionPool.cs
- Binding.cs
- TeredoHelper.cs
- Rotation3D.cs
- Vector3DIndependentAnimationStorage.cs
- AttachmentCollection.cs
- TagElement.cs
- QueryCacheKey.cs
- UpdateManifestForBrowserApplication.cs
- DataSpaceManager.cs
- TextPattern.cs
- LinqToSqlWrapper.cs
- CompositionCommandSet.cs
- InvokeAction.cs
- HTMLTagNameToTypeMapper.cs
- DataGridViewTextBoxColumn.cs
- COM2ComponentEditor.cs
- ProxyElement.cs
- ScriptingWebServicesSectionGroup.cs
- AnnotationResourceCollection.cs
- TypeExtensionConverter.cs
- ConcurrencyBehavior.cs
- ManipulationDeltaEventArgs.cs
- BindingExpressionUncommonField.cs
- StreamReader.cs
- AuthorizationRule.cs
- FontFaceLayoutInfo.cs
- RecordConverter.cs
- ThemeInfoAttribute.cs
- LinkGrep.cs
- StandardTransformFactory.cs
- Context.cs
- UndoEngine.cs
- SaveFileDialog.cs
- AssertFilter.cs
- Block.cs
- PerformanceCountersElement.cs
- NameService.cs
- ProcessStartInfo.cs
- Path.cs
- XamlPoint3DCollectionSerializer.cs
- X509Certificate2Collection.cs
- WsdlBuildProvider.cs
- RtfNavigator.cs
- GenericRootAutomationPeer.cs
- BindingExpressionUncommonField.cs
- MouseWheelEventArgs.cs
- ToolStripItemBehavior.cs
- HotSpotCollection.cs
- SecurityToken.cs
- FontFamily.cs
- ScopelessEnumAttribute.cs
- ContextMenuAutomationPeer.cs
- PrivacyNoticeBindingElement.cs
- MultiTrigger.cs
- StringInfo.cs
- DataGridRow.cs
- ByteFacetDescriptionElement.cs
- Bits.cs
- HealthMonitoringSectionHelper.cs
- DbConnectionPoolGroupProviderInfo.cs
- HostedTransportConfigurationBase.cs
- SimpleFieldTemplateUserControl.cs
- DataBindingHandlerAttribute.cs
- SiteIdentityPermission.cs
- ObjectTag.cs
- Model3DGroup.cs
- ExpressionVisitor.cs
- FormViewDeleteEventArgs.cs
- Oci.cs
- ChildChangedEventArgs.cs
- ClientBase.cs
- CompilerErrorCollection.cs
- WindowsAltTab.cs
- ContextQuery.cs
- DocumentXPathNavigator.cs
- ZipPackage.cs
- Win32.cs
- SafeNativeMethods.cs
- RuleSettingsCollection.cs
- RegexBoyerMoore.cs
- RangeContentEnumerator.cs
- TypeDescriptionProviderAttribute.cs
- TextPointerBase.cs
- RemotingSurrogateSelector.cs
- DoubleAnimationClockResource.cs
- LinqDataSourceValidationException.cs
- _LocalDataStoreMgr.cs
- DbRetry.cs
- CodeIterationStatement.cs
- Header.cs
- WorkItem.cs
- SecureStringHasher.cs
- SuppressMergeCheckAttribute.cs
- XmlSchemaIdentityConstraint.cs
- FullTrustAssembliesSection.cs
- BevelBitmapEffect.cs
- EmbeddedMailObject.cs
- BamlMapTable.cs