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
- MailAddress.cs
- ExceptionHandlerDesigner.cs
- SymLanguageVendor.cs
- InvalidPrinterException.cs
- StoreAnnotationsMap.cs
- HttpCookiesSection.cs
- ShaperBuffers.cs
- CatalogPart.cs
- ConditionCollection.cs
- WindowsUpDown.cs
- Assert.cs
- DeobfuscatingStream.cs
- DbMetaDataCollectionNames.cs
- WSTrustFeb2005.cs
- CompositeActivityCodeGenerator.cs
- DesignerLabelAdapter.cs
- DirectoryNotFoundException.cs
- InvalidOperationException.cs
- SymLanguageType.cs
- BamlResourceDeserializer.cs
- ItemCollection.cs
- BoolLiteral.cs
- MimeAnyImporter.cs
- MetadataItemEmitter.cs
- AsymmetricSignatureDeformatter.cs
- FlowDocumentReaderAutomationPeer.cs
- DocumentSequenceHighlightLayer.cs
- DocumentPageTextView.cs
- Debug.cs
- LiteralDesigner.cs
- GeneralTransformGroup.cs
- StringValidatorAttribute.cs
- LinqDataSourceContextData.cs
- XmlToDatasetMap.cs
- SafeSecurityHandles.cs
- XmlSchemaException.cs
- SectionUpdates.cs
- EventDescriptor.cs
- UrlPath.cs
- ImplicitInputBrush.cs
- ApplicationActivator.cs
- DbDataAdapter.cs
- VersionedStream.cs
- DebugViewWriter.cs
- Invariant.cs
- XmlTextWriter.cs
- HttpModuleAction.cs
- ExternalCalls.cs
- TextPointerBase.cs
- GenericFlowSwitchHelper.cs
- Hex.cs
- DataSourceSelectArguments.cs
- SmtpReplyReaderFactory.cs
- BehaviorService.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ProgramPublisher.cs
- RowToFieldTransformer.cs
- MinimizableAttributeTypeConverter.cs
- ImportStoreException.cs
- IndexedString.cs
- CodeTypeReferenceCollection.cs
- WindowClosedEventArgs.cs
- BindingsCollection.cs
- ToolboxItemAttribute.cs
- NavigationService.cs
- VScrollBar.cs
- ProtocolProfile.cs
- WindowsFormsHostAutomationPeer.cs
- SqlCachedBuffer.cs
- HttpModulesSection.cs
- CodeTypeDeclaration.cs
- ServiceDocument.cs
- MergablePropertyAttribute.cs
- SecuritySessionClientSettings.cs
- EarlyBoundInfo.cs
- ThicknessAnimation.cs
- _FtpDataStream.cs
- CanonicalizationDriver.cs
- HwndKeyboardInputProvider.cs
- XmlSerializer.cs
- IntegrationExceptionEventArgs.cs
- WindowsStatic.cs
- DefaultCommandConverter.cs
- ExpressionEditorAttribute.cs
- RotateTransform3D.cs
- AppDomainManager.cs
- ImpersonateTokenRef.cs
- CapacityStreamGeometryContext.cs
- GridViewAutoFormat.cs
- DefaultValueTypeConverter.cs
- XmlUtf8RawTextWriter.cs
- EndPoint.cs
- FieldInfo.cs
- KeyGestureValueSerializer.cs
- SortExpressionBuilder.cs
- PipelineDeploymentState.cs
- WizardStepBase.cs
- NotSupportedException.cs
- MarkupCompilePass1.cs
- DataGridViewComboBoxCell.cs