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
- AndMessageFilterTable.cs
- TypeUnloadedException.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- StringInfo.cs
- SystemWebCachingSectionGroup.cs
- HorizontalAlignConverter.cs
- DefaultBindingPropertyAttribute.cs
- InvalidDataException.cs
- FileStream.cs
- ErrorLog.cs
- DetailsViewUpdatedEventArgs.cs
- TheQuery.cs
- SQLRoleProvider.cs
- LinqDataSourceView.cs
- ServiceChannelFactory.cs
- SqlXml.cs
- DrawingBrush.cs
- AttributeEmitter.cs
- SpotLight.cs
- TextRunProperties.cs
- AsyncCompletedEventArgs.cs
- IndependentlyAnimatedPropertyMetadata.cs
- SelectorAutomationPeer.cs
- RowToFieldTransformer.cs
- XmlReflectionImporter.cs
- SerializationStore.cs
- PermissionAttributes.cs
- PngBitmapEncoder.cs
- XmlDataSourceNodeDescriptor.cs
- UserCancellationException.cs
- OpacityConverter.cs
- DataGridBoolColumn.cs
- XmlSerializerVersionAttribute.cs
- XsltQilFactory.cs
- InkCanvasSelection.cs
- IIS7UserPrincipal.cs
- AttributeProviderAttribute.cs
- DataGridColumnFloatingHeader.cs
- SystemIPGlobalProperties.cs
- StateRuntime.cs
- NavigationPropertyEmitter.cs
- XmlHierarchyData.cs
- HttpListenerRequestUriBuilder.cs
- ValidatedControlConverter.cs
- CommentGlyph.cs
- Converter.cs
- SqlParameterizer.cs
- Command.cs
- SelectionBorderGlyph.cs
- ConnectionPoolManager.cs
- MasterPageBuildProvider.cs
- StylusLogic.cs
- FontCacheUtil.cs
- ContextActivityUtils.cs
- WebPartManagerInternals.cs
- HttpGetServerProtocol.cs
- TypeUnloadedException.cs
- PrimarySelectionGlyph.cs
- RuntimeConfigurationRecord.cs
- ProfileGroupSettings.cs
- PeerCustomResolverElement.cs
- KerberosReceiverSecurityToken.cs
- DataObject.cs
- WebServiceTypeData.cs
- PenLineCapValidation.cs
- XPathParser.cs
- GradientBrush.cs
- PermissionToken.cs
- IApplicationTrustManager.cs
- IssuanceTokenProviderBase.cs
- KnownBoxes.cs
- CompatibleIComparer.cs
- ValidationRule.cs
- safePerfProviderHandle.cs
- BitmapFrame.cs
- ProfileSection.cs
- _emptywebproxy.cs
- Thumb.cs
- SqlDuplicator.cs
- SafeNativeMethodsCLR.cs
- HtmlHistory.cs
- OpCopier.cs
- TemplateColumn.cs
- DecimalAverageAggregationOperator.cs
- ObjectSecurity.cs
- ExecutionScope.cs
- _HeaderInfoTable.cs
- Int16.cs
- RadioButtonFlatAdapter.cs
- PageContentAsyncResult.cs
- WebPermission.cs
- _NetworkingPerfCounters.cs
- WhitespaceRule.cs
- EmptyStringExpandableObjectConverter.cs
- ProfileSettings.cs
- EntryPointNotFoundException.cs
- TextEditorSelection.cs
- SearchForVirtualItemEventArgs.cs
- DataGridTextBox.cs
- PathParser.cs