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
- DataColumn.cs
- StandardOleMarshalObject.cs
- ObfuscationAttribute.cs
- CodeNamespaceImport.cs
- ModelItemExtensions.cs
- CopyNodeSetAction.cs
- ConnectivityStatus.cs
- XamlPointCollectionSerializer.cs
- ModelUIElement3D.cs
- SessionStateItemCollection.cs
- ArraySortHelper.cs
- KeyValuePair.cs
- ArrayElementGridEntry.cs
- HyperLinkColumn.cs
- SerializationEventsCache.cs
- SapiInterop.cs
- embossbitmapeffect.cs
- UpdateDelegates.Generated.cs
- AnnotationAdorner.cs
- Metadata.cs
- StructuredTypeEmitter.cs
- QualifiedId.cs
- SourceInterpreter.cs
- LocalizableResourceBuilder.cs
- WebPartVerbsEventArgs.cs
- GifBitmapDecoder.cs
- MDIControlStrip.cs
- ListBoxChrome.cs
- TextEndOfLine.cs
- GeometryGroup.cs
- Point4DConverter.cs
- TextModifierScope.cs
- WorkflowServiceInstance.cs
- ExtentJoinTreeNode.cs
- ProcessManager.cs
- ArgumentValueSerializer.cs
- SQLCharsStorage.cs
- CodeValidator.cs
- AutoScrollExpandMessageFilter.cs
- RegexRunner.cs
- XmlFileEditor.cs
- SystemThemeKey.cs
- Type.cs
- PrimitiveXmlSerializers.cs
- IdnMapping.cs
- XmlSchemaAttributeGroupRef.cs
- TabRenderer.cs
- DynamicEndpointElement.cs
- BinaryFormatterWriter.cs
- HtmlProps.cs
- ClosureBinding.cs
- HttpValueCollection.cs
- ButtonFieldBase.cs
- SessionStateModule.cs
- WinFormsSecurity.cs
- Pair.cs
- CheckPair.cs
- AddressingProperty.cs
- ISO2022Encoding.cs
- PageContent.cs
- ConfigurationStrings.cs
- GenericTypeParameterBuilder.cs
- ScriptManagerProxy.cs
- InfoCardBaseException.cs
- OperatingSystem.cs
- ConstrainedDataObject.cs
- UpdateExpressionVisitor.cs
- _IPv4Address.cs
- Preprocessor.cs
- DrawingGroup.cs
- CommonDialog.cs
- ReceiveActivityDesigner.cs
- WriteLine.cs
- UpdateProgress.cs
- ExtensionWindowResizeGrip.cs
- EntityCommand.cs
- XPathParser.cs
- LineServices.cs
- MasterPageBuildProvider.cs
- DataGridViewColumnCollection.cs
- ReversePositionQuery.cs
- FtpWebResponse.cs
- DatatypeImplementation.cs
- LinkLabel.cs
- DesignerActionMethodItem.cs
- ParagraphResult.cs
- TextFormatterHost.cs
- ObjectIDGenerator.cs
- DoubleAnimationBase.cs
- Pen.cs
- GPStream.cs
- DictionaryEntry.cs
- BehaviorEditorPart.cs
- Italic.cs
- UniqueEventHelper.cs
- CharEntityEncoderFallback.cs
- StringInfo.cs
- SoapFault.cs
- ListControlActionList.cs
- BooleanStorage.cs