Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / MS / Internal / Data / DifferencingCollection.cs / 1305600 / DifferencingCollection.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: ObservableCollection that updates by differencing against // an IEnumerable // //--------------------------------------------------------------------------- /***************************************************************************\ This class maps an IEnumerable into an ObservableCollection. The idea is to initialize the collection with the items in the enumerable. When the user of the class has reason to believe the enumerable has changed, he should call Update. This re-enumerates the enumerable and brings the collection up to [....], and also raises appropriate collection-change notifications. A differencing algorithm detects simple changes, such as adding/removing a single item, moving a single item, or replacing an item, and raises the corresponding Add, Remove, Move or Replace event. All other changes result in a Reset event. The constructor and the Update method have an IEnumerable parameter. It's not required that these be the same - you can Update against a different IEnumerable than the constructor used. This makes sense if they enumerate the same items (up to simple changes). This class is used to support XLinq's Elements and Descendants properties, both of which return IEnumerables that don't raise collection-change events. XLinq returns different IEnumerables every time you fetch the property value, so the flexibility of the previous paragraph comes into play. \***************************************************************************/ using System; using System.Collections; // IEnumerable using System.Collections.Generic; // IListusing System.Collections.ObjectModel; // ObservableCollection using System.Collections.Specialized; // INotifyCollectionChanged using System.ComponentModel; // PropertyChangedEventArgs using MS.Internal; // Invariant.Assert namespace MS.Internal.Data { internal sealed class DifferencingCollection : ObservableCollection
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XNodeSchemaApplier.cs
- SchemaElementDecl.cs
- DataServiceException.cs
- TypedElement.cs
- DataGridViewColumnTypePicker.cs
- LocalIdKeyIdentifierClause.cs
- HttpWebRequest.cs
- NativeMethods.cs
- UniqueIdentifierService.cs
- XmlNodeReader.cs
- AttachedPropertyMethodSelector.cs
- DocumentViewerBase.cs
- Link.cs
- BoundPropertyEntry.cs
- EncryptedReference.cs
- StaticSiteMapProvider.cs
- RegisteredExpandoAttribute.cs
- TransformProviderWrapper.cs
- CodeNamespaceImportCollection.cs
- FrameworkContextData.cs
- StandardCommands.cs
- SchemaCollectionPreprocessor.cs
- Attributes.cs
- MediaContext.cs
- GB18030Encoding.cs
- HierarchicalDataSourceControl.cs
- SqlGatherProducedAliases.cs
- HMACSHA384.cs
- WindowsSecurityTokenAuthenticator.cs
- XamlToRtfWriter.cs
- SmiGettersStream.cs
- StaticSiteMapProvider.cs
- TransactionChannelFactory.cs
- ByteAnimation.cs
- NavigationHelper.cs
- ServerValidateEventArgs.cs
- SQLInt16.cs
- SchemaMapping.cs
- TransactionChannelFaultConverter.cs
- SharedUtils.cs
- MatchNoneMessageFilter.cs
- XmlWriterSettings.cs
- PropertyEntry.cs
- RichTextBoxConstants.cs
- HandleCollector.cs
- XmlUtil.cs
- ListView.cs
- TaskForm.cs
- BitmapSizeOptions.cs
- TextMarkerSource.cs
- IndexOutOfRangeException.cs
- TempFiles.cs
- TraversalRequest.cs
- HostedElements.cs
- ConditionValidator.cs
- SemaphoreFullException.cs
- ReachUIElementCollectionSerializer.cs
- XmlWellformedWriter.cs
- HighlightComponent.cs
- SettingsProperty.cs
- KeyValueInternalCollection.cs
- TripleDES.cs
- WebBrowserContainer.cs
- XmlUrlResolver.cs
- Geometry3D.cs
- CodeSubDirectoriesCollection.cs
- QuaternionAnimationBase.cs
- XmlWriterTraceListener.cs
- SplitContainer.cs
- URIFormatException.cs
- PolygonHotSpot.cs
- FrameworkEventSource.cs
- EntityCollection.cs
- BooleanKeyFrameCollection.cs
- InputScopeConverter.cs
- NativeRecognizer.cs
- ConfigLoader.cs
- FileInfo.cs
- SqlWriter.cs
- RoleManagerModule.cs
- PrintPreviewDialog.cs
- AbsoluteQuery.cs
- EntityCommand.cs
- List.cs
- WebBrowserSiteBase.cs
- VisualStateChangedEventArgs.cs
- EntityDataSourceConfigureObjectContext.cs
- DeobfuscatingStream.cs
- WebServiceHandler.cs
- StringWriter.cs
- MergeFailedEvent.cs
- Panel.cs
- DbConnectionClosed.cs
- IERequestCache.cs
- RegexNode.cs
- BasicExpressionVisitor.cs
- DbModificationCommandTree.cs
- Interfaces.cs
- PackUriHelper.cs
- PassportIdentity.cs