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
- ResourceDictionaryCollection.cs
- _NegoStream.cs
- XmlSerializerSection.cs
- AdapterDictionary.cs
- ControlCodeDomSerializer.cs
- DynamicRenderer.cs
- Point3DIndependentAnimationStorage.cs
- IRCollection.cs
- FlowDocument.cs
- DataGridViewCellLinkedList.cs
- sqlinternaltransaction.cs
- CompareInfo.cs
- SchemaComplexType.cs
- Variant.cs
- TableDetailsCollection.cs
- ConfigXmlDocument.cs
- XPathScanner.cs
- HandleExceptionArgs.cs
- ArithmeticException.cs
- XamlGridLengthSerializer.cs
- ActivityCodeGenerator.cs
- BreadCrumbTextConverter.cs
- WindowsSysHeader.cs
- ModuleElement.cs
- WebDescriptionAttribute.cs
- ChildDocumentBlock.cs
- SqlDataSourceSummaryPanel.cs
- PenLineCapValidation.cs
- SlipBehavior.cs
- EntityDataReader.cs
- _UriTypeConverter.cs
- HttpCookiesSection.cs
- InheritanceContextHelper.cs
- PreviousTrackingServiceAttribute.cs
- ThreadStateException.cs
- DrawingState.cs
- XmlNodeChangedEventArgs.cs
- DataGrid.cs
- Rfc2898DeriveBytes.cs
- TrackingProvider.cs
- GPPOINT.cs
- Interfaces.cs
- CustomGrammar.cs
- ComponentDispatcherThread.cs
- XmlDataDocument.cs
- XmlUtil.cs
- StateMachine.cs
- Sql8ExpressionRewriter.cs
- TextViewSelectionProcessor.cs
- BuildProviderUtils.cs
- LinqDataSourceDeleteEventArgs.cs
- ConfigurationProperty.cs
- Stack.cs
- DataRecordInfo.cs
- WorkingDirectoryEditor.cs
- WebServiceMethodData.cs
- ValueTypeIndexerReference.cs
- GraphicsState.cs
- RemoteWebConfigurationHostServer.cs
- MailMessageEventArgs.cs
- NetworkInformationPermission.cs
- EmbeddedMailObject.cs
- QuaternionConverter.cs
- RichTextBox.cs
- ListItemParagraph.cs
- PropertyEmitterBase.cs
- PackageStore.cs
- ManualResetEvent.cs
- DesignerActionUI.cs
- SystemDropShadowChrome.cs
- TextDocumentView.cs
- SqlMethodCallConverter.cs
- dbenumerator.cs
- FlatButtonAppearance.cs
- IncrementalHitTester.cs
- WebHttpBinding.cs
- MatrixStack.cs
- InstanceLockedException.cs
- ServiceContractGenerationContext.cs
- Deflater.cs
- HostingEnvironmentSection.cs
- CodeDomComponentSerializationService.cs
- QueryConverter.cs
- WebPartTransformer.cs
- FixedTextBuilder.cs
- SuppressIldasmAttribute.cs
- RegistryKey.cs
- SafeNativeMethods.cs
- ImageButton.cs
- WindowsGraphics.cs
- Soap.cs
- SqlServices.cs
- WithStatement.cs
- TableProviderWrapper.cs
- ProxyDataContractResolver.cs
- RSAOAEPKeyExchangeDeformatter.cs
- SymbolType.cs
- ExpressionBuilder.cs
- MainMenu.cs
- SqlCacheDependencySection.cs