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
- FaultReason.cs
- FormClosedEvent.cs
- DocumentCollection.cs
- Util.cs
- SelectionPattern.cs
- LogLogRecordHeader.cs
- Matrix.cs
- StylusTouchDevice.cs
- DataSourceControl.cs
- ProfileModule.cs
- XmlValueConverter.cs
- HttpRequest.cs
- ToolstripProfessionalRenderer.cs
- DependencyPropertyValueSerializer.cs
- InvalidDocumentContentsException.cs
- QilCloneVisitor.cs
- ManagementObjectSearcher.cs
- DataTransferEventArgs.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- MimeFormatter.cs
- RootContext.cs
- MemberCollection.cs
- FunctionNode.cs
- Command.cs
- Block.cs
- TransformGroup.cs
- RepeatBehaviorConverter.cs
- X500Name.cs
- SettingsPropertyValueCollection.cs
- CompilerResults.cs
- LogReservationCollection.cs
- HttpCapabilitiesSectionHandler.cs
- MultipleCopiesCollection.cs
- BulletedList.cs
- FillErrorEventArgs.cs
- XmlAttribute.cs
- InvalidProgramException.cs
- TimelineClockCollection.cs
- UniqueConstraint.cs
- PerfService.cs
- GeneralTransform3DGroup.cs
- BinaryFormatter.cs
- NativeMethods.cs
- GZipStream.cs
- HtmlUtf8RawTextWriter.cs
- ObjectDataSourceEventArgs.cs
- PersistChildrenAttribute.cs
- FontUnit.cs
- ToolStripGrip.cs
- WmlPanelAdapter.cs
- BamlResourceSerializer.cs
- TemplateControlParser.cs
- WebPartConnectionsConfigureVerb.cs
- ButtonFlatAdapter.cs
- DbConnectionPoolOptions.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- SegmentInfo.cs
- PropertyDescriptorGridEntry.cs
- DataSourceXmlTextReader.cs
- TextRangeEdit.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- SafeTokenHandle.cs
- TextEditorContextMenu.cs
- XmlStreamStore.cs
- XmlSchemaGroup.cs
- Cursors.cs
- FrameworkContextData.cs
- DataTableClearEvent.cs
- StoreContentChangedEventArgs.cs
- IncrementalReadDecoders.cs
- Shape.cs
- DataColumnChangeEvent.cs
- AffineTransform3D.cs
- ToolStripPanelSelectionBehavior.cs
- ServerIdentity.cs
- MexNamedPipeBindingCollectionElement.cs
- ProcessingInstructionAction.cs
- GridViewDesigner.cs
- ImageMapEventArgs.cs
- ResourceExpression.cs
- SynchronizedInputPattern.cs
- WorkflowDefinitionContext.cs
- TargetConverter.cs
- UserValidatedEventArgs.cs
- EntityStoreSchemaFilterEntry.cs
- MissingFieldException.cs
- SqlCacheDependencyDatabase.cs
- PolicyLevel.cs
- SignerInfo.cs
- AssemblySettingAttributes.cs
- IODescriptionAttribute.cs
- DetailsViewActionList.cs
- TextPointerBase.cs
- ListViewDesigner.cs
- WsatExtendedInformation.cs
- CallTemplateAction.cs
- InputReportEventArgs.cs
- WebPartAddingEventArgs.cs
- FrameworkElementFactoryMarkupObject.cs
- FormsAuthenticationModule.cs