Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TransportElement.cs
- FaultDescription.cs
- SubclassTypeValidatorAttribute.cs
- MetabaseSettings.cs
- WebServiceErrorEvent.cs
- Win32SafeHandles.cs
- TdsParserSessionPool.cs
- TypedReference.cs
- _NTAuthentication.cs
- UnsafeNativeMethods.cs
- WindowsListBox.cs
- ErrorFormatter.cs
- ManualResetEvent.cs
- DataGridCellEditEndingEventArgs.cs
- Int64Animation.cs
- ToolStripCodeDomSerializer.cs
- PagerSettings.cs
- ping.cs
- MsmqDecodeHelper.cs
- SecurityIdentifierElementCollection.cs
- XmlSecureResolver.cs
- GPRECT.cs
- XamlToRtfParser.cs
- GeometryModel3D.cs
- PolyQuadraticBezierSegment.cs
- DynamicValidatorEventArgs.cs
- ComponentResourceManager.cs
- WebPartDisplayModeEventArgs.cs
- EpmCustomContentDeSerializer.cs
- WebBrowserContainer.cs
- XmlUtil.cs
- OdbcErrorCollection.cs
- SplitterDesigner.cs
- DescendantQuery.cs
- Query.cs
- FirstMatchCodeGroup.cs
- ComponentSerializationService.cs
- NavigationExpr.cs
- Utils.cs
- BooleanKeyFrameCollection.cs
- CfgArc.cs
- SharedStatics.cs
- SoapReflectionImporter.cs
- TextSelectionHelper.cs
- ApplicationDirectoryMembershipCondition.cs
- CodeAccessPermission.cs
- ContextStaticAttribute.cs
- DifferencingCollection.cs
- SystemPens.cs
- MultipleViewPattern.cs
- ListViewInsertedEventArgs.cs
- VideoDrawing.cs
- DependencyPropertyConverter.cs
- HMACSHA256.cs
- Track.cs
- AppSettingsSection.cs
- BuildManager.cs
- Events.cs
- BevelBitmapEffect.cs
- ProfileService.cs
- StaticFileHandler.cs
- OracleTransaction.cs
- FlowDocumentFormatter.cs
- AnonymousIdentificationModule.cs
- MembershipValidatePasswordEventArgs.cs
- X509WindowsSecurityToken.cs
- FileSecurity.cs
- SyndicationDeserializer.cs
- DBCommandBuilder.cs
- cookieexception.cs
- EventMap.cs
- GridViewSelectEventArgs.cs
- ControlAdapter.cs
- ScrollData.cs
- Dump.cs
- GenericEnumerator.cs
- QilTypeChecker.cs
- MembershipUser.cs
- DateTimeFormatInfoScanner.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- OleDbReferenceCollection.cs
- DragStartedEventArgs.cs
- _HeaderInfo.cs
- WebPartAuthorizationEventArgs.cs
- WebPartConnectionsConnectVerb.cs
- XmlWriterSettings.cs
- ListenerConfig.cs
- ToolStripSeparator.cs
- CLSCompliantAttribute.cs
- SizeKeyFrameCollection.cs
- storepermission.cs
- XmlComment.cs
- CodeTypeReferenceExpression.cs
- SqlInternalConnection.cs
- SystemColorTracker.cs
- BaseUriHelper.cs
- ProxyHwnd.cs
- InputScopeAttribute.cs
- EditCommandColumn.cs
- RectAnimationBase.cs