Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / MS / Internal / ComponentModel / PropertyChangeTracker.cs / 1305600 / 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
- HtmlTableRow.cs
- RefExpr.cs
- PagesSection.cs
- ColorTransformHelper.cs
- CodeTypeParameterCollection.cs
- ExtensionElement.cs
- TextSelectionHelper.cs
- WebSysDefaultValueAttribute.cs
- Point3D.cs
- SqlNotificationEventArgs.cs
- IndependentAnimationStorage.cs
- MimePart.cs
- UnknownWrapper.cs
- ControlCollection.cs
- ConnectionConsumerAttribute.cs
- ReferencedCollectionType.cs
- CompositeControl.cs
- COM2EnumConverter.cs
- EncoderBestFitFallback.cs
- MessagingDescriptionAttribute.cs
- CacheVirtualItemsEvent.cs
- Region.cs
- ListBoxItemWrapperAutomationPeer.cs
- FlowDocumentPageViewerAutomationPeer.cs
- UTF7Encoding.cs
- SQLBytesStorage.cs
- MessageEncodingBindingElementImporter.cs
- BehaviorEditorPart.cs
- RoutedEventValueSerializer.cs
- QuaternionAnimationBase.cs
- ProgressPage.cs
- TcpTransportManager.cs
- UnmanagedMemoryStreamWrapper.cs
- EditorBrowsableAttribute.cs
- GregorianCalendarHelper.cs
- ExpressionDumper.cs
- HTTPNotFoundHandler.cs
- PreservationFileWriter.cs
- UnsafeNativeMethods.cs
- XamlTreeBuilder.cs
- CaseExpr.cs
- XmlImplementation.cs
- oledbmetadatacolumnnames.cs
- ParentQuery.cs
- CalendarDateRangeChangingEventArgs.cs
- GeometryCombineModeValidation.cs
- TableChangeProcessor.cs
- TypedTableBaseExtensions.cs
- TextCompositionEventArgs.cs
- HtmlControlPersistable.cs
- _Win32.cs
- SponsorHelper.cs
- AsnEncodedData.cs
- HttpHandlerActionCollection.cs
- NativeWindow.cs
- GridViewUpdateEventArgs.cs
- HttpRequest.cs
- DataFormat.cs
- SQLBoolean.cs
- OleCmdHelper.cs
- AuditLog.cs
- MetadataPropertyCollection.cs
- CodeDirectionExpression.cs
- bindurihelper.cs
- DataBindingHandlerAttribute.cs
- DateTimeUtil.cs
- DrawingContextWalker.cs
- BulletDecorator.cs
- MetadataWorkspace.cs
- ConfigXmlReader.cs
- ZipFileInfoCollection.cs
- _CacheStreams.cs
- SignatureToken.cs
- HttpBrowserCapabilitiesWrapper.cs
- _LoggingObject.cs
- StylusPoint.cs
- TextBox.cs
- SqlTransaction.cs
- ValueConversionAttribute.cs
- PeerToPeerException.cs
- InputLanguageEventArgs.cs
- SrgsElement.cs
- ReflectEventDescriptor.cs
- base64Transforms.cs
- SerializationInfo.cs
- AttachedAnnotation.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- HandlerFactoryCache.cs
- DataGridViewCellStateChangedEventArgs.cs
- XsdCachingReader.cs
- KeyTime.cs
- EmptyStringExpandableObjectConverter.cs
- DispatcherSynchronizationContext.cs
- FixedSOMTableRow.cs
- PriorityBindingExpression.cs
- HiddenField.cs
- ColumnPropertiesGroup.cs
- SecurityProtocolCorrelationState.cs
- ExtensibleClassFactory.cs
- ModelUIElement3D.cs