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
- CharacterMetrics.cs
- Transform3D.cs
- DefaultTraceListener.cs
- ReliableMessagingVersion.cs
- ConfigXmlComment.cs
- StrokeNodeOperations.cs
- ItemsPresenter.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- SelectionRangeConverter.cs
- GcHandle.cs
- ObjectKeyFrameCollection.cs
- WizardStepCollectionEditor.cs
- StylusDevice.cs
- RawMouseInputReport.cs
- MethodCallTranslator.cs
- InProcStateClientManager.cs
- CompositeDataBoundControl.cs
- ReadOnlyCollection.cs
- Parameter.cs
- DBConcurrencyException.cs
- CustomErrorsSectionWrapper.cs
- SignatureDescription.cs
- SafeSecurityHandles.cs
- InkPresenter.cs
- NodeFunctions.cs
- XmlSerializableWriter.cs
- ResXResourceReader.cs
- ObjRef.cs
- ToolStripSeparatorRenderEventArgs.cs
- CharEnumerator.cs
- DateTimeConstantAttribute.cs
- IndividualDeviceConfig.cs
- CheckBoxList.cs
- XmlIncludeAttribute.cs
- HandleExceptionArgs.cs
- Speller.cs
- FieldMetadata.cs
- MultiSelectRootGridEntry.cs
- SharedPersonalizationStateInfo.cs
- OperationFormatter.cs
- GenericArgumentsUpdater.cs
- Point3DKeyFrameCollection.cs
- Size.cs
- ProjectionQueryOptionExpression.cs
- SqlDelegatedTransaction.cs
- FlowNode.cs
- MetadataUtil.cs
- SharedPerformanceCounter.cs
- DesignerView.xaml.cs
- XdrBuilder.cs
- RegexCode.cs
- Script.cs
- DetailsViewUpdatedEventArgs.cs
- XNodeNavigator.cs
- StrokeIntersection.cs
- _FtpControlStream.cs
- MenuBindingsEditorForm.cs
- InvariantComparer.cs
- SmtpReplyReader.cs
- ConfigDefinitionUpdates.cs
- OleStrCAMarshaler.cs
- RequestQueryProcessor.cs
- DataGridBoundColumn.cs
- VersionedStreamOwner.cs
- RangeContentEnumerator.cs
- TextSearch.cs
- ResponseStream.cs
- ApplicationDirectoryMembershipCondition.cs
- WebServiceEnumData.cs
- XPathSingletonIterator.cs
- DynamicILGenerator.cs
- StaticResourceExtension.cs
- PathTooLongException.cs
- DataGridViewCellMouseEventArgs.cs
- ResizeGrip.cs
- RunClient.cs
- COM2PropertyDescriptor.cs
- DataMemberConverter.cs
- EmptyStringExpandableObjectConverter.cs
- SafeNativeMethodsMilCoreApi.cs
- MouseEvent.cs
- RenderingEventArgs.cs
- AuthorizationRuleCollection.cs
- AppearanceEditorPart.cs
- Converter.cs
- LogManagementAsyncResult.cs
- IndexerNameAttribute.cs
- XmlEntity.cs
- LockedHandleGlyph.cs
- DPTypeDescriptorContext.cs
- PropertyCollection.cs
- FontDifferentiator.cs
- FolderBrowserDialog.cs
- HighlightVisual.cs
- DictionarySectionHandler.cs
- SafeSecurityHandles.cs
- UpWmlPageAdapter.cs
- BinaryKeyIdentifierClause.cs
- XmlSchemaInfo.cs
- ExceptionHandlersDesigner.cs