Skip to content

Split ObservableListEx.cs into per-family partial classes#1096

Open
dwcullop wants to merge 7 commits into
reactivemarbles:mainfrom
dwcullop:maint/list_ext_breakup
Open

Split ObservableListEx.cs into per-family partial classes#1096
dwcullop wants to merge 7 commits into
reactivemarbles:mainfrom
dwcullop:maint/list_ext_breakup

Conversation

@dwcullop
Copy link
Copy Markdown
Member

@dwcullop dwcullop commented May 26, 2026

Splits ObservableListEx.cs (2,929 lines, 63 distinct operator names spanning 128 method bodies) into one partial-class file per operator name (overload set), following the convention now established for ObservableCacheEx (see PR #1095).

This revision replaces the earlier family-grouping split:

  1. One file per operator name (per overload set). The earlier 17 family files are replaced with 63 per-operator partial files. Finding Bind.cs or MergeChangeSets.cs is now exactly that.
  2. ObservableListEx.cs restored as a bare partial carrying the canonical class XML doc. Every per-operator partial repeats the same canonical summary (Extensions for ObservableList.) so the documentation never diverges between files and SA1601 is satisfied.
  3. Private helpers placed after public members within their containing file. The 5 private Combine overloads (used by And, Except, Or, Xor) live at the bottom of ObservableListEx.And.cs — the alphabetically-first caller.

This is still a pure file reorganisation. No code, no XML documentation, no comments, no preprocessor directives, and no constants were added, removed, or altered. The byte content of every method body is preserved (verified programmatically against the original).

Files

File Operator Overloads
ObservableListEx.Adapt.cs Adapt 1
ObservableListEx.AddKey.cs AddKey 1
ObservableListEx.And.cs And 5 (+ 5 private helpers)
ObservableListEx.AsObservableList.cs AsObservableList 2
ObservableListEx.AutoRefresh.cs AutoRefresh 2
ObservableListEx.AutoRefreshOnObservable.cs AutoRefreshOnObservable 1
ObservableListEx.Bind.cs Bind 5
ObservableListEx.BufferIf.cs BufferIf 4
ObservableListEx.BufferInitial.cs BufferInitial 1
ObservableListEx.Cast.cs Cast 2
ObservableListEx.CastToObject.cs CastToObject 1
ObservableListEx.Clone.cs Clone 1
ObservableListEx.Convert.cs Convert 1
ObservableListEx.DeferUntilLoaded.cs DeferUntilLoaded 2
ObservableListEx.DisposeMany.cs DisposeMany 1
ObservableListEx.DistinctValues.cs DistinctValues 1
ObservableListEx.Except.cs Except 5
ObservableListEx.ExpireAfter.cs ExpireAfter 1
ObservableListEx.Filter.cs Filter 3
ObservableListEx.FilterOnObservable.cs FilterOnObservable 1
ObservableListEx.FilterOnProperty.cs FilterOnProperty 1
ObservableListEx.FlattenBufferResult.cs FlattenBufferResult 1
ObservableListEx.ForEachChange.cs ForEachChange 1
ObservableListEx.ForEachItemChange.cs ForEachItemChange 1
ObservableListEx.GroupOn.cs GroupOn 1
ObservableListEx.GroupOnProperty.cs GroupOnProperty 1
ObservableListEx.GroupOnPropertyWithImmutableState.cs GroupOnPropertyWithImmutableState 1
ObservableListEx.GroupWithImmutableState.cs GroupWithImmutableState 1
ObservableListEx.LimitSizeTo.cs LimitSizeTo 1
ObservableListEx.MergeChangeSets.cs MergeChangeSets 10
ObservableListEx.MergeMany.cs MergeMany 1
ObservableListEx.MergeManyChangeSets.cs MergeManyChangeSets 3
ObservableListEx.NotEmpty.cs NotEmpty 1
ObservableListEx.OnItemAdded.cs OnItemAdded 1
ObservableListEx.OnItemRefreshed.cs OnItemRefreshed 1
ObservableListEx.OnItemRemoved.cs OnItemRemoved 1
ObservableListEx.Or.cs Or 5
ObservableListEx.Page.cs Page 1
ObservableListEx.PopulateInto.cs PopulateInto 1
ObservableListEx.QueryWhenChanged.cs QueryWhenChanged 2
ObservableListEx.RefCount.cs RefCount 1
ObservableListEx.RemoveIndex.cs RemoveIndex 1
ObservableListEx.Reverse.cs Reverse 1
ObservableListEx.SkipInitial.cs SkipInitial 1
ObservableListEx.Sort.cs Sort 2
ObservableListEx.StartWithEmpty.cs StartWithEmpty 1
ObservableListEx.SubscribeMany.cs SubscribeMany 1
ObservableListEx.SuppressRefresh.cs SuppressRefresh 1
ObservableListEx.Switch.cs Switch 2
ObservableListEx.ToCollection.cs ToCollection 1
ObservableListEx.ToObservableChangeSet.cs ToObservableChangeSet 8
ObservableListEx.Top.cs Top 1
ObservableListEx.ToSortedCollection.cs ToSortedCollection 2
ObservableListEx.Transform.cs Transform 4
ObservableListEx.TransformAsync.cs TransformAsync 4
ObservableListEx.TransformMany.cs TransformMany 4
ObservableListEx.Virtualise.cs Virtualise 1
ObservableListEx.WhenAnyPropertyChanged.cs WhenAnyPropertyChanged 1
ObservableListEx.WhenPropertyChanged.cs WhenPropertyChanged 1
ObservableListEx.WhenValueChanged.cs WhenValueChanged 1
ObservableListEx.WhereReasonsAre.cs WhereReasonsAre 1
ObservableListEx.WhereReasonsAreNot.cs WhereReasonsAreNot 1
ObservableListEx.Xor.cs Xor 5

Plus ObservableListEx.cs (bare partial carrying only the class XML doc).

Verification

The split was generated programmatically with byte-level per-method equality checks against the original. Every public method and the 5 private Combine overloads used internally by the combinator operators were confirmed to be present in exactly one file. Library builds clean (0 errors).

dwcullop added 3 commits May 25, 2026 23:06
Splits the 2900-line ObservableListEx.cs into 17 smaller partial-class files grouped by operator family. Each method (and all of its overloads) lives in exactly one file. The class declaration is changed to partial; no code, comments, or XML documentation is added, removed, or otherwise modified. All 2218 tests pass.
Renames ObservableListEx.Pagination.cs to ObservableListEx.Virtualise.cs for closer parity with the cache equivalent (ObservableCacheEx.VirtualiseAndPage.cs). Sorts members alphabetically within each new partial file; overloads of the same name preserve their original declaration order.
@dwcullop dwcullop enabled auto-merge (squash) May 26, 2026 14:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the monolithic ObservableListEx.cs (~2929 lines) into 17 partial-class files grouped by operator family. The change is purely organizational: the class is converted to partial, identical using directives are added to each file, and method bodies are preserved byte-for-byte.

Changes:

  • Splits ObservableListEx into 17 partial files by operator family (Filter, Transform, Sort, Merge, etc.).
  • Adds family-scoped XML summary on each partial-class declaration.
  • Deletes the original src/DynamicData/List/ObservableListEx.cs.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ObservableListEx.Adapt.cs Adapt operator.
ObservableListEx.AutoRefresh.cs AutoRefresh / AutoRefreshOnObservable.
ObservableListEx.Bind.cs Bind overloads.
ObservableListEx.ChangeStream.cs BufferIf, BufferInitial, DeferUntilLoaded, NotEmpty, SkipInitial, StartWithEmpty.
ObservableListEx.Combinators.cs And/Or/Except/Xor + private Combine helpers.
ObservableListEx.Conversions.cs AddKey, AsObservableList, Cast, Clone, Convert, RefCount, RemoveIndex, ForEach*, FlattenBufferResult.
ObservableListEx.Expiration.cs ExpireAfter, LimitSizeTo, Top.
ObservableListEx.Filter.cs Filter overloads, FilterOnObservable, FilterOnProperty, DistinctValues, SuppressRefresh, WhereReasonsAre*.
ObservableListEx.Group.cs GroupOn variants.
ObservableListEx.Lifecycle.cs DisposeMany, PopulateInto, SubscribeMany.
ObservableListEx.Merge.cs MergeChangeSets, MergeMany, MergeManyChangeSets, Switch.
ObservableListEx.Notifications.cs OnItemAdded/Removed/Refreshed.
ObservableListEx.PropertyChanged.cs WhenAnyPropertyChanged, WhenPropertyChanged, WhenValueChanged.
ObservableListEx.Query.cs QueryWhenChanged, ToCollection, ToObservableChangeSet, ToSortedCollection.
ObservableListEx.Sort.cs Sort, Reverse.
ObservableListEx.Transform.cs Transform, TransformAsync, TransformMany.
ObservableListEx.Virtualise.cs Page, Virtualise.

dwcullop added 2 commits May 30, 2026 11:14
…ad set)

Mirrors the same convention applied to ObservableCacheEx (PR reactivemarbles#1095):

1. ONE FILE PER OPERATOR NAME (one overload set per file). The previous 17
   family files are replaced with 63 per-operator partial files.

2. BARE ObservableListEx.cs FILE restored to carry the canonical class-level
   XML documentation. All partials carry the same canonical class summary
   ('Extensions for ObservableList.') so SA1601 is satisfied and there are
   no divergent per-file class docs.

3. PRIVATE HELPERS placed AFTER all public members within their containing
   file. The 5 private 'Combine' overloads (used by And, Except, Or, Xor)
   are placed at the bottom of And.cs (alphabetically first caller).

The byte content of every method body is preserved (verified programmatically).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants