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
- PrincipalPermission.cs
- LinqDataSourceContextEventArgs.cs
- Journal.cs
- LineProperties.cs
- WSHttpBindingBase.cs
- util.cs
- Transform3DGroup.cs
- HandleCollector.cs
- Query.cs
- KeyValuePairs.cs
- CacheMemory.cs
- CommentGlyph.cs
- Int32.cs
- DefaultBindingPropertyAttribute.cs
- HttpServerUtilityWrapper.cs
- GridItemPattern.cs
- NetStream.cs
- SqlException.cs
- SqlDelegatedTransaction.cs
- SqlWebEventProvider.cs
- OracleCommandBuilder.cs
- ResourceReferenceExpressionConverter.cs
- CollectionCodeDomSerializer.cs
- VSWCFServiceContractGenerator.cs
- ConditionalAttribute.cs
- SchemaHelper.cs
- Wildcard.cs
- StylusOverProperty.cs
- PackageRelationshipSelector.cs
- HeaderCollection.cs
- CultureTable.cs
- RuntimeHelpers.cs
- httpstaticobjectscollection.cs
- CreateUserWizardStep.cs
- ControlCachePolicy.cs
- EncoderFallback.cs
- CompositionTarget.cs
- NameSpaceExtractor.cs
- EventLogRecord.cs
- ImageSourceConverter.cs
- SmiContext.cs
- GuidConverter.cs
- TokenizerHelper.cs
- ScrollProperties.cs
- LookupBindingPropertiesAttribute.cs
- SyndicationCategory.cs
- MemoryStream.cs
- IndexedSelectQueryOperator.cs
- WindowsPrincipal.cs
- CompiledQuery.cs
- DataTable.cs
- __Error.cs
- ConfigXmlReader.cs
- IsolatedStorage.cs
- CssStyleCollection.cs
- XmlSerializationWriter.cs
- FontNameConverter.cs
- DnsPermission.cs
- ApplyImportsAction.cs
- ProcessModelSection.cs
- MarkupCompilePass1.cs
- BitmapImage.cs
- FontDialog.cs
- SqlEnums.cs
- MbpInfo.cs
- GACIdentityPermission.cs
- SerializationException.cs
- PermissionSet.cs
- RelatedImageListAttribute.cs
- SimpleMailWebEventProvider.cs
- WebPartUtil.cs
- InputBindingCollection.cs
- GraphicsContainer.cs
- ParallelDesigner.cs
- DocumentApplicationJournalEntry.cs
- RSAPKCS1SignatureDeformatter.cs
- SiteMapDataSourceView.cs
- ResponseBodyWriter.cs
- ToolStripRenderEventArgs.cs
- SafeFileHandle.cs
- SimpleExpression.cs
- StoreAnnotationsMap.cs
- VarInfo.cs
- TypeNameConverter.cs
- Solver.cs
- SkipQueryOptionExpression.cs
- PingReply.cs
- FileSystemEventArgs.cs
- ToolStripDropDownClosedEventArgs.cs
- XmlSchemaSimpleTypeRestriction.cs
- NativeRightsManagementAPIsStructures.cs
- TextSelectionHelper.cs
- Int64Storage.cs
- BooleanProjectedSlot.cs
- ZipIOCentralDirectoryBlock.cs
- SqlError.cs
- WebPartTransformer.cs
- UrlPath.cs
- UTF7Encoding.cs
- TextElementEnumerator.cs