Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- itemelement.cs
- wgx_sdk_version.cs
- WorkflowDesigner.cs
- ClipboardData.cs
- ClosableStream.cs
- OleDbRowUpdatedEvent.cs
- FaultPropagationRecord.cs
- TextComposition.cs
- RowUpdatedEventArgs.cs
- CachedFontFace.cs
- InkPresenter.cs
- __ComObject.cs
- SemaphoreFullException.cs
- WorkflowPrinting.cs
- OutputScope.cs
- SmtpException.cs
- _ContextAwareResult.cs
- SoapServerMessage.cs
- MimeMapping.cs
- Point3D.cs
- TripleDES.cs
- ActivityDesigner.cs
- DataFormats.cs
- Decimal.cs
- QualifiedCellIdBoolean.cs
- GregorianCalendar.cs
- ByteAnimation.cs
- safesecurityhelperavalon.cs
- XmlnsDefinitionAttribute.cs
- BufferedResponseStream.cs
- UnsafeNativeMethodsCLR.cs
- TemplateBuilder.cs
- HttpModuleCollection.cs
- PropertyAccessVisitor.cs
- PassportAuthenticationEventArgs.cs
- MarginCollapsingState.cs
- CacheMemory.cs
- UriWriter.cs
- IOException.cs
- XmlILModule.cs
- ValidatorUtils.cs
- Root.cs
- WebBrowserHelper.cs
- SystemColors.cs
- _DomainName.cs
- Splitter.cs
- GridViewEditEventArgs.cs
- DrawingCollection.cs
- shaperfactoryquerycacheentry.cs
- XmlTypeMapping.cs
- HtmlTitle.cs
- ManagementNamedValueCollection.cs
- IncrementalHitTester.cs
- SourceFileBuildProvider.cs
- EnvironmentPermission.cs
- ResourceAssociationSetEnd.cs
- MachineSettingsSection.cs
- GroupDescription.cs
- MediaTimeline.cs
- TypeDescriptorFilterService.cs
- ping.cs
- FontStretchConverter.cs
- DataTemplateKey.cs
- InstanceData.cs
- ButtonFlatAdapter.cs
- NavigationFailedEventArgs.cs
- UrlMappingCollection.cs
- TypeConvertions.cs
- DataControlFieldTypeEditor.cs
- safex509handles.cs
- MappingModelBuildProvider.cs
- ToolStripItem.cs
- DataGridViewCellLinkedList.cs
- BinHexDecoder.cs
- UpdateTracker.cs
- QueueProcessor.cs
- RequiredAttributeAttribute.cs
- ProcessModelSection.cs
- UncommonField.cs
- ProfilePropertySettingsCollection.cs
- NominalTypeEliminator.cs
- Validator.cs
- XmlAttributeCollection.cs
- RawStylusSystemGestureInputReport.cs
- CompositeFontInfo.cs
- MasterPageParser.cs
- ScriptingRoleServiceSection.cs
- CompositeCollectionView.cs
- ListBindingConverter.cs
- DispatcherFrame.cs
- DataBoundControlHelper.cs
- HostingEnvironment.cs
- CornerRadiusConverter.cs
- HitTestResult.cs
- SqlCharStream.cs
- XmlSchemaSubstitutionGroup.cs
- PkcsMisc.cs
- XmlSerializableReader.cs
- Oci.cs
- OrthographicCamera.cs