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
- DocumentPageHost.cs
- WindowsAuthenticationModule.cs
- SqlConnectionManager.cs
- sqlmetadatafactory.cs
- CodeConditionStatement.cs
- Quaternion.cs
- CollectionExtensions.cs
- Socket.cs
- HScrollBar.cs
- ZipIOExtraFieldElement.cs
- DbModificationCommandTree.cs
- AdornerPresentationContext.cs
- Section.cs
- UpWmlPageAdapter.cs
- GridViewDeleteEventArgs.cs
- SqlTriggerContext.cs
- DesignerToolboxInfo.cs
- DeclaredTypeElementCollection.cs
- LocationReference.cs
- ProgressBarHighlightConverter.cs
- HTTPAPI_VERSION.cs
- CachedPathData.cs
- SystemIcmpV6Statistics.cs
- EntityViewContainer.cs
- XmlTextReaderImpl.cs
- HelloMessage11.cs
- DoWorkEventArgs.cs
- PeerResolverMode.cs
- MatrixValueSerializer.cs
- BinaryObjectInfo.cs
- FixedStringLookup.cs
- CmsInterop.cs
- Facet.cs
- InkCanvasSelectionAdorner.cs
- SspiNegotiationTokenAuthenticatorState.cs
- StorageConditionPropertyMapping.cs
- RelatedCurrencyManager.cs
- InstanceKey.cs
- OutputCacheProfile.cs
- Win32PrintDialog.cs
- Sql8ConformanceChecker.cs
- StretchValidation.cs
- PublishLicense.cs
- ViewStateException.cs
- SiteMapNodeItem.cs
- CircleHotSpot.cs
- ToolboxComponentsCreatedEventArgs.cs
- StrongName.cs
- RepeaterItem.cs
- Adorner.cs
- BitVec.cs
- ExpressionBuilder.cs
- ObjectDataSource.cs
- ConnectorRouter.cs
- BorderGapMaskConverter.cs
- CanonicalFormWriter.cs
- ListDictionaryInternal.cs
- ActivationServices.cs
- Ops.cs
- OrderedDictionary.cs
- URIFormatException.cs
- SafePEFileHandle.cs
- DataObjectAttribute.cs
- HtmlLink.cs
- TypeForwardedToAttribute.cs
- WindowsPen.cs
- UrlMappingsSection.cs
- SplitterPanel.cs
- MemberInitExpression.cs
- Point3DAnimationBase.cs
- Point4DConverter.cs
- ReadOnlyCollectionBase.cs
- ReflectionTypeLoadException.cs
- InstanceContextManager.cs
- MonthChangedEventArgs.cs
- LineServicesRun.cs
- Underline.cs
- DesigntimeLicenseContext.cs
- BitStack.cs
- HttpCapabilitiesSectionHandler.cs
- HttpServerVarsCollection.cs
- XmlDictionaryString.cs
- ServiceKnownTypeAttribute.cs
- ACE.cs
- FlagsAttribute.cs
- _AcceptOverlappedAsyncResult.cs
- AutomationPatternInfo.cs
- Converter.cs
- NamespaceInfo.cs
- IisTraceListener.cs
- HttpListenerResponse.cs
- UIElementParaClient.cs
- ColumnClickEvent.cs
- DataRowView.cs
- EventData.cs
- AutomationAttributeInfo.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- TypedTableHandler.cs
- GcSettings.cs
- TextTreeTextElementNode.cs