From 1f670104c804886c6de45be8bfe94058bc4d0ab7 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Wed, 17 Jun 2026 08:15:16 +0100 Subject: [PATCH 01/36] Add reactive compatibility and update tests Introduce reactive compatibility helpers and update the codebase to support newer Reactive APIs and runtime changes. Added ReactiveCompatibility and ReactiveTestCompatibility files, removed legacy Rxx support, and applied widespread updates across core, cache, list, binding, experimental, tests, and benchmarks to adjust API usage and test fixtures. Project/props files were also updated to align with the new build/runtime expectations. --- .../DynamicData.Profile.csproj | 1 - src/Directory.Build.props | 2 +- .../Cache/DeliveryQueueBenchmarks.cs | 1 - src/DynamicData.Benchmarks/Cache/EditDiff.cs | 3 +- .../Cache/ExpireAfter_Cache_ForStream.cs | 3 +- .../Cache/FilterImmutable.cs | 3 +- .../Cache/Filter_Cache_WithPredicateState.cs | 4 +- .../Cache/SortAndBindChange.cs | 16 +- .../Cache/SortAndBindInitial.cs | 11 +- .../Cache/StatelessFiltering.cs | 3 +- .../Cache/StatelessTransforming.cs | 3 +- .../Cache/ToObservableChangeSet_Cache.cs | 3 +- .../Cache/TransformImmutable.cs | 3 +- .../Cache/TransformMany.cs | 3 +- .../DynamicData.Benchmarks.csproj | 6 + .../List/DisposeMany_List.cs | 3 +- ...lter_List_Static_RandomizedBoundedEdits.cs | 3 +- ...er_List_Static_RandomizedUnboundedEdits.cs | 3 +- .../List/Filter_List_WithPredicateState.cs | 3 +- .../List/ToObservableChangeSet_List.cs | 3 +- ...ts.DynamicDataTests.DotNet9_0.verified.txt | 182 +- .../AggregationTests/AggregationFixture.cs | 1 - src/DynamicData.Tests/AutoRefreshFilter.cs | 5 +- .../Binding/AvaloniaDictionaryFixture.cs | 8 +- .../Binding/BindingLIstBindListFixture.cs | 3 - .../Binding/BindingListBindCacheFixture.cs | 3 +- .../BindingListBindCacheSortedFixture.cs | 4 - .../Binding/BindingListToChangeSetFixture.cs | 4 +- ...eeplyNestedNotifyPropertyChangedFixture.cs | 3 +- .../IObservableListBindCacheSortedFixture.cs | 1 - .../Binding/IObservableListBindListFixture.cs | 7 - .../ObservableCollectionBindCacheFixture.cs | 12 +- ...ervableCollectionBindCacheSortedFixture.cs | 9 - .../ReadonlyCollectionBindCacheFixture.cs | 4 +- .../Binding/WhenPropertyChangedRaceFixture.cs | 9 +- ...syncDisposeManyFixture.IntegrationTests.cs | 11 +- .../AsyncDisposeManyFixture.UnitTests.cs | 16 +- .../Cache/AutoRefreshFixture.Base.cs | 36 - ...AutoRefreshFixture.WithPropertyAccessor.cs | 4 - ...oRefreshFixture.WithoutPropertyAccessor.cs | 3 - .../AutoRefreshOnObservableFixture.Base.cs | 42 - .../AutoRefreshOnObservableFixture.WithKey.cs | 3 - ...toRefreshOnObservableFixture.WithoutKey.cs | 3 - .../Cache/AutoRefreshOnObservableFixture.cs | 3 - src/DynamicData.Tests/Cache/BatchFixture.cs | 2 - src/DynamicData.Tests/Cache/BatchIfFixture.cs | 4 - .../Cache/BatchIfWithTimeOutFixture.cs | 5 - .../Cache/BufferInitialFixture.cs | 2 - .../Cache/CrossCacheDeadlockStressTest.cs | 9 +- .../Cache/DeadlockTortureTest.cs | 1 - .../Cache/DisposeManyFixture.cs | 2 - .../Cache/DistinctFixture.cs | 3 +- .../Cache/EditDiffChangeSetFixture.cs | 3 +- .../Cache/EditDiffChangeSetOptionalFixture.cs | 3 +- .../Cache/EnsureUniqueKeysFixture.cs | 5 +- .../Cache/ExpireAfterFixture.ForSource.cs | 11 +- .../Cache/ExpireAfterFixture.ForStream.cs | 13 +- .../Cache/ExpireAfterFixture.cs | 5 +- .../Cache/FilterFixture.Base.cs | 23 +- ...xture.DynamicPredicate.IntegrationTests.cs | 7 +- ...ilterFixture.DynamicPredicate.UnitTests.cs | 22 +- ...redicateAndReFiltering.IntegrationTests.cs | 8 +- ...ynamicPredicateAndReFiltering.UnitTests.cs | 33 +- ....DynamicPredicateState.IntegrationTests.cs | 7 +- ...Fixture.DynamicPredicateState.UnitTests.cs | 22 +- .../Cache/FilterFixture.Static.cs | 8 +- src/DynamicData.Tests/Cache/FilterFixture.cs | 3 +- .../Cache/FilterImmutableFixture.cs | 21 +- .../Cache/FilterOnObservableFixture.cs | 5 +- .../Cache/FromAsyncFixture.cs | 5 +- .../Cache/GroupControllerFixture.cs | 2 - .../GroupControllerForFilteredItemsFixture.cs | 2 - src/DynamicData.Tests/Cache/GroupFixture.cs | 3 +- .../Cache/GroupOnDynamicFixture.cs | 6 +- .../Cache/GroupOnObservableFixture.cs | 5 +- .../Cache/InnerJoinFixture.cs | 8 - .../Cache/InnerJoinFixtureRaceCondition.cs | 4 +- .../Cache/InnerJoinManyFixture.cs | 8 - .../Cache/LeftJoinFixture.cs | 10 +- .../Cache/LeftJoinManyFixture.cs | 8 - .../Cache/MergeChangeSetsFixture.cs | 4 +- .../Cache/MergeManyChangeSetsCacheFixture.cs | 10 +- ...ManyChangeSetsCacheSourceCompareFixture.cs | 9 +- .../Cache/MergeManyChangeSetsListFixture.cs | 9 +- .../Cache/MergeManyFixture.cs | 2 - .../Cache/MergeManyItemsFixture.cs | 2 - .../Cache/MergeManyWithKeyOverloadFixture.cs | 2 - .../Cache/MonitorStatusFixture.cs | 4 +- .../Cache/ObservableChangeSetFixture.cs | 8 +- src/DynamicData.Tests/Cache/OnItemFixture.cs | 3 +- src/DynamicData.Tests/Cache/PageFixture.cs | 1 - .../Cache/RefCountFixture.cs | 3 +- .../Cache/RightJoinFixture.cs | 8 - .../Cache/RightJoinManyFixture.cs | 8 - .../Cache/SizeLimitFixture.cs | 3 - .../Cache/SortAndBindFixture.cs | 37 - .../Cache/SortAndBindObservableFixture.cs | 10 +- .../Cache/SortAndPageAndBindFixture.cs | 18 +- .../Cache/SortAndPageFixture.cs | 20 +- .../Cache/SortAndVirtualizeAndBindFixture.cs | 24 +- .../Cache/SortAndVirtualizeFixture.cs | 23 +- src/DynamicData.Tests/Cache/SortFixture.cs | 2 - .../Cache/SortObservableFixtureFixture.cs | 1 - .../Cache/SourceCacheFixture.cs | 8 +- .../Cache/SubscribeManyFixture.cs | 3 +- .../Cache/SuspendNotificationsFixture.cs | 3 +- src/DynamicData.Tests/Cache/SwitchFixture.cs | 7 +- ...ChangeSetFixture.Items.IntegrationTests.cs | 10 +- ...ervableChangeSetFixture.Items.UnitTests.cs | 44 +- ...geSetFixture.Sequences.IntegrationTests.cs | 10 +- ...bleChangeSetFixture.Sequences.UnitTests.cs | 38 +- .../Cache/ToObservableOptionalFixture.cs | 3 +- .../Cache/ToSortedCollectionFixture.cs | 6 +- .../Cache/TransformAsyncFixture.cs | 9 - .../Cache/TransformFixture.cs | 4 +- .../Cache/TransformImmutableFixture.cs | 19 +- .../Cache/TransformManyAsyncFixture.cs | 3 +- .../TransformManyObservableCacheFixture.cs | 493 ++- .../Cache/TransformOnObservableFixture.cs | 6 +- .../Cache/TransformSafeAsyncFixture.cs | 8 - .../Cache/TransformTreeFixture.cs | 3 +- .../Cache/TransformWithInlineUpdateFixture.cs | 3 +- .../Cache/TrueForAllFixture.cs | 2 - .../Cache/TrueForAnyFixture.cs | 2 - src/DynamicData.Tests/Cache/WatcherFixture.cs | 6 +- src/DynamicData.Tests/Domain/AnimalOwner.cs | 3 +- src/DynamicData.Tests/Domain/Market.cs | 4 +- src/DynamicData.Tests/Domain/PersonObs.cs | 3 +- .../Domain/SelfObservingPerson.cs | 3 +- .../DynamicData.Tests.csproj | 9 +- .../EnumerableIListFixture.cs | 7 +- .../CacheParentSubscriptionFixture.cs | 5 +- .../Internal/NotificationFixture.cs | 1 - .../Issues/EmptyToChangeSetIssue.cs | 3 +- .../Issues/OnItemRemovedIssue.cs | 3 +- .../Kernal/OptionObservableFixture.cs | 3 +- .../List/AutoRefreshFixture.cs | 4 +- src/DynamicData.Tests/List/BatchFixture.cs | 3 - src/DynamicData.Tests/List/BatchIfFixture.cs | 4 - .../List/BatchIfWithTimeOutFixture.cs | 3 - src/DynamicData.Tests/List/BufferFixture.cs | 3 - .../List/BufferInitialFixture.cs | 2 - .../List/CreationFixtures.cs | 3 +- .../List/DisposeManyFixture.cs | 3 - .../List/ExpireAfterFixture.cs | 11 +- ...terControllerFixtureWithClearAndReplace.cs | 1 - .../FilterControllerFixtureWithDiffSet.cs | 1 - .../List/FilterFixture.Base.cs | 17 +- .../List/FilterFixture.Static.cs | 34 +- .../List/FilterFixture.WithPredicateState.cs | 36 +- .../List/FilterOnObservableFixture.cs | 1 - .../List/FilterWithObservable.cs | 1 - .../List/FromAsyncFixture.cs | 5 +- .../List/GroupImmutableFixture.cs | 4 +- .../List/MergeChangeSetsFixture.cs | 9 +- .../List/MergeManyChangeSetsCacheFixture.cs | 9 +- .../List/MergeManyChangeSetsFixture.cs | 2 - .../List/MergeManyChangeSetsListFixture.cs | 8 +- .../List/MergeManyFixture.cs | 2 - .../List/OnItemAddedFixture.cs | 9 - .../List/OnItemRefreshedFixture.cs | 9 - .../List/OnItemRemovedFixture.cs | 13 - src/DynamicData.Tests/List/PageFixture.cs | 3 - src/DynamicData.Tests/List/RefCountFixture.cs | 1 - .../List/SizeLimitFixture.cs | 2 - src/DynamicData.Tests/List/SortFixture.cs | 6 +- .../List/SortMutableFixture.cs | 2 - .../List/SourceListFixture.cs | 3 +- .../List/SubscribeManyFixture.cs | 1 - src/DynamicData.Tests/List/SwitchFixture.cs | 3 +- .../List/ToCollectionFixture.cs | 3 +- ...ChangeSetFixture.Items.IntegrationTests.cs | 10 +- ...ervableChangeSetFixture.Items.UnitTests.cs | 24 +- ...geSetFixture.Sequences.IntegrationTests.cs | 10 +- ...bleChangeSetFixture.Sequences.UnitTests.cs | 22 +- .../List/TransformFixture.cs | 3 +- .../List/VirtualisationFixture.cs | 2 - .../ObservableCollectionExFixture.cs | 3 +- .../Utilities/CacheItemRecordingObserver.cs | 3 +- .../Utilities/ComparerExtensions.cs | 4 +- .../Utilities/FakeScheduler.cs | 61 +- .../Utilities/FakerExtensions.cs | 6 +- .../Utilities/ListItemRecordingObserver.cs | 3 +- .../Utilities/ObservableEx.cs | 6 +- .../Utilities/ObservableExtensions.cs | 5 +- .../Utilities/ObservableSpy.cs | 4 +- .../Utilities/RandomizerExtensions.cs | 3 +- .../Utilities/ReactiveTestCompatibility.cs | 168 + .../Utilities/RecordingObserverBase.cs | 6 +- .../Utilities/StressAddRemoveExtensions.cs | 6 +- .../Utilities/TestSourceCache.cs | 5 +- .../Utilities/TestSourceList.cs | 5 +- .../UnsynchronizedNotificationException.cs | 3 +- .../Utilities/ValueRecordingObserver.cs | 3 +- src/DynamicData/Aggregation/AggregationEx.cs | 3 - src/DynamicData/Aggregation/AvgEx.cs | 2 - src/DynamicData/Aggregation/CountEx.cs | 4 +- src/DynamicData/Aggregation/MaxEx.cs | 4 +- src/DynamicData/Aggregation/StdDevEx.cs | 4 +- src/DynamicData/Alias/ObservableCacheAlias.cs | 4 +- src/DynamicData/Attributes.cs | 3 +- .../Binding/AbstractNotifyPropertyChanged.cs | 1 - src/DynamicData/Binding/BindPaged.cs | 5 +- src/DynamicData/Binding/BindVirtualized.cs | 5 +- .../Binding/BindingListEventsSuspender.cs | 3 +- src/DynamicData/Binding/BindingListEx.cs | 4 +- src/DynamicData/Binding/ExpressionBuilder.cs | 4 +- src/DynamicData/Binding/IObservableListEx.cs | 3 +- .../Binding/NotifyPropertyChangedEx.cs | 1 - src/DynamicData/Binding/Observable.cs | 4 +- .../Binding/ObservableCollectionEx.cs | 2 - .../Binding/ObservableCollectionExtended.cs | 1 - .../Binding/ObservablePropertyFactory.cs | 5 +- .../Binding/ObservablePropertyPart.cs | 1 - src/DynamicData/Binding/SortAndBind.cs | 4 +- src/DynamicData/Binding/SortAndBindOptions.cs | 4 +- .../Internal/AnonymousObservableCache.cs | 1 - .../Cache/Internal/AsyncDisposeMany.cs | 9 +- src/DynamicData/Cache/Internal/AutoRefresh.cs | 6 +- src/DynamicData/Cache/Internal/BatchIf.cs | 7 +- src/DynamicData/Cache/Internal/Cast.cs | 4 +- .../Cache/Internal/ChangeSetCache.cs | 4 +- src/DynamicData/Cache/Internal/Combiner.cs | 2 - .../Cache/Internal/DeferUntilLoaded.cs | 2 - src/DynamicData/Cache/Internal/DisposeMany.cs | 6 +- .../Cache/Internal/DistinctCalculator.cs | 4 +- .../Cache/Internal/DynamicCombiner.cs | 5 +- .../Cache/Internal/DynamicGrouper.cs | 3 +- .../Internal/EditDiffChangeSetOptional.cs | 4 +- .../Cache/Internal/ExpireAfter.ForSource.cs | 6 +- .../Cache/Internal/ExpireAfter.ForStream.cs | 6 +- .../Cache/Internal/Filter.Dynamic.cs | 4 +- .../Cache/Internal/Filter.Static.cs | 4 +- .../Cache/Internal/FilterImmutable.cs | 5 +- .../Cache/Internal/FilterOnObservable.cs | 5 +- src/DynamicData/Cache/Internal/FinallySafe.cs | 3 - src/DynamicData/Cache/Internal/FullJoin.cs | 5 +- src/DynamicData/Cache/Internal/GroupOn.cs | 6 +- .../Cache/Internal/GroupOnDynamic.cs | 6 +- .../Cache/Internal/GroupOnImmutable.cs | 6 +- .../Cache/Internal/GroupOnObservable.cs | 3 +- .../Cache/Internal/GroupOnProperty.cs | 4 +- .../GroupOnPropertyWithImmutableState.cs | 4 +- src/DynamicData/Cache/Internal/InnerJoin.cs | 5 +- src/DynamicData/Cache/Internal/LeftJoin.cs | 5 +- .../Cache/Internal/LockFreeObservableCache.cs | 5 +- .../Cache/Internal/MergeChangeSets.cs | 6 +- src/DynamicData/Cache/Internal/MergeMany.cs | 4 +- .../Internal/MergeManyCacheChangeSets.cs | 1 - .../MergeManyCacheChangeSetsSourceCompare.cs | 1 - .../Cache/Internal/MergeManyItems.cs | 2 - .../Cache/Internal/MergeManyListChangeSets.cs | 1 - .../Cache/Internal/ObservableWithValue.cs | 2 - src/DynamicData/Cache/Internal/OfType.cs | 3 +- .../Cache/Internal/OnBeingRemoved.cs | 5 +- src/DynamicData/Cache/Internal/Page.cs | 5 +- .../Cache/Internal/QueryWhenChanged.cs | 5 +- src/DynamicData/Cache/Internal/RefCount.cs | 5 +- src/DynamicData/Cache/Internal/RightJoin.cs | 5 +- src/DynamicData/Cache/Internal/SizeExpirer.cs | 3 - src/DynamicData/Cache/Internal/Sort.cs | 6 +- src/DynamicData/Cache/Internal/SortAndPage.cs | 4 +- .../Cache/Internal/SortAndVirtualize.cs | 4 +- .../Cache/Internal/SpecifiedGrouper.cs | 5 +- .../Cache/Internal/StatusMonitor.cs | 4 - .../Cache/Internal/SubscribeMany.cs | 6 +- src/DynamicData/Cache/Internal/Switch.cs | 7 +- .../Cache/Internal/ToObservableChangeSet.cs | 8 +- .../Cache/Internal/ToObservableOptional.cs | 4 +- src/DynamicData/Cache/Internal/Transform.cs | 2 - .../Cache/Internal/TransformAsync.cs | 6 +- .../Cache/Internal/TransformImmutable.cs | 5 +- .../Cache/Internal/TransformMany.cs | 4 +- .../Cache/Internal/TransformManyAsync.cs | 3 +- .../Cache/Internal/TransformOnObservable.cs | 3 +- .../Internal/TransformWithForcedTransform.cs | 5 +- .../Internal/TransformWithInlineUpdate.cs | 2 - src/DynamicData/Cache/Internal/TreeBuilder.cs | 7 +- src/DynamicData/Cache/Internal/TrueFor.cs | 3 - .../Cache/Internal/UniquenessEnforcer.cs | 4 +- src/DynamicData/Cache/Internal/Virtualise.cs | 5 +- src/DynamicData/Cache/Node.cs | 2 - src/DynamicData/Cache/ObservableCache.cs | 18 +- .../Cache/ObservableCacheEx.Adapt.cs | 6 +- .../Cache/ObservableCacheEx.AdaptSelector.cs | 4 - .../Cache/ObservableCacheEx.AddOrUpdate.cs | 6 +- .../Cache/ObservableCacheEx.And.cs | 6 +- .../ObservableCacheEx.AsObservableCache.cs | 6 +- .../ObservableCacheEx.AsyncDisposeMany.cs | 6 +- .../Cache/ObservableCacheEx.AutoRefresh.cs | 6 +- ...servableCacheEx.AutoRefreshOnObservable.cs | 6 +- .../Cache/ObservableCacheEx.Batch.cs | 6 +- .../Cache/ObservableCacheEx.BatchIf.cs | 6 +- .../Cache/ObservableCacheEx.Bind.cs | 6 +- .../Cache/ObservableCacheEx.BufferInitial.cs | 6 +- .../Cache/ObservableCacheEx.Cast.cs | 6 +- .../Cache/ObservableCacheEx.ChangeKey.cs | 6 +- .../Cache/ObservableCacheEx.Clear.cs | 6 +- .../Cache/ObservableCacheEx.Clone.cs | 6 +- .../Cache/ObservableCacheEx.Combine.cs | 4 - .../Cache/ObservableCacheEx.Convert.cs | 6 +- ...vableCacheEx.CreateChangeSetTransformer.cs | 4 - .../ObservableCacheEx.DeferUntilLoaded.cs | 6 +- .../Cache/ObservableCacheEx.DisposeMany.cs | 6 +- .../Cache/ObservableCacheEx.DistinctValues.cs | 6 +- .../Cache/ObservableCacheEx.EditDiff.cs | 6 +- .../ObservableCacheEx.EnsureUniqueKeys.cs | 6 +- .../Cache/ObservableCacheEx.Except.cs | 6 +- .../Cache/ObservableCacheEx.ExpireAfter.cs | 6 +- .../Cache/ObservableCacheEx.Filter.cs | 6 +- .../ObservableCacheEx.FilterImmutable.cs | 6 +- .../ObservableCacheEx.FilterOnObservable.cs | 6 +- .../Cache/ObservableCacheEx.FinallySafe.cs | 6 +- .../Cache/ObservableCacheEx.Flatten.cs | 6 +- .../ObservableCacheEx.FlattenBufferResult.cs | 6 +- .../Cache/ObservableCacheEx.ForEachChange.cs | 6 +- .../Cache/ObservableCacheEx.ForForced.cs | 4 - .../Cache/ObservableCacheEx.FullJoin.cs | 6 +- .../Cache/ObservableCacheEx.FullJoinMany.cs | 6 +- .../Cache/ObservableCacheEx.Group.cs | 6 +- .../ObservableCacheEx.GroupOnObservable.cs | 6 +- .../ObservableCacheEx.GroupOnProperty.cs | 6 +- ...cheEx.GroupOnPropertyWithImmutableState.cs | 6 +- ...servableCacheEx.GroupWithImmutableState.cs | 6 +- ...rvableCacheEx.IgnoreSameReferenceUpdate.cs | 6 +- .../ObservableCacheEx.IgnoreUpdateWhen.cs | 6 +- .../ObservableCacheEx.IncludeUpdateWhen.cs | 6 +- .../Cache/ObservableCacheEx.InnerJoin.cs | 6 +- .../Cache/ObservableCacheEx.InnerJoinMany.cs | 6 +- .../Cache/ObservableCacheEx.InvokeEvaluate.cs | 6 +- .../Cache/ObservableCacheEx.LeftJoin.cs | 6 +- .../Cache/ObservableCacheEx.LeftJoinMany.cs | 6 +- .../Cache/ObservableCacheEx.LimitSizeTo.cs | 6 +- .../ObservableCacheEx.MergeChangeSets.cs | 6 +- .../Cache/ObservableCacheEx.MergeMany.cs | 6 +- .../ObservableCacheEx.MergeManyChangeSets.cs | 6 +- .../Cache/ObservableCacheEx.MergeManyItems.cs | 6 +- .../Cache/ObservableCacheEx.MonitorStatus.cs | 6 +- .../Cache/ObservableCacheEx.NotEmpty.cs | 6 +- .../Cache/ObservableCacheEx.OfType.cs | 6 +- .../Cache/ObservableCacheEx.OnChangeAction.cs | 4 - .../Cache/ObservableCacheEx.OnItemAdded.cs | 6 +- .../ObservableCacheEx.OnItemRefreshed.cs | 6 +- .../Cache/ObservableCacheEx.OnItemRemoved.cs | 6 +- .../Cache/ObservableCacheEx.OnItemUpdated.cs | 6 +- src/DynamicData/Cache/ObservableCacheEx.Or.cs | 6 +- .../Cache/ObservableCacheEx.PopulateFrom.cs | 8 +- .../Cache/ObservableCacheEx.PopulateInto.cs | 6 +- .../ObservableCacheEx.QueryWhenChanged.cs | 6 +- .../Cache/ObservableCacheEx.RefCount.cs | 6 +- .../Cache/ObservableCacheEx.Refresh.cs | 6 +- .../Cache/ObservableCacheEx.Remove.cs | 6 +- .../Cache/ObservableCacheEx.RemoveKey.cs | 6 +- .../Cache/ObservableCacheEx.RemoveKeys.cs | 6 +- .../Cache/ObservableCacheEx.RightJoin.cs | 6 +- .../Cache/ObservableCacheEx.RightJoinMany.cs | 6 +- .../Cache/ObservableCacheEx.SkipInitial.cs | 6 +- .../Cache/ObservableCacheEx.Sort.cs | 6 +- .../Cache/ObservableCacheEx.SortBy.cs | 6 +- .../Cache/ObservableCacheEx.StartWithEmpty.cs | 6 +- .../Cache/ObservableCacheEx.StartWithItem.cs | 6 +- .../Cache/ObservableCacheEx.SubscribeMany.cs | 6 +- .../ObservableCacheEx.SuppressRefresh.cs | 6 +- .../Cache/ObservableCacheEx.Switch.cs | 6 +- .../Cache/ObservableCacheEx.ToCollection.cs | 6 +- ...ObservableCacheEx.ToObservableChangeSet.cs | 6 +- .../ObservableCacheEx.ToObservableOptional.cs | 6 +- .../ObservableCacheEx.ToSortedCollection.cs | 6 +- .../Cache/ObservableCacheEx.Transform.cs | 6 +- .../Cache/ObservableCacheEx.TransformAsync.cs | 6 +- .../ObservableCacheEx.TransformImmutable.cs | 6 +- .../Cache/ObservableCacheEx.TransformMany.cs | 6 +- .../ObservableCacheEx.TransformManyAsync.cs | 6 +- ...bservableCacheEx.TransformManySafeAsync.cs | 6 +- ...ObservableCacheEx.TransformOnObservable.cs | 6 +- .../Cache/ObservableCacheEx.TransformSafe.cs | 6 +- .../ObservableCacheEx.TransformSafeAsync.cs | 6 +- .../ObservableCacheEx.TransformToTree.cs | 6 +- ...rvableCacheEx.TransformWithInlineUpdate.cs | 6 +- ...ObservableCacheEx.TreatMovesAsRemoveAdd.cs | 6 +- .../Cache/ObservableCacheEx.TrueFor.cs | 4 - .../Cache/ObservableCacheEx.TrueForAll.cs | 6 +- .../Cache/ObservableCacheEx.TrueForAny.cs | 6 +- .../Cache/ObservableCacheEx.UpdateIndex.cs | 6 +- .../ObservableCacheEx.VirtualiseAndPage.cs | 1 - .../Cache/ObservableCacheEx.Watch.cs | 6 +- .../Cache/ObservableCacheEx.WatchValue.cs | 6 +- ...bservableCacheEx.WhenAnyPropertyChanged.cs | 6 +- .../ObservableCacheEx.WhenPropertyChanged.cs | 6 +- .../ObservableCacheEx.WhenValueChanged.cs | 6 +- .../ObservableCacheEx.WhereReasonsAre.cs | 6 +- .../ObservableCacheEx.WhereReasonsAreNot.cs | 6 +- .../Cache/ObservableCacheEx.Xor.cs | 6 +- src/DynamicData/Cache/ObservableCacheEx.cs | 6 +- .../Cache/Tests/ChangeSetAggregator.cs | 3 - .../Tests/DistinctChangeSetAggregator.cs | 3 - .../Cache/Tests/GroupChangeSetAggregator.cs | 5 +- .../Cache/Tests/PagedChangeSetAggregator.cs | 3 - .../Cache/Tests/SortedChangeSetAggregator.cs | 3 - .../Cache/Tests/VirtualChangeSetAggregator.cs | 3 - .../Diagnostics/DiagnosticOperators.cs | 4 +- src/DynamicData/DynamicData.csproj | 11 +- src/DynamicData/EnumerableEx.cs | 5 +- .../Experimental/ExperimentalEx.cs | 4 +- .../Experimental/ISubjectWithRefCount.cs | 4 +- .../Experimental/SubjectWithRefCount.cs | 14 +- src/DynamicData/Experimental/Watcher.cs | 7 +- src/DynamicData/GlobalConfig.cs | 6 +- .../Internal/CacheParentSubscription.cs | 4 +- src/DynamicData/Internal/ObservableEx.cs | 4 +- .../Internal/ReactiveCompatibility.cs | 3009 +++++++++++++++++ src/DynamicData/Internal/Rxx.cs | 41 - .../Internal/SynchronizeSafeExtensions.cs | 5 +- src/DynamicData/Kernel/InternalEx.cs | 59 +- .../Kernel/OptionObservableExtensions.cs | 12 +- .../List/Internal/AnonymousObservableList.cs | 1 - src/DynamicData/List/Internal/AutoRefresh.cs | 6 +- src/DynamicData/List/Internal/BufferIf.cs | 5 - .../List/Internal/ClonedListChangeSet.cs | 4 +- src/DynamicData/List/Internal/Combiner.cs | 5 +- .../List/Internal/DeferUntilLoaded.cs | 2 - src/DynamicData/List/Internal/DisposeMany.cs | 6 +- src/DynamicData/List/Internal/Distinct.cs | 2 - .../List/Internal/DynamicCombiner.cs | 3 - src/DynamicData/List/Internal/ExpireAfter.cs | 4 - .../List/Internal/Filter.Dynamic.cs | 2 - .../List/Internal/Filter.Static.cs | 4 +- .../Internal/Filter.WithPredicateState.cs | 19 +- .../List/Internal/FilterOnObservable.cs | 6 +- .../List/Internal/FilterOnProperty.cs | 3 +- src/DynamicData/List/Internal/FilterStatic.cs | 2 - src/DynamicData/List/Internal/GroupOn.cs | 4 - .../List/Internal/GroupOnImmutable.cs | 4 - .../List/Internal/GroupOnProperty.cs | 4 +- .../GroupOnPropertyWithImmutableState.cs | 4 +- src/DynamicData/List/Internal/LimitSizeTo.cs | 3 - .../List/Internal/MergeChangeSets.cs | 3 - src/DynamicData/List/Internal/MergeMany.cs | 4 - .../List/Internal/MergeManyCacheChangeSets.cs | 4 +- .../List/Internal/MergeManyListChangeSets.cs | 6 +- src/DynamicData/List/Internal/OnItemAdded.cs | 2 - .../List/Internal/OnItemRefreshed.cs | 2 - .../List/Internal/OnItemRemoved.cs | 2 - src/DynamicData/List/Internal/Pager.cs | 1 - .../List/Internal/QueryWhenChanged.cs | 2 - src/DynamicData/List/Internal/RefCount.cs | 5 +- src/DynamicData/List/Internal/Sort.cs | 5 +- .../List/Internal/SubscribeMany.cs | 4 - src/DynamicData/List/Internal/Switch.cs | 5 +- .../List/Internal/ToObservableChangeSet.cs | 8 +- .../List/Internal/TransformAsync.cs | 2 - .../List/Internal/TransformMany.cs | 2 - src/DynamicData/List/Internal/Transformer.cs | 2 - src/DynamicData/List/Internal/Virtualiser.cs | 4 +- .../List/ObservableListEx.Adapt.cs | 6 +- .../List/ObservableListEx.AddKey.cs | 6 +- src/DynamicData/List/ObservableListEx.And.cs | 6 +- .../List/ObservableListEx.AsObservableList.cs | 6 +- .../List/ObservableListEx.AutoRefresh.cs | 6 +- ...bservableListEx.AutoRefreshOnObservable.cs | 6 +- src/DynamicData/List/ObservableListEx.Bind.cs | 6 +- .../List/ObservableListEx.BufferIf.cs | 6 +- .../List/ObservableListEx.BufferInitial.cs | 6 +- src/DynamicData/List/ObservableListEx.Cast.cs | 6 +- .../List/ObservableListEx.CastToObject.cs | 6 +- .../List/ObservableListEx.Clone.cs | 6 +- .../List/ObservableListEx.Combine.cs | 4 - .../List/ObservableListEx.Convert.cs | 6 +- .../List/ObservableListEx.DeferUntilLoaded.cs | 6 +- .../List/ObservableListEx.DisposeMany.cs | 6 +- .../List/ObservableListEx.DistinctValues.cs | 6 +- .../List/ObservableListEx.Except.cs | 6 +- .../List/ObservableListEx.ExpireAfter.cs | 6 +- .../List/ObservableListEx.Filter.cs | 6 +- .../ObservableListEx.FilterOnObservable.cs | 6 +- .../List/ObservableListEx.FilterOnProperty.cs | 6 +- .../ObservableListEx.FlattenBufferResult.cs | 8 +- .../List/ObservableListEx.ForEachChange.cs | 6 +- .../ObservableListEx.ForEachItemChange.cs | 6 +- .../List/ObservableListEx.GroupOn.cs | 6 +- .../List/ObservableListEx.GroupOnProperty.cs | 6 +- ...istEx.GroupOnPropertyWithImmutableState.cs | 6 +- ...bservableListEx.GroupWithImmutableState.cs | 6 +- .../List/ObservableListEx.LimitSizeTo.cs | 6 +- .../List/ObservableListEx.MergeChangeSets.cs | 6 +- .../List/ObservableListEx.MergeMany.cs | 6 +- .../ObservableListEx.MergeManyChangeSets.cs | 6 +- .../List/ObservableListEx.NotEmpty.cs | 6 +- .../List/ObservableListEx.OnItemAdded.cs | 6 +- .../List/ObservableListEx.OnItemRefreshed.cs | 6 +- .../List/ObservableListEx.OnItemRemoved.cs | 6 +- src/DynamicData/List/ObservableListEx.Or.cs | 6 +- src/DynamicData/List/ObservableListEx.Page.cs | 6 +- .../List/ObservableListEx.PopulateInto.cs | 6 +- .../List/ObservableListEx.QueryWhenChanged.cs | 6 +- .../List/ObservableListEx.RefCount.cs | 6 +- .../List/ObservableListEx.RemoveIndex.cs | 6 +- .../List/ObservableListEx.Reverse.cs | 6 +- .../List/ObservableListEx.SkipInitial.cs | 6 +- src/DynamicData/List/ObservableListEx.Sort.cs | 6 +- .../List/ObservableListEx.StartWithEmpty.cs | 6 +- .../List/ObservableListEx.SubscribeMany.cs | 6 +- .../List/ObservableListEx.SuppressRefresh.cs | 6 +- .../List/ObservableListEx.Switch.cs | 6 +- .../List/ObservableListEx.ToCollection.cs | 6 +- .../ObservableListEx.ToObservableChangeSet.cs | 6 +- .../ObservableListEx.ToSortedCollection.cs | 6 +- src/DynamicData/List/ObservableListEx.Top.cs | 6 +- .../List/ObservableListEx.Transform.cs | 6 +- .../List/ObservableListEx.TransformAsync.cs | 6 +- .../List/ObservableListEx.TransformMany.cs | 6 +- .../List/ObservableListEx.Virtualise.cs | 6 +- ...ObservableListEx.WhenAnyPropertyChanged.cs | 6 +- .../ObservableListEx.WhenPropertyChanged.cs | 6 +- .../List/ObservableListEx.WhenValueChanged.cs | 6 +- .../List/ObservableListEx.WhereReasonsAre.cs | 6 +- .../ObservableListEx.WhereReasonsAreNot.cs | 6 +- src/DynamicData/List/ObservableListEx.Xor.cs | 6 +- src/DynamicData/List/ObservableListEx.cs | 6 +- src/DynamicData/List/SourceList.cs | 6 +- .../List/Tests/ChangeSetAggregator.cs | 3 - src/DynamicData/ObservableChangeSet.cs | 11 +- src/DynamicData/Platforms/net45/PFilter.cs | 1 - .../Platforms/net45/PSubscribeMany.cs | 2 - src/DynamicData/Platforms/net45/PTransform.cs | 1 - 525 files changed, 4107 insertions(+), 2973 deletions(-) create mode 100644 src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs create mode 100644 src/DynamicData/Internal/ReactiveCompatibility.cs delete mode 100644 src/DynamicData/Internal/Rxx.cs diff --git a/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj b/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj index 504b3165c..8e7cb5536 100644 --- a/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj +++ b/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj @@ -14,7 +14,6 @@ - diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 7d002a3bb..bc6b11c9c 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -58,7 +58,7 @@ - + diff --git a/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs b/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs index f5e397006..8aa5846da 100644 --- a/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs +++ b/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs @@ -4,7 +4,6 @@ using System; using System.Linq; -using System.Reactive.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/src/DynamicData.Benchmarks/Cache/EditDiff.cs b/src/DynamicData.Benchmarks/Cache/EditDiff.cs index a6b4fd53d..6e580d9ac 100644 --- a/src/DynamicData.Benchmarks/Cache/EditDiff.cs +++ b/src/DynamicData.Benchmarks/Cache/EditDiff.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs index a13cefbf0..cfa804e76 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Immutable; using System.Linq; -using System.Reactive.Subjects; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs index 6bde5da17..583eac8c6 100644 --- a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Reactive.Subjects; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs index 0404b7c54..401f3d085 100644 --- a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Immutable; using System.Linq; -using System.Reactive.Subjects; using BenchmarkDotNet.Attributes; @@ -99,7 +98,6 @@ public Filter_Cache_WithPredicateState() } _changeSets = changeSets.MoveToImmutable(); - var predicateStates = ImmutableArray.CreateBuilder(initialCapacity: 5_000); while (predicateStates.Count < predicateStates.Capacity) predicateStates.Add(randomizer.Int()); diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs index 484e544e1..2afd65c0d 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.ObjectModel; using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Subjects; using BenchmarkDotNet.Attributes; using DynamicData.Binding; @@ -19,7 +17,6 @@ private record Item(string Name, int Id, int Ranking); .Ascending(i => i.Ranking) .ThenByAscending(i => i.Name); - Subject> _newSubject = new(); Subject> _newSubjectOptimised = new(); Subject> _oldSubject = new(); @@ -32,12 +29,9 @@ private record Item(string Name, int Id, int Ranking); private ReadOnlyObservableCollection? _oldList; private ReadOnlyObservableCollection? _oldListOptimised; - - [Params(10, 100, 1_000, 10_000, 50_000)] public int Count { get; set; } - [GlobalSetup] public void SetUp() { @@ -46,7 +40,6 @@ public void SetUp() _newSubject = new Subject>(); _newSubjectOptimised = new Subject>(); - _cleanUp = new CompositeDisposable ( _newSubject.SortAndBind(out var newList, _comparer).Subscribe(), @@ -65,8 +58,6 @@ public void SetUp() _oldList = oldList; _oldListOptimised = oldOptimisedList; - - var changeSet = new ChangeSet(Count); foreach (var i in Enumerable.Range(1, Count)) { @@ -84,7 +75,6 @@ public void SetUp() [Benchmark(Baseline = true)] public void Old() => RunTest(_oldSubject, _oldList!); - [Benchmark] public void OldOptimized() => RunTest(_oldSubjectOptimised, _oldListOptimised!); @@ -94,7 +84,6 @@ public void SetUp() [Benchmark] public void NewOptimized() => RunTest(_newSubjectOptimised, _newListOptimised!); - void RunTest(Subject> subject, ReadOnlyObservableCollection list) { var original = list[Count / 2]; @@ -106,6 +95,5 @@ void RunTest(Subject> subject, ReadOnlyObservableCollectio }); } - public void Dispose() => _cleanUp?.Dispose(); -} \ No newline at end of file +} diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs index a27b082bd..894a209cd 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs @@ -1,8 +1,6 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using System; using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Subjects; using DynamicData.Binding; namespace DynamicData.Benchmarks.Cache; @@ -17,7 +15,6 @@ private record Item(string Name, int Id, int Ranking); private readonly SortExpressionComparer _comparer = SortExpressionComparer.Ascending(i => i.Ranking).ThenByAscending(i => i.Name); - Subject> _newSubject = new(); Subject> _newSubjectOptimised = new(); Subject> _oldSubject = new(); @@ -26,11 +23,9 @@ private record Item(string Name, int Id, int Ranking); private IDisposable? _cleanUp; private ChangeSet? _changeSet; - [Params(10, 100, 1_000, 10_000, 50_000)] public int Count { get; set; } - [GlobalSetup] public void SetUp() { @@ -63,7 +58,6 @@ public void SetUp() ); } - [Benchmark(Baseline = true)] public void Old() => _oldSubject.OnNext(_changeSet!); @@ -76,6 +70,5 @@ public void SetUp() [Benchmark] public void NewOptimized() => _newSubjectOptimised.OnNext(_changeSet!); - public void Dispose() => _cleanUp?.Dispose(); -} \ No newline at end of file +} diff --git a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs index b4a806afb..9a63f6cc5 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Reactive.Subjects; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs index 9328dd956..1f1dc2b88 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs index eca407d03..7867c3571 100644 --- a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; diff --git a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs index 3bbd28d8f..e1ccfd9b2 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/Cache/TransformMany.cs b/src/DynamicData.Benchmarks/Cache/TransformMany.cs index 5b91eaa41..86d04c135 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformMany.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformMany.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj index 451ac4697..2eb954106 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -22,6 +22,12 @@ + + + + + + diff --git a/src/DynamicData.Benchmarks/List/DisposeMany_List.cs b/src/DynamicData.Benchmarks/List/DisposeMany_List.cs index 53cbe5d5e..bf5cc60fb 100644 --- a/src/DynamicData.Benchmarks/List/DisposeMany_List.cs +++ b/src/DynamicData.Benchmarks/List/DisposeMany_List.cs @@ -1,9 +1,8 @@ -// Copyright (c) 2011-2019 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2019 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System; -using System.Reactive.Disposables; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs index 6e4ab39ee..4bdc9f9eb 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using System.Reactive.Subjects; using System.Reflection; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs index e9065ef17..4cab054f5 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using System.Reactive.Subjects; using System.Reflection; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs index 3707767be..dd1e57414 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Immutable; using System.Linq; -using System.Reactive.Subjects; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs index 0908c20f9..b80e77629 100644 --- a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs +++ b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs @@ -1,5 +1,4 @@ -using System; -using System.Reactive.Subjects; +using System; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; diff --git a/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet9_0.verified.txt b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet9_0.verified.txt index ff1f94916..b58a51b16 100644 --- a/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet9_0.verified.txt +++ b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet9_0.verified.txt @@ -1,7 +1,7 @@ -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.Profile")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.Benchmarks")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.Profile")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.ReactiveUI")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.Tests")] -[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v9.0", FrameworkDisplayName=".NET 9.0")] namespace DynamicData.Aggregation { public readonly struct AggregateItem : System.IEquatable> @@ -27,7 +27,7 @@ namespace DynamicData.Aggregation public static System.IObservable> ForAggregation(this System.IObservable> source) where TObject : notnull where TKey : notnull { } - public static System.IObservable InvalidateWhen(this System.IObservable source, System.IObservable invalidate) { } + public static System.IObservable InvalidateWhen(this System.IObservable source, System.IObservable invalidate) { } public static System.IObservable InvalidateWhen(this System.IObservable source, System.IObservable invalidate) { } } public static class AvgEx @@ -233,7 +233,7 @@ namespace DynamicData.Alias { public static class ObservableCacheAlias { - public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -241,7 +241,7 @@ namespace DynamicData.Alias where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -254,7 +254,7 @@ namespace DynamicData.Alias where TDestinationKey : notnull where TSource : notnull where TSourceKey : notnull { } - public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -262,7 +262,7 @@ namespace DynamicData.Alias where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -279,7 +279,7 @@ namespace DynamicData.Alias public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicateChanged) where TObject : notnull where TKey : notnull { } - public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicateChanged, System.IObservable reapplyFilter) + public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicateChanged, System.IObservable reapplyFilter) where TObject : notnull where TKey : notnull { } } @@ -322,7 +322,7 @@ namespace DynamicData.Binding } public static class BindingListEx { - public static System.IObservable> ObserveCollectionChanges(this System.ComponentModel.IBindingList source) { } + public static System.IObservable> ObserveCollectionChanges(this System.ComponentModel.IBindingList source) { } public static System.IObservable> ToObservableChangeSet<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this System.ComponentModel.BindingList source) where T : notnull { } public static System.IObservable> ToObservableChangeSet(this TCollection source) @@ -423,7 +423,7 @@ namespace DynamicData.Binding } public static class ObservableCollectionEx { - public static System.IObservable> ObserveCollectionChanges(this System.Collections.Specialized.INotifyCollectionChanged source) { } + public static System.IObservable> ObserveCollectionChanges(this System.Collections.Specialized.INotifyCollectionChanged source) { } public static System.IObservable> ToObservableChangeSet(this System.Collections.ObjectModel.ObservableCollection source) where T : notnull { } public static System.IObservable> ToObservableChangeSet(this System.Collections.ObjectModel.ReadOnlyObservableCollection source) @@ -470,7 +470,7 @@ namespace DynamicData.Binding public int InitialCapacity { get; init; } public bool ResetOnFirstTimeLoad { get; init; } public int ResetThreshold { get; init; } - public System.Reactive.Concurrency.IScheduler? Scheduler { get; init; } + public ReactiveUI.Primitives.Concurrency.ISequencer? Scheduler { get; init; } public bool UseBinarySearch { get; init; } public bool UseReplaceForUpdates { get; init; } } @@ -1132,37 +1132,37 @@ namespace DynamicData public static DynamicData.IObservableCache AsObservableCache(this System.IObservable> source, bool applyLocking = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> AsyncDisposeMany(this System.IObservable> source, System.Action> disposalsCompletedAccessor) + public static System.IObservable> AsyncDisposeMany(this System.IObservable> source, System.Action> disposalsCompletedAccessor) where TObject : notnull where TKey : notnull { } - public static System.IObservable> AutoRefresh(this System.IObservable> source, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : System.ComponentModel.INotifyPropertyChanged where TKey : notnull { } - public static System.IObservable> AutoRefresh(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : System.ComponentModel.INotifyPropertyChanged where TKey : notnull { } - public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> Batch(this System.IObservable> source, System.TimeSpan timeSpan, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> Batch(this System.IObservable> source, System.TimeSpan timeSpan, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.TimeSpan? timeOut = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.TimeSpan? timeOut = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, System.IObservable? timer = null, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, System.IObservable? timer = null, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, System.TimeSpan? timeOut = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, System.TimeSpan? timeOut = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, System.Collections.Generic.IList targetList) @@ -1225,7 +1225,7 @@ namespace DynamicData public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = 25, bool useReplaceForUpdates = true, DynamicData.Binding.ISortedObservableCollectionAdaptor? adaptor = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> BufferInitial(this System.IObservable> source, System.TimeSpan initialBuffer, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BufferInitial(this System.IObservable> source, System.TimeSpan initialBuffer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } public static System.IObservable> Cast(this System.IObservable> source, System.Func converter) @@ -1303,16 +1303,16 @@ namespace DynamicData public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector) where TObject : notnull where TKey : notnull { } - public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, System.Reactive.Concurrency.IScheduler scheduler) + public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, ReactiveUI.Primitives.Concurrency.ISequencer scheduler) where TObject : notnull where TKey : notnull { } public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, System.TimeSpan? pollingInterval) where TObject : notnull where TKey : notnull { } - public static System.IObservable>> ExpireAfter(this DynamicData.ISourceCache source, System.Func timeSelector, System.TimeSpan? pollingInterval = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable>> ExpireAfter(this DynamicData.ISourceCache source, System.Func timeSelector, System.TimeSpan? pollingInterval = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, System.TimeSpan? pollingInterval, System.Reactive.Concurrency.IScheduler scheduler) + public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, System.TimeSpan? pollingInterval, ReactiveUI.Primitives.Concurrency.ISequencer scheduler) where TObject : notnull where TKey : notnull { } public static System.IObservable> Filter(this System.IObservable> source, System.Func filter, bool suppressEmptyChangeSets = true) @@ -1321,7 +1321,7 @@ namespace DynamicData public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicateChanged, bool suppressEmptyChangeSets = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicateChanged, System.IObservable reapplyFilter, bool suppressEmptyChangeSets = true) + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicateChanged, System.IObservable reapplyFilter, bool suppressEmptyChangeSets = true) where TObject : notnull where TKey : notnull { } public static System.IObservable> Filter(this System.IObservable> source, System.IObservable predicateState, System.Func predicate, bool suppressEmptyChangeSets = true) @@ -1330,10 +1330,10 @@ namespace DynamicData public static System.IObservable> FilterImmutable(this System.IObservable> source, System.Func predicate, bool suppressEmptyChangeSets = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> filterFactory, System.TimeSpan? buffer = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> filterFactory, System.TimeSpan? buffer = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> filterFactory, System.TimeSpan? buffer = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> filterFactory, System.TimeSpan? buffer = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } [System.Obsolete("This can cause unhandled exception issues so do not use")] @@ -1379,15 +1379,15 @@ namespace DynamicData where TObject : notnull where TKey : notnull where TGroupKey : notnull { } - public static System.IObservable> Group(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable regrouper) + public static System.IObservable> Group(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable regrouper) where TObject : notnull where TKey : notnull where TGroupKey : notnull { } - public static System.IObservable> Group(this System.IObservable> source, System.IObservable> groupSelectorKeyObservable, System.IObservable? regrouper = null) + public static System.IObservable> Group(this System.IObservable> source, System.IObservable> groupSelectorKeyObservable, System.IObservable? regrouper = null) where TObject : notnull where TKey : notnull where TGroupKey : notnull { } - public static System.IObservable> Group(this System.IObservable> source, System.IObservable> groupSelectorKeyObservable, System.IObservable? regrouper = null) + public static System.IObservable> Group(this System.IObservable> source, System.IObservable> groupSelectorKeyObservable, System.IObservable? regrouper = null) where TObject : notnull where TKey : notnull where TGroupKey : notnull { } @@ -1399,15 +1399,15 @@ namespace DynamicData where TObject : notnull where TKey : notnull where TGroupKey : notnull { } - public static System.IObservable> GroupOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> GroupOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : System.ComponentModel.INotifyPropertyChanged where TKey : notnull where TGroupKey : notnull { } - public static System.IObservable> GroupOnPropertyWithImmutableState(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> GroupOnPropertyWithImmutableState(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : System.ComponentModel.INotifyPropertyChanged where TKey : notnull where TGroupKey : notnull { } - public static System.IObservable> GroupWithImmutableState(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable? regrouper = null) + public static System.IObservable> GroupWithImmutableState(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable? regrouper = null) where TObject : notnull where TKey : notnull where TGroupKey : notnull { } @@ -1482,7 +1482,7 @@ namespace DynamicData public static System.IObservable> LimitSizeTo(this System.IObservable> source, int size) where TObject : notnull where TKey : notnull { } - public static System.IObservable>> LimitSizeTo(this DynamicData.ISourceCache source, int sizeLimit, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable>> LimitSizeTo(this DynamicData.ISourceCache source, int sizeLimit, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } public static System.IObservable> MergeChangeSets(this System.IObservable>> source) @@ -1494,43 +1494,43 @@ namespace DynamicData public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IEqualityComparer equalityComparer) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer equalityComparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer equalityComparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer equalityComparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer equalityComparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } - public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull where TKey : notnull { } public static System.IObservable MergeMany(this System.IObservable> source, System.Func> observableSelector) @@ -1763,11 +1763,11 @@ namespace DynamicData where TObject : notnull where TKey : notnull { } [System.Obsolete("Use SortAndBind as it\'s more efficient")] - public static System.IObservable> Sort(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable resorter, DynamicData.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + public static System.IObservable> Sort(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable resorter, DynamicData.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) where TObject : notnull where TKey : notnull { } [System.Obsolete("Use SortAndBind as it\'s more efficient")] - public static System.IObservable> Sort(this System.IObservable> source, System.IObservable> comparerObservable, System.IObservable resorter, DynamicData.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + public static System.IObservable> Sort(this System.IObservable> source, System.IObservable> comparerObservable, System.IObservable resorter, DynamicData.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) where TObject : notnull where TKey : notnull { } public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList) @@ -1878,10 +1878,10 @@ namespace DynamicData public static System.IObservable> ToCollection(this System.IObservable> source) where TObject : notnull where TKey : notnull { } - public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func keySelector, System.Func? expireAfter = null, int limitSizeTo = -1, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func keySelector, System.Func? expireAfter = null, int limitSizeTo = -1, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func keySelector, System.Func? expireAfter = null, int limitSizeTo = -1, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func keySelector, System.Func? expireAfter = null, int limitSizeTo = -1, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, System.Collections.Generic.IEqualityComparer? equalityComparer = null) @@ -1904,7 +1904,7 @@ namespace DynamicData public static System.IObservable>> Top(this System.IObservable> source, System.Collections.Generic.IComparer comparer, int size) where TObject : notnull where TKey : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -1916,7 +1916,7 @@ namespace DynamicData where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -1928,7 +1928,7 @@ namespace DynamicData where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable forceTransform) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -2060,7 +2060,7 @@ namespace DynamicData where TSource : notnull where TKey : notnull where TDestination : notnull { } - public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -2068,7 +2068,7 @@ namespace DynamicData where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -2076,7 +2076,7 @@ namespace DynamicData where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -2257,11 +2257,11 @@ namespace DynamicData where T : notnull { } public static DynamicData.IObservableList AsObservableList(this System.IObservable> source) where T : notnull { } - public static System.IObservable> AutoRefresh(this System.IObservable> source, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : System.ComponentModel.INotifyPropertyChanged { } - public static System.IObservable> AutoRefresh(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : System.ComponentModel.INotifyPropertyChanged { } - public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull { } public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Binding.IObservableCollection targetCollection, DynamicData.Binding.BindingOptions options) where T : notnull { } @@ -2273,15 +2273,15 @@ namespace DynamicData where T : notnull { } public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this System.IObservable> source, System.ComponentModel.BindingList bindingList, int resetThreshold = 25) where T : notnull { } - public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.TimeSpan? timeOut, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.TimeSpan? timeOut, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState, System.TimeSpan? timeOut, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState, System.TimeSpan? timeOut, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> BufferInitial(this System.IObservable> source, System.TimeSpan initialBuffer, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> BufferInitial(this System.IObservable> source, System.TimeSpan initialBuffer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull { } public static System.IObservable> Cast(this System.IObservable> source) where TDestination : notnull { } @@ -2315,7 +2315,7 @@ namespace DynamicData where T : notnull { } public static System.IObservable> Except(this System.IObservable> source, params System.IObservable>[] others) where T : notnull { } - public static System.IObservable> ExpireAfter(this DynamicData.ISourceList source, System.Func timeSelector, System.TimeSpan? pollingInterval = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ExpireAfter(this DynamicData.ISourceList source, System.Func timeSelector, System.TimeSpan? pollingInterval = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } public static System.IObservable> Filter(this System.IObservable> source, System.Func predicate) where T : notnull { } @@ -2323,10 +2323,10 @@ namespace DynamicData where T : notnull { } public static System.IObservable> Filter(this System.IObservable> source, System.IObservable predicateState, System.Func predicate, DynamicData.ListFilterPolicy filterPolicy = 1, bool suppressEmptyChangeSets = true) where T : notnull { } - public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> objectFilterObservable, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> objectFilterObservable, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull { } [System.Obsolete("Use AutoRefresh(), followed by Filter() instead")] - public static System.IObservable> FilterOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.Func predicate, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> FilterOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.Func predicate, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : System.ComponentModel.INotifyPropertyChanged { } public static System.IObservable> FlattenBufferResult(this System.IObservable>> source) where T : notnull { } @@ -2334,19 +2334,19 @@ namespace DynamicData where TObject : notnull { } public static System.IObservable> ForEachItemChange(this System.IObservable> source, System.Action> action) where TObject : notnull { } - public static System.IObservable>> GroupOn(this System.IObservable> source, System.Func groupSelector, System.IObservable? regrouper = null) + public static System.IObservable>> GroupOn(this System.IObservable> source, System.Func groupSelector, System.IObservable? regrouper = null) where TObject : notnull where TGroup : notnull { } - public static System.IObservable>> GroupOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable>> GroupOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : System.ComponentModel.INotifyPropertyChanged where TGroup : notnull { } - public static System.IObservable>> GroupOnPropertyWithImmutableState(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable>> GroupOnPropertyWithImmutableState(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : System.ComponentModel.INotifyPropertyChanged where TGroup : notnull { } - public static System.IObservable>> GroupWithImmutableState(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable? regrouper = null) + public static System.IObservable>> GroupWithImmutableState(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable? regrouper = null) where TObject : notnull where TGroupKey : notnull { } - public static System.IObservable> LimitSizeTo(this DynamicData.ISourceList source, int sizeLimit, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> LimitSizeTo(this DynamicData.ISourceList source, int sizeLimit, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } public static System.IObservable> MergeChangeSets(this DynamicData.IObservableList>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null) where TObject : notnull { } @@ -2354,11 +2354,11 @@ namespace DynamicData where TObject : notnull { } public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null) where TObject : notnull { } - public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull { } - public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer? equalityComparer = null, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull { } - public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer? equalityComparer = null, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) where TObject : notnull { } public static System.IObservable> MergeChangeSets(this DynamicData.IObservableList>> source, System.Collections.Generic.IComparer comparer) where TObject : notnull @@ -2419,9 +2419,9 @@ namespace DynamicData where T : notnull { } public static System.IObservable> SkipInitial(this System.IObservable> source) where T : notnull { } - public static System.IObservable> Sort(this System.IObservable> source, System.IObservable> comparerChanged, DynamicData.SortOptions options = 0, System.IObservable? resort = null, int resetThreshold = 50) + public static System.IObservable> Sort(this System.IObservable> source, System.IObservable> comparerChanged, DynamicData.SortOptions options = 0, System.IObservable? resort = null, int resetThreshold = 50) where T : notnull { } - public static System.IObservable> Sort(this System.IObservable> source, System.Collections.Generic.IComparer comparer, DynamicData.SortOptions options = 0, System.IObservable? resort = null, System.IObservable>? comparerChanged = null, int resetThreshold = 50) + public static System.IObservable> Sort(this System.IObservable> source, System.Collections.Generic.IComparer comparer, DynamicData.SortOptions options = 0, System.IObservable? resort = null, System.IObservable>? comparerChanged = null, int resetThreshold = 50) where T : notnull { } public static System.IObservable> StartWithEmpty(this System.IObservable> source) where T : notnull { } @@ -2435,21 +2435,21 @@ namespace DynamicData where T : notnull { } public static System.IObservable> ToCollection(this System.IObservable> source) where TObject : notnull { } - public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func expireAfter, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func expireAfter, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, int limitSizeTo, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, int limitSizeTo, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func expireAfter, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func expireAfter, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> ToObservableChangeSet(this System.IObservable source, int limitSizeTo, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, int limitSizeTo, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func? expireAfter, int limitSizeTo, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func? expireAfter, int limitSizeTo, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } - public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func? expireAfter, int limitSizeTo, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func? expireAfter, int limitSizeTo, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where T : notnull { } public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Collections.Generic.IComparer comparer) where TObject : notnull { } @@ -2747,7 +2747,7 @@ namespace DynamicData.Experimental { public static class ExperimentalEx { - public static DynamicData.Experimental.IWatcher AsWatcher(this System.IObservable> source, System.Reactive.Concurrency.IScheduler? scheduler = null) + public static DynamicData.Experimental.IWatcher AsWatcher(this System.IObservable> source, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } } @@ -2793,8 +2793,8 @@ namespace DynamicData.Kernel { public static System.IObservable RetryWithBackOff(this System.IObservable source, System.Func backOffStrategy) where TException : System.Exception { } - public static System.IDisposable ScheduleRecurringAction(this System.Reactive.Concurrency.IScheduler scheduler, System.Func interval, System.Action action) { } - public static System.IDisposable ScheduleRecurringAction(this System.Reactive.Concurrency.IScheduler scheduler, System.TimeSpan interval, System.Action action) { } + public static System.IDisposable ScheduleRecurringAction(this ReactiveUI.Primitives.Concurrency.ISequencer scheduler, System.Func interval, System.Action action) { } + public static System.IDisposable ScheduleRecurringAction(this ReactiveUI.Primitives.Concurrency.ISequencer scheduler, System.TimeSpan interval, System.Action action) { } } public readonly struct ItemWithIndex : System.IEquatable> { @@ -3100,4 +3100,4 @@ namespace DynamicData.Tests public void Dispose() { } protected virtual void Dispose(bool isDisposing) { } } -} +} \ No newline at end of file diff --git a/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs b/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs index 4755cddbc..8610dbd7c 100644 --- a/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs @@ -1,5 +1,4 @@ using System; -using System.Reactive.Linq; using DynamicData.Aggregation; using DynamicData.Kernel; diff --git a/src/DynamicData.Tests/AutoRefreshFilter.cs b/src/DynamicData.Tests/AutoRefreshFilter.cs index 94226edb9..81577cd92 100644 --- a/src/DynamicData.Tests/AutoRefreshFilter.cs +++ b/src/DynamicData.Tests/AutoRefreshFilter.cs @@ -1,9 +1,7 @@ -using System; +using System; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.Binding; using FluentAssertions; @@ -32,7 +30,6 @@ public void Bind_Transform_and_FilterOnObservable() ); } - [Fact] public void Test() { diff --git a/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs b/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs index 478fa6807..e1407662d 100644 --- a/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs +++ b/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; @@ -51,7 +51,6 @@ public void Replace() _results.Data.Items[0].Should().Be(person2); } - [Fact] public void Remove() { @@ -64,7 +63,6 @@ public void Remove() } } - public interface IAvaloniaDictionary : IDictionary, IAvaloniaReadOnlyDictionary, @@ -73,7 +71,6 @@ public interface IAvaloniaDictionary { } - public interface IAvaloniaReadOnlyDictionary : IReadOnlyDictionary, INotifyCollectionChanged, @@ -82,7 +79,6 @@ public interface IAvaloniaReadOnlyDictionary { } - /* Copied from Avalionia because an issue was raised due to compatibility issues with ToObservableChangeSet(). @@ -202,7 +198,6 @@ public void Clear() PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Count))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(CommonPropertyNames.IndexerName)); - if (CollectionChanged != null) { var e = new NotifyCollectionChangedEventArgs( @@ -294,7 +289,6 @@ private void NotifyAdd(TKey key, TValue value) PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Count))); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs($"{CommonPropertyNames.IndexerName}[{key}]")); - if (CollectionChanged != null) { var e = new NotifyCollectionChangedEventArgs( diff --git a/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs b/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs index 750aaf1ae..cbc1e3e86 100644 --- a/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs @@ -61,8 +61,6 @@ public void Clear() _collection.Count.Should().Be(0, "Should be 100 items in the collection"); } - - [Fact] public void Refresh() { @@ -83,7 +81,6 @@ public void Refresh() args.NewIndex.Should().Be(10); } - [Fact] public void RemoveSourceRemovesFromTheDestination() { diff --git a/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs b/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs index f76ff68bf..5df6444f5 100644 --- a/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs @@ -1,4 +1,4 @@ -#if SUPPORTS_BINDINGLIST +#if SUPPORTS_BINDINGLIST using System; using System.ComponentModel; @@ -57,7 +57,6 @@ public void BatchRemove() _collection.Count.Should().Be(0, "Should be 100 items in the collection"); } - [Fact] public void RemoveSourceRemovesFromTheDestination() { diff --git a/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs index a706c4aea..83cb29a78 100644 --- a/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs @@ -70,7 +70,6 @@ public void CollectionIsInSortOrder() sorted.Should().BeEquivalentTo(_collection.ToList()); } - [Fact] public void LargeUpdateInvokesAReset() { @@ -109,7 +108,6 @@ public void Refresh() _collection[args.NewIndex].Should().Be(people[10]); } - [Fact] public void RemoveSourceRemovesFromTheDestination() { @@ -197,7 +195,6 @@ public void UpdateToSourceUpdatesTheDestination() _collection.First().Should().Be(personUpdated, "Should be updated person"); } - public void Dispose() { _binder.Dispose(); @@ -205,6 +202,5 @@ public void Dispose() } } - } #endif diff --git a/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs index b9818d8bc..b9ab66157 100644 --- a/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Linq; @@ -80,7 +80,6 @@ public void RefreshCausesReplace() sourceCacheResults.Messages.First().Adds.Should().Be(1); sourceCacheResults.Messages.Last().Refreshes.Should().Be(1); - /* List receives add and replace instead of refresh (and as of 23/02/2023 it receives a refresh too!) */ @@ -130,7 +129,6 @@ public void ResetFiresClearsAndAdds() resetNotification.Adds.Should().Be(10); } - [Fact] public void InsertInto() { diff --git a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs index e233c5c6a..0dc2ff518 100644 --- a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs +++ b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Reactive.Linq; using DynamicData.Binding; diff --git a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs index 35aa4eb1f..e769d81be 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs index 9dceabfb2..d08791e8d 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs @@ -2,7 +2,6 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; @@ -43,7 +42,6 @@ public void ResetThresholdsForBinding_ObservableCollection() var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -65,7 +63,6 @@ public void ResetThresholdsForBinding_ObservableCollection() result = events; }); - var binder = options == null ? _source.Connect().Bind(list).Subscribe() : _source.Connect().Bind(list, options.Value).Subscribe(); @@ -82,14 +79,12 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() { var people = _generator.Take(100).ToArray(); - // check whether reset is fired with different params var test1 = Test(); var test2 = Test(new BindingOptions(95)); var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -122,8 +117,6 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() } } - - [Fact] public void AddRange() { diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs index 6d68b12c0..d38ebf1b2 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; @@ -34,15 +33,12 @@ public void ResetThresholdsForBinding_ObservableCollection() { var people = _generator.Take(100).ToArray(); - - // check whether reset is fired with different params var test1 = Test(); var test2 = Test(new BindingOptions(95)); var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -64,7 +60,6 @@ public void ResetThresholdsForBinding_ObservableCollection() result = events; }); - var binder = options == null ? _source.Connect().Bind(list).Subscribe() : _source.Connect().Bind(list, options.Value).Subscribe(); @@ -81,14 +76,12 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() { var people = _generator.Take(100).ToArray(); - // check whether reset is fired with different params var test1 = Test(); var test2 = Test(new BindingOptions(95)); var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -121,7 +114,6 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() } } - [Fact] public void AddToSourceAddsToDestination() { @@ -173,7 +165,6 @@ public void UpdateToSourceSendsReplaceOnDestination() RunTest(true); RunTest(false); - void RunTest(bool useReplace) { var collection = new ObservableCollectionExtended(); @@ -181,7 +172,6 @@ void RunTest(bool useReplace) using var source = new SourceCache(p => p.Name); using var binder = source.Connect().Bind(collection, new ObservableCollectionAdaptor(useReplaceForUpdates: useReplace)).Subscribe(); - NotifyCollectionChangedAction action = default; source.AddOrUpdate(new Person("Adult1", 50)); diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs index c5df8ce24..86ebfcce1 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs @@ -3,7 +3,6 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; @@ -32,21 +31,17 @@ public ObservableCollectionBindCacheSortedFixture() _binder = _source.Connect().Sort(_comparer, resetThreshold: 25).Bind(_collection).Subscribe(); } - [Fact] public void ResetThresholdsForBinding_ObservableCollection() { var people = _generator.Take(100).ToArray(); - - // check whether reset is fired with different params var test1 = Test(); var test2 = Test(new BindingOptions(95)); var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -68,7 +63,6 @@ public void ResetThresholdsForBinding_ObservableCollection() result = events; }); - var binder = options == null ? _source.Connect().Sort(_comparer).Bind(list).Subscribe() : _source.Connect().Sort(_comparer).Bind(list, options.Value).Subscribe(); @@ -85,14 +79,12 @@ public void ResetThresholdsForBinding_ReadonlyObservableCollection() { var people = _generator.Take(100).ToArray(); - // check whether reset is fired with different params var test1 = Test(); var test2 = Test(new BindingOptions(95)); var test3 = Test(new BindingOptions(105, ResetOnFirstTimeLoad: false)); var test4 = Test(BindingOptions.NeverFireReset()); - test1.action.Should().Be(NotifyCollectionChangedAction.Reset); test2.action.Should().Be(NotifyCollectionChangedAction.Reset); test3.action.Should().Be(NotifyCollectionChangedAction.Add); @@ -292,7 +284,6 @@ public void UpdateToSourceSendsReplaceIfSortingIsNotAffected() RunTest(true); RunTest(false); - void RunTest(bool useReplace) { var collection = new ObservableCollectionExtended(); diff --git a/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs b/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs index 492448b73..9194ee66c 100644 --- a/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; @@ -74,7 +73,6 @@ public void UpdateToSourceSendsReplaceOnDestination() RunTest(true); RunTest(false); - void RunTest(bool useReplace) { using var source = new SourceCache(p => p.Name); diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs index 5c8d073c8..4354bbf6e 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,9 +6,6 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using System.Threading; using System.Threading.Tasks; @@ -345,7 +342,7 @@ public async Task AutoRefreshThenFilter_DualSubscribers_AllItemsObserved() var items = Enumerable.Range(0, itemCount).Select(i => new KeyedActivable(i)).ToList(); using var mutator = cache.Connect() - .ObserveOn(TaskPoolScheduler.Default) + .ObserveOn(TaskPoolSequencer.Default) .Subscribe(changes => { foreach (var change in changes) @@ -358,7 +355,7 @@ public async Task AutoRefreshThenFilter_DualSubscribers_AllItemsObserved() }); using var results = cache.Connect() - .ObserveOn(TaskPoolScheduler.Default) + .ObserveOn(TaskPoolSequencer.Default) .AutoRefresh(x => x.Activated) .Filter(x => x.Activated) .AsAggregator(); diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs index 3fe7de711..68bf7489b 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading.Tasks; using DynamicData.Kernel; @@ -44,7 +41,6 @@ public async Task ItemDisposalErrors_ErrorPropagatesToDisposalsCompleted(ItemTyp disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - source.AddOrUpdate(new[] { ItemBase.Create(type: itemType, id: 1, version: 1), @@ -61,7 +57,6 @@ public async Task ItemDisposalErrors_ErrorPropagatesToDisposalsCompleted(ItemTyp disposalsCompletedResults.RecordedValues.Should().BeEmpty("no disposals should have occurred"); disposalsCompletedResults.HasCompleted.Should().BeFalse("no disposals should have occurred"); - var error = new Exception("Test"); source.Items.ElementAt(1).FailDisposal(error); @@ -104,7 +99,6 @@ public async Task ItemDisposalsComplete_DisposalsCompletedOccursAndCompletes(Ite disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - source.AddOrUpdate(new[] { ItemBase.Create(type: itemType, id: 1, version: 1), @@ -121,7 +115,6 @@ public async Task ItemDisposalsComplete_DisposalsCompletedOccursAndCompletes(Ite disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - sourceCompletionSource.OnNext(Unit.Default); foreach (var item in source.Items) item.CompleteDisposal(); @@ -161,7 +154,6 @@ public async Task ItemDisposalsOccurOnMultipleThreads_DisposalIsThreadSafe() disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - var items = Enumerable.Range(1, 100_000) .Select(id => new AsyncDisposableItem() { @@ -181,7 +173,6 @@ public async Task ItemDisposalsOccurOnMultipleThreads_DisposalIsThreadSafe() disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - sourceCompletionSource.OnNext(); await Task.WhenAll(items .GroupBy(item => item.Id % 4) diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs index c6eea36b0..2e938e7cb 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs @@ -1,9 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.Cache.Internal; using DynamicData.Kernel; @@ -42,7 +39,6 @@ public void ItemsAreAddedMovedOrRefreshed_ItemsAreNotDisposed(ItemType itemType) disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - // Addition var items = new List() { @@ -72,7 +68,6 @@ public void ItemsAreAddedMovedOrRefreshed_ItemsAreNotDisposed(ItemType itemType) disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - // Movement items.Move(2, 0, items[2]); items.Move(2, 1, items[2]); @@ -96,7 +91,6 @@ public void ItemsAreAddedMovedOrRefreshed_ItemsAreNotDisposed(ItemType itemType) disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - // Refreshing source.OnNext(new ChangeSet(items .Select((item, index) => new Change( @@ -150,7 +144,6 @@ public void ItemsAreRemoved_ItemsAreDisposedAfterDownstreamProcessing(ItemType i disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - source.AddOrUpdate(new[] { ItemBase.Create(type: itemType, id: 1, version: 1), @@ -167,7 +160,6 @@ public void ItemsAreRemoved_ItemsAreDisposedAfterDownstreamProcessing(ItemType i disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - var items = source.Items.ToArray(); source.Clear(); @@ -213,7 +205,6 @@ public void ItemsAreUpdated_PreviousItemsAreDisposedAfterDownstreamProcessing(It disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - source.AddOrUpdate(new[] { ItemBase.Create(type: itemType, id: 1, version: 1), @@ -230,7 +221,6 @@ public void ItemsAreUpdated_PreviousItemsAreDisposedAfterDownstreamProcessing(It disposalsCompletedResults.RecordedValues.Should().BeEmpty("the source has not completed"); disposalsCompletedResults.HasCompleted.Should().BeFalse("the source has not completed"); - var previousItems = source.Items.ToArray(); source.AddOrUpdate(new[] { @@ -278,7 +268,6 @@ public void SourceCompletes_ItemsAreDisposedAndCompletionPropagates(SourceType s ? Observable.Return(changeSet) : new Subject>(); - ValueRecordingObserver? disposalsCompletedResults = null; using var subscription = source @@ -293,7 +282,6 @@ public void SourceCompletes_ItemsAreDisposedAndCompletionPropagates(SourceType s disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - if (source is Subject> subject) { subject.OnNext(changeSet); @@ -334,7 +322,6 @@ public void SourceErrors_ItemsAreDisposedAndErrorPropagates(SourceType sourceTyp .Concat(Observable.Throw>(error)) : new Subject>(); - ValueRecordingObserver? disposalsCompletedResults = null; using var subscription = source @@ -349,7 +336,6 @@ public void SourceErrors_ItemsAreDisposedAndErrorPropagates(SourceType sourceTyp disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - if (source is Subject> subject) { subject.OnNext(changeSet); diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs index ebdc26950..ec3af62ae 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs @@ -1,10 +1,5 @@ using System; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; using FluentAssertions; using Xunit; @@ -31,7 +26,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -46,7 +40,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish property change notification) ++item2.Value; @@ -54,7 +47,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(1).Should().BeEmpty("the property change notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(5).Ticks); @@ -62,7 +54,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(1).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -74,7 +65,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish property change notification) ++item1.Value; @@ -82,7 +72,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(2).Should().BeEmpty("the property change notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(15).Ticks); @@ -90,7 +79,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(2).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish additional property change notification) ++item3.Value; @@ -98,7 +86,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedChangeSets.Skip(2).Should().BeEmpty("the property change notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(20).Ticks); @@ -110,7 +97,6 @@ public void ChangeSetBufferIsGiven_PropertyChangedNotificationsAreBufferedOnSche results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (normal refresh) source.Refresh(item2); @@ -140,7 +126,6 @@ public void ItemIsAdded_SubscribesToPropertyChanged() results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; @@ -192,7 +177,6 @@ public void ItemIsMoved_NotificationPropagates() "item indexes should propagate"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.OnNext(new ChangeSet() { @@ -226,7 +210,6 @@ public void ItemIsRefreshed_NotificationPropagates() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -262,7 +245,6 @@ public void ItemIsRemoved_UnsubscribesFromPropertyChanged() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -274,7 +256,6 @@ public void ItemIsRemoved_UnsubscribesFromPropertyChanged() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(item2); @@ -300,7 +281,6 @@ public void ItemIsUpdated_ReSubscribesToPropertyChanged() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -312,7 +292,6 @@ public void ItemIsUpdated_ReSubscribesToPropertyChanged() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item4 = new Item() { Id = 2 }; source.AddOrUpdate(item4); @@ -340,7 +319,6 @@ public void PropertyChangedOccurs_ItemRefreshes() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -352,7 +330,6 @@ public void PropertyChangedOccurs_ItemRefreshes() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action ++item2.Value; @@ -379,7 +356,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -394,7 +370,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish property change notification) ++item2.Value; @@ -402,7 +377,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(1).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish additional property change notification, immediately) ++item2.Value; @@ -410,7 +384,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(1).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time to end of throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -422,7 +395,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish property change notification) ++item2.Value; @@ -430,7 +402,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(2).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish additional property change notification, within throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(15).Ticks); ++item2.Value; @@ -440,7 +411,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(2).Should().BeEmpty("the throttle window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time to end of original throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(20).Ticks); @@ -448,7 +418,6 @@ public void PropertyChangeThrottleIsGiven_PropertyChangedNotificationsAreThrottl results.RecordedChangeSets.Skip(2).Should().BeEmpty("the throttle window should have been extended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time to end of throttle window) scheduler.AdvanceTo(TimeSpan.FromSeconds(25).Ticks); @@ -469,7 +438,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagates(NotificationStrategy n // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -501,7 +469,6 @@ public void SourceCompletesWhenNotEmpty_CompletionDoesNotPropagate(NotificationS source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization & Action (source completion) if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -536,7 +503,6 @@ public void SourceFails_ErrorPropagates(NotificationStrategy notificationStrateg var error = new Exception("Test"); - // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) source.SetError(error); @@ -582,7 +548,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() new Change(reason: ChangeReason.Add, key: item3.Id, current: item3) }; - // UUT Initialization using var subscription = BuildUut(source.Prepend(initialChangeset)) .ValidateSynchronization() @@ -594,7 +559,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs index c948aedb8..135461be0 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs @@ -1,8 +1,6 @@ using System; using System.Linq; using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using FluentAssertions; using Xunit; @@ -36,7 +34,6 @@ public void PropertyChangedNotificationDoesNotMatchPropertyAccessor_IgnoresNotif source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -48,7 +45,6 @@ public void PropertyChangedNotificationDoesNotMatchPropertyAccessor_IgnoresNotif results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action ++item2.OtherValue; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs index 402d175ff..e2847abe8 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Reactive.Concurrency; using FluentAssertions; using Xunit; @@ -26,7 +25,6 @@ public void PropertyChangedNotificationDoesNotSpecifyPropertyName_ItemRefreshes( source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut(source.Connect()) .ValidateSynchronization() @@ -38,7 +36,6 @@ public void PropertyChangedNotificationDoesNotSpecifyPropertyName_ItemRefreshes( results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action item2.RaiseAllPropertiesChanged(); diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs index a09e0ea9c..475399420 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs @@ -1,11 +1,5 @@ using System; using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; using FluentAssertions; using Xunit; @@ -32,7 +26,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -48,7 +41,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish reevaluator notification) ++item2.Value; @@ -56,7 +48,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(1).Should().BeEmpty("the reevaluator notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(5).Ticks); @@ -64,7 +55,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(1).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -76,7 +66,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish reevaluator notification) ++item1.Value; @@ -84,7 +73,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(2).Should().BeEmpty("the reevaluator notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, within buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(15).Ticks); @@ -92,7 +80,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(2).Should().BeEmpty("the buffer window has not yet ended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (publish additional reevaluator notification) ++item3.Value; @@ -100,7 +87,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedChangeSets.Skip(2).Should().BeEmpty("the reevaluator notification should have been buffered"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (advance time, to buffer window) scheduler.AdvanceTo(TimeSpan.FromSeconds(20).Ticks); @@ -112,7 +98,6 @@ public void ChangeSetBufferIsGiven_ReevaluatorNotificationsAreBufferedOnSchedule results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "no items should have changed, within the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (normal refresh) source.Refresh(item2); @@ -136,7 +121,6 @@ public void ItemIsAdded_SubscribesToReevaluator() using var item2 = new Item() { Id = 2 }; using var item3 = new Item() { Id = 3 }; - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -149,7 +133,6 @@ public void ItemIsAdded_SubscribesToReevaluator() results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.AddOrUpdate(new[] { item1, item2, item3 }); @@ -199,7 +182,6 @@ public void ItemIsMoved_NotificationPropagates() "item indexes should propagate"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.OnNext(new ChangeSet() { @@ -235,7 +217,6 @@ public void ItemIsRefreshed_NotificationPropagates() var reevaluatorInvocationCount = 0; - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -281,7 +262,6 @@ public void ItemIsRemoved_UnsubscribesFromReevaluator() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -295,7 +275,6 @@ public void ItemIsRemoved_UnsubscribesFromReevaluator() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(item2); @@ -321,7 +300,6 @@ public void ItemIsUpdated_ReInvokesReevaluator() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -335,7 +313,6 @@ public void ItemIsUpdated_ReInvokesReevaluator() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action using var item4 = new Item() { Id = 2 }; source.AddOrUpdate(item4); @@ -350,7 +327,6 @@ public void ItemIsUpdated_ReInvokesReevaluator() item1.HasObservers.Should().BeTrue("the item was not removed from the source"); item3.HasObservers.Should().BeTrue("the item was not removed from the source"); - // UUT Action (updated item publishes reevaluator notification) ++item4.Value; @@ -377,7 +353,6 @@ public void ReevaluatorCompletesWhenNotOnlyItemInSource_CompletionWaitsForSource source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization & Action (initial completion) if (notificationStrategy is NotificationStrategy.Immediate) item2.Complete(); @@ -397,7 +372,6 @@ public void ReevaluatorCompletesWhenNotOnlyItemInSource_CompletionWaitsForSource results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("not all notification sources have completed"); - // UUT Action (remaining reevaluator completions) item1.Complete(); item3.Complete(); @@ -406,7 +380,6 @@ public void ReevaluatorCompletesWhenNotOnlyItemInSource_CompletionWaitsForSource results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (source completion) source.Complete(); @@ -427,7 +400,6 @@ public void ReevaluatorCompletesWhenOnlyItemInSource_CompletionWaitsForSourceCom source.AddOrUpdate(item); - // UUT Initialization & Action (reevaluator completion) if (notificationStrategy is NotificationStrategy.Immediate) item.Complete(); @@ -447,7 +419,6 @@ public void ReevaluatorCompletesWhenOnlyItemInSource_CompletionWaitsForSourceCom results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "1 item was added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (source completion) source.Complete(); @@ -468,7 +439,6 @@ public void ReevaluatorEmitsAsynchronously_ItemRefreshes() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -482,7 +452,6 @@ public void ReevaluatorEmitsAsynchronously_ItemRefreshes() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action ++item2.Value; @@ -507,7 +476,6 @@ public void ReevaluatorEmitsImmediately_ItemDoesNotRefresh() source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization & Action using var subscription = BuildUut( source: source.Connect(), @@ -539,7 +507,6 @@ public void ReevaluatorFails_ErrorPropagates(NotificationStrategy notificationSt var error = new Exception("Test"); - // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) item2.SetError(error); @@ -572,7 +539,6 @@ public void ReevaluatorThrows_ExceptionPropagates() var error = new Exception("Test"); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -585,7 +551,6 @@ public void ReevaluatorThrows_ExceptionPropagates() results.RecordedChangeSets.Should().BeEmpty("no initial changesets were published"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action using var item = new Item() { Id = 1 }; source.AddOrUpdate(item); @@ -602,7 +567,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagates(NotificationStrategy n // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -636,7 +600,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForReevaluatorCompletions source.AddOrUpdate(new[] { item1, item2, item3 }); - // UUT Initialization & Action (source completion) if (notificationStrategy is NotificationStrategy.Immediate) source.Complete(); @@ -656,7 +619,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForReevaluatorCompletions results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("not all notification sources have completed"); - // UUT Action (initial reevaluator completion) item2.Complete(); @@ -664,7 +626,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForReevaluatorCompletions results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("not all notification sources have completed"); - // UUT Action (remaining reevaluator completions) item1.Complete(); item3.Complete(); @@ -690,7 +651,6 @@ public void SourceFails_ErrorPropagates(NotificationStrategy notificationStrateg var error = new Exception("Test"); - // UUT Initialization & Action if (notificationStrategy is NotificationStrategy.Immediate) source.SetError(error); @@ -740,7 +700,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() new Change(reason: ChangeReason.Add, key: item3.Id, current: item3) }; - // UUT Initialization using var subscription = BuildUut( source: source.Prepend(initialChangeset), @@ -754,7 +713,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "3 items were added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs index 4fa7ec9d7..d198a628e 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs @@ -1,7 +1,4 @@ using System; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using FluentAssertions; using Xunit; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs index 3e96d6e96..29b396f08 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs @@ -1,7 +1,4 @@ using System; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using FluentAssertions; using Xunit; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs index 4e6f974a2..f4ddfdbd7 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs @@ -1,7 +1,4 @@ using System; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/BatchFixture.cs b/src/DynamicData.Tests/Cache/BatchFixture.cs index d22e060fe..fba1312ab 100644 --- a/src/DynamicData.Tests/Cache/BatchFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchFixture.cs @@ -4,8 +4,6 @@ using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/BatchIfFixture.cs b/src/DynamicData.Tests/Cache/BatchIfFixture.cs index 87f47356e..698acdb3b 100644 --- a/src/DynamicData.Tests/Cache/BatchIfFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfFixture.cs @@ -1,13 +1,9 @@ using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs index 239dba558..b9b033be0 100644 --- a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs @@ -1,14 +1,9 @@ using System; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/BufferInitialFixture.cs b/src/DynamicData.Tests/Cache/BufferInitialFixture.cs index eafe1bf6e..b4426dd68 100644 --- a/src/DynamicData.Tests/Cache/BufferInitialFixture.cs +++ b/src/DynamicData.Tests/Cache/BufferInitialFixture.cs @@ -6,8 +6,6 @@ using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs index 8915bc6bc..0055de966 100644 --- a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs +++ b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs @@ -1,15 +1,10 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System; using System.Collections.Generic; using System.Linq; -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Reactive.Threading.Tasks; using System.Threading; using System.Threading.Tasks; @@ -797,8 +792,6 @@ static int CountAll(IEnumerable> nodes) treeCache.Items.Any(n => n.Children.Count > 0).Should().BeTrue("Tree has child nodes"); treeCache2.Count.Should().BeGreaterThan(0, "Tree2 produces results"); - - // Side chains lastQuery.Should().NotBeNull("QueryWhenChanged(B) fired"); lastQueryA.Should().NotBeNull("QueryWhenChanged(A) fired"); diff --git a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs index 4f4ddf9a4..264bcebe8 100644 --- a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs +++ b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using System; -using System.Reactive.Subjects; using System.Threading; using System.Threading.Tasks; diff --git a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs index b196e1431..d12e2b345 100644 --- a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs @@ -1,7 +1,5 @@ using System; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; diff --git a/src/DynamicData.Tests/Cache/DistinctFixture.cs b/src/DynamicData.Tests/Cache/DistinctFixture.cs index fbbd36c7b..4067b3b14 100644 --- a/src/DynamicData.Tests/Cache/DistinctFixture.cs +++ b/src/DynamicData.Tests/Cache/DistinctFixture.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Linq; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs index d178c9ea6..ad3b6d323 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using FluentAssertions; using Xunit; diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs index 280f7db33..28b098834 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs @@ -1,9 +1,8 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq; -using System.Reactive.Linq; using DynamicData.Kernel; using FluentAssertions; diff --git a/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs b/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs index fe2d05737..236e0f5df 100644 --- a/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs +++ b/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using DynamicData.Tests.Domain; using FluentAssertions; @@ -18,7 +18,6 @@ public EnsureUniqueKeysFixture() _results = _source.Connect(suppressEmptyChangeSets: false).EnsureUniqueKeys().AsAggregator(); } - [Fact] public void UniqueForAdds() { @@ -67,7 +66,6 @@ public void Refresh() } - [Fact] public void CompoundRefresh1() { @@ -122,7 +120,6 @@ public void CompoundRefresh3() } - public void Dispose() { _source.Dispose(); diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs index ad88ee3a8..17fda4c7e 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs @@ -1,9 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using System.Threading.Tasks; using Bogus; @@ -188,7 +186,6 @@ public void PollingIntervalIsGiven_RemovalsAreScheduledAtInterval() // Not testing Move changes, since ISourceCache doesn't actually provide an API to generate them. - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); @@ -326,7 +323,6 @@ public void PollingIntervalIsNotGiven_RemovalsAreScheduledImmediately() // Not testing Move changes, since ISourceCache doesn't actually provide an API to generate them. - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); @@ -411,7 +407,6 @@ public void SchedulerIsInaccurate_RemovalsAreNotSkipped() var item1 = new TestItem() { Id = 1, Expiration = DateTimeOffset.FromUnixTimeMilliseconds(10) }; source.AddOrUpdate(item1); - results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); source.Items.Should().BeEquivalentTo(new[] { item1 }, "1 item was added"); @@ -550,7 +545,7 @@ public async Task ThreadPoolSchedulerIsUsedWithoutPolling_ExpirationIsThreadSafe { using var source = new TestSourceCache(static item => item.Id); - var scheduler = ThreadPoolScheduler.Instance; + var scheduler = ThreadPoolSequencer.Instance; using var subscription = source .ExpireAfter( @@ -581,7 +576,7 @@ public async Task ThreadPoolSchedulerIsUsedWithPolling_ExpirationIsThreadSafe() { using var source = new TestSourceCache(static item => item.Id); - var scheduler = ThreadPoolScheduler.Instance; + var scheduler = ThreadPoolSequencer.Instance; using var subscription = source .ExpireAfter( diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs index 868fad2fd..af667005c 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs @@ -1,11 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading.Tasks; using Bogus; @@ -287,7 +283,6 @@ public void PollingIntervalIsGiven_RemovalsAreScheduledAtInterval() new(reason: ChangeReason.Moved, key: item1.Id, current: item1, previous: default, currentIndex: 4, previousIndex: 1) }); - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedChangeSets.Count.Should().Be(7, "8 source operations were performed, and 1 should have been ignored"); @@ -453,7 +448,6 @@ public void PollingIntervalIsNotGiven_RemovalsAreScheduledImmediately() new(reason: ChangeReason.Moved, key: item1.Id, current: item1, previous: default, currentIndex: 4, previousIndex: 1) }); - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedChangeSets.Count.Should().Be(7, "8 source operations were performed, and 1 should have been ignored"); @@ -592,7 +586,6 @@ public void SchedulerIsInaccurate_RemovalsAreNotSkipped() new(reason: ChangeReason.Add, key: item1.Id, current: item1) }); - results.Error.Should().BeNull(); results.RecordedChangeSets.Count.Should().Be(1, "1 source operation was performed"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was added"); @@ -770,7 +763,7 @@ public async Task ThreadPoolSchedulerIsUsedWithoutPolling_ExpirationIsThreadSafe { using var source = new Subject>(); - var scheduler = ThreadPoolScheduler.Instance; + var scheduler = ThreadPoolSequencer.Instance; using var subscription = source .ExpireAfter( @@ -800,7 +793,7 @@ public async Task ThreadPoolSchedulerIsUsedWithPolling_ExpirationIsThreadSafe() { using var source = new Subject>(); - var scheduler = ThreadPoolScheduler.Instance; + var scheduler = ThreadPoolSequencer.Instance; using var subscription = source .ExpireAfter( diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs index f701d6a38..7bb929de3 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs @@ -1,7 +1,4 @@ -using System; -using System.Reactive.Concurrency; - -using Microsoft.Reactive.Testing; +using System; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs index dad57e373..096886140 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; using Xunit; @@ -32,7 +30,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade(EmptyChangesetPolicy emptyC new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -47,7 +44,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade(EmptyChangesetPolicy emptyC results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(source.Items.Where(static item => !item.IsIncluded).ToArray()); @@ -63,7 +59,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade(EmptyChangesetPolicy emptyC } results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -76,7 +71,6 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Intialization using var subscription = BuildUut( source: source.Connect(), @@ -90,7 +84,6 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.AddOrUpdate(new[] { @@ -107,7 +100,6 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -147,7 +139,6 @@ public void ItemsAreMoved_MovementsAreIgnored(EmptyChangesetPolicy emptyChangese results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items, "all matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.OnNext(new ChangeSet() { @@ -167,7 +158,6 @@ public void ItemsAreMoved_MovementsAreIgnored(EmptyChangesetPolicy emptyChangese } results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -190,7 +180,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -205,7 +194,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add items) foreach (var item in source.Items) item.IsIncluded = true; @@ -218,7 +206,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove items) foreach (var item in source.Items.Take(3)) item.IsIncluded = false; @@ -231,7 +218,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -254,7 +240,6 @@ public void ItemsAreUpdated_ItemsAreReFiltered(EmptyChangesetPolicy emptyChanges new Item() { Id = 6, IsIncluded = false } }); - // UUT Intialization using var subscription = BuildUut( source: source.Connect(), @@ -269,7 +254,6 @@ public void ItemsAreUpdated_ItemsAreReFiltered(EmptyChangesetPolicy emptyChanges results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add and update items) source.AddOrUpdate(new[] { @@ -286,7 +270,6 @@ public void ItemsAreUpdated_ItemsAreReFiltered(EmptyChangesetPolicy emptyChanges results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove and update items) source.AddOrUpdate(new[] { @@ -303,7 +286,6 @@ public void ItemsAreUpdated_ItemsAreReFiltered(EmptyChangesetPolicy emptyChanges results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -326,7 +308,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate(EmptyChangesetPolicy empty new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -341,7 +322,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate(EmptyChangesetPolicy empty results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(source.Items.Where(Item.FilterByIsIncluded).ToArray()); @@ -350,7 +330,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate(EmptyChangesetPolicy empty results.RecordedItemsByKey.Values.Should().BeEmpty("all matching items were removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs index 8b5c76e4c..57de70973 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading.Tasks; using Bogus; @@ -39,7 +37,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() using var source = new Subject>(); using var predicateChanged = new Subject>(); - // UUT Initialization using var subscription = source .Filter(predicateChanged) @@ -47,7 +44,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - // UUT Action await Task.WhenAll( Task.Run(() => @@ -67,7 +63,6 @@ await Task.WhenAll( results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items.Items.Where(finalPredicate), "the source colleciton should be filtered to include only items matching the final predicate"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs index 5315727d1..4a7b3221f 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; using Xunit; @@ -26,7 +23,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -40,7 +36,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action // Add changes source.AddOrUpdate(new[] @@ -87,7 +82,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em } results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -111,7 +105,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -126,7 +119,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action predicateChanged.OnNext(Item.FilterByEvenId); @@ -135,7 +127,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByEvenId), "newly-matching items should have been added, and newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -164,7 +155,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceC var reapplyFilter = new Subject(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter(predicateChanged) @@ -183,7 +173,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceC results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("changes could still be generated by the source"); - // UUT Action source.Complete(); @@ -194,7 +183,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceC results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -215,7 +203,6 @@ public void PredicateChangedCompletesBeforeInitialValue_CompletionPropagatesIfEm ? new Subject>() : Observable.Empty>(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -250,7 +237,6 @@ public void PredicateChangedFails_ErrorPropagates(CompletionStrategy completionS ? new Subject>() : Observable.Throw>(error); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -311,7 +297,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagatesWhenEmptyChangesetsAreS else results.HasCompleted.Should().BeTrue("the source has completed, and no further changesets can occur"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -336,7 +321,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -355,7 +339,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the collection could still change due to new predicates"); - // UUT Action predicateChanged.OnCompleted(); @@ -364,7 +347,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "no changes should have been made"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final Verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -376,7 +358,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() using var source = new Subject>(); using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); - // UUT Initialization using var subscription = source .Filter(predicateChanged) @@ -388,7 +369,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs index 8491fe821..1db36ea31 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading.Tasks; using Bogus; @@ -41,7 +38,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() using var predicateChanged = new Subject>(); using var reapplyFilter = new Subject(); - // UUT Initialization using var subscription = source .Filter( @@ -51,7 +47,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - // UUT Action await Task.WhenAll( Task.Run(() => @@ -76,7 +71,6 @@ await Task.WhenAll( results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items.Items.Where(finalPredicate), "the source colleciton should be filtered to include only items matching the final predicate"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs index e56101cb5..b530a9814 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; using Xunit; @@ -26,7 +23,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -41,7 +37,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action // Add changes source.AddOrUpdate(new[] @@ -84,7 +79,6 @@ public void ChangesAreMadeBeforeInitialPredicateChangedValue_ItemsAreExcluded(Em results.RecordedItemsByKey.Should().BeEmpty("the predicate has not initialized"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -108,7 +102,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -124,7 +117,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action predicateChanged.OnNext(Item.FilterByEvenId); @@ -133,7 +125,6 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByEvenId), "newly-matching items should have been added, and newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -166,7 +157,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceA var reapplyFilter = new Subject(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -187,7 +177,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceA results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("changes could still be generated by the source"); - // UUT Action (second completion) if (lastCompletion is DynamicParameter.ReapplyFilter) source.Complete(); @@ -201,7 +190,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceA results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("changes could still be generated by the filtering sources"); - // UUT Action (last completion) if (lastCompletion is DynamicParameter.ReapplyFilter) reapplyFilter.OnCompleted(); @@ -215,7 +203,6 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceA results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -236,7 +223,6 @@ public void PredicateChangedCompletesBeforeInitialValue_CompletionPropagatesIfEm ? new Subject>() : Observable.Empty>(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -272,7 +258,6 @@ public void PredicateChangedFails_ErrorPropagates(CompletionStrategy completionS ? new Subject>() : Observable.Throw>(error); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -326,7 +311,6 @@ public void ReapplyFilterCompletes_CompletionWaitsForSourceAndPredicateChangedCo ? new Subject() : Observable.Empty(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -344,7 +328,6 @@ public void ReapplyFilterCompletes_CompletionWaitsForSourceAndPredicateChangedCo results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("changes could still be generated by the source"); - // UUT Action (second completion) if (lastCompletion is DynamicParameter.PredicateChanged) source.Complete(); @@ -355,7 +338,6 @@ public void ReapplyFilterCompletes_CompletionWaitsForSourceAndPredicateChangedCo results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("changes could still be generated by other source streams"); - // UUT Action (last completion) if (lastCompletion is DynamicParameter.PredicateChanged) predicateChanged.OnCompleted(); @@ -366,7 +348,6 @@ public void ReapplyFilterCompletes_CompletionWaitsForSourceAndPredicateChangedCo results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("all input streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -385,7 +366,6 @@ public void ReapplyFilterFails_ErrorPropagates(CompletionStrategy completionStra ? new Subject() : Observable.Throw(error); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -432,7 +412,6 @@ public void ReapplyFilterOccurs_ItemsAreReFiltered(EmptyChangesetPolicy emptyCha var predicate = Item.FilterByIsIncluded; - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -448,7 +427,6 @@ public void ReapplyFilterOccurs_ItemsAreReFiltered(EmptyChangesetPolicy emptyCha results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(predicate), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Items[1].IsIncluded = false; source.Items[5].IsIncluded = true; @@ -460,7 +438,6 @@ public void ReapplyFilterOccurs_ItemsAreReFiltered(EmptyChangesetPolicy emptyCha results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(predicate), "newly-matching items should have been added, and newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -477,7 +454,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagatesWhenEmptyChangesetsAreS // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -503,7 +479,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagatesWhenEmptyChangesetsAreS else results.HasCompleted.Should().BeTrue("the source has completed, and no further changesets can occur"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -533,7 +508,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedAndRea using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); using var reapplyFilter = new Subject(); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -554,7 +528,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedAndRea results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the collection could still change due to new predicates"); - // UUT Action (second completion) if (lastCompletion is DynamicParameter.PredicateChanged) reapplyFilter.OnCompleted(); @@ -566,7 +539,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedAndRea results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "no changes should have been made"); results.HasCompleted.Should().BeFalse("the collection could still change due to outstanding source streams"); - // UUT Action (last completion) if (lastCompletion is DynamicParameter.PredicateChanged) predicateChanged.OnCompleted(); @@ -578,7 +550,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedAndRea results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "no changes should have been made"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -591,7 +562,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); using var reapplyFilter = new Subject(); - // UUT Initialization using var subscription = source .Filter( @@ -605,7 +575,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs index 49654ba16..d99537010 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs @@ -1,6 +1,4 @@ -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; +using System.Linq; using System.Threading.Tasks; using Bogus; @@ -37,7 +35,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() using var source = new Subject>(); using var predicateState = new Subject(); - // UUT Initialization using var subscription = source .Filter( @@ -47,7 +44,6 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - // UUT Action await Task.WhenAll( Task.Run(() => @@ -67,7 +63,6 @@ await Task.WhenAll( results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items.Items.Where(item => Item.FilterByIdInclusionMask(finalPredicateState, item)), "the source colleciton should be filtered to include only items matching the final predicate"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs index 1b0c55c88..7b50ab570 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; using Xunit; @@ -25,7 +23,6 @@ public void ChangesAreMadeBeforeInitialPredicateStateValue_ItemsAreExcluded(Empt // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization using var subscription = source .Connect() @@ -41,7 +38,6 @@ public void ChangesAreMadeBeforeInitialPredicateStateValue_ItemsAreExcluded(Empt results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action // Add changes source.AddOrUpdate(new[] @@ -84,7 +80,6 @@ public void ChangesAreMadeBeforeInitialPredicateStateValue_ItemsAreExcluded(Empt results.RecordedItemsByKey.Should().BeEmpty("the predicate has not initialized"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -120,7 +115,6 @@ public void PredicateStateCompletesAfterInitialValue_CompletionWaitsForSourceCom ? new Subject() : Observable.Return(new object()); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -141,7 +135,6 @@ public void PredicateStateCompletesAfterInitialValue_CompletionWaitsForSourceCom results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("changes could still be generated by the source"); - // UUT Action source.Complete(); @@ -152,7 +145,6 @@ public void PredicateStateCompletesAfterInitialValue_CompletionWaitsForSourceCom results.RecordedChangeSets.Skip(1).Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -173,7 +165,6 @@ public void PredicateStateCompletesBeforeInitialValue_CompletionPropagatesIfEmpt ? new Subject() : Observable.Empty(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -209,7 +200,6 @@ public void PredicateStateFails_ErrorPropagates(CompletionStrategy completionStr ? new Subject() : Observable.Throw(error); - // UUT Initialization & Action using var subscription = source.Connect() .Filter( @@ -254,7 +244,6 @@ public void PredicateStateChanges_ItemsAreReFiltered(EmptyChangesetPolicy emptyC new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter( @@ -270,7 +259,6 @@ public void PredicateStateChanges_ItemsAreReFiltered(EmptyChangesetPolicy emptyC results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(item => Item.FilterByIdInclusionMask(predicateState.Value, item)), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action predicateState.OnNext(0xA); @@ -279,7 +267,6 @@ public void PredicateStateChanges_ItemsAreReFiltered(EmptyChangesetPolicy emptyC results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(item => Item.FilterByIdInclusionMask(predicateState.Value, item)), "newly-matching items should have been added, and newly-excluded items should have been removed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -296,7 +283,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagatesWhenEmptyChangesetsAreS // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -322,7 +308,6 @@ public void SourceCompletesWhenEmpty_CompletionPropagatesWhenEmptyChangesetsAreS else results.HasCompleted.Should().BeTrue("the source has completed, and no further changesets can occur"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -347,7 +332,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple using var predicateState = new BehaviorSubject(new object()); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -368,7 +352,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the collection could still change due to new predicates"); - // UUT Action predicateState.OnCompleted(); @@ -377,7 +360,6 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple results.RecordedItemsByKey.Values.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "no changes should have been made"); results.HasCompleted.Should().BeTrue("all source streams have completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -389,7 +371,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() using var source = new Subject>(); using var predicateState = new BehaviorSubject(new()); - // UUT Initialization using var subscription = source .Filter( @@ -403,7 +384,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs index f3d61ac0a..36b1b2f30 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs @@ -1,6 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; +using System; using FluentAssertions; using Xunit; @@ -30,7 +28,6 @@ public void SourceCompletes_CompletionPropagates(CompletionStrategy completionSt // Setup using var source = new TestSourceCache(Item.SelectId); - // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) source.Complete(); @@ -48,7 +45,6 @@ public void SourceCompletes_CompletionPropagates(CompletionStrategy completionSt results.RecordedChangeSets.Should().BeEmpty("no source operations were performed"); results.HasCompleted.Should().BeTrue("the source has completed"); - // Final verification results.ShouldNotSupportSorting("sorting is not supported by filter operators"); } @@ -59,7 +55,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() // Setup using var source = new Subject>(); - // UUT Intialization using var subscription = source .Filter(Item.FilterByIsIncluded) @@ -72,7 +67,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedItemsByKey.Values.Should().BeEmpty("the source has not initialized"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/Cache/FilterFixture.cs b/src/DynamicData.Tests/Cache/FilterFixture.cs index d42e11579..fa12f02ab 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.cs @@ -1,6 +1,5 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using Bogus; diff --git a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs index a86e7438f..0c9eea4b4 100644 --- a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; using Xunit; @@ -20,7 +17,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( .FilterImmutable(predicate: Item.Predicate) .AsAggregator(); - // Add items var item1 = new Item() { Id = 1, IsIncluded = true }; var item2 = new Item() { Id = 2, IsIncluded = false }; @@ -34,7 +30,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( results.Messages.Count.Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEquivalentTo(new[] { item1 }, "2 items were added, with 1 excluded"); - // Replace items, changing inclusion var item3 = new Item() { Id = item1.Id, IsIncluded = false }; var item4 = new Item() { Id = item2.Id, IsIncluded = true }; @@ -48,7 +43,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( results.Messages.Skip(1).Count().Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEquivalentTo(new[] { item4 }, "2 items were replaced, with 1 excluded"); - // Replace items, not changing inclusion var item5 = new Item() { Id = item3.Id, IsIncluded = false }; var item6 = new Item() { Id = item4.Id, IsIncluded = true }; @@ -62,7 +56,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( results.Messages.Skip(2).Count().Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEquivalentTo(new[] { item6 }, "2 items were replaced, with 1 excluded"); - // Refresh items source.OnNext(new ChangeSet() { @@ -74,7 +67,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( results.Messages.Skip(3).Count().Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEquivalentTo(new[] { item6 }, "2 items were refreshed, with 1 excluded"); - // Remove items source.OnNext(new ChangeSet() { @@ -86,7 +78,6 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( results.Messages.Skip(4).Count().Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEmpty("2 items were removed, with one excluded"); - results.Messages.SelectMany(static changes => changes).Should().AllSatisfy( change => { @@ -118,7 +109,6 @@ public void ItemsAreMoved_ChangesAreNotPropagated() }); results.Messages.Clear(); - // Move items source.OnNext(new ChangeSet() { @@ -148,7 +138,6 @@ public void PredicateThrows_ExceptionIsCaptured() .FilterImmutable(predicate: _ => throw error) .AsAggregator(); - var item1 = new Item() { Id = 1, IsIncluded = true }; source.OnNext(new ChangeSet() { @@ -169,7 +158,6 @@ public void SourceCompletes_CompletionIsPropagated() .FilterImmutable(predicate: Item.Predicate) .AsAggregator(); - var item1 = new Item() { Id = 1, IsIncluded = true }; source.OnNext(new ChangeSet() { @@ -182,7 +170,6 @@ public void SourceCompletes_CompletionIsPropagated() results.Messages.Count.Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEquivalentTo(new[] { item1 }, "1 item was added"); - // Make sure no extraneous notifications are published. var item2 = new Item() { Id = 2, IsIncluded = true }; source.OnNext(new ChangeSet() @@ -216,7 +203,6 @@ public void SourceCompletesImmediately_CompletionIsPropagated() .FilterImmutable(predicate: Item.Predicate) .AsAggregator(); - results.Error.Should().BeNull(); results.IsCompleted.Should().BeTrue(); results.Messages.Count.Should().Be(1, "1 source operation was performed"); @@ -234,7 +220,6 @@ public void SourceErrors_ErrorIsPropagated() .FilterImmutable(predicate: Item.Predicate) .AsAggregator(); - var item1 = new Item() { Id = 1, IsIncluded = true }; source.OnNext(new ChangeSet() { @@ -247,7 +232,6 @@ public void SourceErrors_ErrorIsPropagated() results.Messages.Count.Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEquivalentTo(new[] { item1 }, "1 item was added"); - // Make sure no extraneous notifications are published. var item2 = new Item() { Id = 2, IsIncluded = true }; source.OnNext(new ChangeSet() @@ -280,7 +264,6 @@ public void SourceErrorsImmediately_ErrorIsPropagated() .FilterImmutable(predicate: Item.Predicate) .AsAggregator(); - results.Error.Should().Be(error); results.IsCompleted.Should().BeFalse(); results.Messages.Count.Should().Be(1, "1 source operation was performed"); @@ -305,7 +288,6 @@ public void SuppressEmptyChangesetsIsFalse_EmptyChangesetsArePublished() suppressEmptyChangeSets: false) .AsAggregator(); - ManipulateExcludedItems(source); results.Error.Should().BeNull(); @@ -323,7 +305,6 @@ public void SuppressEmptyChangesetsIsTrue_EmptyChangesetsAreNotPublished() .FilterImmutable(predicate: Item.Predicate) .AsAggregator(); - ManipulateExcludedItems(source); results.Error.Should().BeNull(); diff --git a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs index 84b487055..6a95dfe9a 100644 --- a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs @@ -1,12 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs index 03f716d6d..a4ddfa5f6 100644 --- a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs @@ -1,15 +1,12 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using System.Threading.Tasks; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs index 31686cadd..0a3ce8d78 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs @@ -1,7 +1,5 @@ using System; using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs index 871f5498c..702b81b99 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs @@ -1,7 +1,5 @@ using System; using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Cache/GroupFixture.cs b/src/DynamicData.Tests/Cache/GroupFixture.cs index c0139eed5..549b4476c 100644 --- a/src/DynamicData.Tests/Cache/GroupFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupFixture.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using System.Reactive.Linq; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs index ab5fd0bd4..b1b6357ef 100644 --- a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading.Tasks; using Bogus; @@ -264,7 +261,6 @@ public void ResultIsCorrectAfterForcedRegroup() VerifyGroupingResults(); } - [Theory] [InlineData(false, false, false)] [InlineData(false, false, true)] diff --git a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs index 1909b2abb..081515e58 100644 --- a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading.Tasks; using Bogus; diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs index bd5ffc054..487671be1 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs @@ -124,7 +124,6 @@ public void RefreshRightKey() var refreshItem = _right.Lookup(2).Value; - // Change pairing refreshItem.Name = "Device3"; _right.Refresh(refreshItem); @@ -132,7 +131,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Keys.Should().Contain(("Device3", 2)); - // Remove pairing refreshItem.Name = "Device4"; _right.Refresh(refreshItem); @@ -140,7 +138,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(2); _result.Data.Keys.Should().NotContain(pair => pair.rightKey == 2); - // Restore pairing refreshItem.Name = "Device2"; _right.Refresh(refreshItem); @@ -148,7 +145,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Keys.Should().Contain(("Device2", 2)); - // No change _right.Refresh(refreshItem); @@ -231,28 +227,24 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new DeviceMetaData(3,"Device3")); }); - // Change pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device3")); _result.Data.Count.Should().Be(3); _result.Data.Keys.Should().Contain(("Device3", 2)); - // Remove pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device4")); _result.Data.Count.Should().Be(2); _result.Data.Keys.Should().NotContain(pair => pair.rightKey == 2); - // Restore pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); _result.Data.Count.Should().Be(3); _result.Data.Keys.Should().Contain(("Device2", 2)); - // No change _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs index bdad60ee9..28b264a7a 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs @@ -1,6 +1,4 @@ using System; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using Xunit; @@ -59,7 +57,7 @@ public void LetsSeeWhetherWeCanRandomlyHitADifferentRaceCondition() IDisposable BeginGeneratingThings(SourceCache source, string namePrefix) // Generate items infinitely. The runtime of the test is limited by the .Subscribe() loop. - => Observable.Range(1, int.MaxValue, ThreadPoolScheduler.Instance) + => Observable.Range(1, int.MaxValue, ThreadPoolSequencer.Instance) .Subscribe(id => { source.AddOrUpdate(new Thing() diff --git a/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs b/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs index edaad944a..48196ae8c 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs @@ -87,7 +87,6 @@ public void RefreshRightKey() var refreshPerson = _people.Lookup("Person #2").Value; - // Change pairing refreshPerson.ParentName = "Person #3"; _people.Refresh(refreshPerson); @@ -96,7 +95,6 @@ public void RefreshRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing refreshPerson.ParentName = "Person #4"; _people.Refresh(refreshPerson); @@ -104,7 +102,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(1); _result.Data.Items.SelectMany(family => family.Children.Select(child => (parentName: family.Parent.Name, chilldName: child.Name))).Should().NotContain(pair => pair.chilldName == "Person #2"); - // Restore pairing refreshPerson.ParentName = "Person #1"; _people.Refresh(refreshPerson); @@ -112,7 +109,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(2); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.Refresh(refreshPerson); @@ -193,7 +189,6 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new Person() { Name = "Person #3", ParentName = "Person #2" } ); }); - // Change pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #3" }); @@ -201,21 +196,18 @@ public void UpdateRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #4" }); _result.Data.Count.Should().Be(1); _result.Data.Items.SelectMany(family => family.Children.Select(child => (parentName: family.Parent.Name, chilldName: child.Name))).Should().NotContain(pair => pair.chilldName == "Person #2"); - // Restore pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); _result.Data.Count.Should().Be(2); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); diff --git a/src/DynamicData.Tests/Cache/LeftJoinFixture.cs b/src/DynamicData.Tests/Cache/LeftJoinFixture.cs index c5d0fcd35..eef5e30c2 100644 --- a/src/DynamicData.Tests/Cache/LeftJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/LeftJoinFixture.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using DynamicData.Kernel; @@ -134,7 +134,6 @@ public void RefreshRightKey() var refreshItem = _right.Lookup(2).Value; - // Change pairing refreshItem.Name = "Device3"; _right.Refresh(refreshItem); @@ -143,7 +142,6 @@ public void RefreshRightKey() _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().NotContain(("Device2", 2)); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().Contain(("Device3", 2)); - // Remove pairing refreshItem.Name = "Device4"; _right.Refresh(refreshItem); @@ -151,7 +149,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().NotContain(pair => pair.Key == 2); - // Restore pairing refreshItem.Name = "Device2"; _right.Refresh(refreshItem); @@ -159,7 +156,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().Contain(("Device2", 2)); - // No change _right.Refresh(refreshItem); @@ -238,7 +234,6 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new DeviceMetaData(3,"Device3")); }); - // Change pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device3")); @@ -246,21 +241,18 @@ public void UpdateRightKey() _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().NotContain(("Device2", 2)); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().Contain(("Device3", 2)); - // Remove pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device4")); _result.Data.Count.Should().Be(3); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().NotContain(pair => pair.Key == 2); - // Restore pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); _result.Data.Count.Should().Be(3); _result.Data.Items.Select(pair => (pair.Device.Name, pair.MetaData.ValueOrDefault()?.Key)).Should().Contain(("Device2", 2)); - // No change _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); diff --git a/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs b/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs index dd4b22056..875c3249a 100644 --- a/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs @@ -90,7 +90,6 @@ public void RefreshRightKey() var refreshPerson = _people.Lookup("Person #2").Value; - // Change pairing refreshPerson.ParentName = "Person #3"; _people.Refresh(refreshPerson); @@ -99,7 +98,6 @@ public void RefreshRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing refreshPerson.ParentName = "Person #4"; _people.Refresh(refreshPerson); @@ -107,7 +105,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Items.SelectMany(family => family.Children.Select(child => (parentName: family.Parent.Name, chilldName: child.Name))).Should().NotContain(pair => pair.chilldName == "Person #2"); - // Restore pairing refreshPerson.ParentName = "Person #1"; _people.Refresh(refreshPerson); @@ -115,7 +112,6 @@ public void RefreshRightKey() _result.Data.Count.Should().Be(3); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.Refresh(refreshPerson); @@ -196,7 +192,6 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new Person() { Name = "Person #3", ParentName = "Person #2" } ); }); - // Change pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #3" }); @@ -204,21 +199,18 @@ public void UpdateRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #4" }); _result.Data.Count.Should().Be(3); _result.Data.Items.SelectMany(family => family.Children.Select(child => (parentName: family.Parent.Name, chilldName: child.Name))).Should().NotContain(pair => pair.chilldName == "Person #2"); - // Restore pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); _result.Data.Count.Should().Be(3); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); diff --git a/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs b/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs index b6f3047e2..12d4e90b6 100644 --- a/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs @@ -1,12 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using DynamicData.Kernel; using DynamicData.Tests.Domain; using DynamicData.Tests.Utilities; using FluentAssertions; -using Microsoft.Reactive.Testing; using Xunit; diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs index 949ec35bf..18dad24f8 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs @@ -1,11 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; @@ -98,7 +93,7 @@ IObservable AddRemovePrices(Market market, int priceCount, int para using var connect = merged.Connect(); // Start asynchrononously modifying the parent list and the child lists - using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolScheduler.Default) + using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolSequencer.Default) .Finally(() => adding = false) .Subscribe(); @@ -816,7 +811,6 @@ public void MergeManyChangeSetsWorksCorrectlyWithValueTypes() results.Summary.Overall.Removes.Should().Be(PricesPerMarket); } - [Theory] [InlineData(true)] [InlineData(false)] diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs index ce6cc89fd..095f8c954 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs @@ -1,11 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; @@ -98,7 +93,7 @@ IObservable AddRemovePrices(Market market, int priceCount, int para using var connect = merged.Connect(); // Start asynchrononously modifying the parent list and the child lists - using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolScheduler.Default) + using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolSequencer.Default) .Finally(() => adding = false) .Subscribe(); diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs index 49f566907..505540455 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs @@ -1,11 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; @@ -94,7 +89,7 @@ IObservable AddRemoveAnimals(AnimalOwner owner, int animalCount, int par using var connect = mergeAnimals.Connect(); // Start asynchrononously modifying the parent list and the child lists - using var addAnimals = AddRemoveAnimalsStress(ownerCount, animalCount, Environment.ProcessorCount, TaskPoolScheduler.Default) + using var addAnimals = AddRemoveAnimalsStress(ownerCount, animalCount, Environment.ProcessorCount, TaskPoolSequencer.Default) .Finally(() => addingAnimals = false) .Subscribe(); diff --git a/src/DynamicData.Tests/Cache/MergeManyFixture.cs b/src/DynamicData.Tests/Cache/MergeManyFixture.cs index 553bf452e..8f449080a 100644 --- a/src/DynamicData.Tests/Cache/MergeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyFixture.cs @@ -1,6 +1,4 @@ using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; diff --git a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs index e2a6be748..7bf6bdc5f 100644 --- a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs @@ -1,6 +1,4 @@ using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; diff --git a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs index e6987e846..6d98c9dc7 100644 --- a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs @@ -1,6 +1,4 @@ using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; diff --git a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs index 6a6a33a38..6f739aa69 100644 --- a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs +++ b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs @@ -1,6 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; +using System; using DynamicData.Kernel; diff --git a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs index 4460dad3e..45cfebd7e 100644 --- a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs @@ -1,9 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Threading.Tasks; using DynamicData.Tests.Domain; @@ -27,7 +25,6 @@ private async Task AsyncSubscriptionCanReceiveMultipleResults() //the aim of this test is to ensure we can continuously receive subscriptions when we use the async subscribe overloads var result = new List(); - var observable = ObservableChangeSet.Create( async (changeSet, token) => { @@ -49,11 +46,9 @@ private async Task AsyncSubscriptionCanReceiveMultipleResults() i => i) .Select(cs => cs.Select(c => c.Current).ToList()); - var isComplete = false; Exception? error = null; - //load list of results var subscriber = observable .Subscribe(item => result.AddRange(item), ex => error = ex, () => isComplete = true); @@ -77,7 +72,6 @@ private async Task AsyncSubscriptionCanReceiveMultipleResults() subscriber.Dispose(); } - [Fact] public void HandlesAsyncError() { diff --git a/src/DynamicData.Tests/Cache/OnItemFixture.cs b/src/DynamicData.Tests/Cache/OnItemFixture.cs index 97aeebc75..76a4f1045 100644 --- a/src/DynamicData.Tests/Cache/OnItemFixture.cs +++ b/src/DynamicData.Tests/Cache/OnItemFixture.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; @@ -128,7 +128,6 @@ public class Proxy public bool? Active { get; set; } - } public class ProxyEqualityComparer : IEqualityComparer diff --git a/src/DynamicData.Tests/Cache/PageFixture.cs b/src/DynamicData.Tests/Cache/PageFixture.cs index 8c31979d5..7d3762f40 100644 --- a/src/DynamicData.Tests/Cache/PageFixture.cs +++ b/src/DynamicData.Tests/Cache/PageFixture.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Cache/RefCountFixture.cs b/src/DynamicData.Tests/Cache/RefCountFixture.cs index 14be2f16b..2b2c040e6 100644 --- a/src/DynamicData.Tests/Cache/RefCountFixture.cs +++ b/src/DynamicData.Tests/Cache/RefCountFixture.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Linq; using System.Threading.Tasks; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Cache/RightJoinFixture.cs b/src/DynamicData.Tests/Cache/RightJoinFixture.cs index 62aa30190..b415002bd 100644 --- a/src/DynamicData.Tests/Cache/RightJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinFixture.cs @@ -135,7 +135,6 @@ public void RefreshRightKey() var refreshItem = _right.Lookup(2).Value; - // Change pairing refreshItem.Name = "Device3"; _right.Refresh(refreshItem); @@ -144,7 +143,6 @@ public void RefreshRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain(("Device2", 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain(("Device3", 2)); - // Remove pairing refreshItem.Name = "Device4"; _right.Refresh(refreshItem); @@ -153,7 +151,6 @@ public void RefreshRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain(("Device3", 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain((null, 2)); - // Restore pairing refreshItem.Name = "Device2"; _right.Refresh(refreshItem); @@ -162,7 +159,6 @@ public void RefreshRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain((null, 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain(("Device2", 2)); - // No change _right.Refresh(refreshItem); @@ -243,7 +239,6 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new DeviceMetaData(3,"Device3")); }); - // Change pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device3")); @@ -251,7 +246,6 @@ public void UpdateRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain(("Device2", 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain(("Device3", 2)); - // Remove pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device4")); @@ -259,7 +253,6 @@ public void UpdateRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain(("Device3", 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain((null, 2)); - // Restore pairing _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); @@ -267,7 +260,6 @@ public void UpdateRightKey() _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().NotContain((null, 2)); _result.Data.Items.Select(pair => (pair.Device.ValueOrDefault()?.Name, pair.MetaData.Key)).Should().Contain(("Device2", 2)); - // No change _right.AddOrUpdate(new DeviceMetaData(2,"Device2")); diff --git a/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs b/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs index 24f013c3a..08a42da17 100644 --- a/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs @@ -88,7 +88,6 @@ public void RefreshRightKey() var refreshPerson = _people.Lookup("Person #2").Value; - // Change pairing refreshPerson.ParentName = "Person #3"; _people.Refresh(refreshPerson); @@ -97,7 +96,6 @@ public void RefreshRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing refreshPerson.ParentName = "Person #4"; _people.Refresh(refreshPerson); @@ -106,7 +104,6 @@ public void RefreshRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain(("Person #3", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain((null, "Person #2")); - // Restore pairing refreshPerson.ParentName = "Person #1"; _people.Refresh(refreshPerson); @@ -115,7 +112,6 @@ public void RefreshRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain((null, "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.Refresh(refreshPerson); @@ -197,7 +193,6 @@ public void UpdateRightKey() innerCache.AddOrUpdate(new Person() { Name = "Person #3", ParentName = "Person #2" } ); }); - // Change pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #3" }); @@ -205,7 +200,6 @@ public void UpdateRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain(("Person #1", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain(("Person #3", "Person #2")); - // Remove pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #4" }); @@ -213,7 +207,6 @@ public void UpdateRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain(("Person #3", "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain((null, "Person #2")); - // Restore pairing _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); @@ -221,7 +214,6 @@ public void UpdateRightKey() _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().NotContain((null, "Person #2")); _result.Data.Items.SelectMany(family => family.Children.Select(child => (family.Parent?.Name, child.Name))).Should().Contain(("Person #1", "Person #2")); - // No change _people.AddOrUpdate(new Person() { Name = "Person #2", ParentName = "Person #1" }); diff --git a/src/DynamicData.Tests/Cache/SizeLimitFixture.cs b/src/DynamicData.Tests/Cache/SizeLimitFixture.cs index 378b7fa6d..1960aa98e 100644 --- a/src/DynamicData.Tests/Cache/SizeLimitFixture.cs +++ b/src/DynamicData.Tests/Cache/SizeLimitFixture.cs @@ -1,13 +1,10 @@ using System; using System.Linq; -using System.Reactive.Linq; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs index f4a68b701..851de7a08 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs @@ -4,8 +4,6 @@ using System.Collections.Specialized; using System.ComponentModel; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Disposables; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; @@ -26,7 +24,6 @@ protected override (ChangeSetAggregator Aggregrator, IList Aggregrator, IList Aggregrator, IList _strings.Dispose(); } - - // Bind to a readonly observable collection - using default comparer public sealed class SortAndBindToReadOnlyObservableCollectionDefaultComparer : SortAndBindFixture { @@ -175,7 +168,6 @@ public void FiresResetWhenThresholdIsMet() _collectionChangedEventArgs.Count.Should().Be(5); _collectionChangedEventArgs.All(a=>a.Action == NotifyCollectionChangedAction.Add).Should().BeTrue(); - _collectionChangedEventArgs.Clear(); // fire 15 changes, we should get a refresh event @@ -194,7 +186,6 @@ public void FiresResetWhenThresholdIsMet() } - [Fact] [Description("Check reset is not fired")] public void NeverFireReset() @@ -209,7 +200,6 @@ public void NeverFireReset() _collectionChangedEventArgs.Count.Should().Be(5); _collectionChangedEventArgs.All(a => a.Action == NotifyCollectionChangedAction.Add).Should().BeTrue(); - _collectionChangedEventArgs.Clear(); // fire 15 changes, we should get a refresh event @@ -235,7 +225,6 @@ public void FireResetOnFirstTimeLoad() _collectionChangedEventArgs.Count.Should().Be(1); _collectionChangedEventArgs.All(a => a.Action == NotifyCollectionChangedAction.Reset).Should().BeTrue(); - _collectionChangedEventArgs.Clear(); // fire 15 changes, we should get a refresh event @@ -254,12 +243,9 @@ public void FireResetOnFirstTimeLoad() } - - public void Dispose() => _source.Dispose(); } - public abstract class SortAndBindFixture : IDisposable { @@ -270,7 +256,6 @@ public abstract class SortAndBindFixture : IDisposable protected readonly IComparer _comparer = Person.DefaultComparer; protected readonly ISourceCache _source = new SourceCache(p => p.Key); - public SortAndBindFixture() { // It's ok in this case to call VirtualMemberCallInConstructor @@ -287,10 +272,8 @@ public SortAndBindFixture() } - protected abstract (ChangeSetAggregator Aggregrator, IList List) SetUpTests(); - [Fact] public void InsertAtBeginning() { @@ -333,7 +316,6 @@ public void InsertAtEnd() _boundList.SequenceEqual(_source.Items.OrderBy(p => p, _comparer)).Should().BeTrue(); } - [Fact] public void InsertInMiddle() { @@ -353,7 +335,6 @@ public void InsertInMiddle() _boundList.SequenceEqual(_source.Items.OrderBy(p => p, _comparer)).Should().BeTrue(); } - [Fact] public void InsertSameLocation() { @@ -377,11 +358,9 @@ void UpdateAndAssetPosition(Person person, int expectedIndex) _boundList.Count.Should().Be(10); - _boundList.SequenceEqual(_source.Items.OrderBy(p => p, _comparer)).Should().BeTrue(); } - [Fact] public void Refresh() { @@ -396,7 +375,6 @@ public void Refresh() RefreshAtAndAssetPosition(toRefresh, p => p.Age = 20, 1); RefreshAtAndAssetPosition(toRefresh, p => p.Age = 25, 1); - // move after RefreshAtAndAssetPosition(toRefresh, p => p.Age = 45, 3); @@ -414,11 +392,9 @@ void RefreshAtAndAssetPosition(Person person, Action action,int expected _boundList.Count.Should().Be(10); - _boundList.SequenceEqual(_source.Items.OrderBy(p => p, _comparer)).Should().BeTrue(); } - [Fact] public void BatchOfVariousChanges() { @@ -452,7 +428,6 @@ public void BatchOfVariousChanges() expectedInOrder.SequenceEqual(_boundList).Should().BeTrue(); } - [Fact] public void BatchOfVariousEndingInClear() { @@ -470,7 +445,6 @@ public void BatchOfVariousEndingInClear() } - [Fact] public void LargeBatchChange() { @@ -478,12 +452,10 @@ public void LargeBatchChange() _source.AddOrUpdate(Enumerable.Range(0, 100).Select(i => new Person($"P{i}", i))); _source.AddOrUpdate(Enumerable.Range(100, 100).Select(i => new Person($"P{i}", i))); - _boundList.Count.Should().Be(200); _boundList.SequenceEqual(_source.Items.OrderBy(p => p, _comparer)).Should().BeTrue(); } - [Fact] public void BatchUpdateShiftingIndicies() { @@ -519,8 +491,6 @@ public void BatchUpdateShiftingIndicies() _boundList.SequenceEqual(expected).Should().BeTrue(); } - - [Fact] public void RemoveFirst() { @@ -549,7 +519,6 @@ public void RemoveFromEnd() _source.Remove(people[99].Key); _boundList.Count.Should().Be(99); - people.RemoveAt(99); people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); } @@ -565,15 +534,12 @@ public void RemoveFromMiddle() _source.Remove(people[50].Key); _boundList.Count.Should().Be(99); - people.RemoveAt(IndexFromKey(people[50].Key)); int IndexFromKey(string key) => people.FindIndex(p => p.Key == key); - people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); } - [Fact] public void SortInitialBatch() { @@ -594,14 +560,12 @@ public void UpdateFirst() var update = new Person(toUpdate.Name, toUpdate.Age + 5); - _source.AddOrUpdate(new Person(toUpdate.Name, toUpdate.Age + 5)); people[IndexFromKey(update.Key)] = new Person(toUpdate.Name, toUpdate.Age + 5); int IndexFromKey(string key) => people.FindIndex(p => p.Key == key); - people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); } @@ -622,7 +586,6 @@ public void UpdateLast() people.OrderBy(p => p, _comparer).SequenceEqual(_boundList).Should().BeTrue(); } - [Fact] public void UpdateMiddle() { diff --git a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs index 9698c86e3..b0afb853f 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; @@ -9,7 +8,6 @@ namespace DynamicData.Tests.Cache; - // Bind to a readonly observable collection public sealed class SortAndBindObservableToReadOnlyObservableCollection : SortAndBindObservableFixture { @@ -37,7 +35,6 @@ public abstract class SortAndBindObservableFixture : IDisposable { protected readonly ISourceCache Cache = new SourceCache(p => p.Name); - private readonly RandomPersonGenerator _generator = new(); private readonly ChangeSetAggregator _results; @@ -45,10 +42,8 @@ public abstract class SortAndBindObservableFixture : IDisposable private readonly SortExpressionComparer _oldestComparer = SortExpressionComparer.Descending(p => p.Age).ThenByAscending(p => p.Name); private readonly SortExpressionComparer _defaultComparer = SortExpressionComparer.Ascending(p => p.Name).ThenByAscending(p => p.Age); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "By Design.")] - protected readonly BehaviorSubject> ComparerObservable; - + private protected readonly BehaviorSubject> ComparerObservable; protected SortAndBindObservableFixture() { @@ -69,7 +64,6 @@ protected SortAndBindObservableFixture() protected abstract (ChangeSetAggregator Aggregrator, IList List) SetUpTests(); - [Fact] public void SortInitialBatch() { @@ -80,7 +74,6 @@ public void SortInitialBatch() _boundList.SequenceEqual(defaultOrder).Should().BeTrue(); } - [Fact] public void ChangeSort() { @@ -100,7 +93,6 @@ public void ChangeSort() _boundList.SequenceEqual(defaultOrder).Should().BeTrue(); } - public void Dispose() { Cache.Dispose(); diff --git a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs index 3b3466c85..2ea3dbd8b 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs @@ -1,8 +1,7 @@ - + using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; @@ -10,7 +9,6 @@ namespace DynamicData.Tests.Cache; - public sealed class SortAndPageAndBindWithImplicitOptionsFixtureReadOnlyCollection : SortAndPageAndBindFixtureBase { protected override (ChangeSetAggregator aggregator, IList list) SetUpTests() @@ -76,7 +74,7 @@ public abstract class SortAndPageAndBindFixtureBase : IDisposable protected readonly SourceCache Source = new(p => p.Name); protected readonly IComparer Comparer = SortExpressionComparer.Ascending(p => p.Age).ThenByAscending(p => p.Name); - protected readonly ISubject PageRequests = new BehaviorSubject(new PageRequest(0, 25)); + private protected readonly ISubject PageRequests = new BehaviorSubject(new PageRequest(0, 25)); protected readonly ChangeSetAggregator Aggregator; protected readonly IList List; @@ -94,10 +92,8 @@ protected SortAndPageAndBindFixtureBase() List = args.list; } - protected abstract (ChangeSetAggregator aggregator, IList list) SetUpTests(); - [Fact] public void PageGreaterThanNumberOfPagesAvailable() { @@ -112,7 +108,6 @@ public void PageGreaterThanNumberOfPagesAvailable() List.Should().BeEquivalentTo(expectedResult); } - [Fact] public void OverlappingShift() { @@ -156,7 +151,6 @@ public void AddFirstInRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void AddOutsideOfRange() { @@ -170,7 +164,6 @@ public void AddOutsideOfRange() // only the initials message should have been received Aggregator.Messages.Count.Should().Be(1); - people.Add(person); var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); List.SequenceEqual(expectedResult).Should().Be(true); @@ -191,7 +184,6 @@ public void UpdateMoveOutOfRange() var changes = Aggregator.Messages[1]; changes.Count.Should().Be(2); - var firstChange = changes.First(); firstChange.Reason.Should().Be(ChangeReason.Remove); firstChange.Current.Should().Be(new Person("P012", 50)); @@ -235,8 +227,6 @@ public void UpdateStayRange() List.SequenceEqual(expectedResult).Should().Be(true); } - - [Fact] public void UpdateOutOfRange() { @@ -255,7 +245,6 @@ public void UpdateOutOfRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RemoveRange() { @@ -305,7 +294,6 @@ public void RemoveOutOfRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RefreshInRange() { @@ -374,13 +362,11 @@ public void RefreshWithInlineChangeOutsideRange() secondChange.Reason.Should().Be(ChangeReason.Add); secondChange.Current.Should().Be(new Person("P026", 26)); - var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); List.SequenceEqual(expectedResult).Should().Be(true); } - public void Dispose() { Source.Dispose(); diff --git a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs index 19f177cd4..a15a000d8 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using System.Text; using System.Threading.Tasks; using DynamicData.Binding; @@ -83,11 +82,10 @@ public abstract class SortAndPageFixtureBase : IDisposable protected readonly SourceCache Source = new(p => p.Name); protected readonly IComparer Comparer = SortExpressionComparer.Ascending(p => p.Age).ThenByAscending(p => p.Name); - protected readonly ISubject PageRequests = new BehaviorSubject(new PageRequest(1, 25)); + private protected readonly ISubject PageRequests = new BehaviorSubject(new PageRequest(1, 25)); protected readonly ChangeSetAggregator> Aggregator; - protected SortAndPageFixtureBase() { // It's ok in this case to call VirtualMemberCallInConstructor @@ -98,10 +96,8 @@ protected SortAndPageFixtureBase() #pragma warning restore CA2214 } - protected abstract ChangeSetAggregator> SetUpTests(); - [Fact] public void InitialBatches() { @@ -113,7 +109,6 @@ public void InitialBatches() var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); actualResult.Should().BeEquivalentTo(expectedResult); - PageRequests.OnNext(new PageRequest(3, 25)); expectedResult = people.OrderBy(p => p, Comparer).Skip(50).Take(25).ToList(); @@ -127,8 +122,6 @@ public void InitialBatches() [Fact] public void ThrowsForNegativeSizeParameters() => Assert.Throws(() => PageRequests.OnNext(new PageRequest(1, -1))); - - [Fact] public void PageGreaterThanNumberOfPagesAvailable() { @@ -143,7 +136,6 @@ public void PageGreaterThanNumberOfPagesAvailable() actualResult.Should().BeEquivalentTo(expectedResult); } - [Fact] public void OverlappingShift() { @@ -189,7 +181,6 @@ public void AddFirstInRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void AddOutsideOfRange() { @@ -203,7 +194,6 @@ public void AddOutsideOfRange() // only the initials message should have been received Aggregator.Messages.Count.Should().Be(1); - people.Add(person); var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); @@ -225,7 +215,6 @@ public void UpdateMoveOutOfRange() var changes = Aggregator.Messages[1]; changes.Count.Should().Be(2); - var firstChange = changes.First(); firstChange.Reason.Should().Be(ChangeReason.Remove); firstChange.Current.Should().Be(new Person("P012", 50)); @@ -271,8 +260,6 @@ public void UpdateStayRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - - [Fact] public void UpdateOutOfRange() { @@ -291,7 +278,6 @@ public void UpdateOutOfRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RemoveRange() { @@ -341,7 +327,6 @@ public void RemoveOutOfRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RefreshInRange() { @@ -410,7 +395,6 @@ public void RefreshWithInlineChangeOutsideRange() secondChange.Reason.Should().Be(ChangeReason.Add); secondChange.Current.Should().Be(new Person("P026", 26)); - var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); actualResult.SequenceEqual(expectedResult).Should().Be(true); diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs index bb8896aac..9b841218f 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; @@ -9,7 +8,6 @@ namespace DynamicData.Tests.Cache; - public sealed class SortAndVirtualizeAndBindWithImplicitOptionsFixtureReadOnlyCollection : SortAndVirtualizeAndBindFixtureBase { protected override (ChangeSetAggregator aggregator, IList list) SetUpTests() @@ -75,7 +73,7 @@ public abstract class SortAndVirtualizeAndBindFixtureBase : IDisposable protected readonly SourceCache Source = new(p => p.Name); protected readonly IComparer Comparer = SortExpressionComparer.Ascending(p => p.Age).ThenByAscending(p => p.Name); - protected readonly ISubject VirtualRequests = new BehaviorSubject(new VirtualRequest(0, 25)); + private protected readonly ISubject VirtualRequests = new BehaviorSubject(new VirtualRequest(0, 25)); protected readonly ChangeSetAggregator Aggregator; protected readonly IList List; @@ -93,10 +91,8 @@ protected SortAndVirtualizeAndBindFixtureBase() List = args.list; } - protected abstract (ChangeSetAggregator aggregator, IList list) SetUpTests(); - [Fact] public void InitialBatches() { @@ -107,22 +103,15 @@ public void InitialBatches() var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); List.Should().BeEquivalentTo(expectedResult); - VirtualRequests.OnNext(new VirtualRequest(25, 50)); expectedResult = people.OrderBy(p => p, Comparer).Skip(25).Take(50).ToList(); List.Should().BeEquivalentTo(expectedResult); - VirtualRequests.OnNext(new VirtualRequest(40, 50)); expectedResult = people.OrderBy(p => p, Comparer).Skip(40).Take(50).ToList(); List.Should().BeEquivalentTo(expectedResult); } - - - - - [Fact] public void OverlappingShift() { @@ -166,14 +155,12 @@ public void AddFirstInRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void AddOutsideOfRange() { var people = Enumerable.Range(1, 100).Select(i => new Person($"P{i:000}", i)).OrderBy(p => Guid.NewGuid()).ToList(); Source.AddOrUpdate(people); - // insert right at end var person = new Person("X_Last", 100); Source.AddOrUpdate(person); @@ -181,7 +168,6 @@ public void AddOutsideOfRange() // only the initials message should have been received Aggregator.Messages.Count.Should().Be(1); - people.Add(person); var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); List.SequenceEqual(expectedResult).Should().Be(true); @@ -202,7 +188,6 @@ public void UpdateMoveOutOfRange() var changes = Aggregator.Messages[1]; changes.Count.Should().Be(2); - var firstChange = changes.First(); firstChange.Reason.Should().Be(ChangeReason.Remove); firstChange.Current.Should().Be(new Person("P012", 50)); @@ -246,8 +231,6 @@ public void UpdateStayRange() List.SequenceEqual(expectedResult).Should().Be(true); } - - [Fact] public void UpdateOutOfRange() { @@ -265,7 +248,6 @@ public void UpdateOutOfRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RemoveRange() { @@ -313,7 +295,6 @@ public void RemoveOutOfRange() List.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RefreshInRange() { @@ -381,7 +362,6 @@ public void RefreshWithInlineChangeOutsideRange() secondChange.Reason.Should().Be(ChangeReason.Add); secondChange.Current.Should().Be(new Person("P026", 26)); - var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); List.SequenceEqual(expectedResult).Should().Be(true); } diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs index f5d865369..e9ba5da10 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs @@ -1,8 +1,7 @@ - + using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; @@ -10,10 +9,6 @@ namespace DynamicData.Tests.Cache; - - - - public sealed class SortAndVirtualizeWithComparerChangesFixture : SortAndVirtualizeFixtureBase { private BehaviorSubject> _comparerSubject ; @@ -85,11 +80,10 @@ public abstract class SortAndVirtualizeFixtureBase : IDisposable protected readonly SourceCache Source = new(p => p.Name); protected readonly IComparer Comparer = SortExpressionComparer.Ascending(p => p.Age).ThenByAscending(p => p.Name); - protected readonly ISubject VirtualRequests = new BehaviorSubject(new VirtualRequest(0, 25)); + private protected readonly ISubject VirtualRequests = new BehaviorSubject(new VirtualRequest(0, 25)); protected readonly ChangeSetAggregator> Aggregator; - protected SortAndVirtualizeFixtureBase() { // It's ok in this case to call VirtualMemberCallInConstructor @@ -100,10 +94,8 @@ protected SortAndVirtualizeFixtureBase() #pragma warning restore CA2214 } - protected abstract ChangeSetAggregator> SetUpTests(); - [Fact] public void InitialBatches() { @@ -115,7 +107,6 @@ public void InitialBatches() var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); actualResult.Should().BeEquivalentTo(expectedResult); - VirtualRequests.OnNext(new VirtualRequest(25,50)); expectedResult = people.OrderBy(p => p, Comparer).Skip(25).Take(50).ToList(); @@ -123,8 +114,6 @@ public void InitialBatches() actualResult.Should().BeEquivalentTo(expectedResult); } - - [Fact] public void OverlappingShift() { @@ -170,7 +159,6 @@ public void AddFirstInRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void AddOutsideOfRange() { @@ -184,7 +172,6 @@ public void AddOutsideOfRange() // only the initials message should have been received Aggregator.Messages.Count.Should().Be(1); - people.Add(person); var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); @@ -206,7 +193,6 @@ public void UpdateMoveOutOfRange() var changes = Aggregator.Messages[1]; changes.Count.Should().Be(2); - var firstChange = changes.First(); firstChange.Reason.Should().Be(ChangeReason.Remove); firstChange.Current.Should().Be(new Person("P012", 50)); @@ -252,8 +238,6 @@ public void UpdateStayRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - - [Fact] public void UpdateOutOfRange() { @@ -272,7 +256,6 @@ public void UpdateOutOfRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RemoveRange() { @@ -322,7 +305,6 @@ public void RemoveOutOfRange() actualResult.SequenceEqual(expectedResult).Should().Be(true); } - [Fact] public void RefreshInRange() { @@ -391,7 +373,6 @@ public void RefreshWithInlineChangeOutsideRange() secondChange.Reason.Should().Be(ChangeReason.Add); secondChange.Current.Should().Be(new Person("P026", 26)); - var expectedResult = people.OrderBy(p => p, Comparer).Take(25).ToList(); var actualResult = Aggregator.Data.Items.OrderBy(p => p, Comparer); actualResult.SequenceEqual(expectedResult).Should().Be(true); diff --git a/src/DynamicData.Tests/Cache/SortFixture.cs b/src/DynamicData.Tests/Cache/SortFixture.cs index 0f228b173..5ee4ff10a 100644 --- a/src/DynamicData.Tests/Cache/SortFixture.cs +++ b/src/DynamicData.Tests/Cache/SortFixture.cs @@ -3,8 +3,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Kernel; diff --git a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs index 6175a0f5c..621b1fbc2 100644 --- a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs +++ b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Cache/SourceCacheFixture.cs b/src/DynamicData.Tests/Cache/SourceCacheFixture.cs index 99b79fbfd..3dda8598d 100644 --- a/src/DynamicData.Tests/Cache/SourceCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/SourceCacheFixture.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using System.Threading; using System.Threading.Tasks; @@ -162,8 +161,6 @@ public void EmptyChangesWithFilter() change!.Count.Should().Be(0); } - - [Fact] public void StaticFilterRemove() { @@ -174,7 +171,6 @@ public void StaticFilterRemove() cache.AddOrUpdate(Enumerable.Range(1,10).Select(i=> new SomeObject(i,i))); - above5.Items.Should().BeEquivalentTo(Enumerable.Range(6, 5).Select(i => new SomeObject(i, i))); below5.Items.Should().BeEquivalentTo(Enumerable.Range(1, 5).Select(i => new SomeObject(i, i))); @@ -184,14 +180,12 @@ public void StaticFilterRemove() above5.Count.Should().Be(4); below5.Count.Should().Be(6); - above5.Items.Should().BeEquivalentTo(Enumerable.Range(7, 4).Select(i => new SomeObject(i, i))); below5.Items.Should().BeEquivalentTo(Enumerable.Range(1, 6).Select(i => new SomeObject(i, i == 6 ? -1 : i))); } public record class SomeObject(int Id, int Value); - [Fact] public async Task MultiCacheFanInDoesNotDeadlock() { diff --git a/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs b/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs index 5d6d26729..323c1e7ca 100644 --- a/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Disposables; using FluentAssertions; diff --git a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs index db39604a5..f8d4a74a5 100644 --- a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs +++ b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using System.Threading; using System.Threading.Tasks; using DynamicData.Kernel; diff --git a/src/DynamicData.Tests/Cache/SwitchFixture.cs b/src/DynamicData.Tests/Cache/SwitchFixture.cs index 5a5b76555..d8cb7fcff 100644 --- a/src/DynamicData.Tests/Cache/SwitchFixture.cs +++ b/src/DynamicData.Tests/Cache/SwitchFixture.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; @@ -19,7 +18,6 @@ public void ClearsForNewSource() using var switchable = new BehaviorSubject>(source); var results = switchable.Switch().AsAggregator(); - var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); source.AddOrUpdate(inital); @@ -45,7 +43,6 @@ public void PoulatesFirstSource() using var switchable = new BehaviorSubject>(source); var results = switchable.Switch().AsAggregator(); - var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); source.AddOrUpdate(inital); @@ -59,7 +56,6 @@ public void PropagatesOuterErrors() using var switchable = new BehaviorSubject>(source); var results = switchable.Switch().AsAggregator(); - var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); source.AddOrUpdate(inital); @@ -76,7 +72,6 @@ public void PropagatesInnerErrors() using var switchable = new BehaviorSubject>>(source.Connect()); var results = switchable.Switch().AsAggregator(); - var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); source.AddOrUpdate(inital); diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 8dd0ae91e..edf278399 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using System.Threading.Tasks; using FluentAssertions; @@ -27,10 +25,10 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { IScheduler scheduler = schedulerType switch { - SchedulerType.Default => DefaultScheduler.Instance, + SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), - SchedulerType.TaskPool => TaskPoolScheduler.Default, - SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, + SchedulerType.TaskPool => TaskPoolSequencer.Default, + SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, _ => throw new ArgumentOutOfRangeException(nameof(SchedulerType)) }; diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs index 892f55535..40c3af69c 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -1,9 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; using FluentAssertions; using Xunit; @@ -26,7 +22,6 @@ public void ExpireAfterThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -43,7 +38,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedItemsByKey.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(item1); @@ -54,7 +48,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "1 item was emitted before an error occurred"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was emitted before an error occurred"); - results.ShouldNotSupportSorting($"Cache source operators do not support sorting"); } @@ -73,7 +66,6 @@ public void KeySelectorThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet(static item => (item.Error is not null) @@ -88,7 +80,6 @@ public void KeySelectorThrows_ErrorPropagates() results.RecordedItemsByKey.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(item1); @@ -99,7 +90,6 @@ public void KeySelectorThrows_ErrorPropagates() results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "1 item was emitted before an error occurred"); results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was emitted before an error occurred"); - results.ShouldNotSupportSorting($"Cache source operators do not support sorting"); } @@ -109,7 +99,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() // Setup using var source = new Subject(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -124,7 +113,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEmpty("no items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Not enough items to reach the limit var item1 = new Item() { Id = 1 }; source.OnNext(item1); @@ -143,7 +131,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3, item4 }, "4 items were emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Limit is reached var item5 = new Item() { Id = 5 }; source.OnNext(item5); @@ -153,7 +140,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3, item4, item5 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: New item exceeds the limit var item6 = new Item() { Id = 6 }; source.OnNext(item6); @@ -163,7 +149,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2, item3, item4, item5, item6 }, "1 item was emitted, and 1 was evicted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Replacement leaves all other items in-place var item7 = new Item() { Id = 4 }; source.OnNext(item7); @@ -191,7 +176,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -216,7 +200,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("1 item has yet to expire"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -228,7 +211,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio results.RecordedItemsByKey.Values.Should().BeEmpty("all items have expired"); results.HasCompleted.Should().BeTrue("the source, and all outstanding expirations, have completed"); - results.ShouldNotSupportSorting(); } @@ -249,7 +231,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -274,7 +255,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item }, "1 item was emitted"); results.HasCompleted.Should().BeTrue("the source has completed, and no items remain to be expired"); - results.ShouldNotSupportSorting(); } @@ -286,7 +266,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -302,7 +281,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEmpty("no items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item1); @@ -313,7 +291,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item2 = new Item() { Id = 2 }; source.OnNext(item2); @@ -324,7 +301,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item3 = new Item() { Id = 3, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item3); @@ -335,7 +311,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item4 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item4); @@ -346,7 +321,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item4, item2, item3 }, "1 item was emitted, and replaced an existing item"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item5 = new Item() { Id = 2 }; source.OnNext(item5); @@ -357,7 +331,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item4, item5, item3 }, "1 item was emitted, and replaced an existing item"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item6 = new Item() { Id = 3, Lifetime = TimeSpan.FromSeconds(3) }; source.OnNext(item6); @@ -368,7 +341,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item4, item5, item6 }, "1 item was emitted, and replaced an existing item"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -377,7 +349,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5, item6 }, "1 item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -386,7 +357,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5, item6 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -395,7 +365,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5 }, "1 item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -404,7 +373,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - results.ShouldNotSupportSorting(); } @@ -416,7 +384,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -432,7 +399,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEmpty("no items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(3) }; source.OnNext(item1); @@ -443,7 +409,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item2 = new Item() { Id = 2 }; source.OnNext(item2); @@ -454,7 +419,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item3 = new Item() { Id = 3, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item3); @@ -465,7 +429,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "1 item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -474,7 +437,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "1 item expired, and 1 had its lifetime extended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -483,7 +445,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -492,7 +453,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2 }, "1 item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -501,7 +461,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - results.ShouldNotSupportSorting(); } @@ -520,7 +479,6 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet(Item.SelectId) diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index f6dece980..595c4119d 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using System.Threading.Tasks; using FluentAssertions; @@ -27,10 +25,10 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { IScheduler scheduler = schedulerType switch { - SchedulerType.Default => DefaultScheduler.Instance, + SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), - SchedulerType.TaskPool => TaskPoolScheduler.Default, - SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, + SchedulerType.TaskPool => TaskPoolSequencer.Default, + SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, _ => throw new ArgumentOutOfRangeException(nameof(SchedulerType)) }; diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs index 94213315a..b5bea808a 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -1,10 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; using FluentAssertions; using Xunit; @@ -27,7 +23,6 @@ public void ExpireAfterThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -44,7 +39,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedItemsByKey.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(new[] @@ -58,7 +52,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedChangeSets.Skip(1).Should().BeEmpty("an error occurred during processing of the sequence"); results.RecordedItemsByKey.Values.Should().BeEmpty("an error occurred during processing of the sequence"); - results.ShouldNotSupportSorting($"Cache source operators do not support sorting"); } @@ -77,7 +70,6 @@ public void KeySelectorThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet(static item => (item.Error is not null) @@ -92,7 +84,6 @@ public void KeySelectorThrows_ErrorPropagates() results.RecordedItemsByKey.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(new[] @@ -106,7 +97,6 @@ public void KeySelectorThrows_ErrorPropagates() results.RecordedChangeSets.Skip(1).Should().BeEmpty("an error occurred during processing of the sequence"); results.RecordedItemsByKey.Values.Should().BeEmpty("an error occurred during processing of the sequence"); - results.ShouldNotSupportSorting($"Cache source operators do not support sorting"); } @@ -116,7 +106,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() // Setup using var source = new Subject>(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -131,7 +120,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEmpty("no source items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Not enough items to reach the limit var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; @@ -150,7 +138,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3, item4 }, "4 source items were emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Limit is reached var item5 = new Item() { Id = 5 }; source.OnNext(new[] { item5 }); @@ -160,7 +147,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3, item4, item5 }, "1 source item was emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: New item exceeds the limit var item6 = new Item() { Id = 6 }; source.OnNext(new[] { item6 }); @@ -170,7 +156,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2, item3, item4, item5, item6 }, "1 source item was emitted, and 1 was evicted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Replacement leaves all other items in-place var item7 = new Item() { Id = 4 }; source.OnNext(new[] { item7 }); @@ -203,7 +188,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -228,7 +212,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items, "3 items were emitted"); results.HasCompleted.Should().BeFalse("2 items have yet to expire"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(30).Ticks); @@ -240,7 +223,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items.Where(static item => item.Lifetime is null), "all expirable items have expired"); results.HasCompleted.Should().BeTrue("the source, and all outstanding expirations, have completed"); - results.ShouldNotSupportSorting(); } @@ -266,7 +248,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -291,7 +272,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour results.RecordedItemsByKey.Values.Should().BeEquivalentTo(items, "3 items were emitted"); results.HasCompleted.Should().BeTrue("the source has completed, and no items remain to be expired"); - results.ShouldNotSupportSorting(); } @@ -303,7 +283,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -319,7 +298,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEmpty("no source items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(1) }; var item2 = new Item() { Id = 2 }; @@ -332,7 +310,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "3 items were emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item4 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(1) }; var item5 = new Item() { Id = 2 }; @@ -345,7 +322,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item4, item5, item6 }, "3 items were emitted, and replaced existing items"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -354,7 +330,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5, item6 }, "1 source item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -363,7 +338,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5, item6 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -372,7 +346,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5 }, "1 source item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -381,7 +354,6 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item5 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - results.ShouldNotSupportSorting(); } @@ -393,7 +365,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -409,7 +380,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEmpty("no source items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(3) }; var item2 = new Item() { Id = 2 }; @@ -422,7 +392,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2, item3 }, "3 items were emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -431,7 +400,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "1 item expired, and 1 had its lifetime extended"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -440,7 +408,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item1, item2 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -449,7 +416,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2 }, "1 item reached its expiration"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -458,7 +424,6 @@ public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItemsByKey.Values.Should().BeEquivalentTo(new[] { item2 }, "no changes were made"); results.HasCompleted.Should().BeFalse("the source has not completed"); - results.ShouldNotSupportSorting(); } @@ -477,7 +442,6 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet(Item.SelectId) diff --git a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs index d4ea2fd7e..8a6f29e29 100644 --- a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -using System.Reactive.Linq; using System.Threading.Tasks; using DynamicData.Kernel; using FluentAssertions; diff --git a/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs b/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs index 5c7e84f23..601c97598 100644 --- a/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs +++ b/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs @@ -1,16 +1,12 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs index 7483eccb4..e281af462 100644 --- a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs @@ -1,9 +1,6 @@ using System; using System.Collections.ObjectModel; using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading.Tasks; using DynamicData.Binding; using DynamicData.Tests.Domain; @@ -199,9 +196,6 @@ public void Update() stub.Results.Messages[1].Updates.Should().Be(1, "Should be 1 update"); } - - - [Theory, InlineData(true), InlineData(false)] public void TransformOnRefresh(bool transformOnRefresh) { @@ -218,13 +212,11 @@ public void TransformOnRefresh(bool transformOnRefresh) person.Age = 21; - results.Data.Count.Should().Be(1); results.Data.Lookup("SomeOne").Value.AgeGroup.Should().Be(transformOnRefresh ? "Adult": "Child"); } - [Theory, InlineData(10), InlineData(100)] public async Task WithMaxConcurrency(int maxConcurrency) @@ -237,7 +229,6 @@ public async Task WithMaxConcurrency(int maxConcurrency) So it works, but how can it be tested in a scientific way ?? */ - const int transformCount = 100; using var source = new SourceCache(p => p.Name); diff --git a/src/DynamicData.Tests/Cache/TransformFixture.cs b/src/DynamicData.Tests/Cache/TransformFixture.cs index d149276cd..740f98e28 100644 --- a/src/DynamicData.Tests/Cache/TransformFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformFixture.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs index 4b529b345..4116d0af0 100644 --- a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; using Xunit; @@ -20,7 +17,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() .TransformImmutable(transformFactory: Item.NameSelector) .AsAggregator(); - // Additions var item1 = new Item() { Id = 1, Name = "Item #1" }; var item2 = new Item() { Id = 2, Name = "Item #2" }; @@ -37,7 +33,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() results.Messages.ElementAt(0).Select(change => change.PreviousIndex).Should().BeEquivalentTo(operation1.Select(change => change.PreviousIndex), "indexes should be preserved"); results.Data.Items.Should().BeEquivalentTo(new[] { item1.Name, item2.Name }, "2 items were added"); - // Replace items, changing inclusion var item3 = new Item() { Id = item1.Id, Name = "Item #3" }; var item4 = new Item() { Id = item2.Id, Name = "Item #4" }; @@ -54,7 +49,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() results.Messages.ElementAt(1).Select(change => change.PreviousIndex).Should().BeEquivalentTo(operation2.Select(change => change.PreviousIndex), "indexes should be preserved"); results.Data.Items.Should().BeEquivalentTo(new[] { item3.Name, item4.Name }, "2 items were replaced"); - // Refresh items var operation3 = new ChangeSet() { @@ -69,7 +63,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() results.Messages.ElementAt(2).Select(change => change.PreviousIndex).Should().BeEquivalentTo(operation3.Select(change => change.PreviousIndex), "indexes should be preserved"); results.Data.Items.Should().BeEquivalentTo(new[] { item3.Name, item4.Name }, "2 items were refreshed"); - // Move items var operation4 = new ChangeSet() { @@ -84,7 +77,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() results.Messages.ElementAt(3).Select(change => change.PreviousIndex).Should().BeEquivalentTo(operation4.Select(change => change.PreviousIndex), "indexes should be preserved"); results.Data.Items.Should().BeEquivalentTo(new[] { item4.Name, item3.Name }, "2 items were moved"); - // Remove items var operation5 = new ChangeSet() { @@ -99,7 +91,6 @@ public void ItemsAreManipulated_ItemsAreTransformed() results.Messages.ElementAt(4).Select(change => change.PreviousIndex).Should().BeEquivalentTo(operation5.Select(change => change.PreviousIndex), "indexes should be preserved"); results.Data.Items.Should().BeEmpty("2 items were removed"); - results.IsCompleted.Should().BeFalse(); } @@ -112,7 +103,6 @@ public void SourceCompletes_CompletionIsPropagated() .TransformImmutable(transformFactory: Item.NameSelector) .AsAggregator(); - var item1 = new Item() { Id = 1, Name = "Item #1" }; source.OnNext(new ChangeSet() { @@ -125,7 +115,6 @@ public void SourceCompletes_CompletionIsPropagated() results.Messages.Count.Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEquivalentTo(new[] { item1.Name }, "1 item was added"); - // Make sure no extraneous notifications are published. var item2 = new Item() { Id = 2, Name = "Item #2" }; source.OnNext(new ChangeSet() @@ -159,7 +148,6 @@ public void SourceCompletesImmediately_CompletionIsPropagated() .TransformImmutable(transformFactory: Item.NameSelector) .AsAggregator(); - results.Error.Should().BeNull(); results.IsCompleted.Should().BeTrue(); results.Messages.Count.Should().Be(1, "1 source operation was performed"); @@ -177,7 +165,6 @@ public void SourceErrors_ErrorIsPropagated() .TransformImmutable(transformFactory: Item.NameSelector) .AsAggregator(); - var item1 = new Item() { Id = 1, Name = "Item #1" }; source.OnNext(new ChangeSet() { @@ -190,7 +177,6 @@ public void SourceErrors_ErrorIsPropagated() results.Messages.Count.Should().Be(1, "1 source operation was performed"); results.Data.Items.Should().BeEquivalentTo(new[] { item1.Name }, "1 item was added"); - // Make sure no extraneous notifications are published. var item2 = new Item() { Id = 2, Name = "Item #2" }; source.OnNext(new ChangeSet() @@ -223,7 +209,6 @@ public void SourceErrorsImmediately_ErrorIsPropagated() .TransformImmutable(transformFactory: Item.NameSelector) .AsAggregator(); - results.Error.Should().Be(error); results.IsCompleted.Should().BeFalse(); results.Messages.Count.Should().Be(1, "1 source operation was performed"); @@ -255,7 +240,6 @@ public void TransformFactoryThrows_ExceptionIsCaptured() .TransformImmutable(transformFactory: _ => throw error) .AsAggregator(); - var item1 = new Item() { Id = 1, Name = "Item #1" }; source.OnNext(new ChangeSet() { @@ -277,7 +261,6 @@ public void TDestinationIsValueType_DoesNotThrowException() .TransformImmutable(transformFactory: static value => value.Length) .AsAggregator(); - source.OnNext(new ChangeSet() { new(reason: ChangeReason.Add, key: "Item #1", current: "Item #1", index: 0) diff --git a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs index 3781b1a2a..9c95f66e9 100644 --- a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using System.Reactive.Linq; using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; diff --git a/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs b/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs index a15d1c051..f0dd5de25 100644 --- a/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs @@ -1,249 +1,248 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Linq; -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; - -public class TransformManyObservableCollectionFixture -{ - [Fact] - public void FlattenObservableCollection() - { - var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); - - var childIndex = 0; - var parents = Enumerable.Range(1, 50).Select( - i => - { - var parent = new Parent( - i, - new[] - { - children[childIndex], - children[childIndex + 1] - }); - - childIndex += 2; - return parent; - }).ToArray(); - - using var source = new SourceCache(x => x.Id); - using var aggregator = source.Connect().TransformMany(p => p.Children, c => c.Name).AsAggregator(); - source.AddOrUpdate(parents); - - aggregator.Data.Count.Should().Be(100); - - //add a child to an observable collection and check the new item is added - parents[0].Children.Add(new Person("NewlyAddded", 100)); - aggregator.Data.Count.Should().Be(101); - - ////remove first parent and check children have gone - source.RemoveKey(1); - aggregator.Data.Count.Should().Be(98); - - //check items can be cleared and then added back in - var childrenInZero = parents[1].Children.ToArray(); - parents[1].Children.Clear(); - aggregator.Data.Count.Should().Be(96); - parents[1].Children.AddRange(childrenInZero); - aggregator.Data.Count.Should().Be(98); - - //replace produces an update - var replacedChild = parents[1].Children[0]; - parents[1].Children[0] = new Person("Replacement", 100); - aggregator.Data.Count.Should().Be(98); - - aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); - aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); - } - - [Fact] - public void FlattenReadOnlyObservableCollection() - { - var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); - - var childIndex = 0; - var parents = Enumerable.Range(1, 50).Select( - i => - { - var parent = new Parent( - i, - new[] - { - children[childIndex], - children[childIndex + 1] - }); - - childIndex += 2; - return parent; - }).ToArray(); - - using var source = new SourceCache(x => x.Id); - using var aggregator = source.Connect().TransformMany(p => p.ChildrenReadonly, c => c.Name).AsAggregator(); - source.AddOrUpdate(parents); - - aggregator.Data.Count.Should().Be(100); - - //add a child to an observable collection and check the new item is added - parents[0].Children.Add(new Person("NewlyAddded", 100)); - aggregator.Data.Count.Should().Be(101); - - ////remove first parent and check children have gone - source.RemoveKey(1); - aggregator.Data.Count.Should().Be(98); - - //check items can be cleared and then added back in - var childrenInZero = parents[1].Children.ToArray(); - parents[1].Children.Clear(); - aggregator.Data.Count.Should().Be(96); - parents[1].Children.AddRange(childrenInZero); - aggregator.Data.Count.Should().Be(98); - - //replace produces an update - var replacedChild = parents[1].Children[0]; - parents[1].Children[0] = new Person("Replacement", 100); - aggregator.Data.Count.Should().Be(98); - - aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); - aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); - } - - [Fact] - public void FlattenObservableCache() - { - var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); - - var childIndex = 0; - var parents = Enumerable.Range(1, 50).Select( - i => - { - var parent = new Parent( - i, - new[] - { - children[childIndex], - children[childIndex + 1] - }); - - childIndex += 2; - return parent; - }).ToArray(); - - using var source = new SourceCache(x => x.Id); - using var aggregator = source.Connect().TransformMany(p => p.ChildrenCache, c => c.Name).AsAggregator(); - source.AddOrUpdate(parents); - - aggregator.Data.Count.Should().Be(100); - - //add a child to an observable collection and check the new item is added - parents[0].Children.Add(new Person("NewlyAddded", 100)); - aggregator.Data.Count.Should().Be(101); - - ////remove first parent and check children have gone - source.RemoveKey(1); - aggregator.Data.Count.Should().Be(98); - - //check items can be cleared and then added back in - var childrenInZero = parents[1].Children.ToArray(); - parents[1].Children.Clear(); - aggregator.Data.Count.Should().Be(96); - parents[1].Children.AddRange(childrenInZero); - aggregator.Data.Count.Should().Be(98); - - //replace produces an update - var replacedChild = parents[1].Children[0]; - parents[1].Children[0] = new Person("Replacement", 100); - aggregator.Data.Count.Should().Be(98); - - aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); - aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); - } - - [Fact] - public void ObservableCollectionWithoutInitialData() - { - using var parents = new SourceCache(d => d.Id); - var collection = parents.Connect().TransformMany(d => d.Children, p => p.Name).AsObservableCache(); - - var parent = new Parent(1); - parents.AddOrUpdate(parent); - - collection.Count.Should().Be(0); - - parent.Children.Add(new Person("child1", 1)); - collection.Count.Should().Be(1); - - parent.Children.Add(new Person("child2", 2)); - collection.Count.Should().Be(2); - } - - [Fact] - public void ReadOnlyObservableCollectionWithoutInitialData() - { - using var parents = new SourceCache(d => d.Id); - var collection = parents.Connect().TransformMany(d => d.ChildrenReadonly, p => p.Name).AsObservableCache(); - - var parent = new Parent(1); - parents.AddOrUpdate(parent); - - collection.Count.Should().Be(0); - - parent.Children.Add(new Person("child1", 1)); - collection.Count.Should().Be(1); - - parent.Children.Add(new Person("child2", 2)); - collection.Count.Should().Be(2); - } - - [Fact] - public void ObservableCacheWithoutInitialData() - { - using var parents = new SourceCache(d => d.Id); - var collection = parents.Connect().TransformMany(d => d.ChildrenCache, p => p.Name).AsObservableCache(); - - var parent = new Parent(1); - parents.AddOrUpdate(parent); - - collection.Count.Should().Be(0); - - parent.Children.Add(new Person("child1", 1)); - collection.Count.Should().Be(1); - - parent.Children.Add(new Person("child2", 2)); - collection.Count.Should().Be(2); - } - - private class Parent - { - public Parent(int id, IEnumerable children) - { - Id = id; - Children = new ObservableCollection(children); - ChildrenReadonly = new ReadOnlyObservableCollection(Children); - ChildrenCache = Children.ToObservableChangeSet(x => x.Name).AsObservableCache(); - } - - public Parent(int id) - { - Id = id; - Children = new ObservableCollection(); - ChildrenReadonly = new ReadOnlyObservableCollection(Children); - ChildrenCache = Children.ToObservableChangeSet(x => x.Name).AsObservableCache(); - } - - public ObservableCollection Children { get; } - +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using DynamicData.Binding; +using DynamicData.Tests.Domain; + +using FluentAssertions; + +using Xunit; + +namespace DynamicData.Tests.Cache; + +public class TransformManyObservableCollectionFixture +{ + [Fact] + public void FlattenObservableCollection() + { + var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); + + var childIndex = 0; + var parents = Enumerable.Range(1, 50).Select( + i => + { + var parent = new Parent( + i, + new[] + { + children[childIndex], + children[childIndex + 1] + }); + + childIndex += 2; + return parent; + }).ToArray(); + + using var source = new SourceCache(x => x.Id); + using var aggregator = source.Connect().TransformMany(p => p.Children, c => c.Name).AsAggregator(); + source.AddOrUpdate(parents); + + aggregator.Data.Count.Should().Be(100); + + //add a child to an observable collection and check the new item is added + parents[0].Children.Add(new Person("NewlyAddded", 100)); + aggregator.Data.Count.Should().Be(101); + + ////remove first parent and check children have gone + source.RemoveKey(1); + aggregator.Data.Count.Should().Be(98); + + //check items can be cleared and then added back in + var childrenInZero = parents[1].Children.ToArray(); + parents[1].Children.Clear(); + aggregator.Data.Count.Should().Be(96); + parents[1].Children.AddRange(childrenInZero); + aggregator.Data.Count.Should().Be(98); + + //replace produces an update + var replacedChild = parents[1].Children[0]; + parents[1].Children[0] = new Person("Replacement", 100); + aggregator.Data.Count.Should().Be(98); + + aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); + aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); + } + + [Fact] + public void FlattenReadOnlyObservableCollection() + { + var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); + + var childIndex = 0; + var parents = Enumerable.Range(1, 50).Select( + i => + { + var parent = new Parent( + i, + new[] + { + children[childIndex], + children[childIndex + 1] + }); + + childIndex += 2; + return parent; + }).ToArray(); + + using var source = new SourceCache(x => x.Id); + using var aggregator = source.Connect().TransformMany(p => p.ChildrenReadonly, c => c.Name).AsAggregator(); + source.AddOrUpdate(parents); + + aggregator.Data.Count.Should().Be(100); + + //add a child to an observable collection and check the new item is added + parents[0].Children.Add(new Person("NewlyAddded", 100)); + aggregator.Data.Count.Should().Be(101); + + ////remove first parent and check children have gone + source.RemoveKey(1); + aggregator.Data.Count.Should().Be(98); + + //check items can be cleared and then added back in + var childrenInZero = parents[1].Children.ToArray(); + parents[1].Children.Clear(); + aggregator.Data.Count.Should().Be(96); + parents[1].Children.AddRange(childrenInZero); + aggregator.Data.Count.Should().Be(98); + + //replace produces an update + var replacedChild = parents[1].Children[0]; + parents[1].Children[0] = new Person("Replacement", 100); + aggregator.Data.Count.Should().Be(98); + + aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); + aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); + } + + [Fact] + public void FlattenObservableCache() + { + var children = Enumerable.Range(1, 100).Select(i => new Person("Name" + i, i)).ToArray(); + + var childIndex = 0; + var parents = Enumerable.Range(1, 50).Select( + i => + { + var parent = new Parent( + i, + new[] + { + children[childIndex], + children[childIndex + 1] + }); + + childIndex += 2; + return parent; + }).ToArray(); + + using var source = new SourceCache(x => x.Id); + using var aggregator = source.Connect().TransformMany(p => p.ChildrenCache, c => c.Name).AsAggregator(); + source.AddOrUpdate(parents); + + aggregator.Data.Count.Should().Be(100); + + //add a child to an observable collection and check the new item is added + parents[0].Children.Add(new Person("NewlyAddded", 100)); + aggregator.Data.Count.Should().Be(101); + + ////remove first parent and check children have gone + source.RemoveKey(1); + aggregator.Data.Count.Should().Be(98); + + //check items can be cleared and then added back in + var childrenInZero = parents[1].Children.ToArray(); + parents[1].Children.Clear(); + aggregator.Data.Count.Should().Be(96); + parents[1].Children.AddRange(childrenInZero); + aggregator.Data.Count.Should().Be(98); + + //replace produces an update + var replacedChild = parents[1].Children[0]; + parents[1].Children[0] = new Person("Replacement", 100); + aggregator.Data.Count.Should().Be(98); + + aggregator.Data.Lookup(replacedChild.Key).HasValue.Should().BeFalse(); + aggregator.Data.Lookup("Replacement").HasValue.Should().BeTrue(); + } + + [Fact] + public void ObservableCollectionWithoutInitialData() + { + using var parents = new SourceCache(d => d.Id); + var collection = parents.Connect().TransformMany(d => d.Children, p => p.Name).AsObservableCache(); + + var parent = new Parent(1); + parents.AddOrUpdate(parent); + + collection.Count.Should().Be(0); + + parent.Children.Add(new Person("child1", 1)); + collection.Count.Should().Be(1); + + parent.Children.Add(new Person("child2", 2)); + collection.Count.Should().Be(2); + } + + [Fact] + public void ReadOnlyObservableCollectionWithoutInitialData() + { + using var parents = new SourceCache(d => d.Id); + var collection = parents.Connect().TransformMany(d => d.ChildrenReadonly, p => p.Name).AsObservableCache(); + + var parent = new Parent(1); + parents.AddOrUpdate(parent); + + collection.Count.Should().Be(0); + + parent.Children.Add(new Person("child1", 1)); + collection.Count.Should().Be(1); + + parent.Children.Add(new Person("child2", 2)); + collection.Count.Should().Be(2); + } + + [Fact] + public void ObservableCacheWithoutInitialData() + { + using var parents = new SourceCache(d => d.Id); + var collection = parents.Connect().TransformMany(d => d.ChildrenCache, p => p.Name).AsObservableCache(); + + var parent = new Parent(1); + parents.AddOrUpdate(parent); + + collection.Count.Should().Be(0); + + parent.Children.Add(new Person("child1", 1)); + collection.Count.Should().Be(1); + + parent.Children.Add(new Person("child2", 2)); + collection.Count.Should().Be(2); + } + + private class Parent + { + public Parent(int id, IEnumerable children) + { + Id = id; + Children = new ObservableCollection(children); + ChildrenReadonly = new ReadOnlyObservableCollection(Children); + ChildrenCache = Children.ToObservableChangeSet(x => x.Name).AsObservableCache(); + } + + public Parent(int id) + { + Id = id; + Children = new ObservableCollection(); + ChildrenReadonly = new ReadOnlyObservableCollection(Children); + ChildrenCache = Children.ToObservableChangeSet(x => x.Name).AsObservableCache(); + } + + public ObservableCollection Children { get; } + public ReadOnlyObservableCollection ChildrenReadonly { get; } - public IObservableCache ChildrenCache { get; } - - public int Id { get; } - } -} + public IObservableCache ChildrenCache { get; } + + public int Id { get; } + } +} diff --git a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs index cc37806b7..5253e0638 100644 --- a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs @@ -1,9 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; diff --git a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs index 6c1f34eff..64fc6463b 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs @@ -1,9 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading.Tasks; using DynamicData.Cache; using DynamicData.Kernel; @@ -201,13 +198,11 @@ public void TransformOnRefresh(bool transformOnRefresh) person.Age = 21; - results.Data.Count.Should().Be(1); results.Data.Lookup("SomeOne").Value.AgeGroup.Should().Be(transformOnRefresh ? "Adult" : "Child"); errorCount.Should().Be(0); } - [Theory, InlineData(10), InlineData(100)] public async Task WithMaxConcurrency(int maxConcurrency) @@ -235,16 +230,13 @@ public async Task WithMaxConcurrency(int maxConcurrency) , TransformAsyncOptions.Default with { MaximumConcurrency = maxConcurrency }) .AsAggregator(); - source.AddOrUpdate(Enumerable.Range(1, transformCount).Select(l => new Person("Person" + l, l))); - await results.Data.CountChanged.Where(c => c == transformCount).Take(1); errorCount.Should().Be(0); } - private class TransformStub : IDisposable { public TransformStub() diff --git a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs index 33bf44573..fab7da98b 100644 --- a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using FluentAssertions; diff --git a/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs b/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs index 0be034a13..ff39c18f3 100644 --- a/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using DynamicData.Tests.Domain; @@ -76,7 +76,6 @@ public void Remove() stub.Results.Data.Count.Should().Be(0, "Should be nothing cached"); } - [Fact] public void TransformOnRefresh() { diff --git a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs index f9dece32b..e3cec45ea 100644 --- a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs @@ -1,6 +1,4 @@ using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; diff --git a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs index ad5d9086d..cdf3b352c 100644 --- a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs @@ -1,6 +1,4 @@ using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Cache/WatcherFixture.cs b/src/DynamicData.Tests/Cache/WatcherFixture.cs index 23faff11f..1173dcef4 100644 --- a/src/DynamicData.Tests/Cache/WatcherFixture.cs +++ b/src/DynamicData.Tests/Cache/WatcherFixture.cs @@ -1,18 +1,14 @@ -#region +#region using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Experimental; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; #endregion diff --git a/src/DynamicData.Tests/Domain/AnimalOwner.cs b/src/DynamicData.Tests/Domain/AnimalOwner.cs index 26049705b..ad3a49556 100644 --- a/src/DynamicData.Tests/Domain/AnimalOwner.cs +++ b/src/DynamicData.Tests/Domain/AnimalOwner.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections; using System.Collections.ObjectModel; -using System.Reactive.Disposables; using DynamicData.Binding; namespace DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Domain/Market.cs b/src/DynamicData.Tests/Domain/Market.cs index a100e6df3..78bc1b762 100644 --- a/src/DynamicData.Tests/Domain/Market.cs +++ b/src/DynamicData.Tests/Domain/Market.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -using System.Reactive.Linq; using System.Threading; using DynamicData.Kernel; using DynamicData.Tests.Utilities; @@ -128,7 +127,6 @@ public int Compare([DisallowNull] IMarket x, [DisallowNull] IMarket y) => } } - internal sealed class FixedMarket : IMarket { public FixedMarket(Func getPrice, int minId, int maxId, bool completable = true) diff --git a/src/DynamicData.Tests/Domain/PersonObs.cs b/src/DynamicData.Tests/Domain/PersonObs.cs index 08bd463b7..adc86d977 100644 --- a/src/DynamicData.Tests/Domain/PersonObs.cs +++ b/src/DynamicData.Tests/Domain/PersonObs.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Reactive.Subjects; namespace DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Domain/SelfObservingPerson.cs b/src/DynamicData.Tests/Domain/SelfObservingPerson.cs index 7a11ea949..e59c64130 100644 --- a/src/DynamicData.Tests/Domain/SelfObservingPerson.cs +++ b/src/DynamicData.Tests/Domain/SelfObservingPerson.cs @@ -1,5 +1,4 @@ -using System; -using System.Reactive.Linq; +using System; namespace DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index 4b9e28c65..c0014e5e3 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -17,11 +17,18 @@ - all runtime; build; native; contentfiles; analyzers + + + + + + + + diff --git a/src/DynamicData.Tests/EnumerableIListFixture.cs b/src/DynamicData.Tests/EnumerableIListFixture.cs index 2c18d4302..2a0febc62 100644 --- a/src/DynamicData.Tests/EnumerableIListFixture.cs +++ b/src/DynamicData.Tests/EnumerableIListFixture.cs @@ -1,9 +1,6 @@ -using System; +using System; using DynamicData.Cache.Internal; using System.Collections.Generic; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.Kernel; using Xunit; @@ -50,7 +47,7 @@ public void ExceptionTests() var exSubject = new Subject(); object exceptionRecived = default!; - exSubject.ObserveOn(ImmediateScheduler.Instance).Subscribe(ex => { exceptionRecived = ex; }); + exSubject.ObserveOn(Sequencer.Immediate).Subscribe(ex => { exceptionRecived = ex; }); exSubject.OnNext(new UnspecifiedIndexException()); Assert.IsType(exceptionRecived); diff --git a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs index 5f11b9fc5..75da93135 100644 --- a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs +++ b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs @@ -1,11 +1,10 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using System.Threading; using System.Threading.Tasks; @@ -372,4 +371,4 @@ private sealed class TestObserver : IObserver> public void OnError(Exception error) => Error = error; public void OnCompleted() => IsCompleted = true; } -} \ No newline at end of file +} diff --git a/src/DynamicData.Tests/Internal/NotificationFixture.cs b/src/DynamicData.Tests/Internal/NotificationFixture.cs index d221b0044..7df92b5bc 100644 --- a/src/DynamicData.Tests/Internal/NotificationFixture.cs +++ b/src/DynamicData.Tests/Internal/NotificationFixture.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using System; -using System.Reactive; using DynamicData.Internal; using FluentAssertions; diff --git a/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs b/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs index 1044f5cd2..ed68a55ed 100644 --- a/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs +++ b/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs @@ -1,5 +1,4 @@ -using System.Collections.ObjectModel; -using System.Reactive; +using System.Collections.ObjectModel; using DynamicData.Binding; using FluentAssertions; using Xunit; diff --git a/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs b/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs index d257b8abb..d2e62b888 100644 --- a/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs +++ b/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using DynamicData.Binding; @@ -53,7 +53,6 @@ public class Proxy public bool? Active { get; set; } - } public class ProxyEqualityComparer : IEqualityComparer diff --git a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs index 06095bc20..302ed7731 100644 --- a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using DynamicData.Kernel; using FluentAssertions; diff --git a/src/DynamicData.Tests/List/AutoRefreshFixture.cs b/src/DynamicData.Tests/List/AutoRefreshFixture.cs index e6e88aa72..1d5dd5cd5 100644 --- a/src/DynamicData.Tests/List/AutoRefreshFixture.cs +++ b/src/DynamicData.Tests/List/AutoRefreshFixture.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using DynamicData.Binding; @@ -7,8 +7,6 @@ using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/BatchFixture.cs b/src/DynamicData.Tests/List/BatchFixture.cs index c93fe2d08..95f200a0c 100644 --- a/src/DynamicData.Tests/List/BatchFixture.cs +++ b/src/DynamicData.Tests/List/BatchFixture.cs @@ -1,12 +1,9 @@ using System; -using System.Reactive.Linq; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/BatchIfFixture.cs b/src/DynamicData.Tests/List/BatchIfFixture.cs index ebbb28484..838f099aa 100644 --- a/src/DynamicData.Tests/List/BatchIfFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfFixture.cs @@ -1,13 +1,9 @@ using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs index f192a17ca..c0b8e256f 100644 --- a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs @@ -1,12 +1,9 @@ using System; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/BufferFixture.cs b/src/DynamicData.Tests/List/BufferFixture.cs index e02330f98..e80a77583 100644 --- a/src/DynamicData.Tests/List/BufferFixture.cs +++ b/src/DynamicData.Tests/List/BufferFixture.cs @@ -1,12 +1,9 @@ using System; -using System.Reactive.Linq; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/BufferInitialFixture.cs b/src/DynamicData.Tests/List/BufferInitialFixture.cs index cd32c1b23..49fc76ff6 100644 --- a/src/DynamicData.Tests/List/BufferInitialFixture.cs +++ b/src/DynamicData.Tests/List/BufferInitialFixture.cs @@ -6,8 +6,6 @@ using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/CreationFixtures.cs b/src/DynamicData.Tests/List/CreationFixtures.cs index ae7ca0d0b..e2abea91c 100644 --- a/src/DynamicData.Tests/List/CreationFixtures.cs +++ b/src/DynamicData.Tests/List/CreationFixtures.cs @@ -1,5 +1,4 @@ -using System; -using System.Reactive.Linq; +using System; using System.Threading.Tasks; using FluentAssertions; diff --git a/src/DynamicData.Tests/List/DisposeManyFixture.cs b/src/DynamicData.Tests/List/DisposeManyFixture.cs index 2d06a1122..eaeeb7719 100644 --- a/src/DynamicData.Tests/List/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/List/DisposeManyFixture.cs @@ -1,8 +1,5 @@ using System; using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; diff --git a/src/DynamicData.Tests/List/ExpireAfterFixture.cs b/src/DynamicData.Tests/List/ExpireAfterFixture.cs index 9ad68eb16..cafe64a5a 100644 --- a/src/DynamicData.Tests/List/ExpireAfterFixture.cs +++ b/src/DynamicData.Tests/List/ExpireAfterFixture.cs @@ -2,12 +2,8 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using System.Threading.Tasks; -using Microsoft.Reactive.Testing; - using Bogus; using FluentAssertions; using Xunit; @@ -195,7 +191,6 @@ public void PollingIntervalIsGiven_RemovalsAreScheduledAtInterval() // Not testing Refresh changes, since ISourceList doesn't actually provide an API to generate them. - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); @@ -331,7 +326,6 @@ public void PollingIntervalIsNotGiven_RemovalsAreScheduledImmediately() source.Move(2, 3); scheduler.AdvanceBy(1); - // Verify initial state, after all emissions results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); @@ -415,7 +409,6 @@ public void SchedulerIsInaccurate_RemovalsAreNotSkipped() var item1 = new TestItem() { Id = 1, Expiration = DateTimeOffset.FromUnixTimeMilliseconds(10) }; source.Add(item1); - results.Error.Should().BeNull(); results.RecordedValues.Should().BeEmpty("no expirations should have occurred"); source.Items.Should().BeEquivalentTo(new[] { item1 }, "1 item was added"); @@ -554,7 +547,7 @@ public async Task ThreadPoolSchedulerIsUsedWithoutPolling_ExpirationIsThreadSafe { using var source = new TestSourceList(); - var scheduler = ThreadPoolScheduler.Instance; + var scheduler = ThreadPoolSequencer.Instance; using var subscription = source .ExpireAfter( @@ -586,7 +579,7 @@ public async Task ThreadPoolSchedulerIsUsedWithPolling_ExpirationIsThreadSafe() { using var source = new TestSourceList(); - var scheduler = ThreadPoolScheduler.Instance; + var scheduler = ThreadPoolSequencer.Instance; using var subscription = source .ExpireAfter( diff --git a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs index 781165835..3d84a2d1a 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs index fb3b6e855..8ee3ae5b6 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/List/FilterFixture.Base.cs b/src/DynamicData.Tests/List/FilterFixture.Base.cs index 3282e1fe8..c30d9978d 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Base.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using FluentAssertions; @@ -30,7 +30,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade(EmptyChangesetPolicy emptyC new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -47,7 +46,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade(EmptyChangesetPolicy emptyC config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.RemoveMany(source.Items.Where(static item => !item.IsIncluded).ToArray()); @@ -74,7 +72,6 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang // Setup using var source = new TestSourceList(); - // UUT Intialization using var subscription = BuildUut( source: source.Connect(), @@ -89,7 +86,6 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang results.RecordedItems.Should().BeEmpty("no items have been added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.AddRange(new[] { @@ -127,7 +123,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate(EmptyChangesetPolicy emptyC new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -144,7 +139,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate(EmptyChangesetPolicy emptyC config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Moves for matching items, source.Edit(items => { @@ -159,7 +153,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate(EmptyChangesetPolicy emptyC config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Moves for excluded items source.Edit(items => { @@ -200,7 +193,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -215,7 +207,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy results.RecordedItems.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add items) foreach (var item in source.Items) item.IsIncluded = true; @@ -228,7 +219,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed(EmptyChangesetPolicy results.RecordedItems.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove items) foreach (var item in source.Items.Take(3)) item.IsIncluded = false; @@ -260,7 +250,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered(EmptyChangesetPolicy emptyChange new Item() { Id = 6, IsIncluded = false } }); - // UUT Intialization using var subscription = BuildUut( source: source.Connect(), @@ -277,7 +266,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered(EmptyChangesetPolicy emptyChange config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add and replace items) source.Edit(items => { @@ -296,7 +284,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered(EmptyChangesetPolicy emptyChange config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove and replace items) source.Edit(items => { @@ -334,7 +321,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate(EmptyChangesetPolicy empty new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = BuildUut( source: source.Connect(), @@ -351,7 +337,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate(EmptyChangesetPolicy empty config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.RemoveMany(source.Items.Where(Item.FilterByIsIncluded).ToArray()); diff --git a/src/DynamicData.Tests/List/FilterFixture.Static.cs b/src/DynamicData.Tests/List/FilterFixture.Static.cs index 927deae5d..ba1d65def 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Static.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; using Xunit; @@ -30,7 +28,6 @@ public void DuplicateItemsAreAdded_ItemsAreTrackedSeparately() 2 }); - // UUT Initialization using var subscription = source.Connect() .Filter(static item => (item % 2) is 0) @@ -45,7 +42,6 @@ public void DuplicateItemsAreAdded_ItemsAreTrackedSeparately() config: options => options.WithoutStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(2); @@ -56,7 +52,6 @@ public void DuplicateItemsAreAdded_ItemsAreTrackedSeparately() config: options => options.WithoutStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(3); @@ -64,7 +59,6 @@ public void DuplicateItemsAreAdded_ItemsAreTrackedSeparately() results.RecordedChangeSets.Skip(2).Should().BeEmpty("an operation was performed upon an excluded item"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Remove(2); @@ -82,7 +76,6 @@ public void ExcludedItemIsAdded_NoChangesAreMade() // Setup using var source = new TestSourceList(); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -95,7 +88,6 @@ public void ExcludedItemIsAdded_NoChangesAreMade() results.RecordedItems.Should().BeEmpty("no items have been added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Add(new Item() { Id = 1, IsIncluded = false }); @@ -120,7 +112,6 @@ public void ExcludedItemIsRemoved_NoChangesAreMade() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -135,7 +126,6 @@ public void ExcludedItemIsRemoved_NoChangesAreMade() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.RemoveAt(5); @@ -160,7 +150,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -175,7 +164,6 @@ public void ExcludedItemsAreRemoved_NoChangesAreMade() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.RemoveMany(source.Items.Where(static item => !item.IsIncluded).ToArray()); @@ -190,7 +178,6 @@ public void ItemsAreAdded_MatchingItemsPropagate() // Setup using var source = new TestSourceList(); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -203,7 +190,6 @@ public void ItemsAreAdded_MatchingItemsPropagate() results.RecordedItems.Should().BeEmpty("no items have been added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.AddRange(new[] { @@ -239,7 +225,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -254,7 +239,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Moves for matching items, source.Edit(items => { @@ -269,7 +253,6 @@ public void ItemsAreMoved_MatchingMovementsPropagate() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Moves for excluded items source.Edit(items => { @@ -298,7 +281,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -311,7 +293,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed() results.RecordedItems.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all matching items should have propagated"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add items) foreach (var item in source.Items) item.IsIncluded = true; @@ -324,7 +305,6 @@ public void ItemsAreRefreshed_ItemsAreReFilteredOrRefreshed() results.RecordedItems.Should().BeEquivalentTo(source.Items.Where(Item.FilterByIsIncluded), "all newly-matching items should have been added"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove items) foreach (var item in source.Items.Take(3)) item.IsIncluded = false; @@ -354,7 +334,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -369,7 +348,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (add and replace items) source.Edit(items => { @@ -388,7 +366,6 @@ public void ItemsAreReplaced_ItemsAreReFiltered() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action (remove and replace items) source.Edit(items => { @@ -414,7 +391,6 @@ public void MatchingItemIsAdded_ItemPropagates() // Setup using var source = new TestSourceList(); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -427,7 +403,6 @@ public void MatchingItemIsAdded_ItemPropagates() results.RecordedItems.Should().BeEmpty("no items have been added to the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.Add(new Item() { Id = 1, IsIncluded = true }); @@ -453,7 +428,6 @@ public void MatchingItemIsRemoved_RemovalPropagates() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -468,7 +442,6 @@ public void MatchingItemIsRemoved_RemovalPropagates() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var removedItem = source.Items[2]; source.RemoveAt(2); @@ -497,7 +470,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate() new Item() { Id = 6, IsIncluded = false } }); - // UUT Initialization using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -512,7 +484,6 @@ public void MatchingItemsAreRemoved_RemovalsPropagate() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action source.RemoveMany(source.Items.Where(Item.FilterByIsIncluded).ToArray()); @@ -546,7 +517,6 @@ public void SourceCompletes_CompletionPropagates(SourceType sourceType) if (sourceType is SourceType.Immediate) source.Complete(); - // UUT Initialization & Action using var subscription = source.Connect() .Filter(Item.FilterByIsIncluded) @@ -615,7 +585,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() // Setup using var source = new Subject>(); - // UUT Initialization using var subscription = source .Filter(Item.FilterByIsIncluded) @@ -628,7 +597,6 @@ public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() results.RecordedItems.Should().BeEmpty("the source has not initialized"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action subscription.Dispose(); diff --git a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs index d3f28efd3..60b66f1d3 100644 --- a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs +++ b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading; using System.Threading.Tasks; @@ -42,13 +40,11 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter .ValidateChangeSets() .RecordListItems(out var results); - // Set initial state predicateState.OnNext(new()); results.RecordedChangeSets.Should().BeEmpty("no source operations have been performed"); - // Test Add, with an included item var item1 = new Item() { Id = 1, IsIncluded = true }; source.Add(item1); @@ -56,14 +52,12 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Count.Should().Be(1, "one source operation was performed, with one included item added"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Add, with an excluded item var item2 = new Item() { Id = 2, IsIncluded = false }; source.Add(item2); results.RecordedChangeSets.Skip(1).Should().BeEmpty("one source operation was performed, but no included items were affected"); - // Test AddRange, with both included and excluded items var item3 = new Item() { Id = 3, IsIncluded = false }; var item4 = new Item() { Id = 4, IsIncluded = true }; @@ -76,7 +70,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "one source operation was performed, with 3 included items added"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Refresh, with no item mutations. source.Refresh(Enumerable.Range(0, source.Count)); @@ -85,7 +78,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Skip(2).First().Select(static change => change.Item.Current).Should().BeEquivalentTo(EnumerateFilteredItems(), "all included items should have been refreshed"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Refresh, with item mutations affecting filtering. item1.IsIncluded = !item1.IsIncluded; item3.IsIncluded = !item3.IsIncluded; @@ -96,27 +88,23 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Skip(3).Count().Should().Be(1, "one source operation was performed, with items being included and excluded"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Remove, with an included item source.RemoveAt(3); results.RecordedChangeSets.Skip(4).Count().Should().Be(1, "one source operation was performed, with one included item affected"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Remove, with an excluded item source.RemoveAt(3); results.RecordedChangeSets.Skip(5).Should().BeEmpty("one source operation was performed, but no included items were affected"); - // Test Remove, with both included and excluded items source.RemoveRange(index: 2, count: 2); results.RecordedChangeSets.Skip(5).Count().Should().Be(1, "one source operation was performed, with one included item affected"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Replace, not affecting filtering var item9 = new Item() { Id = 9, IsIncluded = false }; var item10 = new Item() { Id = 10, IsIncluded = true }; @@ -129,7 +117,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Skip(6).Count().Should().Be(1, "one source operation was performed, with one included item affected"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Replace, affecting filtering var item11 = new Item() { Id = 11, IsIncluded = true }; var item12 = new Item() { Id = 12, IsIncluded = false }; @@ -142,7 +129,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter results.RecordedChangeSets.Skip(7).Count().Should().Be(1, "one source operation was performed, with one included item affected"); ShouldBeValid(results, EnumerateFilteredItems()); - // Test Move of an included item, relative to another included item var item13 = new Item() { Id = 13, IsIncluded = true }; source.Add(item13); @@ -160,7 +146,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter } ShouldBeValid(results, EnumerateFilteredItems()); - // Test Move of an excluded item source.Move(4, 2); @@ -175,7 +160,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter break; } - // Test Clear, with included items source.Clear(); @@ -191,7 +175,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter } ShouldBeValid(results, EnumerateFilteredItems()); - // Test Clear, with only excluded items source.Add(new Item() { Id = 14, IsIncluded = false }); source.Clear(); @@ -208,7 +191,6 @@ public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilter } ShouldBeValid(results, EnumerateFilteredItems()); - IEnumerable EnumerateFilteredItems() => source.Items.Where(static item => item.IsIncluded); } @@ -231,14 +213,12 @@ public void ChangesAreMadeAfterMultiplePredicateStateChanges_ItemsAreFilteredWit .ValidateChangeSets() .RecordListItems(out var results); - // Publish multiple state changes predicateState.OnNext(2); predicateState.OnNext(3); results.RecordedChangeSets.Should().BeEmpty("no source operations have been performed"); - // Test filtering of items, by state source.AddRange(new[] { @@ -270,10 +250,8 @@ public void ChangesAreMadeBeforeInitialPredicateState_ItemsAreFilteredOnPredicat .ValidateChangeSets() .RecordListItems(out var results); - results.RecordedChangeSets.Should().BeEmpty("no source operations have been performed"); - // Test Add, with an included item var item1 = new Item() { Id = 1, IsIncluded = true }; source.Add(item1); @@ -338,7 +316,6 @@ public void ChangesAreMadeBeforeInitialPredicateState_ItemsAreFilteredOnPredicat results.RecordedChangeSets.Should().BeEmpty("the predicate state has not initialized"); - // Set initial state predicateState.OnNext(new()); @@ -362,7 +339,6 @@ public void FilterPolicyIsClearAndReplace_ReFilteringPreservesOrder() .ValidateChangeSets() .RecordListItems(out var results); - // Test filtering of items, by state source.AddRange(new[] { @@ -416,7 +392,6 @@ public void PredicateStateChanges_ItemsAreReFiltered(ListFilterPolicy filterPoli .ValidateChangeSets() .RecordListItems(out var results); - // Test filtering of items, by state source.AddRange(new[] { @@ -429,14 +404,12 @@ public void PredicateStateChanges_ItemsAreReFiltered(ListFilterPolicy filterPoli results.RecordedChangeSets.Count.Should().Be(1, "one source operation was performed"); ShouldBeValid(results, EnumerateFilteredItems()); - // Publish a state change, to change the filtering predicateState.OnNext(2); results.RecordedChangeSets.Skip(1).Count().Should().Be(1, "one source operation was performed"); ShouldBeValid(results, EnumerateFilteredItems()); - IEnumerable EnumerateFilteredItems() => source.Items.Where(item => item.Id == predicateState.Value); } @@ -505,7 +478,6 @@ public void PredicateStateErrors_ErrorIsPropagated(ListFilterPolicy filterPolicy .ValidateChangeSets() .RecordListItems(out var results); - var error = new Exception("This is a test."); predicateState.OnError(error); @@ -566,7 +538,6 @@ public async Task SourceAndPredicateStateNotifyFromDifferentThreads_FilteringIsT valueCount: 5_000, randomizer: randomizer); - using var source = new Subject>(); using var predicateState = new Subject(); @@ -711,7 +682,6 @@ public void SourceErrors_ErrorIsPropagated(ListFilterPolicy filterPolicy) .ValidateChangeSets() .RecordListItems(out var results); - var error = new Exception("This is a test."); source.OnError(error); @@ -773,7 +743,6 @@ public void SubscriptionIsDisposed_UnsubscriptionIsPropagated(ListFilterPolicy f .ValidateChangeSets() .RecordListItems(out var results); - subscription.Dispose(); source.HasObservers.Should().BeFalse("subscription disposal should be propagated to all input streams"); @@ -800,7 +769,6 @@ public void SuppressEmptyChangeSetsIsFalse_EmptyChangesetsArePropagatedAndOnlyFi .ValidateChangeSets() .RecordListItems(out var results); - // Initialize the predicate predicateState.OnNext(new object()); @@ -808,7 +776,6 @@ public void SuppressEmptyChangeSetsIsFalse_EmptyChangesetsArePropagatedAndOnlyFi results.RecordedChangeSets[0].Should().BeEmpty("there are no items in the collection"); ShouldBeValid(results, Enumerable.Empty()); - // Publish an empty changeset source.OnNext(ChangeSet.Empty); @@ -816,7 +783,6 @@ public void SuppressEmptyChangeSetsIsFalse_EmptyChangesetsArePropagatedAndOnlyFi results.RecordedChangeSets.Skip(1).First().Should().BeEmpty("the source changeset was empty"); ShouldBeValid(results, Enumerable.Empty()); - // Publish a changeset with only excluded items source.OnNext(new ChangeSet() { diff --git a/src/DynamicData.Tests/List/FilterOnObservableFixture.cs b/src/DynamicData.Tests/List/FilterOnObservableFixture.cs index 8cb3e152b..017613a52 100644 --- a/src/DynamicData.Tests/List/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/List/FilterOnObservableFixture.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Reactive.Linq; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/List/FilterWithObservable.cs b/src/DynamicData.Tests/List/FilterWithObservable.cs index 9a71359c5..adab80d75 100644 --- a/src/DynamicData.Tests/List/FilterWithObservable.cs +++ b/src/DynamicData.Tests/List/FilterWithObservable.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Aggregation; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/List/FromAsyncFixture.cs b/src/DynamicData.Tests/List/FromAsyncFixture.cs index 2f1913c48..44cf625c7 100644 --- a/src/DynamicData.Tests/List/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/List/FromAsyncFixture.cs @@ -1,15 +1,12 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using System.Threading.Tasks; using DynamicData.Tests.Domain; using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/GroupImmutableFixture.cs b/src/DynamicData.Tests/List/GroupImmutableFixture.cs index cbf674654..9b59595b1 100644 --- a/src/DynamicData.Tests/List/GroupImmutableFixture.cs +++ b/src/DynamicData.Tests/List/GroupImmutableFixture.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; using DynamicData.Kernel; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs index 253a70070..feae87d1a 100644 --- a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs @@ -1,16 +1,12 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; using DynamicData.Tests.Utilities; using FluentAssertions; -using Microsoft.Reactive.Testing; using Xunit; using System.Collections.Concurrent; @@ -84,7 +80,7 @@ IObservable AddRemoveAnimals(AnimalOwner owner, int animalCount, int par var addedOwners = new ConcurrentBag(); var addingAnimals = true; - var observableObservable = CreateStressObservable(ownerCount, animalCount, Environment.ProcessorCount, addedOwners, TaskPoolScheduler.Default) + var observableObservable = CreateStressObservable(ownerCount, animalCount, Environment.ProcessorCount, addedOwners, TaskPoolSequencer.Default) .Finally(() => addingAnimals = false) .Publish() .RefCount(); @@ -273,7 +269,6 @@ public async Task ResultContainsChildrenAddedWithInsertEnum() CheckResultContents(_animalOwners, results); } - [Fact] public async Task ResultContainsCorrectItemsAfterChildReplacementObs() { diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs index bdac643d9..b0a4aed14 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs @@ -1,10 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive; -using System.Reactive.Linq; using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; @@ -48,7 +44,6 @@ public MergeManyChangeSetsCacheFixture() _marketListResults = _marketList.Connect().AsAggregator(); } - [Theory] [InlineData(5, 7)] [InlineData(10, 50)] @@ -96,7 +91,7 @@ IObservable AddRemovePrices(Market market, int priceCount, int para var adding = true; // Start asynchrononously modifying the parent list and the child lists - using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolScheduler.Default) + using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolSequencer.Default) .Finally(() => adding = false) .Subscribe(); diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs index ea8019ea4..cb3ccdec1 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs @@ -44,12 +44,10 @@ public void MergeManyShouldWork() a.ReplaceAt(0,100); new[] { 2, 100 }.Should().BeEquivalentTo(d.Items); - var f = new SourceList(); f.AddRange(Enumerable.Range(10,5)); parent.ReplaceAt(2,f); - new[] { 2, 100, 10,11,12,13,14 }.Should().BeEquivalentTo(d.Items); } } diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs index 41cec34e1..1bb32d47b 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs @@ -1,10 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; @@ -91,7 +87,7 @@ IObservable AddRemoveAnimals(AnimalOwner owner, int animalCount, int par var addingAnimals = true; // Start asynchrononously modifying the parent list and the child lists - using var addAnimals = AddRemoveAnimalsStress(ownerCount, animalCount, Environment.ProcessorCount, TaskPoolScheduler.Default) + using var addAnimals = AddRemoveAnimalsStress(ownerCount, animalCount, Environment.ProcessorCount, TaskPoolSequencer.Default) .Finally(() => addingAnimals = false) .Subscribe(); diff --git a/src/DynamicData.Tests/List/MergeManyFixture.cs b/src/DynamicData.Tests/List/MergeManyFixture.cs index 997e91f9f..33185e9f3 100644 --- a/src/DynamicData.Tests/List/MergeManyFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyFixture.cs @@ -1,6 +1,4 @@ using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; diff --git a/src/DynamicData.Tests/List/OnItemAddedFixture.cs b/src/DynamicData.Tests/List/OnItemAddedFixture.cs index 3585426cb..81bfdebbb 100644 --- a/src/DynamicData.Tests/List/OnItemAddedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemAddedFixture.cs @@ -56,7 +56,6 @@ public void ItemIsAdded_AddActionIsInvoked( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.Insert( index: insertionIndex, @@ -112,7 +111,6 @@ public void ItemIsMoved_AddActionIsNotInvoked( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.Move( original: originalIndex, @@ -165,7 +163,6 @@ public void ItemIsRefreshed_AddActionIsNotInvoked( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.Refresh(refreshIndex); @@ -217,7 +214,6 @@ public void ItemIsRemoved_AddActionIsNotInvoked( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.RemoveAt(removalIndex); @@ -268,7 +264,6 @@ public void ItemIsReplaced_AddActionIsInvokedForNewItem( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.ReplaceAt( index: replacementIndex, @@ -323,7 +318,6 @@ public void ItemRangeIsRemoved_AddActionIsNotInvoked( because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.RemoveRange( index: removalIndex, @@ -372,7 +366,6 @@ public void ItemsAreCleared_AddActionIsNotInvoked(int initialItemCount) because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.Clear(); @@ -422,7 +415,6 @@ public void SourceCompletesAsynchronously_CompletionPropagates() because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action source.Complete(); @@ -504,7 +496,6 @@ public void SourceFailsAsynchronously_CompletionPropagates() because: "the collection contained initial items"); addActionInvocations.Clear(); - // UUT Action var error = new Exception(); source.SetError(error); diff --git a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs index c044d8e89..df1e2a2da 100644 --- a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs @@ -49,7 +49,6 @@ public void ItemIsAdded_RefreshActionIsNotInvoked( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action source.Insert( index: insertionIndex, @@ -101,7 +100,6 @@ public void ItemIsMoved_RefreshActionIsNotInvoked( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action source.Move( original: originalIndex, @@ -150,7 +148,6 @@ public void ItemIsRefreshed_RefreshActionIsNotInvoked( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action var refreshedItem = source.Items[refreshIndex]; source.Refresh(refreshIndex); @@ -199,7 +196,6 @@ public void ItemIsRemoved_RefreshActionIsInvoked( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action var removedItem = source.Items[removalIndex]; source.RemoveAt(removalIndex); @@ -247,7 +243,6 @@ public void ItemIsReplaced_RefreshActionIsInvokedForOldItem( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action source.ReplaceAt( index: replacementIndex, @@ -298,7 +293,6 @@ public void ItemRangeIsRemoved_RefreshActionIsInvokedForEachItem( refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action source.RemoveRange( index: removalIndex, @@ -343,7 +337,6 @@ public void ItemsAreCleared_RefreshActionIsInvokedForEachItem(int initialItemCou refreshActionInvocations.Should().BeEmpty("no items were refreshed within the collection"); - // UUT Action source.Clear(); @@ -389,7 +382,6 @@ public void SourceCompletesAsynchronously_CompletionPropagates() refreshActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action source.Complete(); @@ -463,7 +455,6 @@ public void SourceFailsAsynchronously_CompletionPropagates() refreshActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var error = new Exception(); source.SetError(error); diff --git a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs index 6b91fc11d..db904b030 100644 --- a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; using FluentAssertions; using Xunit; @@ -74,7 +72,6 @@ public void InvokeOnUnsubscribeIsRequested_RemoveActionIsInvokedForEachRemaining removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Setup: Remove some items, to ensure correct tracking of remaining items. var removedItems = source.Items .Skip(removalIndex) @@ -142,7 +139,6 @@ public void InvokeOnUnsubscribeIsNotRequested_RemoveActionIsNotInvokedOnCompleti removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Setup: Remove some items, to ensure correct tracking of remaining items. var removedItems = source.Items .Skip(removalIndex) @@ -206,7 +202,6 @@ public void ItemIsAdded_RemoveActionIsNotInvoked( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action source.Insert( index: insertionIndex, @@ -252,7 +247,6 @@ public void ItemIsMoved_RemoveActionIsNotInvoked( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action source.Move( original: originalIndex, @@ -296,7 +290,6 @@ public void ItemIsRemoved_RemoveActionIsInvoked( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var removedItem = source.Items[removalIndex]; source.RemoveAt(removalIndex); @@ -339,7 +332,6 @@ public void ItemIsRefreshed_RemoveActionIsNotInvoked( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action source.Refresh(refreshIndex); @@ -380,7 +372,6 @@ public void ItemIsReplaced_RemoveActionIsInvokedForOldItem( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var replacedItem = source.Items[replacementIndex]; source.ReplaceAt( @@ -429,7 +420,6 @@ public void ItemRangeIsRemoved_RemoveActionIsInvokedForEachItem( removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var removedItems = source.Items .Skip(removalIndex) @@ -473,7 +463,6 @@ public void ItemsAreCleared_RemoveActionIsInvokedForEachItem(int initialItemCoun removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var clearedItems = source.Items .ToArray(); @@ -520,7 +509,6 @@ public void SourceCompletesAsynchronously_CompletionPropagates(bool invokeOnUnsu removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action source.Complete(); @@ -602,7 +590,6 @@ public void SourceFailsAsynchronously_CompletionPropagates(bool invokeOnUnsubscr removeActionInvocations.Should().BeEmpty("no items have been removed from the collection"); - // UUT Action var error = new Exception(); source.SetError(error); diff --git a/src/DynamicData.Tests/List/PageFixture.cs b/src/DynamicData.Tests/List/PageFixture.cs index 5091b06b7..e9fb2942f 100644 --- a/src/DynamicData.Tests/List/PageFixture.cs +++ b/src/DynamicData.Tests/List/PageFixture.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Tests.Domain; @@ -168,7 +166,6 @@ public void SimplePaging() sut.Paged.Count.Should().Be(3); } - [Fact] public void DoesNotThrowWithDuplicates() { diff --git a/src/DynamicData.Tests/List/RefCountFixture.cs b/src/DynamicData.Tests/List/RefCountFixture.cs index c0d86e06d..5d8eb9880 100644 --- a/src/DynamicData.Tests/List/RefCountFixture.cs +++ b/src/DynamicData.Tests/List/RefCountFixture.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Reactive.Linq; using System.Threading.Tasks; using DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/List/SizeLimitFixture.cs b/src/DynamicData.Tests/List/SizeLimitFixture.cs index f07825d14..265fe125e 100644 --- a/src/DynamicData.Tests/List/SizeLimitFixture.cs +++ b/src/DynamicData.Tests/List/SizeLimitFixture.cs @@ -5,8 +5,6 @@ using FluentAssertions; -using Microsoft.Reactive.Testing; - using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/SortFixture.cs b/src/DynamicData.Tests/List/SortFixture.cs index 7f2a7dea3..fcf3a2aeb 100644 --- a/src/DynamicData.Tests/List/SortFixture.cs +++ b/src/DynamicData.Tests/List/SortFixture.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Tests.Domain; @@ -15,7 +14,6 @@ public class SortChangedFixture { private static readonly IComparer DefaultComparer = SortExpressionComparer.Ascending(x => x.Number); - /// /// See https://github.com/reactivemarbles/DynamicData/issues/473 /// @@ -36,11 +34,9 @@ public void SortsWithoutError() sorter.OnNext(SortExpressionComparer.Descending(x => x.Number)); - bound.Select(x => x.Number).Should().BeInDescendingOrder(); } - private class ListItem(int number) : IComparable { public int Number { get; } = number; diff --git a/src/DynamicData.Tests/List/SortMutableFixture.cs b/src/DynamicData.Tests/List/SortMutableFixture.cs index 63eab9e03..73be51e2c 100644 --- a/src/DynamicData.Tests/List/SortMutableFixture.cs +++ b/src/DynamicData.Tests/List/SortMutableFixture.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; using DynamicData.Binding; using DynamicData.Kernel; diff --git a/src/DynamicData.Tests/List/SourceListFixture.cs b/src/DynamicData.Tests/List/SourceListFixture.cs index dc37bdaed..966cfb748 100644 --- a/src/DynamicData.Tests/List/SourceListFixture.cs +++ b/src/DynamicData.Tests/List/SourceListFixture.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using FluentAssertions; @@ -17,7 +17,6 @@ public void InitialChangeIsRange() source.Connect().Subscribe(changeSets.Add).Dispose(); - changeSets[0].First().Type.Should().Be(ChangeType.Range); changeSets[0].First().Range.Index.Should().Be(0); } diff --git a/src/DynamicData.Tests/List/SubscribeManyFixture.cs b/src/DynamicData.Tests/List/SubscribeManyFixture.cs index 8f8995a2e..744319e81 100644 --- a/src/DynamicData.Tests/List/SubscribeManyFixture.cs +++ b/src/DynamicData.Tests/List/SubscribeManyFixture.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Reactive.Disposables; using FluentAssertions; diff --git a/src/DynamicData.Tests/List/SwitchFixture.cs b/src/DynamicData.Tests/List/SwitchFixture.cs index abcdaa8d3..5656e046a 100644 --- a/src/DynamicData.Tests/List/SwitchFixture.cs +++ b/src/DynamicData.Tests/List/SwitchFixture.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Subjects; using FluentAssertions; diff --git a/src/DynamicData.Tests/List/ToCollectionFixture.cs b/src/DynamicData.Tests/List/ToCollectionFixture.cs index a46aa790f..a2be60af8 100644 --- a/src/DynamicData.Tests/List/ToCollectionFixture.cs +++ b/src/DynamicData.Tests/List/ToCollectionFixture.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Reactive.Linq; using FluentAssertions; using Xunit; diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 0a60bc356..57a3d3ddf 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using System.Threading.Tasks; using FluentAssertions; @@ -27,10 +25,10 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { IScheduler scheduler = schedulerType switch { - SchedulerType.Default => DefaultScheduler.Instance, + SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), - SchedulerType.TaskPool => TaskPoolScheduler.Default, - SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, + SchedulerType.TaskPool => TaskPoolSequencer.Default, + SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, _ => throw new ArgumentOutOfRangeException(nameof(SchedulerType)) }; diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs index 887a230d4..bb2baeddb 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -1,9 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; using FluentAssertions; using Xunit; @@ -26,7 +22,6 @@ public void ExpireAfterThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet(expireAfter: static item => (item.Error is not null) @@ -41,7 +36,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedItems.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(item1); @@ -59,7 +53,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() // Setup using var source = new Subject(); - // UUT Initialization using var subscription = source .ToObservableChangeSet(limitSizeTo: 5) @@ -72,7 +65,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItems.Should().BeEmpty("no items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Not enough items to reach the limit var item1 = new Item() { Id = 1 }; source.OnNext(item1); @@ -93,7 +85,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Limit is reached var item5 = new Item() { Id = 5 }; source.OnNext(item5); @@ -105,7 +96,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: New item exceeds the limit var item6 = new Item() { Id = 6 }; source.OnNext(item6); @@ -135,7 +125,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -161,7 +150,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("1 item has yet to expire"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(10).Ticks); @@ -191,7 +179,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -226,7 +213,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -241,7 +227,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItems.Should().BeEmpty("no items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(3) }; source.OnNext(item1); @@ -254,7 +239,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item2 = new Item() { Id = 2 }; source.OnNext(item2); @@ -267,7 +251,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item3 = new Item() { Id = 3, Lifetime = TimeSpan.FromSeconds(1) }; source.OnNext(item3); @@ -280,7 +263,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -291,7 +273,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -302,7 +283,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -313,7 +293,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -340,7 +319,6 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet() diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 505404290..314d02584 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using System.Threading.Tasks; using FluentAssertions; @@ -27,10 +25,10 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { IScheduler scheduler = schedulerType switch { - SchedulerType.Default => DefaultScheduler.Instance, + SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), - SchedulerType.TaskPool => TaskPoolScheduler.Default, - SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, + SchedulerType.TaskPool => TaskPoolSequencer.Default, + SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, _ => throw new ArgumentOutOfRangeException(nameof(schedulerType)) }; diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs index 55b1fdaae..4c5a06081 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -1,10 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; using FluentAssertions; using Xunit; @@ -27,7 +23,6 @@ public void ExpireAfterThrows_ErrorPropagates() var error = new Exception("Test Exception"); - // UUT Initialization using var subscription = source .ToObservableChangeSet(expireAfter: static item => (item.Error is not null) @@ -42,7 +37,6 @@ public void ExpireAfterThrows_ErrorPropagates() results.RecordedItems.Should().BeEmpty("no items have been emitted by the source"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1 }; source.OnNext(new[] @@ -63,7 +57,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() // Setup using var source = new Subject>(); - // UUT Initialization using var subscription = source .ToObservableChangeSet(limitSizeTo: 5) @@ -76,7 +69,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() results.RecordedItems.Should().BeEmpty("no source items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Not enough items to reach the limit var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; @@ -97,7 +89,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: Limit is reached var item5 = new Item() { Id = 5 }; source.OnNext(new[] { item5 }); @@ -109,7 +100,6 @@ public void SizeLimitIsExceeded_OldestItemsAreRemoved() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action: New item exceeds the limit var item6 = new Item() { Id = 6 }; source.OnNext(new[] { item6 }); @@ -144,7 +134,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -170,7 +159,6 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("2 items have yet to expire"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(30).Ticks); @@ -207,7 +195,6 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var scheduler = new TestScheduler(); - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet( @@ -242,7 +229,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() var scheduler = new TestScheduler(); - // UUT Initialization using var subscription = source .ToObservableChangeSet( @@ -257,7 +243,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() results.RecordedItems.Should().BeEmpty("no source items have been emitted"); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action var item1 = new Item() { Id = 1, Lifetime = TimeSpan.FromSeconds(3) }; var item2 = new Item() { Id = 2 }; @@ -272,7 +257,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(1).Ticks); @@ -283,7 +267,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(2).Ticks); @@ -294,7 +277,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(3).Ticks); @@ -305,7 +287,6 @@ public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() config: options => options.WithStrictOrdering()); results.HasCompleted.Should().BeFalse("the source has not completed"); - // UUT Action scheduler.AdvanceTo(TimeSpan.FromSeconds(4).Ticks); @@ -332,7 +313,6 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; - // UUT Initialization & Action using var subscription = source .ToObservableChangeSet() diff --git a/src/DynamicData.Tests/List/TransformFixture.cs b/src/DynamicData.Tests/List/TransformFixture.cs index 0841ae4f4..c605bcd46 100644 --- a/src/DynamicData.Tests/List/TransformFixture.cs +++ b/src/DynamicData.Tests/List/TransformFixture.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using DynamicData.Tests.Domain; @@ -131,7 +131,6 @@ public void Update() _results.Messages[0].Replaced.Should().Be(0, "Should be 1 update"); } - [Fact] public void MultipleSubscribersShouldNotShareState() { diff --git a/src/DynamicData.Tests/List/VirtualisationFixture.cs b/src/DynamicData.Tests/List/VirtualisationFixture.cs index 66f681bff..9395ed1df 100644 --- a/src/DynamicData.Tests/List/VirtualisationFixture.cs +++ b/src/DynamicData.Tests/List/VirtualisationFixture.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Subjects; using DynamicData.Tests.Domain; @@ -130,7 +129,6 @@ public void VirtualiseInitial() _results.Data.Items.Should().BeEquivalentTo(expected); } - [Fact] public void DoesNotThrowWithDuplicates() { diff --git a/src/DynamicData.Tests/ObservableCollectionExFixture.cs b/src/DynamicData.Tests/ObservableCollectionExFixture.cs index 0d93711a9..d72b6cef9 100644 --- a/src/DynamicData.Tests/ObservableCollectionExFixture.cs +++ b/src/DynamicData.Tests/ObservableCollectionExFixture.cs @@ -1,4 +1,4 @@ - + using System.Collections.ObjectModel; using DynamicData.Binding; using DynamicData.Tests.Domain; @@ -35,7 +35,6 @@ public void CanConvertToObservableChangeSetCache() one.Should().BeEquivalentTo(_person1); } - [Fact] public void ReplacingAnItemWithSameProducesUpdate() { diff --git a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs index 7f0eba1b9..b83efea61 100644 --- a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.Reactive.Concurrency; +using System.Collections.Generic; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/ComparerExtensions.cs b/src/DynamicData.Tests/Utilities/ComparerExtensions.cs index 76433346f..a88101be6 100644 --- a/src/DynamicData.Tests/Utilities/ComparerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ComparerExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -17,7 +17,6 @@ internal sealed class NoOpEqualityComparer : IEqualityComparer public int GetHashCode([DisallowNull] T obj) => throw new NotImplementedException(); } - internal sealed class InvertedComparer(IComparer original) : IComparer { private readonly IComparer _original = original; @@ -25,7 +24,6 @@ internal sealed class InvertedComparer(IComparer original) : IComparer public int Compare(T x, T y) => _original.Compare(x, y) * -1; } - internal static class ComparerExtensions { public static IComparer Invert(this IComparer comparer) => new InvertedComparer(comparer); diff --git a/src/DynamicData.Tests/Utilities/FakeScheduler.cs b/src/DynamicData.Tests/Utilities/FakeScheduler.cs index fc2b19bbf..27fcc9d35 100644 --- a/src/DynamicData.Tests/Utilities/FakeScheduler.cs +++ b/src/DynamicData.Tests/Utilities/FakeScheduler.cs @@ -1,7 +1,7 @@ -using System; +using System; using System.Collections.Generic; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; +using System.Diagnostics; +using ReactiveUI.Primitives.Concurrency; namespace DynamicData.Tests.Utilities; @@ -11,6 +11,7 @@ internal sealed class FakeScheduler private readonly List _scheduledActions; private DateTimeOffset _now; + private long? _originClockTicks; public FakeScheduler() => _scheduledActions = new(); @@ -24,6 +25,35 @@ public DateTimeOffset Now set => _now = value; } + public long Timestamp + { + get + { + _originClockTicks ??= _now.Ticks; + return ToTimestamp(_now.Ticks); + } + } + + public void Schedule(IWorkItem item) => + _scheduledActions.Add( + new ScheduledAction( + dueTime: null, + onInvoked: () => + { + item.Execute(); + return Disposable.Empty; + })); + + public void Schedule(IWorkItem item, long dueTimestamp) => + _scheduledActions.Add( + new ScheduledAction( + dueTime: new DateTimeOffset(ToClockTicks(dueTimestamp), TimeSpan.Zero), + onInvoked: () => + { + item.Execute(); + return Disposable.Empty; + })); + public IDisposable Schedule( TState state, Func action) @@ -91,6 +121,31 @@ private IDisposable ScheduleCore( return Disposable.Create(scheduledAction.Cancel); } + private long ToTimestamp(long ticks) + { + _originClockTicks ??= ticks; + var elapsedTicks = ticks - _originClockTicks.Value; + if (elapsedTicks <= 0) + { + return 0; + } + + var value = elapsedTicks / (double)TimeSpan.TicksPerSecond * Stopwatch.Frequency; + return value >= long.MaxValue ? long.MaxValue : (long)value; + } + + private long ToClockTicks(long timestamp) + { + var originClockTicks = _originClockTicks ?? 0; + if (timestamp <= 0) + { + return originClockTicks; + } + + var value = timestamp / (double)Stopwatch.Frequency * TimeSpan.TicksPerSecond; + return value >= long.MaxValue - originClockTicks ? long.MaxValue : originClockTicks + (long)value; + } + public sealed class ScheduledAction { private readonly Func _onInvoked; diff --git a/src/DynamicData.Tests/Utilities/FakerExtensions.cs b/src/DynamicData.Tests/Utilities/FakerExtensions.cs index 1388d3b80..69b182381 100644 --- a/src/DynamicData.Tests/Utilities/FakerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/FakerExtensions.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Concurrency; using Bogus; namespace DynamicData.Tests.Utilities; @@ -14,5 +12,5 @@ public static IObservable IntervalGenerate(this Faker faker, Randomizer public static IObservable IntervalGenerate(this Faker faker, TimeSpan period, IScheduler? scheduler = null) where T : class => - Observable.Interval(period, scheduler ?? DefaultScheduler.Instance).Select(_ => faker.Generate()); + Observable.Interval(period, scheduler ?? Sequencer.Default).Select(_ => faker.Generate()); } diff --git a/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs b/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs index 09eaa8819..1574dab88 100644 --- a/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.Reactive.Concurrency; +using System.Collections.Generic; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/ObservableEx.cs b/src/DynamicData.Tests/Utilities/ObservableEx.cs index df45f9f75..e4757bf34 100644 --- a/src/DynamicData.Tests/Utilities/ObservableEx.cs +++ b/src/DynamicData.Tests/Utilities/ObservableEx.cs @@ -1,6 +1,4 @@ -using System; -using System.Reactive.Concurrency; -using System.Reactive.Linq; +using System; namespace DynamicData.Tests.Utilities; @@ -33,6 +31,6 @@ IDisposable HandleNext(IScheduler _, long counter) return sch.Schedule(0, nextInterval(), HandleNext); } - return ScheduleFirst(scheduler ?? DefaultScheduler.Instance); + return ScheduleFirst(scheduler ?? Sequencer.Default); }); } diff --git a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs index acd336d0e..d30838837 100644 --- a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs @@ -1,9 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using System.Threading; diff --git a/src/DynamicData.Tests/Utilities/ObservableSpy.cs b/src/DynamicData.Tests/Utilities/ObservableSpy.cs index b4ae7bbc8..85fa90cf7 100644 --- a/src/DynamicData.Tests/Utilities/ObservableSpy.cs +++ b/src/DynamicData.Tests/Utilities/ObservableSpy.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.InteropServices; using System.Threading; using Xunit.Abstractions; diff --git a/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs b/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs index eb9f4a490..5108d9116 100644 --- a/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Diagnostics; -using System.Reactive.Concurrency; using Bogus; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs b/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs new file mode 100644 index 000000000..a233ceb0f --- /dev/null +++ b/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using ReactiveUI.Primitives.Concurrency; + +namespace DynamicData.Tests.Utilities; + +public enum NotificationKind +{ + OnNext, + OnError, + OnCompleted +} + +public sealed class Notification +{ + private Notification(NotificationKind kind, T? value = default, Exception? exception = null) + { + Kind = kind; + Value = value!; + Exception = exception; + } + + public NotificationKind Kind { get; } + + public T Value { get; } + + public Exception? Exception { get; } + + public static Notification CreateOnNext(T value) => new(NotificationKind.OnNext, value); + + public static Notification CreateOnError(Exception error) => new(NotificationKind.OnError, exception: error); + + public static Notification CreateOnCompleted() => new(NotificationKind.OnCompleted); +} + +public static class Notification +{ + public static Notification CreateOnNext(T value) => Notification.CreateOnNext(value); + + public static Notification CreateOnError(Exception error) => Notification.CreateOnError(error); + + public static Notification CreateOnCompleted() => Notification.CreateOnCompleted(); +} + +public readonly record struct Recorded +{ + public Recorded(long time, T value) + { + Time = time; + Value = value; + } + + public long Time { get; } + + public T Value { get; } +} + +public sealed class NewThreadScheduler : ISequencer +{ + public DateTimeOffset Now => ThreadPoolSequencer.Instance.Now; + + public long Timestamp => ThreadPoolSequencer.Instance.Timestamp; + + public void Schedule(IWorkItem item) => ThreadPoolSequencer.Instance.Schedule(item); + + public void Schedule(IWorkItem item, long dueTimestamp) => ThreadPoolSequencer.Instance.Schedule(item, dueTimestamp); +} + +public sealed class TestScheduler : ISequencer +{ + private readonly List _queue = []; + private long _clockTicks; + private long? _originClockTicks; + private long _timestamp; + private long _nextId; + + public DateTimeOffset Now => new(_clockTicks, TimeSpan.Zero); + + public long Timestamp + { + get + { + _originClockTicks ??= _clockTicks; + return _timestamp; + } + } + + public void Schedule(IWorkItem item) => Schedule(item, _timestamp); + + public void Schedule(IWorkItem item, long dueTimestamp) + { + _queue.Add(new ScheduledItem(dueTimestamp, _nextId++, item)); + _queue.Sort(static (left, right) => + { + var due = left.DueTimestamp.CompareTo(right.DueTimestamp); + return due != 0 ? due : left.Id.CompareTo(right.Id); + }); + } + + public void AdvanceBy(long ticks) + { + if (ticks < 0) + { + throw new ArgumentOutOfRangeException(nameof(ticks)); + } + + AdvanceTo(_clockTicks + ticks); + } + + public void AdvanceTo(long ticks) + { + if (ticks < _clockTicks) + { + return; + } + + _originClockTicks ??= _queue.Count == 0 ? ticks : _clockTicks; + var targetTimestamp = ToTimestamp(ticks); + while (_queue.Count != 0 && _queue[0].DueTimestamp <= targetTimestamp) + { + var next = _queue[0]; + _queue.RemoveAt(0); + _timestamp = next.DueTimestamp; + _clockTicks = ToClockTicks(_timestamp); + next.Item.Execute(); + } + + _clockTicks = ticks; + _timestamp = targetTimestamp; + } + + public void Start() + { + while (_queue.Count != 0) + { + var next = _queue[0]; + AdvanceTo(ToClockTicks(next.DueTimestamp)); + } + } + + private long ToTimestamp(long ticks) + { + _originClockTicks ??= ticks; + var elapsedTicks = ticks - _originClockTicks.Value; + if (elapsedTicks <= 0) + { + return 0; + } + + var value = elapsedTicks / (double)TimeSpan.TicksPerSecond * Stopwatch.Frequency; + return value >= long.MaxValue ? long.MaxValue : (long)value; + } + + private long ToClockTicks(long timestamp) + { + var originClockTicks = _originClockTicks ?? 0; + if (timestamp <= 0) + { + return originClockTicks; + } + + var value = timestamp / (double)Stopwatch.Frequency * TimeSpan.TicksPerSecond; + return value >= long.MaxValue - originClockTicks ? long.MaxValue : originClockTicks + (long)value; + } + + private sealed record ScheduledItem(long DueTimestamp, long Id, IWorkItem Item); +} diff --git a/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs b/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs index 4c7ce3a0e..167ce5fce 100644 --- a/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs +++ b/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs @@ -1,11 +1,7 @@ -using System; +using System; using System.Collections.Generic; -using System.Reactive.Concurrency; -using System.Reactive; using System.Threading.Tasks; -using Microsoft.Reactive.Testing; - namespace DynamicData.Tests.Utilities; // Using a custom implementing of IObserver<> to bypass normal RX safeguards, allowing invalid behaviors to be potentially tested for. diff --git a/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs b/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs index afe5f47d5..918f1eceb 100644 --- a/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs +++ b/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs @@ -1,7 +1,5 @@ -using System; +using System; using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; namespace DynamicData.Tests.Utilities; @@ -12,7 +10,7 @@ public static IObservable StressAddRemove(this IObservable item where T : notnull => items.Do(i => onAdd(i, state)) .SelectMany(item => getRemoveTimeout?.Invoke(item) is TimeSpan ts - ? Observable.Timer(ts, scheduler ?? DefaultScheduler.Instance) + ? Observable.Timer(ts, scheduler ?? Sequencer.Default) .Do(_ => onRemove(item, state)) .Select(_ => item) : Observable.Return(item)); diff --git a/src/DynamicData.Tests/Utilities/TestSourceCache.cs b/src/DynamicData.Tests/Utilities/TestSourceCache.cs index bdd440a1c..daa6c12f8 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceCache.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceCache.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.Kernel; diff --git a/src/DynamicData.Tests/Utilities/TestSourceList.cs b/src/DynamicData.Tests/Utilities/TestSourceList.cs index 6f3a1e2c2..4abf8f481 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceList.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceList.cs @@ -1,9 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs b/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs index 4994e2b35..f42f0a427 100644 --- a/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs +++ b/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs @@ -1,5 +1,4 @@ -using System; -using System.Reactive; +using System; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs b/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs index 51c53964d..37bda848b 100644 --- a/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.Reactive.Concurrency; +using System.Collections.Generic; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData/Aggregation/AggregationEx.cs b/src/DynamicData/Aggregation/AggregationEx.cs index c90e35520..af3d45bca 100644 --- a/src/DynamicData/Aggregation/AggregationEx.cs +++ b/src/DynamicData/Aggregation/AggregationEx.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.Aggregation; /// diff --git a/src/DynamicData/Aggregation/AvgEx.cs b/src/DynamicData/Aggregation/AvgEx.cs index f042bba71..0567fd3ea 100644 --- a/src/DynamicData/Aggregation/AvgEx.cs +++ b/src/DynamicData/Aggregation/AvgEx.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Aggregation; /// diff --git a/src/DynamicData/Aggregation/CountEx.cs b/src/DynamicData/Aggregation/CountEx.cs index 46a1f298b..8845bdc71 100644 --- a/src/DynamicData/Aggregation/CountEx.cs +++ b/src/DynamicData/Aggregation/CountEx.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Aggregation; /// diff --git a/src/DynamicData/Aggregation/MaxEx.cs b/src/DynamicData/Aggregation/MaxEx.cs index beb4d6e10..30e1e96de 100644 --- a/src/DynamicData/Aggregation/MaxEx.cs +++ b/src/DynamicData/Aggregation/MaxEx.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Aggregation; /// diff --git a/src/DynamicData/Aggregation/StdDevEx.cs b/src/DynamicData/Aggregation/StdDevEx.cs index 30599f9ec..406e1da48 100644 --- a/src/DynamicData/Aggregation/StdDevEx.cs +++ b/src/DynamicData/Aggregation/StdDevEx.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Aggregation; /// diff --git a/src/DynamicData/Alias/ObservableCacheAlias.cs b/src/DynamicData/Alias/ObservableCacheAlias.cs index 12b0b3ca8..85687c02a 100644 --- a/src/DynamicData/Alias/ObservableCacheAlias.cs +++ b/src/DynamicData/Alias/ObservableCacheAlias.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; - namespace DynamicData.Alias; /// diff --git a/src/DynamicData/Attributes.cs b/src/DynamicData/Attributes.cs index dfb6a9e85..76f194b3c 100644 --- a/src/DynamicData/Attributes.cs +++ b/src/DynamicData/Attributes.cs @@ -5,5 +5,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("DynamicData.Tests")] +[assembly: InternalsVisibleTo("DynamicData.Benchmarks")] [assembly: InternalsVisibleTo("DynamicData.ReactiveUI")] -[assembly: InternalsVisibleTo("DynamicData.Profile")] \ No newline at end of file +[assembly: InternalsVisibleTo("DynamicData.Profile")] diff --git a/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs b/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs index e24b07843..6bafd4ed5 100644 --- a/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs +++ b/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs @@ -4,7 +4,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; using System.Runtime.CompilerServices; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/BindPaged.cs b/src/DynamicData/Binding/BindPaged.cs index 1cbe39d35..24e6f8587 100644 --- a/src/DynamicData/Binding/BindPaged.cs +++ b/src/DynamicData/Binding/BindPaged.cs @@ -1,11 +1,8 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/BindVirtualized.cs b/src/DynamicData/Binding/BindVirtualized.cs index 37a3e1739..554e7aabb 100644 --- a/src/DynamicData/Binding/BindVirtualized.cs +++ b/src/DynamicData/Binding/BindVirtualized.cs @@ -1,11 +1,8 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/BindingListEventsSuspender.cs b/src/DynamicData/Binding/BindingListEventsSuspender.cs index 256d08fbe..a4b52b97e 100644 --- a/src/DynamicData/Binding/BindingListEventsSuspender.cs +++ b/src/DynamicData/Binding/BindingListEventsSuspender.cs @@ -1,10 +1,9 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.ComponentModel; using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/BindingListEx.cs b/src/DynamicData/Binding/BindingListEx.cs index 1b5804bba..6bf5c03ff 100644 --- a/src/DynamicData/Binding/BindingListEx.cs +++ b/src/DynamicData/Binding/BindingListEx.cs @@ -1,12 +1,10 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; -using System.Reactive; -using System.Reactive.Linq; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/ExpressionBuilder.cs b/src/DynamicData/Binding/ExpressionBuilder.cs index 47b241c96..552c56d8e 100644 --- a/src/DynamicData/Binding/ExpressionBuilder.cs +++ b/src/DynamicData/Binding/ExpressionBuilder.cs @@ -1,11 +1,9 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.ComponentModel; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Linq; using System.Reflection; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/IObservableListEx.cs b/src/DynamicData/Binding/IObservableListEx.cs index cf7d3a37a..4b46e5013 100644 --- a/src/DynamicData/Binding/IObservableListEx.cs +++ b/src/DynamicData/Binding/IObservableListEx.cs @@ -1,9 +1,8 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Collections.ObjectModel; -using System.Reactive.Linq; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs index 3c3ac0924..39d693ad5 100644 --- a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs +++ b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs @@ -4,7 +4,6 @@ using System.ComponentModel; using System.Linq.Expressions; -using System.Reactive.Linq; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/Observable.cs b/src/DynamicData/Binding/Observable.cs index 3e439d160..f877c2169 100644 --- a/src/DynamicData/Binding/Observable.cs +++ b/src/DynamicData/Binding/Observable.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Binding; internal static class Observable diff --git a/src/DynamicData/Binding/ObservableCollectionEx.cs b/src/DynamicData/Binding/ObservableCollectionEx.cs index 9b181ddeb..cfa6bec81 100644 --- a/src/DynamicData/Binding/ObservableCollectionEx.cs +++ b/src/DynamicData/Binding/ObservableCollectionEx.cs @@ -4,8 +4,6 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.Reactive; -using System.Reactive.Linq; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/ObservableCollectionExtended.cs b/src/DynamicData/Binding/ObservableCollectionExtended.cs index f99d9b9b4..c188d4298 100644 --- a/src/DynamicData/Binding/ObservableCollectionExtended.cs +++ b/src/DynamicData/Binding/ObservableCollectionExtended.cs @@ -5,7 +5,6 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; -using System.Reactive.Disposables; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/ObservablePropertyFactory.cs b/src/DynamicData/Binding/ObservablePropertyFactory.cs index 4dd3fbd68..bbb5a2daf 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactory.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactory.cs @@ -1,13 +1,10 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Collections.Generic; using System.ComponentModel; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Internal; diff --git a/src/DynamicData/Binding/ObservablePropertyPart.cs b/src/DynamicData/Binding/ObservablePropertyPart.cs index 9b4b1ab09..888ff1fb4 100644 --- a/src/DynamicData/Binding/ObservablePropertyPart.cs +++ b/src/DynamicData/Binding/ObservablePropertyPart.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using System.Linq.Expressions; -using System.Reactive; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/SortAndBind.cs b/src/DynamicData/Binding/SortAndBind.cs index 0bb5fe208..c5fdedbb6 100644 --- a/src/DynamicData/Binding/SortAndBind.cs +++ b/src/DynamicData/Binding/SortAndBind.cs @@ -1,11 +1,9 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.ComponentModel; using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Cache; using DynamicData.Cache.Internal; diff --git a/src/DynamicData/Binding/SortAndBindOptions.cs b/src/DynamicData/Binding/SortAndBindOptions.cs index bf93e8afe..38c207856 100644 --- a/src/DynamicData/Binding/SortAndBindOptions.cs +++ b/src/DynamicData/Binding/SortAndBindOptions.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index be5e8d189..56617ee2f 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; -using System.Reactive.Disposables; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index 8699e1c58..a413b008b 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; #if SUPPORTS_ASYNC_DISPOSABLE @@ -105,4 +100,4 @@ void TryDisposeItem(TObject item) }); } } -#endif \ No newline at end of file +#endif diff --git a/src/DynamicData/Cache/Internal/AutoRefresh.cs b/src/DynamicData/Cache/Internal/AutoRefresh.cs index ee81fe581..55c5e725b 100644 --- a/src/DynamicData/Cache/Internal/AutoRefresh.cs +++ b/src/DynamicData/Cache/Internal/AutoRefresh.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class AutoRefresh(IObservable> source, Func> reEvaluator, TimeSpan? buffer = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/Cache/Internal/BatchIf.cs b/src/DynamicData/Cache/Internal/BatchIf.cs index 76af20a61..ae204bded 100644 --- a/src/DynamicData/Cache/Internal/BatchIf.cs +++ b/src/DynamicData/Cache/Internal/BatchIf.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class BatchIf(IObservable> source, IObservable pauseIfTrueSelector, TimeSpan? timeOut, bool initialPauseState = false, IObservable? intervalTimer = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/Cache/Internal/Cast.cs b/src/DynamicData/Cache/Internal/Cast.cs index 02f62ebb8..3b5f62c8e 100644 --- a/src/DynamicData/Cache/Internal/Cast.cs +++ b/src/DynamicData/Cache/Internal/Cast.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class Cast(IObservable> source, Func converter) diff --git a/src/DynamicData/Cache/Internal/ChangeSetCache.cs b/src/DynamicData/Cache/Internal/ChangeSetCache.cs index d63a93bea..5a3defe00 100644 --- a/src/DynamicData/Cache/Internal/ChangeSetCache.cs +++ b/src/DynamicData/Cache/Internal/ChangeSetCache.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/Combiner.cs b/src/DynamicData/Cache/Internal/Combiner.cs index c7734512d..e1b73f834 100644 --- a/src/DynamicData/Cache/Internal/Combiner.cs +++ b/src/DynamicData/Cache/Internal/Combiner.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs index 0402b7b5f..9fe165f33 100644 --- a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class DeferUntilLoaded diff --git a/src/DynamicData/Cache/Internal/DisposeMany.cs b/src/DynamicData/Cache/Internal/DisposeMany.cs index fe97f5c0e..f10cdfd35 100644 --- a/src/DynamicData/Cache/Internal/DisposeMany.cs +++ b/src/DynamicData/Cache/Internal/DisposeMany.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class DisposeMany(IObservable> source) diff --git a/src/DynamicData/Cache/Internal/DistinctCalculator.cs b/src/DynamicData/Cache/Internal/DistinctCalculator.cs index 934f17ac3..33ed4a913 100644 --- a/src/DynamicData/Cache/Internal/DistinctCalculator.cs +++ b/src/DynamicData/Cache/Internal/DistinctCalculator.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class DistinctCalculator(IObservable> source, Func valueSelector) diff --git a/src/DynamicData/Cache/Internal/DynamicCombiner.cs b/src/DynamicData/Cache/Internal/DynamicCombiner.cs index 41c7e3a8d..df8fafcd5 100644 --- a/src/DynamicData/Cache/Internal/DynamicCombiner.cs +++ b/src/DynamicData/Cache/Internal/DynamicCombiner.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class DynamicCombiner(IObservableList>> source, CombineOperator type) diff --git a/src/DynamicData/Cache/Internal/DynamicGrouper.cs b/src/DynamicData/Cache/Internal/DynamicGrouper.cs index cb4880193..ede740ddc 100644 --- a/src/DynamicData/Cache/Internal/DynamicGrouper.cs +++ b/src/DynamicData/Cache/Internal/DynamicGrouper.cs @@ -1,9 +1,8 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Diagnostics; -using System.Reactive.Disposables; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs index f65df1b96..2db71092b 100644 --- a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs +++ b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class EditDiffChangeSetOptional(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs index 60bcd9de2..bbd0c3393 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - using DynamicData.Internal; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs index d128ada8f..9cdb0212b 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - using DynamicData.Internal; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs index 350ae272b..d9627347e 100644 --- a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Linq; using DynamicData.Internal; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/Filter.Static.cs b/src/DynamicData/Cache/Internal/Filter.Static.cs index e53a479bc..3466f5ea2 100644 --- a/src/DynamicData/Cache/Internal/Filter.Static.cs +++ b/src/DynamicData/Cache/Internal/Filter.Static.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal static partial class Filter diff --git a/src/DynamicData/Cache/Internal/FilterImmutable.cs b/src/DynamicData/Cache/Internal/FilterImmutable.cs index f257b18a1..b6f6969f1 100644 --- a/src/DynamicData/Cache/Internal/FilterImmutable.cs +++ b/src/DynamicData/Cache/Internal/FilterImmutable.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class FilterImmutable diff --git a/src/DynamicData/Cache/Internal/FilterOnObservable.cs b/src/DynamicData/Cache/Internal/FilterOnObservable.cs index d444d9ac4..de3d20cf9 100644 --- a/src/DynamicData/Cache/Internal/FilterOnObservable.cs +++ b/src/DynamicData/Cache/Internal/FilterOnObservable.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class FilterOnObservable(IObservable> source, Func> filterFactory, TimeSpan? buffer = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/Cache/Internal/FinallySafe.cs b/src/DynamicData/Cache/Internal/FinallySafe.cs index d4cb04523..577d42c32 100644 --- a/src/DynamicData/Cache/Internal/FinallySafe.cs +++ b/src/DynamicData/Cache/Internal/FinallySafe.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class FinallySafe(IObservable source, Action finallyAction) diff --git a/src/DynamicData/Cache/Internal/FullJoin.cs b/src/DynamicData/Cache/Internal/FullJoin.cs index 46bdb663f..5666930aa 100644 --- a/src/DynamicData/Cache/Internal/FullJoin.cs +++ b/src/DynamicData/Cache/Internal/FullJoin.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class FullJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) diff --git a/src/DynamicData/Cache/Internal/GroupOn.cs b/src/DynamicData/Cache/Internal/GroupOn.cs index fd0936fe7..98982946c 100644 --- a/src/DynamicData/Cache/Internal/GroupOn.cs +++ b/src/DynamicData/Cache/Internal/GroupOn.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class GroupOn(IObservable> source, Func groupSelectorKey, IObservable? regrouper) diff --git a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs index 0e11bc594..f89d1cc4e 100644 --- a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs +++ b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class GroupOnDynamic(IObservable> source, IObservable> selectGroupObservable, IObservable? regrouper = null) diff --git a/src/DynamicData/Cache/Internal/GroupOnImmutable.cs b/src/DynamicData/Cache/Internal/GroupOnImmutable.cs index ba33db031..2700e4f6c 100644 --- a/src/DynamicData/Cache/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/Cache/Internal/GroupOnImmutable.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class GroupOnImmutable(IObservable> source, Func groupSelectorKey, IObservable? regrouper) diff --git a/src/DynamicData/Cache/Internal/GroupOnObservable.cs b/src/DynamicData/Cache/Internal/GroupOnObservable.cs index 0555004e1..c0c604052 100644 --- a/src/DynamicData/Cache/Internal/GroupOnObservable.cs +++ b/src/DynamicData/Cache/Internal/GroupOnObservable.cs @@ -1,8 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; using DynamicData.Internal; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/GroupOnProperty.cs b/src/DynamicData/Cache/Internal/GroupOnProperty.cs index 8fa06893b..b27970f8d 100644 --- a/src/DynamicData/Cache/Internal/GroupOnProperty.cs +++ b/src/DynamicData/Cache/Internal/GroupOnProperty.cs @@ -1,11 +1,9 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.ComponentModel; using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs index bc3755a44..f54752dd3 100644 --- a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs @@ -1,11 +1,9 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.ComponentModel; using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/InnerJoin.cs b/src/DynamicData/Cache/Internal/InnerJoin.cs index e27c565c6..155526d04 100644 --- a/src/DynamicData/Cache/Internal/InnerJoin.cs +++ b/src/DynamicData/Cache/Internal/InnerJoin.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class InnerJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func<(TLeftKey leftKey, TRightKey rightKey), TLeft, TRight, TDestination> resultSelector) diff --git a/src/DynamicData/Cache/Internal/LeftJoin.cs b/src/DynamicData/Cache/Internal/LeftJoin.cs index f0709cb75..55e39c2aa 100644 --- a/src/DynamicData/Cache/Internal/LeftJoin.cs +++ b/src/DynamicData/Cache/Internal/LeftJoin.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class LeftJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) diff --git a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs index be539b82c..1361f6287 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs @@ -1,11 +1,8 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/MergeChangeSets.cs b/src/DynamicData/Cache/Internal/MergeChangeSets.cs index ebf4b22f1..d6d5d15f9 100644 --- a/src/DynamicData/Cache/Internal/MergeChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeChangeSets.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/MergeMany.cs b/src/DynamicData/Cache/Internal/MergeMany.cs index fe2eecc75..1dee93a3c 100644 --- a/src/DynamicData/Cache/Internal/MergeMany.cs +++ b/src/DynamicData/Cache/Internal/MergeMany.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs index 551cc8bbf..7a9971c68 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; using DynamicData.Internal; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs index a49ad8223..1480851a8 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; using DynamicData.Internal; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/MergeManyItems.cs b/src/DynamicData/Cache/Internal/MergeManyItems.cs index 26b85614b..b546e9d20 100644 --- a/src/DynamicData/Cache/Internal/MergeManyItems.cs +++ b/src/DynamicData/Cache/Internal/MergeManyItems.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class MergeManyItems diff --git a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs index bd7b18f4d..09fae60c8 100644 --- a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; using DynamicData.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/Cache/Internal/ObservableWithValue.cs b/src/DynamicData/Cache/Internal/ObservableWithValue.cs index 51ae8ac9d..59baa2bd6 100644 --- a/src/DynamicData/Cache/Internal/ObservableWithValue.cs +++ b/src/DynamicData/Cache/Internal/ObservableWithValue.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class ObservableWithValue diff --git a/src/DynamicData/Cache/Internal/OfType.cs b/src/DynamicData/Cache/Internal/OfType.cs index 17546116d..7eb41363b 100644 --- a/src/DynamicData/Cache/Internal/OfType.cs +++ b/src/DynamicData/Cache/Internal/OfType.cs @@ -1,8 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; using DynamicData.Internal; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/OnBeingRemoved.cs b/src/DynamicData/Cache/Internal/OnBeingRemoved.cs index 092306f3d..148b94fec 100644 --- a/src/DynamicData/Cache/Internal/OnBeingRemoved.cs +++ b/src/DynamicData/Cache/Internal/OnBeingRemoved.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class OnBeingRemoved(IObservable> source, Action removeAction) diff --git a/src/DynamicData/Cache/Internal/Page.cs b/src/DynamicData/Cache/Internal/Page.cs index e41595871..f172f33f7 100644 --- a/src/DynamicData/Cache/Internal/Page.cs +++ b/src/DynamicData/Cache/Internal/Page.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class Page(IObservable> source, IObservable pageRequests) diff --git a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs index 01828e85e..e5ea2ffdd 100644 --- a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class QueryWhenChanged(IObservable> source, Func>? itemChangedTrigger = null) diff --git a/src/DynamicData/Cache/Internal/RefCount.cs b/src/DynamicData/Cache/Internal/RefCount.cs index 4c4736391..5dc44b5e0 100644 --- a/src/DynamicData/Cache/Internal/RefCount.cs +++ b/src/DynamicData/Cache/Internal/RefCount.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class RefCount(IObservable> source) diff --git a/src/DynamicData/Cache/Internal/RightJoin.cs b/src/DynamicData/Cache/Internal/RightJoin.cs index 85163f75e..26bc89128 100644 --- a/src/DynamicData/Cache/Internal/RightJoin.cs +++ b/src/DynamicData/Cache/Internal/RightJoin.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class RightJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) diff --git a/src/DynamicData/Cache/Internal/SizeExpirer.cs b/src/DynamicData/Cache/Internal/SizeExpirer.cs index ede14bced..3dda1820c 100644 --- a/src/DynamicData/Cache/Internal/SizeExpirer.cs +++ b/src/DynamicData/Cache/Internal/SizeExpirer.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class SizeExpirer diff --git a/src/DynamicData/Cache/Internal/Sort.cs b/src/DynamicData/Cache/Internal/Sort.cs index 11b39035e..a835af94c 100644 --- a/src/DynamicData/Cache/Internal/Sort.cs +++ b/src/DynamicData/Cache/Internal/Sort.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class Sort diff --git a/src/DynamicData/Cache/Internal/SortAndPage.cs b/src/DynamicData/Cache/Internal/SortAndPage.cs index 2d612a9b6..70d74ab5f 100644 --- a/src/DynamicData/Cache/Internal/SortAndPage.cs +++ b/src/DynamicData/Cache/Internal/SortAndPage.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/SortAndVirtualize.cs b/src/DynamicData/Cache/Internal/SortAndVirtualize.cs index 44c6d3dc3..84854791f 100644 --- a/src/DynamicData/Cache/Internal/SortAndVirtualize.cs +++ b/src/DynamicData/Cache/Internal/SortAndVirtualize.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs b/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs index 863f2d6d6..aa128ecf2 100644 --- a/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs +++ b/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class SpecifiedGrouper(IObservable> source, Func groupSelector, IObservable> resultGroupSource) diff --git a/src/DynamicData/Cache/Internal/StatusMonitor.cs b/src/DynamicData/Cache/Internal/StatusMonitor.cs index 445074b63..a617834aa 100644 --- a/src/DynamicData/Cache/Internal/StatusMonitor.cs +++ b/src/DynamicData/Cache/Internal/StatusMonitor.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; internal sealed class StatusMonitor(IObservable source) diff --git a/src/DynamicData/Cache/Internal/SubscribeMany.cs b/src/DynamicData/Cache/Internal/SubscribeMany.cs index 78579fbeb..27a78b86e 100644 --- a/src/DynamicData/Cache/Internal/SubscribeMany.cs +++ b/src/DynamicData/Cache/Internal/SubscribeMany.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class SubscribeMany diff --git a/src/DynamicData/Cache/Internal/Switch.cs b/src/DynamicData/Cache/Internal/Switch.cs index 766f9f14a..a33b744dd 100644 --- a/src/DynamicData/Cache/Internal/Switch.cs +++ b/src/DynamicData/Cache/Internal/Switch.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; internal sealed class Switch(IObservable>> sources) @@ -31,6 +27,7 @@ public IObservable> Run() => Observable.Create { }, onError: error => errors.OnError(error)) + .Catch, Exception>(static _ => Observable.Empty>()) .PopulateInto(destination); return new CompositeDisposable( diff --git a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs index f3634dac3..73b04a528 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - using DynamicData.Internal; namespace DynamicData.Cache.Internal; @@ -194,7 +190,7 @@ private void OnSourceNext(IEnumerable upstreamItems) var lifetime = _expireAfter?.Invoke(item); if (lifetime is TimeSpan lifetimeValue) { - var expireAtTicks = (now + Scheduler.Normalize(lifetimeValue)).UtcTicks; + var expireAtTicks = (now + Sequencer.Normalize(lifetimeValue)).UtcTicks; var expireAt = new DateTimeOffset(ticks: expireAtTicks - (expireAtTicks % TimeSpan.TicksPerMillisecond), offset: TimeSpan.Zero); _expireAtsByKey[key] = expireAt; diff --git a/src/DynamicData/Cache/Internal/ToObservableOptional.cs b/src/DynamicData/Cache/Internal/ToObservableOptional.cs index 47efd420c..6557f78a9 100644 --- a/src/DynamicData/Cache/Internal/ToObservableOptional.cs +++ b/src/DynamicData/Cache/Internal/ToObservableOptional.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class ToObservableOptional(IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) diff --git a/src/DynamicData/Cache/Internal/Transform.cs b/src/DynamicData/Cache/Internal/Transform.cs index 0934d1061..e0da30457 100644 --- a/src/DynamicData/Cache/Internal/Transform.cs +++ b/src/DynamicData/Cache/Internal/Transform.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class Transform(IObservable> source, Func, TKey, TDestination> transformFactory, Action>? exceptionCallback = null, bool transformOnRefresh = false) diff --git a/src/DynamicData/Cache/Internal/TransformAsync.cs b/src/DynamicData/Cache/Internal/TransformAsync.cs index 73b6f62a9..efa251e05 100644 --- a/src/DynamicData/Cache/Internal/TransformAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformAsync.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Threading.Tasks; - namespace DynamicData.Cache.Internal; internal class TransformAsync( diff --git a/src/DynamicData/Cache/Internal/TransformImmutable.cs b/src/DynamicData/Cache/Internal/TransformImmutable.cs index 6090f034c..fd2d71cca 100644 --- a/src/DynamicData/Cache/Internal/TransformImmutable.cs +++ b/src/DynamicData/Cache/Internal/TransformImmutable.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class TransformImmutable diff --git a/src/DynamicData/Cache/Internal/TransformMany.cs b/src/DynamicData/Cache/Internal/TransformMany.cs index f38853c08..07ec989f7 100644 --- a/src/DynamicData/Cache/Internal/TransformMany.cs +++ b/src/DynamicData/Cache/Internal/TransformMany.cs @@ -1,11 +1,9 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Collections; using System.Collections.ObjectModel; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; diff --git a/src/DynamicData/Cache/Internal/TransformManyAsync.cs b/src/DynamicData/Cache/Internal/TransformManyAsync.cs index b202cb307..15f358923 100644 --- a/src/DynamicData/Cache/Internal/TransformManyAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformManyAsync.cs @@ -1,8 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; using DynamicData.Internal; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/TransformOnObservable.cs b/src/DynamicData/Cache/Internal/TransformOnObservable.cs index b88e4f1c6..50e8023ad 100644 --- a/src/DynamicData/Cache/Internal/TransformOnObservable.cs +++ b/src/DynamicData/Cache/Internal/TransformOnObservable.cs @@ -1,8 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; using DynamicData.Internal; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs index c7c95aa66..50c900b75 100644 --- a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs +++ b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class TransformWithForcedTransform(IObservable> source, Func, TKey, TDestination> transformFactory, IObservable> forceTransform, Action>? exceptionCallback = null) diff --git a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs index 322a50eb1..69c4c9169 100644 --- a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class TransformWithInlineUpdate(IObservable> source, diff --git a/src/DynamicData/Cache/Internal/TreeBuilder.cs b/src/DynamicData/Cache/Internal/TreeBuilder.cs index bf379ef99..2afc5cb97 100644 --- a/src/DynamicData/Cache/Internal/TreeBuilder.cs +++ b/src/DynamicData/Cache/Internal/TreeBuilder.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; internal sealed class TreeBuilder(IObservable> source, Func pivotOn, IObservable, bool>>? predicateChanged) diff --git a/src/DynamicData/Cache/Internal/TrueFor.cs b/src/DynamicData/Cache/Internal/TrueFor.cs index 28e036298..e544dc2b7 100644 --- a/src/DynamicData/Cache/Internal/TrueFor.cs +++ b/src/DynamicData/Cache/Internal/TrueFor.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class TrueFor(IObservable> source, Func> observableSelector, Func>, bool> collectionMatcher) diff --git a/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs b/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs index 0c858419c..ec5068dfb 100644 --- a/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs +++ b/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class UniquenessEnforcer(IObservable> source) diff --git a/src/DynamicData/Cache/Internal/Virtualise.cs b/src/DynamicData/Cache/Internal/Virtualise.cs index 9a5fefbcc..e93a3c8e2 100644 --- a/src/DynamicData/Cache/Internal/Virtualise.cs +++ b/src/DynamicData/Cache/Internal/Virtualise.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class Virtualise(IObservable> source, IObservable virtualRequests) diff --git a/src/DynamicData/Cache/Node.cs b/src/DynamicData/Cache/Node.cs index 44918b4c1..eb45dce6d 100644 --- a/src/DynamicData/Cache/Node.cs +++ b/src/DynamicData/Cache/Node.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCache.cs b/src/DynamicData/Cache/ObservableCache.cs index 5cbeca988..38bdbfa41 100644 --- a/src/DynamicData/Cache/ObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCache.cs @@ -3,9 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; using System.Threading; using DynamicData.Binding; using DynamicData.Cache; @@ -338,25 +335,20 @@ private void ResumeCount() private void ResumeNotifications() { - bool emitResume; - using (var notifications = _notifications.AcquireLock()) { Debug.Assert(_suspensionTracker.IsValueCreated, "Should not be Resuming Notifications without Suspend Notifications instance"); - (var changes, emitResume) = _suspensionTracker.Value.ResumeNotifications(); + var (changes, emitResume) = _suspensionTracker.Value.ResumeNotifications(); if (changes is not null) { notifications.EnqueueNext(new CacheUpdate(changes, _readerWriter.Count, ++_currentVersion)); } - } - // Emit the resume signal after releasing the delivery scope so that - // accumulated changes are delivered first - if (emitResume) - { - using var readLock = _notifications.AcquireReadLock(); - _suspensionTracker.Value.EmitResumeNotification(); + if (emitResume) + { + _suspensionTracker.Value.EmitResumeNotification(); + } } } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs index f99f46747..28ba162c6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs index 07c984029..756e02364 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs index 3b217f6ed..ec494006e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.And.cs b/src/DynamicData/Cache/ObservableCacheEx.And.cs index bae09dd4e..00fd9a282 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.And.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.And.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs index 3a9f58875..227b3639c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs index 0a15843d5..801c86ab9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs index 1e7bfb428..47625108d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs index 39a04294e..dd007e108 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs index 1ed843deb..4e58c5923 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs index 99fb5ee13..6c70d768d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs index ec591efa2..d5ef4e870 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs index c8d709c85..ca5bfc34d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs index 90aa68b00..b3955886a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs index 53dc96e5d..ae4a41df8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs index d29301dc8..025bdf6ff 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs index 1f635fc58..8eae3ed84 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs index eb46b86b3..d1a2fff42 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs index bf6d26c18..becaefa46 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs index 47d11d3ca..9c50278bf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs index 89cebf0da..e3b448589 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs index 52ad51274..10a78e2ea 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs index 6007f055c..1791a5170 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs index 86a68c29a..482a9c564 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs index f3ec6e103..195f21998 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Except.cs b/src/DynamicData/Cache/ObservableCacheEx.Except.cs index 19699c8d2..ca7b83c03 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Except.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Except.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs index 168d8903e..c90c1e6e1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs index 7b43d0173..3ce393615 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs index 3c4d432a7..6264e1c7c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs index 82733f25a..f37cbee03 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs index b50111d6b..0e7b5e465 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs index 23052c9e5..584d6cd01 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs index 357b859ac..e7f779d4e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs index fb23c04b6..9172493e1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs index 02103498f..2b761800b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs index 9328527e2..cfd209572 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs index c2e5894bc..725350a32 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Group.cs b/src/DynamicData/Cache/ObservableCacheEx.Group.cs index b803146d8..4f362cb03 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Group.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Group.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs index 31115d013..aa650fe61 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs index 5165d4091..a23b4604a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs index 2be1f5ca0..facb68085 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs index 1284a4b4f..4b4f7d518 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs index f5ff65ace..1a7c9355f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs index 2b8f11a87..57dda1f38 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs index 2c1a2e020..3c2783c51 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs index 8a80e640d..88b6e140b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs index 60bf2a343..2d00eb6a7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs index f19fde951..68b6ae513 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs index 5da9d2abe..8eafeb097 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs index 726ec5f1f..fa358a6df 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs index 810f118d0..de334f316 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs index c29bd2a6b..e9491eb06 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs index b3c290d34..a22262d6c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs index 5fcbb9ed0..c4ffc12a9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs index b2581c6c8..524e4ec58 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs index 93abf0f92..7190fd04d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs index a267d1511..5dceb0b81 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs index dd12ae230..f749d1074 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs index 00b222a68..f7f776855 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs index 40e47a95b..cbe1993c2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs index 13441fd02..b3fcc3ab7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs index 6935103fe..ae467860e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs index 464bbf29b..1b7f6cbf5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Or.cs b/src/DynamicData/Cache/ObservableCacheEx.Or.cs index a0de6f338..29e988388 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Or.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Or.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs index 24d4d407e..e91ca48fe 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -7,10 +7,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Cache; @@ -44,6 +40,7 @@ public static IDisposable PopulateFrom(this ISourceCache(this ISourceCache diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index b3457ec93..d12d46147 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -8,12 +8,19 @@ - + + + + + + + + @@ -40,4 +47,4 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int - \ No newline at end of file + diff --git a/src/DynamicData/EnumerableEx.cs b/src/DynamicData/EnumerableEx.cs index 124a4da30..1ddcf09f3 100644 --- a/src/DynamicData/EnumerableEx.cs +++ b/src/DynamicData/EnumerableEx.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData; /// diff --git a/src/DynamicData/Experimental/ExperimentalEx.cs b/src/DynamicData/Experimental/ExperimentalEx.cs index 69f7d3adc..8794b7265 100644 --- a/src/DynamicData/Experimental/ExperimentalEx.cs +++ b/src/DynamicData/Experimental/ExperimentalEx.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; - namespace DynamicData.Experimental; /// diff --git a/src/DynamicData/Experimental/ISubjectWithRefCount.cs b/src/DynamicData/Experimental/ISubjectWithRefCount.cs index 3bf4d4eda..f90c451d3 100644 --- a/src/DynamicData/Experimental/ISubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/ISubjectWithRefCount.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Subjects; - namespace DynamicData.Experimental; /// diff --git a/src/DynamicData/Experimental/SubjectWithRefCount.cs b/src/DynamicData/Experimental/SubjectWithRefCount.cs index 0554eb718..213acd459 100644 --- a/src/DynamicData/Experimental/SubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/SubjectWithRefCount.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Subjects; - namespace DynamicData.Experimental; /// @@ -27,6 +24,15 @@ internal sealed class SubjectWithRefCount(ISubject? subject = null) : ISub /// public int RefCount => _refCount; + /// + public bool HasObservers => _subject.HasObservers; + + /// + public bool IsDisposed => _subject.IsDisposed; + + /// + public void Dispose() => (_subject as IDisposable)?.Dispose(); + /// /// Notifies the observer that the provider has finished sending push-based notifications. /// diff --git a/src/DynamicData/Experimental/Watcher.cs b/src/DynamicData/Experimental/Watcher.cs index 9825ae686..b7cc90fac 100644 --- a/src/DynamicData/Experimental/Watcher.cs +++ b/src/DynamicData/Experimental/Watcher.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Experimental; internal sealed class Watcher : IWatcher diff --git a/src/DynamicData/GlobalConfig.cs b/src/DynamicData/GlobalConfig.cs index 106e66aec..6a46849fa 100644 --- a/src/DynamicData/GlobalConfig.cs +++ b/src/DynamicData/GlobalConfig.cs @@ -1,12 +1,10 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; - namespace DynamicData; internal static class GlobalConfig { - public static IScheduler DefaultScheduler => TaskPoolScheduler.Default; + public static IScheduler DefaultScheduler => TaskPoolSequencer.Default; } diff --git a/src/DynamicData/Internal/CacheParentSubscription.cs b/src/DynamicData/Internal/CacheParentSubscription.cs index 3a33143df..4a3371ee3 100644 --- a/src/DynamicData/Internal/CacheParentSubscription.cs +++ b/src/DynamicData/Internal/CacheParentSubscription.cs @@ -1,10 +1,8 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; namespace DynamicData.Internal; diff --git a/src/DynamicData/Internal/ObservableEx.cs b/src/DynamicData/Internal/ObservableEx.cs index 8fce9a875..f45a3032f 100644 --- a/src/DynamicData/Internal/ObservableEx.cs +++ b/src/DynamicData/Internal/ObservableEx.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; - namespace DynamicData.Internal; internal static class ObservableEx diff --git a/src/DynamicData/Internal/ReactiveCompatibility.cs b/src/DynamicData/Internal/ReactiveCompatibility.cs new file mode 100644 index 000000000..02d40f593 --- /dev/null +++ b/src/DynamicData/Internal/ReactiveCompatibility.cs @@ -0,0 +1,3009 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; +using ReactiveUI.Primitives.Signals; + +namespace DynamicData.Internal; + +/// +/// Compatibility helpers for the subset of Rx APIs used internally by DynamicData. +/// +internal static class ReactiveCompatibility; + +/// +/// Creates disposable instances compatible with the old Rx helper surface. +/// +internal static class Disposable +{ + /// + /// Gets a disposable that does nothing when disposed. + /// + public static IDisposable Empty { get; } = ReactiveUI.Primitives.Disposables.EmptyDisposable.Instance; + + /// + /// Creates a disposable that invokes the supplied action once. + /// + /// The action to invoke. + /// A disposable wrapper. + public static IDisposable Create(Action dispose) => ReactiveUI.Primitives.Disposables.Scope.Create(dispose); + + /// + /// Creates a disposable that invokes the supplied action once with state. + /// + /// The state type. + /// The state passed to the action. + /// The action to invoke. + /// A disposable wrapper. + public static IDisposable Create(TState state, Action dispose) => + ReactiveUI.Primitives.Disposables.Scope.Create(() => dispose(state)); +} + +/// +/// Scheduler aliases compatible with the old Rx static helper surface. +/// +internal static class Scheduler +{ + /// + /// Gets the default sequencer. + /// + public static IScheduler Default => Sequencer.Default; + + /// + /// Normalizes negative due times to zero. + /// + public static TimeSpan Normalize(TimeSpan dueTime) => Sequencer.Normalize(dueTime); +} + +/// +/// A mutable collection of disposables disposed as a group. +/// +internal sealed class CompositeDisposable : ReactiveUI.Primitives.Disposables.MultipleDisposable +{ + /// + /// Initializes a new instance of the class. + /// + public CompositeDisposable() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// Initial disposables. + public CompositeDisposable(params IDisposable[] disposables) + { + foreach (var disposable in disposables) + { + Add(disposable); + } + } +} + +/// +/// A disposable whose inner disposable can be assigned once. +/// +internal sealed class SingleAssignmentDisposable : IDisposable +{ + private readonly object _locker = new(); + private IDisposable? _disposable; + private bool _disposed; + private bool _assigned; + + /// + /// Gets a value indicating whether this instance has been disposed. + /// + public bool IsDisposed + { + get + { + lock (_locker) + { + return _disposed; + } + } + } + + /// + /// Gets or sets the assigned disposable. + /// + public IDisposable? Disposable + { + get + { + lock (_locker) + { + return _disposable; + } + } + + set + { + IDisposable? toDispose = null; + lock (_locker) + { + if (_assigned) + { + throw new InvalidOperationException("Disposable has already been assigned."); + } + + _assigned = true; + if (_disposed) + { + toDispose = value; + } + else + { + _disposable = value; + } + } + + toDispose?.Dispose(); + } + } + + /// + public void Dispose() + { + IDisposable? toDispose = null; + lock (_locker) + { + if (_disposed) + { + return; + } + + _disposed = true; + toDispose = _disposable; + _disposable = null; + } + + toDispose?.Dispose(); + } +} + +/// +/// A disposable whose inner disposable can be replaced. +/// +internal sealed class SerialDisposable : IDisposable +{ + private readonly object _locker = new(); + private IDisposable? _disposable; + private bool _disposed; + + /// + /// Gets a value indicating whether this instance has been disposed. + /// + public bool IsDisposed + { + get + { + lock (_locker) + { + return _disposed; + } + } + } + + /// + /// Gets or sets the current disposable, disposing the previous value on replacement. + /// + public IDisposable? Disposable + { + get + { + lock (_locker) + { + return _disposable; + } + } + + set + { + IDisposable? previous; + lock (_locker) + { + if (_disposed) + { + previous = value; + value = null; + } + else + { + previous = _disposable; + _disposable = value; + } + } + + previous?.Dispose(); + } + } + + /// + public void Dispose() + { + IDisposable? toDispose = null; + lock (_locker) + { + if (_disposed) + { + return; + } + + _disposed = true; + toDispose = _disposable; + _disposable = null; + } + + toDispose?.Dispose(); + } +} + +/// +/// Represents a subject that is both an observer and observable. +/// +/// The element type. +internal interface ISubject : IObservable, IObserver +{ + /// + /// Gets a value indicating whether the subject currently has observers. + /// + bool HasObservers { get; } + + /// + /// Gets a value indicating whether the subject has been disposed. + /// + bool IsDisposed { get; } +} + +/// +/// A multicast subject. +/// +/// The element type. +internal sealed class Subject : ISubject, IDisposable +{ + private readonly object _locker = new(); + private readonly List> _observers = []; + private Exception? _error; + private bool _completed; + private bool _disposed; + + /// + public bool HasObservers + { + get + { + lock (_locker) + { + return _observers.Count != 0; + } + } + } + + /// + public bool IsDisposed + { + get + { + lock (_locker) + { + return _disposed; + } + } + } + + /// + public void Dispose() + { + lock (_locker) + { + _disposed = true; + _observers.Clear(); + } + } + + /// + public void OnCompleted() + { + IObserver[] observers; + lock (_locker) + { + if (_disposed || _completed || _error is not null) + { + return; + } + + _completed = true; + observers = [.. _observers]; + _observers.Clear(); + } + + foreach (var observer in observers) + { + observer.OnCompleted(); + } + } + + /// + public void OnError(Exception error) + { + IObserver[] observers; + lock (_locker) + { + if (_disposed || _completed || _error is not null) + { + return; + } + + _error = error; + observers = [.. _observers]; + _observers.Clear(); + } + + foreach (var observer in observers) + { + observer.OnError(error); + } + } + + /// + public void OnNext(T value) + { + IObserver[] observers; + lock (_locker) + { + if (_disposed || _completed || _error is not null) + { + return; + } + + observers = [.. _observers]; + } + + foreach (var observer in observers) + { + observer.OnNext(value); + } + } + + /// + public IDisposable Subscribe(IObserver observer) + { + lock (_locker) + { + if (_error is not null) + { + observer.OnError(_error); + return Disposable.Empty; + } + + if (_completed) + { + observer.OnCompleted(); + return Disposable.Empty; + } + + if (_disposed) + { + observer.OnCompleted(); + return Disposable.Empty; + } + + _observers.Add(observer); + } + + return Disposable.Create(() => + { + lock (_locker) + { + _observers.Remove(observer); + } + }); + } +} + +/// +/// A subject that replays its most recent value. +/// +/// The element type. +internal sealed class BehaviorSubject : ISubject, IDisposable +{ + private readonly BehaviorSignal _signal; + + /// + /// Initializes a new instance of the class. + /// + /// The initial value. + public BehaviorSubject(T value) => _signal = new(value); + + /// + /// Gets the current value. + /// + public T Value => _signal.Value; + + /// + public bool HasObservers => _signal.HasObservers; + + /// + public bool IsDisposed => _signal.IsDisposed; + + /// + public void Dispose() => _signal.Dispose(); + + /// + public void OnCompleted() => _signal.OnCompleted(); + + /// + public void OnError(Exception error) => _signal.OnError(error); + + /// + public void OnNext(T value) => _signal.OnNext(value); + + /// + public IDisposable Subscribe(IObserver observer) => _signal.Subscribe(observer); +} + +/// +/// A subject that replays buffered values to new subscribers. +/// +/// The element type. +internal sealed class ReplaySubject : ISubject, IDisposable +{ + private readonly object _locker = new(); + private readonly List _values = []; + private readonly List> _observers = []; + private readonly int? _bufferSize; + private Exception? _error; + private bool _completed; + private bool _disposed; + + /// + /// Initializes a new instance of the class. + /// + public ReplaySubject() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The maximum number of values to replay. + public ReplaySubject(int bufferSize) + { + if (bufferSize < 0) + { + throw new ArgumentOutOfRangeException(nameof(bufferSize)); + } + + _bufferSize = bufferSize; + } + + /// + public bool HasObservers + { + get + { + lock (_locker) + { + return _observers.Count != 0; + } + } + } + + /// + public bool IsDisposed + { + get + { + lock (_locker) + { + return _disposed; + } + } + } + + /// + public void Dispose() + { + lock (_locker) + { + _disposed = true; + _observers.Clear(); + _values.Clear(); + } + } + + /// + public void OnCompleted() + { + IObserver[] observers; + lock (_locker) + { + ThrowIfDisposed(); + if (_completed || _error is not null) + { + return; + } + + _completed = true; + observers = [.. _observers]; + _observers.Clear(); + } + + foreach (var observer in observers) + { + observer.OnCompleted(); + } + } + + /// + public void OnError(Exception error) + { + if (error is null) + { + throw new ArgumentNullException(nameof(error)); + } + + IObserver[] observers; + lock (_locker) + { + ThrowIfDisposed(); + if (_completed || _error is not null) + { + return; + } + + _error = error; + observers = [.. _observers]; + _observers.Clear(); + } + + foreach (var observer in observers) + { + observer.OnError(error); + } + } + + /// + public void OnNext(T value) + { + IObserver[] observers; + lock (_locker) + { + ThrowIfDisposed(); + if (_completed || _error is not null) + { + return; + } + + _values.Add(value); + if (_bufferSize is { } bufferSize) + { + while (_values.Count > bufferSize) + { + _values.RemoveAt(0); + } + } + + observers = [.. _observers]; + } + + foreach (var observer in observers) + { + observer.OnNext(value); + } + } + + /// + public IDisposable Subscribe(IObserver observer) + { + if (observer is null) + { + throw new ArgumentNullException(nameof(observer)); + } + + T[] values; + Exception? error; + var completed = false; + + lock (_locker) + { + ThrowIfDisposed(); + values = [.. _values]; + error = _error; + completed = _completed; + if (error is null && !completed) + { + _observers.Add(observer); + } + } + + foreach (var value in values) + { + observer.OnNext(value); + } + + if (error is not null) + { + observer.OnError(error); + return Disposable.Empty; + } + + if (completed) + { + observer.OnCompleted(); + return Disposable.Empty; + } + + return Disposable.Create(() => + { + lock (_locker) + { + _observers.Remove(observer); + } + }); + } + + private void ThrowIfDisposed() + { + if (_disposed) + { + throw new ObjectDisposedException(GetType().FullName); + } + } +} + +/// +/// Factory methods compatible with the subset of the old Rx Observable surface used internally. +/// +internal static class Observable +{ + /// + /// Creates an observable from a subscribe function. + /// + public static IObservable Create(Func, IDisposable> subscribe) => + new AnonymousObservable(subscribe); + + /// + /// Creates an observable from an asynchronous subscribe function. + /// + public static IObservable Create(Func, Task> subscribe) => + Create(observer => + { + var subscription = new SerialDisposable(); + try + { + var task = subscribe(observer); + if (task.Status == TaskStatus.RanToCompletion) + { + subscription.Disposable = task.Result; + } + else + { + _ = AwaitSubscription(task, observer, subscription); + } + } + catch (Exception error) + { + observer.OnError(error); + } + + return subscription; + }); + + /// + /// Creates an observable from an asynchronous subscribe function. + /// + public static IObservable Create(Func, CancellationToken, Task> subscribe) => + Create(observer => + { + var cancellation = new CancellationTokenSource(); + var subscription = new CompositeDisposable(cancellation); + try + { + var task = subscribe(observer, cancellation.Token); + if (task.Status == TaskStatus.RanToCompletion) + { + subscription.Add(task.Result); + } + else + { + _ = AwaitSubscription(task, observer, subscription, cancellation.Token); + } + } + catch (Exception error) + { + if (!cancellation.IsCancellationRequested) + { + observer.OnError(error); + } + } + + return subscription; + }); + + /// + /// Defers observable creation until subscription. + /// + public static IObservable Defer(Func> factory) => + ReactiveUI.Primitives.Signals.Signal.Lazy(factory); + + /// + /// Defers asynchronous value creation until subscription. + /// + public static IObservable Defer(Func> factory) => FromAsync(factory); + + /// + /// Defers asynchronous observable creation until subscription. + /// + public static IObservable Defer(Func>> factory) => + FromAsync(factory).Switch(); + + /// + /// Creates an observable that completes immediately. + /// + public static IObservable Empty() => ReactiveUI.Primitives.Signals.Signal.None(); + + /// + /// Creates an observable that never completes. + /// + public static IObservable Never() => Create(_ => Disposable.Empty); + + /// + /// Creates an observable that emits a single value. + /// + public static IObservable Return(T value) => ReactiveUI.Primitives.Signals.Signal.Emit(value); + + /// + /// Creates an observable that terminates with an error. + /// + public static IObservable Throw(Exception error) => ReactiveUI.Primitives.Signals.Signal.Fail(error); + + /// + /// Creates an observable range. + /// + public static IObservable Range(int start, int count) => ReactiveUI.Primitives.Signals.Signal.Sequence(start, count); + + /// + /// Creates an observable range on a sequencer. + /// + public static IObservable Range(int start, int count, IScheduler scheduler) => + Enumerable.Range(start, count).ToObservable(scheduler); + + /// + /// Creates an observable from an asynchronous value factory. + /// + public static IObservable FromAsync(Func> taskFactory) => + Observable.Create(observer => + { + try + { + return taskFactory().ToObservable().Subscribe(observer); + } + catch (Exception error) + { + observer.OnError(error); + return Disposable.Empty; + } + }); + + /// + /// Creates an observable from an asynchronous value factory. + /// + public static IObservable FromAsync(Func> taskFactory) => + Observable.Create(observer => + { + var cancellation = new CancellationTokenSource(); + var subscription = new SerialDisposable(); + + try + { + subscription.Disposable = taskFactory(cancellation.Token).ToObservable().Subscribe(observer); + } + catch (Exception error) + { + observer.OnError(error); + } + + return Disposable.Create(() => + { + cancellation.Cancel(); + cancellation.Dispose(); + subscription.Dispose(); + }); + }); + + /// + /// Creates an observable from an asynchronous action factory. + /// + public static IObservable FromAsync(Func taskFactory) => + FromAsync(async () => + { + await taskFactory().ConfigureAwait(false); + return Unit.Default; + }); + + /// + /// Creates a timer observable. + /// + public static IObservable Timer(TimeSpan dueTime) => ReactiveUI.Primitives.Signals.Signal.After(dueTime); + + /// + /// Creates a timer observable. + /// + public static IObservable Timer(TimeSpan dueTime, IScheduler scheduler) => + ReactiveUI.Primitives.Signals.Signal.After(dueTime, scheduler); + + /// + /// Creates a timer observable. + /// + public static IObservable Timer(TimeSpan dueTime, TimeSpan period, IScheduler scheduler) => + ReactiveUI.Primitives.Signals.Signal.After(dueTime, period, scheduler); + + /// + /// Creates an observable that emits a sequential value at each interval. + /// + public static IObservable Interval(TimeSpan period) => + ReactiveUI.Primitives.Signals.Signal.Every(period); + + /// + /// Creates an observable that emits a sequential value at each interval. + /// + public static IObservable Interval(TimeSpan period, IScheduler scheduler) => + ReactiveUI.Primitives.Signals.Signal.Every(period, scheduler); + + /// + /// Merges observable sources. + /// + public static IObservable Merge(params IObservable[] sources) => sources.Merge(); + + /// + /// Merges observable sources. + /// + public static IObservable Merge(IEnumerable> sources) => sources.Merge(); + + /// + /// Concatenates observable sources. + /// + public static IObservable Concat(params IObservable[] sources) => sources.ToObservable().Concat(); + + /// + /// Concatenates observable sources. + /// + public static IObservable Concat(IEnumerable> sources) => sources.ToObservable().Concat(); + + /// + /// Switches to the latest inner observable. + /// + public static IObservable Switch(IObservable> source) => source.Switch(); + + /// + /// Projects values to enumerable sequences. + /// + public static IObservable SelectMany( + IObservable source, + Func> selector) => + source.SelectMany(selector); + + /// + /// Converts an event into event-pattern values. + /// + public static IObservable> FromEventPattern( + Action addHandler, + Action removeHandler) + where TEventHandler : Delegate + where TEventArgs : EventArgs => + Create>(observer => + { + if (addHandler is null) + { + throw new ArgumentNullException(nameof(addHandler)); + } + + if (removeHandler is null) + { + throw new ArgumentNullException(nameof(removeHandler)); + } + + void Handler(object? sender, TEventArgs eventArgs) => + observer.OnNext(new EventPattern(sender, eventArgs)); + + Action action = Handler; + var handler = (TEventHandler)Delegate.CreateDelegate(typeof(TEventHandler), action.Target, action.Method); + addHandler(handler); + return Disposable.Create(handler, removeHandler); + }); + + private static async Task AwaitSubscription( + Task task, + IObserver observer, + SerialDisposable subscription) + { + try + { + subscription.Disposable = await task.ConfigureAwait(false); + } + catch (Exception error) + { + observer.OnError(error); + } + } + + private static async Task AwaitSubscription( + Task task, + IObserver observer, + CompositeDisposable subscription, + CancellationToken cancellationToken) + { + try + { + subscription.Add(await task.ConfigureAwait(false)); + } + catch (Exception error) + { + if (!cancellationToken.IsCancellationRequested) + { + observer.OnError(error); + } + } + } +} + +/// +/// Observer factory helpers. +/// +internal static class Observer +{ + /// + /// Creates an observer from callbacks. + /// + public static IObserver Create(Action onNext) => + new AnonymousObserver(onNext, Throw, static () => { }); + + /// + /// Creates an observer from callbacks. + /// + public static IObserver Create(Action onNext, Action onError) => + new AnonymousObserver(onNext, onError, static () => { }); + + /// + /// Creates an observer from callbacks. + /// + public static IObserver Create(Action onNext, Action onCompleted) => + new AnonymousObserver(onNext, Throw, onCompleted); + + /// + /// Creates an observer from callbacks. + /// + public static IObserver Create(Action onNext, Action onError, Action onCompleted) => + new AnonymousObserver(onNext, onError, onCompleted); + + private static void Throw(Exception error) => ExceptionDispatchInfo.Capture(error).Throw(); +} + +/// +/// Observer implementation backed by delegates. +/// +/// The element type. +internal sealed class AnonymousObserver : IObserver +{ + private readonly Action _onNext; + private readonly Action _onError; + private readonly Action _onCompleted; + + /// + /// Initializes a new instance of the class. + /// + public AnonymousObserver(Action onNext, Action onError, Action onCompleted) + { + _onNext = onNext; + _onError = onError; + _onCompleted = onCompleted; + } + + /// + public void OnCompleted() => _onCompleted(); + + /// + public void OnError(Exception error) => _onError(error); + + /// + public void OnNext(T value) => _onNext(value); +} + +/// +/// Observable implementation backed by a subscribe delegate. +/// +/// The element type. +internal sealed class AnonymousObservable : IObservable +{ + private readonly Func, IDisposable> _subscribe; + + /// + /// Initializes a new instance of the class. + /// + public AnonymousObservable(Func, IDisposable> subscribe) => _subscribe = subscribe; + + /// + public IDisposable Subscribe(IObserver observer) + { + try + { + return _subscribe(observer) ?? Disposable.Empty; + } + catch (Exception error) + { + observer.OnError(error); + return Disposable.Empty; + } + } +} + +/// +/// Rx-style extension methods used by DynamicData internals. +/// +internal static class ObservableCompatibilityExtensions +{ + /// + /// Subscribes with no value handler. + /// + public static IDisposable Subscribe(this IObservable source) => + source.Subscribe(Observer.Create(static _ => { })); + + /// + /// Subscribes with a value handler. + /// + public static IDisposable Subscribe(this IObservable source, Action onNext) => + source.Subscribe(Observer.Create(onNext)); + + /// + /// Subscribes with value and error handlers. + /// + public static IDisposable Subscribe(this IObservable source, Action onNext, Action onError) => + source.Subscribe(Observer.Create(onNext, onError)); + + /// + /// Subscribes with value and completion handlers. + /// + public static IDisposable Subscribe(this IObservable source, Action onNext, Action onCompleted) => + source.Subscribe(Observer.Create(onNext, onCompleted)); + + /// + /// Subscribes with value, error, and completion handlers. + /// + public static IDisposable Subscribe(this IObservable source, Action onNext, Action onError, Action onCompleted) => + source.Subscribe(Observer.Create(onNext, onError, onCompleted)); + + /// + /// Subscribes an observer to the source. + /// + public static IDisposable SubscribeSafe(this IObservable source, IObserver observer) + { + var subscription = new SerialDisposable(); + var stopped = 0; + + void StopWithError(Exception error) + { + if (Interlocked.Exchange(ref stopped, 1) == 0) + { + try + { + observer.OnError(error); + } + finally + { + subscription.Dispose(); + } + } + } + + subscription.Disposable = source.Subscribe( + value => + { + if (Volatile.Read(ref stopped) != 0) + { + return; + } + + try + { + observer.OnNext(value); + } + catch (Exception error) + { + StopWithError(error); + } + }, + error => + { + StopWithError(error); + }, + () => + { + if (Interlocked.Exchange(ref stopped, 1) == 0) + { + try + { + observer.OnCompleted(); + } + finally + { + subscription.Dispose(); + } + } + }); + + return subscription; + } + + /// + /// Hides the identity of an observable. + /// + public static IObservable AsObservable(this IObservable source) => + Observable.Create(source.Subscribe); + + /// + /// Projects each value. + /// + public static IObservable Select( + this IObservable source, + Func selector) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + source.Subscribe( + value => + { + TResult result; + try + { + result = selector(value); + } + catch (Exception error) + { + observer.OnError(error); + return; + } + + observer.OnNext(result); + }, + observer.OnError, + observer.OnCompleted)); + + /// + /// Projects each value with its index. + /// + public static IObservable Select( + this IObservable source, + Func selector) + => Observable.Create(observer => + { + var index = -1; + return source.Subscribe( + value => + { + TResult result; + try + { + result = selector(value, Interlocked.Increment(ref index)); + } + catch (Exception error) + { + observer.OnError(error); + return; + } + + observer.OnNext(result); + }, + observer.OnError, + observer.OnCompleted); + }); + + /// + /// Filters values. + /// + public static IObservable Where(this IObservable source, Func predicate) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + source.Subscribe( + value => + { + bool keep; + try + { + keep = predicate(value); + } + catch (Exception error) + { + observer.OnError(error); + return; + } + + if (keep) + { + observer.OnNext(value); + } + }, + observer.OnError, + observer.OnCompleted)); + + /// + /// Projects values to observable sequences and merges the results. + /// + public static IObservable SelectMany( + this IObservable source, + Func> selector) => + source.Select(selector).Merge(); + + /// + /// Projects each value to the same observable sequence and merges the results. + /// + public static IObservable SelectMany( + this IObservable source, + IObservable other) => + source.Select(_ => other).Merge(); + + /// + /// Projects values to enumerable sequences and merges the results. + /// + public static IObservable SelectMany( + this IObservable source, + Func> selector) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + source.Subscribe( + value => + { + IEnumerable values; + try + { + values = selector(value); + } + catch (Exception error) + { + observer.OnError(error); + return; + } + + foreach (var result in values) + { + observer.OnNext(result); + } + }, + observer.OnError, + observer.OnCompleted)); + + /// + /// Projects values with a result selector. + /// + public static IObservable SelectMany( + this IObservable source, + Func> collectionSelector, + Func resultSelector) => + source.SelectMany(value => collectionSelector(value).Select(inner => resultSelector(value, inner))); + + /// + /// Merges two observable sources. + /// + public static IObservable Merge(this IObservable first, IObservable second) => + new[] { first, second }.Merge(); + + /// + /// Merges observable sources. + /// + public static IObservable Merge(this IEnumerable> sources) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + var disposables = new CompositeDisposable(); + var remaining = 1; + var gate = new object(); + var stopped = false; + + void CompleteOne() + { + lock (gate) + { + if (stopped) + { + return; + } + + if (--remaining == 0) + { + stopped = true; + observer.OnCompleted(); + } + } + } + + void Fail(Exception error) + { + var shouldDispose = false; + lock (gate) + { + if (stopped) + { + return; + } + + stopped = true; + observer.OnError(error); + shouldDispose = true; + } + + if (shouldDispose) + { + disposables.Dispose(); + } + } + + foreach (var source in sources) + { + lock (gate) + { + if (stopped) + { + break; + } + + remaining++; + } + + disposables.Add(source.Subscribe( + value => + { + lock (gate) + { + if (!stopped) + { + observer.OnNext(value); + } + } + }, + Fail, + CompleteOne)); + } + + CompleteOne(); + return disposables; + }); + + /// + /// Merges a sequence of observable sources. + /// + public static IObservable Merge(this IObservable> sources) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + var subscriptions = new CompositeDisposable(); + var outerCompleted = false; + var active = 0; + var gate = new object(); + var stopped = false; + + void Fail(Exception error) + { + var shouldDispose = false; + lock (gate) + { + if (stopped) + { + return; + } + + stopped = true; + observer.OnError(error); + shouldDispose = true; + } + + if (shouldDispose) + { + subscriptions.Dispose(); + } + } + + void TryComplete() + { + if (!stopped && outerCompleted && active == 0) + { + stopped = true; + observer.OnCompleted(); + } + } + + subscriptions.Add(sources.Subscribe( + inner => + { + lock (gate) + { + if (stopped) + { + return; + } + + active++; + } + + var innerSubscription = new SingleAssignmentDisposable(); + subscriptions.Add(innerSubscription); + innerSubscription.Disposable = inner.Subscribe( + value => + { + lock (gate) + { + if (!stopped) + { + observer.OnNext(value); + } + } + }, + Fail, + () => + { + subscriptions.Remove(innerSubscription); + lock (gate) + { + if (stopped) + { + return; + } + + active--; + TryComplete(); + } + }); + }, + Fail, + () => + { + lock (gate) + { + if (stopped) + { + return; + } + + outerCompleted = true; + TryComplete(); + } + })); + + return subscriptions; + }); + + /// + /// Merges observable sources with a maximum concurrency. + /// + public static IObservable Merge(this IEnumerable> sources, int maxConcurrent) + { + if (maxConcurrent <= 0) + { + throw new ArgumentOutOfRangeException(nameof(maxConcurrent)); + } + + return ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + var subscriptions = new CompositeDisposable(); + var enumerator = sources.GetEnumerator(); + var gate = new object(); + var active = 0; + var stopped = false; + + bool SubscribeNext() + { + IObservable? next = null; + lock (gate) + { + if (stopped) + { + return false; + } + + if (enumerator.MoveNext()) + { + next = enumerator.Current; + active++; + } + else if (active == 0) + { + stopped = true; + observer.OnCompleted(); + return false; + } + else + { + return false; + } + } + + if (next is null) + { + return false; + } + + var inner = new SingleAssignmentDisposable(); + subscriptions.Add(inner); + inner.Disposable = next.Subscribe( + value => + { + lock (gate) + { + if (!stopped) + { + observer.OnNext(value); + } + } + }, + error => + { + lock (gate) + { + if (stopped) + { + return; + } + + stopped = true; + } + + observer.OnError(error); + subscriptions.Dispose(); + }, + () => + { + subscriptions.Remove(inner); + lock (gate) + { + active--; + } + + SubscribeNext(); + }); + + return true; + } + + for (var i = 0; i < maxConcurrent; i++) + { + if (!SubscribeNext()) + { + break; + } + } + + subscriptions.Add(enumerator); + return subscriptions; + }); + } + + /// + /// Concatenates observable sources. + /// + public static IObservable Concat(this IObservable first, IObservable second) => + new[] { first, second }.ToObservable().Concat(); + + /// + /// Concatenates observable sources. + /// + public static IObservable Concat(this IObservable> sources) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + var subscriptions = new CompositeDisposable(); + var queue = new Queue>(); + var gate = new object(); + var outerCompleted = false; + var active = false; + + void Drain() + { + IObservable? next = null; + lock (gate) + { + if (active || queue.Count == 0) + { + if (outerCompleted && !active && queue.Count == 0) + { + observer.OnCompleted(); + } + + return; + } + + active = true; + next = queue.Dequeue(); + } + + var inner = new SingleAssignmentDisposable(); + subscriptions.Add(inner); + inner.Disposable = next.Subscribe( + observer.OnNext, + observer.OnError, + () => + { + subscriptions.Remove(inner); + lock (gate) + { + active = false; + } + + Drain(); + }); + } + + subscriptions.Add(sources.Subscribe( + source => + { + lock (gate) + { + queue.Enqueue(source); + } + + Drain(); + }, + observer.OnError, + () => + { + lock (gate) + { + outerCompleted = true; + } + + Drain(); + })); + + return subscriptions; + }); + + /// + /// Concatenates task results in source order. + /// + public static IObservable Concat(this IObservable> source) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + var disposables = new CompositeDisposable(); + var gate = new object(); + var queue = new Queue>(); + var outerCompleted = false; + var active = false; + + void Drain() + { + Task? next = null; + lock (gate) + { + if (active) + { + return; + } + + if (queue.Count == 0) + { + if (outerCompleted) + { + observer.OnCompleted(); + } + + return; + } + + active = true; + next = queue.Dequeue(); + } + + void Finish() + { + lock (gate) + { + active = false; + } + + Drain(); + } + + if (next.IsCompleted) + { + EmitCompletedTask(next, observer, Finish); + } + else + { + _ = AwaitTask(next, observer, Finish); + } + } + + disposables.Add(source.Subscribe( + task => + { + lock (gate) + { + queue.Enqueue(task); + } + + Drain(); + }, + observer.OnError, + () => + { + lock (gate) + { + outerCompleted = true; + } + + Drain(); + })); + + return disposables; + }); + + private static async Task AwaitTask(Task task, IObserver observer, Action completed) + { + try + { + observer.OnNext(await task.ConfigureAwait(false)); + } + catch (Exception error) + { + observer.OnError(error); + return; + } + + completed(); + } + + private static void EmitCompletedTask(Task task, IObserver observer, Action completed) + { + if (task.IsCanceled) + { + observer.OnError(new TaskCanceledException(task)); + return; + } + + if (task.IsFaulted) + { + observer.OnError(task.Exception?.InnerException ?? (Exception?)task.Exception ?? new InvalidOperationException("Task faulted without an exception.")); + return; + } + + observer.OnNext(task.Result); + completed(); + } + + /// + /// Switches to the latest inner observable. + /// + public static IObservable Switch(this IObservable> sources) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + var subscriptions = new CompositeDisposable(); + var current = new SerialDisposable(); + var gate = new object(); + var outerCompleted = false; + var active = 0; + subscriptions.Add(current); + + void TryComplete() + { + if (outerCompleted && active == 0) + { + observer.OnCompleted(); + } + } + + subscriptions.Add(sources.Subscribe( + inner => + { + Interlocked.Increment(ref active); + var mine = active; + current.Disposable = inner.Subscribe( + observer.OnNext, + observer.OnError, + () => + { + if (Volatile.Read(ref active) == mine) + { + Interlocked.Decrement(ref active); + lock (gate) + { + TryComplete(); + } + } + }); + }, + observer.OnError, + () => + { + lock (gate) + { + outerCompleted = true; + TryComplete(); + } + })); + + return subscriptions; + }); + + /// + /// Prefixes values to an observable. + /// + public static IObservable StartWith(this IObservable source, params T[] values) => + values.ToObservable().Concat(source); + + /// + /// Prefixes a value to an observable. + /// + public static IObservable Prepend(this IObservable source, T value) => + source.StartWith(value); + + /// + /// Accumulates values. + /// + public static IObservable Scan( + this IObservable source, + TAccumulate seed, + Func accumulator) + => Observable.Create(observer => + { + var current = seed; + return source.Subscribe( + value => + { + try + { + current = accumulator(current, value); + } + catch (Exception error) + { + observer.OnError(error); + return; + } + + observer.OnNext(current); + }, + observer.OnError, + observer.OnCompleted); + }); + + /// + /// Buffers values by count. + /// + public static IObservable> Buffer(this IObservable source, int count) => + ReactiveUI.Primitives.Signals.Signal.Create>(observer => + { + var buffer = new List(count); + return source.Subscribe( + value => + { + buffer.Add(value); + if (buffer.Count < count) + { + return; + } + + observer.OnNext(buffer.ToArray()); + buffer.Clear(); + }, + observer.OnError, + () => + { + if (buffer.Count != 0) + { + observer.OnNext(buffer.ToArray()); + } + + observer.OnCompleted(); + }); + }); + + /// + /// Buffers values by time. + /// + public static IObservable> Buffer(this IObservable source, TimeSpan timeSpan) => + source.Buffer(timeSpan, Sequencer.Default); + + /// + /// Buffers values by time. + /// + public static IObservable> Buffer(this IObservable source, TimeSpan timeSpan, IScheduler scheduler) => + ReactiveUI.Primitives.Signals.Signal.Create>(observer => + { + var gate = new object(); + var buffer = new List(); + var disposables = new CompositeDisposable(); + + void Flush() + { + T[] values; + lock (gate) + { + if (buffer.Count == 0) + { + return; + } + + values = [.. buffer]; + buffer.Clear(); + } + + observer.OnNext(values); + } + + disposables.Add(source.Subscribe( + value => + { + lock (gate) + { + buffer.Add(value); + } + }, + observer.OnError, + () => + { + Flush(); + observer.OnCompleted(); + })); + + disposables.Add(scheduler.ScheduleRecurringAction(timeSpan, Flush)); + return disposables; + }); + + /// + /// Distinct values. + /// + public static IObservable Distinct(this IObservable source) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + var seen = new HashSet(); + return source.Subscribe( + value => + { + if (seen.Add(value)) + { + observer.OnNext(value); + } + }, + observer.OnError, + observer.OnCompleted); + }); + + /// + /// Emits values when they differ from the previous value. + /// + public static IObservable DistinctUntilChanged(this IObservable source) => + source.DistinctUntilChanged(EqualityComparer.Default); + + /// + /// Emits values when they differ from the previous value. + /// + public static IObservable DistinctUntilChanged(this IObservable source, IEqualityComparer comparer) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + var hasValue = false; + var previous = default(T); + return source.Subscribe( + value => + { + if (!hasValue || !comparer.Equals(previous!, value)) + { + hasValue = true; + previous = value; + observer.OnNext(value); + } + }, + observer.OnError, + observer.OnCompleted); + }); + + /// + /// Takes a fixed number of values. + /// + public static IObservable Take(this IObservable source, int count) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + if (count <= 0) + { + observer.OnCompleted(); + return Disposable.Empty; + } + + var seen = 0; + var subscription = new SerialDisposable(); + subscription.Disposable = source.Subscribe( + value => + { + if (seen >= count) + { + return; + } + + observer.OnNext(value); + if (++seen == count) + { + observer.OnCompleted(); + subscription.Dispose(); + } + }, + observer.OnError, + observer.OnCompleted); + return subscription; + }); + + /// + /// Takes values until the other observable produces a value or error. + /// + public static IObservable TakeUntil(this IObservable source, IObservable other) => + Observable.Create(observer => + { + var disposables = new CompositeDisposable(); + var gate = new object(); + var stopped = false; + + void Stop(Action terminal) + { + var shouldStop = false; + lock (gate) + { + if (!stopped) + { + stopped = true; + shouldStop = true; + } + } + + if (shouldStop) + { + terminal(); + disposables.Dispose(); + } + } + + disposables.Add(source.Subscribe( + value => + { + lock (gate) + { + if (!stopped) + { + observer.OnNext(value); + } + } + }, + error => Stop(() => observer.OnError(error)), + () => Stop(observer.OnCompleted))); + + disposables.Add(other.Subscribe( + _ => Stop(observer.OnCompleted), + error => Stop(() => observer.OnError(error)), + static () => { })); + + return disposables; + }); + + /// + /// Skips a fixed number of values. + /// + public static IObservable Skip(this IObservable source, int count) + { + var seen = 0; + return source.Where(_ => seen++ >= count); + } + + /// + /// Skips values while a predicate is true. + /// + public static IObservable SkipWhile(this IObservable source, Func predicate) + { + var skipping = true; + return source.Where(value => + { + if (!skipping) + { + return true; + } + + skipping = predicate(value); + return !skipping; + }); + } + + /// + /// Invokes an action for each value. + /// + public static IObservable Do(this IObservable source, Action onNext) => + source.Do(onNext, static () => { }); + + /// + /// Invokes actions for values and errors. + /// + public static IObservable Do(this IObservable source, Action onNext, Action onError) => + source.Do(onNext, onError, static () => { }); + + /// + /// Invokes actions for values and completion. + /// + public static IObservable Do(this IObservable source, Action onNext, Action onCompleted) => + source.Do(onNext, static _ => { }, onCompleted); + + /// + /// Invokes actions for values, errors, and completion. + /// + public static IObservable Do( + this IObservable source, + Action onNext, + Action onError, + Action onCompleted) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + source.Subscribe( + value => + { + onNext(value); + observer.OnNext(value); + }, + error => + { + onError(error); + observer.OnError(error); + }, + () => + { + onCompleted(); + observer.OnCompleted(); + })); + + /// + /// Invokes an action when the subscription terminates. + /// + public static IObservable Finally(this IObservable source, Action finallyAction) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + var invoked = 0; + + void InvokeFinally() + { + if (Interlocked.Exchange(ref invoked, 1) == 0) + { + finallyAction(); + } + } + + var subscription = source.Subscribe( + observer.OnNext, + error => + { + try + { + observer.OnError(error); + } + finally + { + InvokeFinally(); + } + }, + () => + { + try + { + observer.OnCompleted(); + } + finally + { + InvokeFinally(); + } + }); + + return Disposable.Create(() => + { + subscription.Dispose(); + InvokeFinally(); + }); + }); + + /// + /// Throttles values by dropping pending values until no new value arrives for the duration. + /// + public static IObservable Throttle(this IObservable source, TimeSpan dueTime, IScheduler scheduler) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + { + var gate = new object(); + var version = 0; + var disposables = new CompositeDisposable(); + var timer = new SerialDisposable(); + disposables.Add(timer); + + disposables.Add(source.Subscribe( + value => + { + var id = Interlocked.Increment(ref version); + timer.Disposable = scheduler.Schedule(dueTime, () => + { + if (Volatile.Read(ref version) == id) + { + lock (gate) + { + observer.OnNext(value); + } + } + }); + }, + observer.OnError, + observer.OnCompleted)); + + return disposables; + }); + + /// + /// Observes values on a sequencer. + /// + public static IObservable ObserveOn(this IObservable source, IScheduler scheduler) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + source.Subscribe( + value => scheduler.Schedule(() => observer.OnNext(value)), + error => scheduler.Schedule(() => observer.OnError(error)), + () => scheduler.Schedule(observer.OnCompleted))); + + /// + /// Synchronizes observer calls with a lock. + /// + public static IObservable Synchronize(this IObservable source) => source.Synchronize(new object()); + + /// + /// Synchronizes observer calls with a lock. + /// + public static IObservable Synchronize(this IObservable source, object gate) => + ReactiveUI.Primitives.Signals.Signal.Create(observer => + source.Subscribe( + value => + { + lock (gate) + { + observer.OnNext(value); + } + }, + error => + { + lock (gate) + { + observer.OnError(error); + } + }, + () => + { + lock (gate) + { + observer.OnCompleted(); + } + })); + + /// + /// Creates a connectable observable using a subject. + /// + public static IConnectableObservable Publish(this IObservable source) => + new ConnectableObservable(source, new Subject()); + + /// + /// Creates a connectable observable that replays all values to late subscribers. + /// + public static IConnectableObservable Replay(this IObservable source) => + new ConnectableObservable(source, new ReplaySubject()); + + /// + /// Creates a connectable observable that replays buffered values to late subscribers. + /// + public static IConnectableObservable Replay(this IObservable source, int bufferSize) => + new ConnectableObservable(source, new ReplaySubject(bufferSize)); + + /// + /// Creates a connectable observable and applies a selector. + /// + public static IObservable Publish(this IObservable source, Func, IObservable> selector) => + Observable.Create(observer => + { + var connectable = source.Publish(); + var subscription = selector(connectable).Subscribe(observer); + var connection = connectable.Connect(); + return new CompositeDisposable(subscription, connection); + }); + + /// + /// Shares a single subscription while observers are present. + /// + public static IObservable RefCount(this IConnectableObservable source) + { + var gate = new object(); + var count = 0; + IDisposable? connection = null; + + return Observable.Create(observer => + { + var subscription = source.Subscribe(observer); + + lock (gate) + { + count++; + connection ??= source.Connect(); + } + + return Disposable.Create(() => + { + subscription.Dispose(); + + IDisposable? connectionToDispose = null; + lock (gate) + { + count--; + if (count == 0) + { + connectionToDispose = connection; + connection = null; + } + } + + connectionToDispose?.Dispose(); + }); + }); + } + + /// + /// Connects when the required number of observers subscribe. + /// + public static IObservable AutoConnect(this IConnectableObservable source) => source.AutoConnect(1); + + /// + /// Connects when the required number of observers subscribe. + /// + public static IObservable AutoConnect(this IConnectableObservable source, int minObservers) => + minObservers <= 0 + ? AutoConnectImmediately(source) + : Observable.Create(observer => + { + var subscription = source.Subscribe(observer); + var count = Interlocked.Increment(ref AutoConnectState.Counts.GetValue(source, static _ => new StrongBox()).Value); + if (count == minObservers) + { + AutoConnectState.Connections.GetValue(source, static item => new SerialDisposable()).Disposable = source.Connect(); + } + + return subscription; + }); + + private static IObservable AutoConnectImmediately(IConnectableObservable source) + { + var connection = AutoConnectState.Connections.GetValue(source, static _ => new SerialDisposable()); + if (connection.Disposable is null) + { + connection.Disposable = source.Connect(); + } + + return Observable.Create(source.Subscribe); + } + + /// + /// Converts an enumerable to an observable. + /// + public static IObservable ToObservable(this IEnumerable source) => + Observable.Create(observer => + { + try + { + foreach (var value in source) + { + observer.OnNext(value); + } + + observer.OnCompleted(); + } + catch (Exception error) + { + observer.OnError(error); + } + + return Disposable.Empty; + }); + + /// + /// Converts an enumerable to an observable. + /// + public static IObservable ToObservable(this IEnumerable source, IScheduler scheduler) => + Observable.Create(observer => scheduler.Schedule(() => + { + foreach (var value in source) + { + observer.OnNext(value); + } + + observer.OnCompleted(); + })); + + /// + /// Converts a task to an observable. + /// + public static IObservable ToObservable(this Task task) => + Observable.Create(observer => + { + if (task.IsCompleted) + { + EmitCompletedTask( + task, + observer, + static () => { }); + if (task.Status == TaskStatus.RanToCompletion) + { + observer.OnCompleted(); + } + + return Disposable.Empty; + } + + var disposed = 0; + _ = AwaitTask( + task, + observer, + () => + { + if (Volatile.Read(ref disposed) == 0) + { + observer.OnCompleted(); + } + }); + + return Disposable.Create(() => Interlocked.Exchange(ref disposed, 1)); + }); + + /// + /// Blocks until the observable completes and returns the collected values. + /// + public static IEnumerable ToEnumerable(this IObservable source) + { + var values = new List(); + Exception? failure = null; + using var completed = new ManualResetEventSlim(); + using var subscription = source.Subscribe( + values.Add, + error => + { + failure = error; + completed.Set(); + }, + completed.Set); + + completed.Wait(); + if (failure is not null) + { + ExceptionDispatchInfo.Capture(failure).Throw(); + } + + return values; + } + + /// + /// Collects values into a list. + /// + public static IObservable> ToList(this IObservable source) => + source.Aggregate((IList)new List(), (list, value) => + { + list.Add(value); + return list; + }); + + /// + /// Converts the observable to a task for the final value. + /// + public static Task ToTask(this IObservable source) + { + var completion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var subscription = new SerialDisposable(); + var hasValue = false; + var lastValue = default(T); + subscription.Disposable = source.Subscribe( + value => + { + hasValue = true; + lastValue = value; + }, + error => + { + subscription.Dispose(); + completion.TrySetException(error); + }, + () => + { + subscription.Dispose(); + if (hasValue) + { + completion.TrySetResult(lastValue!); + } + else + { + completion.TrySetException(new InvalidOperationException("Sequence contains no elements.")); + } + }); + + return completion.Task; + } + + /// + /// Gets an awaiter for the final observable value. + /// + public static TaskAwaiter GetAwaiter(this IObservable source) => + source.ToTask().GetAwaiter(); + + /// + /// Supplies a default value when the source is empty. + /// + public static IObservable DefaultIfEmpty(this IObservable source, T defaultValue) => + Observable.Create(observer => + { + var seen = false; + return source.Subscribe( + value => + { + seen = true; + observer.OnNext(value); + }, + observer.OnError, + () => + { + if (!seen) + { + observer.OnNext(defaultValue); + } + + observer.OnCompleted(); + }); + }); + + /// + /// Aggregates values. + /// + public static IObservable Aggregate( + this IObservable source, + TAccumulate seed, + Func accumulator) => + Observable.Create(observer => + { + var current = seed; + return source.Subscribe( + value => current = accumulator(current, value), + observer.OnError, + () => + { + observer.OnNext(current); + observer.OnCompleted(); + }); + }); + + /// + /// Collects values into an array. + /// + public static IObservable ToArray(this IObservable source) => + source.Aggregate(new List(), (list, value) => + { + list.Add(value); + return list; + }).Select(static list => list.ToArray()); + + /// + /// Determines whether any values match the predicate. + /// + public static IObservable Any(this IObservable source, Func predicate) => + Observable.Create(observer => + { + var subscription = new SerialDisposable(); + subscription.Disposable = source.Subscribe( + value => + { + if (!predicate(value)) + { + return; + } + + observer.OnNext(true); + observer.OnCompleted(); + subscription.Dispose(); + }, + observer.OnError, + () => + { + observer.OnNext(false); + observer.OnCompleted(); + }); + return subscription; + }); + + /// + /// Determines whether all values match the predicate. + /// + public static IObservable All(this IObservable source, Func predicate) => + Observable.Create(observer => + { + var subscription = new SerialDisposable(); + subscription.Disposable = source.Subscribe( + value => + { + if (predicate(value)) + { + return; + } + + observer.OnNext(false); + observer.OnCompleted(); + subscription.Dispose(); + }, + observer.OnError, + () => + { + observer.OnNext(true); + observer.OnCompleted(); + }); + return subscription; + }); + + /// + /// Counts source values. + /// + public static IObservable Count(this IObservable source) => + source.Aggregate(0, static (count, _) => count + 1); + + /// + /// Emits the last value, or the default value when the source is empty. + /// + public static IObservable LastOrDefaultAsync(this IObservable source) => + Observable.Create(observer => + { + var last = default(T); + return source.Subscribe( + value => last = value, + observer.OnError, + () => + { + observer.OnNext(last!); + observer.OnCompleted(); + }); + }); + + /// + /// Combines latest values from two sources. + /// + public static IObservable CombineLatest( + this IObservable first, + IObservable second, + Func resultSelector) => + Observable.Create(observer => + { + var gate = new object(); + var firstHasValue = false; + var secondHasValue = false; + var firstValue = default(TFirst); + var secondValue = default(TSecond); + var firstCompleted = false; + var secondCompleted = false; + + void TryComplete() + { + if (firstCompleted && secondCompleted) + { + observer.OnCompleted(); + } + } + + return new CompositeDisposable( + first.Subscribe( + value => + { + lock (gate) + { + firstValue = value; + firstHasValue = true; + if (secondHasValue) + { + observer.OnNext(resultSelector(firstValue!, secondValue!)); + } + } + }, + observer.OnError, + () => + { + lock (gate) + { + firstCompleted = true; + TryComplete(); + } + }), + second.Subscribe( + value => + { + lock (gate) + { + secondValue = value; + secondHasValue = true; + if (firstHasValue) + { + observer.OnNext(resultSelector(firstValue!, secondValue!)); + } + } + }, + observer.OnError, + () => + { + lock (gate) + { + secondCompleted = true; + TryComplete(); + } + })); + }); + + /// + /// Combines latest values from three sources. + /// + public static IObservable CombineLatest( + this IObservable source1, + IObservable source2, + IObservable source3, + Func resultSelector) => + source1.CombineLatest(source2, ValueTuple.Create).CombineLatest(source3, (pair, value3) => resultSelector(pair.Item1, pair.Item2, value3)); + + /// + /// Combines latest values from four sources. + /// + public static IObservable CombineLatest( + this IObservable source1, + IObservable source2, + IObservable source3, + IObservable source4, + Func resultSelector) => + source1.CombineLatest(source2, source3, (value1, value2, value3) => (value1, value2, value3)) + .CombineLatest(source4, (tuple, value4) => resultSelector(tuple.value1, tuple.value2, tuple.value3, value4)); + + /// + /// Combines latest values from five sources. + /// + public static IObservable CombineLatest( + this IObservable source1, + IObservable source2, + IObservable source3, + IObservable source4, + IObservable source5, + Func resultSelector) => + source1.CombineLatest(source2, source3, source4, (value1, value2, value3, value4) => (value1, value2, value3, value4)) + .CombineLatest(source5, (tuple, value5) => resultSelector(tuple.value1, tuple.value2, tuple.value3, tuple.value4, value5)); + + /// + /// Combines latest values from six sources. + /// + public static IObservable CombineLatest( + this IObservable source1, + IObservable source2, + IObservable source3, + IObservable source4, + IObservable source5, + IObservable source6, + Func resultSelector) => + source1.CombineLatest(source2, source3, source4, source5, (value1, value2, value3, value4, value5) => (value1, value2, value3, value4, value5)) + .CombineLatest(source6, (tuple, value6) => resultSelector(tuple.value1, tuple.value2, tuple.value3, tuple.value4, tuple.value5, value6)); + + /// + /// Zips two observable sources. + /// + public static IObservable Zip( + this IObservable first, + IObservable second, + Func resultSelector) => + Observable.Create(observer => + { + var gate = new object(); + var firstQueue = new Queue(); + var secondQueue = new Queue(); + var firstCompleted = false; + var secondCompleted = false; + + void Drain() + { + while (firstQueue.Count != 0 && secondQueue.Count != 0) + { + observer.OnNext(resultSelector(firstQueue.Dequeue(), secondQueue.Dequeue())); + } + + if ((firstCompleted && firstQueue.Count == 0) || (secondCompleted && secondQueue.Count == 0)) + { + observer.OnCompleted(); + } + } + + return new CompositeDisposable( + first.Subscribe( + value => + { + lock (gate) + { + firstQueue.Enqueue(value); + Drain(); + } + }, + observer.OnError, + () => + { + lock (gate) + { + firstCompleted = true; + Drain(); + } + }), + second.Subscribe( + value => + { + lock (gate) + { + secondQueue.Enqueue(value); + Drain(); + } + }, + observer.OnError, + () => + { + lock (gate) + { + secondCompleted = true; + Drain(); + } + })); + }); + + /// + /// Ignores all values and preserves termination. + /// + public static IObservable IgnoreElements(this IObservable source) => + Observable.Create(observer => source.Subscribe(static _ => { }, observer.OnError, observer.OnCompleted)); + + /// + /// Handles errors by switching to a replacement observable. + /// + public static IObservable Catch(this IObservable source, Func> handler) + where TException : Exception => + Observable.Create(observer => + { + var subscription = new SerialDisposable(); + subscription.Disposable = source.Subscribe( + observer.OnNext, + error => + { + if (error is TException typed) + { + subscription.Disposable = handler(typed).Subscribe(observer); + } + else + { + observer.OnError(error); + } + }, + observer.OnCompleted); + return subscription; + }); + + private static class AutoConnectState + { + public static readonly ConditionalWeakTable, StrongBox> Counts = new(); + public static readonly ConditionalWeakTable, SerialDisposable> Connections = new(); + } +} + +/// +/// Represents a connectable observable source. +/// +/// The element type. +internal interface IConnectableObservable : IObservable +{ + /// + /// Connects the source. + /// + /// The connection lifetime. + IDisposable Connect(); +} + +/// +/// A simple connectable observable implementation. +/// +/// The element type. +internal sealed class ConnectableObservable : IConnectableObservable +{ + private readonly IObservable _source; + private readonly ISubject _subject; + private readonly object _locker = new(); + private IDisposable? _connection; + private bool _terminated; + + /// + /// Initializes a new instance of the class. + /// + /// The source observable. + /// The multicast subject. + public ConnectableObservable(IObservable source, ISubject subject) + { + _source = source; + _subject = subject; + } + + /// + public IDisposable Connect() + { + lock (_locker) + { + if (_terminated) + { + return Disposable.Empty; + } + + if (_connection is null) + { + var subscription = _source.Subscribe( + _subject.OnNext, + error => + { + lock (_locker) + { + _terminated = true; + _connection = null; + } + + _subject.OnError(error); + }, + () => + { + lock (_locker) + { + _terminated = true; + _connection = null; + } + + _subject.OnCompleted(); + }); + + if (_terminated) + { + subscription.Dispose(); + return Disposable.Empty; + } + + IDisposable? connection = null; + connection = Disposable.Create(() => + { + subscription.Dispose(); + lock (_locker) + { + if (ReferenceEquals(_connection, connection)) + { + _connection = null; + } + } + }); + _connection = connection; + } + + return _connection; + } + } + + /// + public IDisposable Subscribe(IObserver observer) => _subject.Subscribe(observer); +} + +/// +/// A disposable that invokes two disposable actions. +/// +internal sealed class CompositeActionDisposable : IDisposable +{ + private readonly IDisposable _first; + private readonly Action _second; + + /// + /// Initializes a new instance of the class. + /// + public CompositeActionDisposable(IDisposable first, Action second) + { + _first = first; + _second = second; + } + + /// + public void Dispose() + { + _first.Dispose(); + _second(); + } +} diff --git a/src/DynamicData/Internal/Rxx.cs b/src/DynamicData/Internal/Rxx.cs deleted file mode 100644 index 8fe86a561..000000000 --- a/src/DynamicData/Internal/Rxx.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -#if NET9_0_OR_GREATER -using DynamicData.Internal; - -namespace System.Reactive.Linq; - -internal static class Rxx -{ - /// - /// Keep this class internal as it should be supplied by System.Reactive and probably will be one day. - /// - public static IObservable Synchronize(this IObservable source, Lock locker) - { - return Observable.Create(observer => - { - return source.SubscribeSafe(t => - { - lock (locker) - { - observer.OnNext(t); - } - }, ex => - { - lock (locker) - { - observer.OnError(ex); - } - }, () => - { - lock (locker) - { - observer.OnCompleted(); - } - }); - }); - } -} -#endif diff --git a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs index ace8ed4a1..0de44feb8 100644 --- a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs +++ b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Internal; /// diff --git a/src/DynamicData/Kernel/InternalEx.cs b/src/DynamicData/Kernel/InternalEx.cs index 68e6fa47d..8dfc36410 100644 --- a/src/DynamicData/Kernel/InternalEx.cs +++ b/src/DynamicData/Kernel/InternalEx.cs @@ -1,12 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Kernel; /// @@ -62,13 +57,25 @@ IObservable Retry(int failureCount) => /// The interval. /// The action. /// A disposable that will stop the schedule. - public static IDisposable ScheduleRecurringAction(this IScheduler scheduler, TimeSpan interval, Action action) => scheduler.Schedule( - interval, - scheduleNext => - { - action(); - scheduleNext(interval); - }); + public static IDisposable ScheduleRecurringAction(this IScheduler scheduler, TimeSpan interval, Action action) + { + scheduler.ThrowArgumentNullExceptionIfNull(nameof(scheduler)); + action.ThrowArgumentNullExceptionIfNull(nameof(action)); + + var disposable = new SerialDisposable(); + + void ScheduleNext() => + disposable.Disposable = scheduler.Schedule( + interval, + () => + { + action(); + ScheduleNext(); + }); + + ScheduleNext(); + return disposable; + } /// /// Schedules a recurring action. @@ -86,14 +93,22 @@ public static IDisposable ScheduleRecurringAction(this IScheduler scheduler, Fun { interval.ThrowArgumentNullExceptionIfNull(nameof(interval)); - return scheduler.Schedule( - interval(), - scheduleNext => - { - action(); - var next = interval(); - scheduleNext(next); - }); + scheduler.ThrowArgumentNullExceptionIfNull(nameof(scheduler)); + action.ThrowArgumentNullExceptionIfNull(nameof(action)); + + var disposable = new SerialDisposable(); + + void ScheduleNext() => + disposable.Disposable = scheduler.Schedule( + interval(), + () => + { + action(); + ScheduleNext(); + }); + + ScheduleNext(); + return disposable; } internal static void OnNext(this ISubject source) => source.OnNext(Unit.Default); @@ -110,6 +125,6 @@ internal static IObservable Return(Func source) => { o.OnNext(source()); o.OnCompleted(); - return () => { }; + return Disposable.Empty; }); } diff --git a/src/DynamicData/Kernel/OptionObservableExtensions.cs b/src/DynamicData/Kernel/OptionObservableExtensions.cs index bbb23a052..de8a4d7d1 100644 --- a/src/DynamicData/Kernel/OptionObservableExtensions.cs +++ b/src/DynamicData/Kernel/OptionObservableExtensions.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.Kernel; /// @@ -146,7 +144,12 @@ public static IObservable> OnHasNoValue(this IObservableAn Observable with the Values. /// Observable version of . public static IObservable SelectValues(this IObservable> source) - where T : notnull => source.Where(t => t.HasValue && t.Value is not null).Select(t => t.Value!); + where T : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + + return source.Where(t => t.HasValue && t.Value is not null).Select(t => t.Value!); + } /// /// Converts an Observable of into an IObservable of by extracting the @@ -162,6 +165,7 @@ public static IObservable ValueOr(this IObservable> source, Fu where T : notnull { source.ThrowArgumentNullExceptionIfNull(nameof(source)); + valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); return source.Select(optional => optional.HasValue ? optional.Value : valueSelector()); } diff --git a/src/DynamicData/List/Internal/AnonymousObservableList.cs b/src/DynamicData/List/Internal/AnonymousObservableList.cs index 79051b1d6..0664702d4 100644 --- a/src/DynamicData/List/Internal/AnonymousObservableList.cs +++ b/src/DynamicData/List/Internal/AnonymousObservableList.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; -using System.Reactive.Disposables; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/AutoRefresh.cs b/src/DynamicData/List/Internal/AutoRefresh.cs index da2e4dc6a..2839494ae 100644 --- a/src/DynamicData/List/Internal/AutoRefresh.cs +++ b/src/DynamicData/List/Internal/AutoRefresh.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class AutoRefresh(IObservable> source, Func> reEvaluator, TimeSpan? buffer = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/BufferIf.cs b/src/DynamicData/List/Internal/BufferIf.cs index 8f7d1993c..daadcee78 100644 --- a/src/DynamicData/List/Internal/BufferIf.cs +++ b/src/DynamicData/List/Internal/BufferIf.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.List.Internal; internal sealed class BufferIf(IObservable> source, IObservable pauseIfTrueSelector, bool initialPauseState = false, TimeSpan? timeOut = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/ClonedListChangeSet.cs b/src/DynamicData/List/Internal/ClonedListChangeSet.cs index 3b9996a1f..cbb9bc6e4 100644 --- a/src/DynamicData/List/Internal/ClonedListChangeSet.cs +++ b/src/DynamicData/List/Internal/ClonedListChangeSet.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class ClonedListChangeSet diff --git a/src/DynamicData/List/Internal/Combiner.cs b/src/DynamicData/List/Internal/Combiner.cs index 64882a3ba..6b356ed8d 100644 --- a/src/DynamicData/List/Internal/Combiner.cs +++ b/src/DynamicData/List/Internal/Combiner.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - using DynamicData.Cache.Internal; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/DeferUntilLoaded.cs b/src/DynamicData/List/Internal/DeferUntilLoaded.cs index aae382472..d76e3401a 100644 --- a/src/DynamicData/List/Internal/DeferUntilLoaded.cs +++ b/src/DynamicData/List/Internal/DeferUntilLoaded.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class DeferUntilLoaded(IObservable> source) diff --git a/src/DynamicData/List/Internal/DisposeMany.cs b/src/DynamicData/List/Internal/DisposeMany.cs index 046e19e4d..87cd29477 100644 --- a/src/DynamicData/List/Internal/DisposeMany.cs +++ b/src/DynamicData/List/Internal/DisposeMany.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class DisposeMany(IObservable> source) diff --git a/src/DynamicData/List/Internal/Distinct.cs b/src/DynamicData/List/Internal/Distinct.cs index 00ab3a458..caaafef76 100644 --- a/src/DynamicData/List/Internal/Distinct.cs +++ b/src/DynamicData/List/Internal/Distinct.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Distinct(IObservable> source, Func valueSelector) diff --git a/src/DynamicData/List/Internal/DynamicCombiner.cs b/src/DynamicData/List/Internal/DynamicCombiner.cs index bb3091378..534a43c27 100644 --- a/src/DynamicData/List/Internal/DynamicCombiner.cs +++ b/src/DynamicData/List/Internal/DynamicCombiner.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - using DynamicData.Cache.Internal; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/ExpireAfter.cs b/src/DynamicData/List/Internal/ExpireAfter.cs index 97a39c84e..43469a996 100644 --- a/src/DynamicData/List/Internal/ExpireAfter.cs +++ b/src/DynamicData/List/Internal/ExpireAfter.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - using DynamicData.Internal; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/Filter.Dynamic.cs b/src/DynamicData/List/Internal/Filter.Dynamic.cs index 8d9b5e8dc..0d59af43d 100644 --- a/src/DynamicData/List/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/List/Internal/Filter.Dynamic.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal static partial class Filter diff --git a/src/DynamicData/List/Internal/Filter.Static.cs b/src/DynamicData/List/Internal/Filter.Static.cs index 36a49c5e9..dfa23fe54 100644 --- a/src/DynamicData/List/Internal/Filter.Static.cs +++ b/src/DynamicData/List/Internal/Filter.Static.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal static partial class Filter diff --git a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs index c9f04be4f..037642deb 100644 --- a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs +++ b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - using DynamicData.Internal; namespace DynamicData.List.Internal; @@ -87,14 +85,19 @@ public void Activate( IObservable> source) { var onError = OnError; + var predicateStateSubscription = new SingleAssignmentDisposable(); + var sourceSubscription = new SingleAssignmentDisposable(); + + _predicateStateSubscription = predicateStateSubscription; + _sourceSubscription = sourceSubscription; - _predicateStateSubscription = predicateState + predicateStateSubscription.Disposable = predicateState .SubscribeSafe( onNext: OnPredicateStateNext, onError: onError, onCompleted: OnPredicateStateCompleted); - _sourceSubscription = source + sourceSubscription.Disposable = source .SubscribeSafe( onNext: OnSourceNext, onError: onError, @@ -208,6 +211,9 @@ private void OnPredicateStateCompleted() // no matter how many items come through from source, so just go ahead and complete now. if (_hasSourceCompleted || (!_isLatestPredicateStateValid && _suppressEmptyChangeSets)) { + _predicateStateSubscription?.Dispose(); + _sourceSubscription?.Dispose(); + Monitor.Enter(DownstreamSynchronizationGate, ref hasDownstreamLock); if (hasUpstreamLock) @@ -281,6 +287,9 @@ private void OnSourceCompleted() // and the source has reported that it'll never change, so go ahead and complete now. if (_hasPredicateStateCompleted || ((_itemStates.Count is 0) && _suppressEmptyChangeSets)) { + _predicateStateSubscription?.Dispose(); + _sourceSubscription?.Dispose(); + Monitor.Enter(DownstreamSynchronizationGate, ref hasDownstreamLock); if (hasUpstreamLock) diff --git a/src/DynamicData/List/Internal/FilterOnObservable.cs b/src/DynamicData/List/Internal/FilterOnObservable.cs index 1d2dae5e0..8fd8317d3 100644 --- a/src/DynamicData/List/Internal/FilterOnObservable.cs +++ b/src/DynamicData/List/Internal/FilterOnObservable.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class FilterOnObservable(IObservable> source, Func> filter, TimeSpan? buffer = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/FilterOnProperty.cs b/src/DynamicData/List/Internal/FilterOnProperty.cs index d73b8e238..2ecc2bcd3 100644 --- a/src/DynamicData/List/Internal/FilterOnProperty.cs +++ b/src/DynamicData/List/Internal/FilterOnProperty.cs @@ -1,10 +1,9 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.ComponentModel; using System.Linq.Expressions; -using System.Reactive.Concurrency; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/FilterStatic.cs b/src/DynamicData/List/Internal/FilterStatic.cs index 23786400e..bd69d9e00 100644 --- a/src/DynamicData/List/Internal/FilterStatic.cs +++ b/src/DynamicData/List/Internal/FilterStatic.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class FilterStatic(IObservable> source, Func predicate) diff --git a/src/DynamicData/List/Internal/GroupOn.cs b/src/DynamicData/List/Internal/GroupOn.cs index 6ea7deccd..adefca815 100644 --- a/src/DynamicData/List/Internal/GroupOn.cs +++ b/src/DynamicData/List/Internal/GroupOn.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class GroupOn(IObservable> source, Func groupSelector, IObservable? regrouper) diff --git a/src/DynamicData/List/Internal/GroupOnImmutable.cs b/src/DynamicData/List/Internal/GroupOnImmutable.cs index 2b4a08be8..26fbd357a 100644 --- a/src/DynamicData/List/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/List/Internal/GroupOnImmutable.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class GroupOnImmutable(IObservable> source, Func groupSelector, IObservable? reGrouper) diff --git a/src/DynamicData/List/Internal/GroupOnProperty.cs b/src/DynamicData/List/Internal/GroupOnProperty.cs index ab5998aed..2debc3d6c 100644 --- a/src/DynamicData/List/Internal/GroupOnProperty.cs +++ b/src/DynamicData/List/Internal/GroupOnProperty.cs @@ -1,11 +1,9 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.ComponentModel; using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs index 99d8b1d75..ef2e8947b 100644 --- a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs @@ -1,11 +1,9 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. using System.ComponentModel; using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/LimitSizeTo.cs b/src/DynamicData/List/Internal/LimitSizeTo.cs index c2ed74896..7408098bc 100644 --- a/src/DynamicData/List/Internal/LimitSizeTo.cs +++ b/src/DynamicData/List/Internal/LimitSizeTo.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; #if NET9_0_OR_GREATER diff --git a/src/DynamicData/List/Internal/MergeChangeSets.cs b/src/DynamicData/List/Internal/MergeChangeSets.cs index 480c69b3a..e6297834e 100644 --- a/src/DynamicData/List/Internal/MergeChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeChangeSets.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; /// diff --git a/src/DynamicData/List/Internal/MergeMany.cs b/src/DynamicData/List/Internal/MergeMany.cs index 65b238068..875e54be4 100644 --- a/src/DynamicData/List/Internal/MergeMany.cs +++ b/src/DynamicData/List/Internal/MergeMany.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.List.Internal; internal sealed class MergeMany(IObservable> source, Func> observableSelector) diff --git a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs index 3b63ea231..ca22c3ccd 100644 --- a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Cache.Internal; using DynamicData.Internal; @@ -51,7 +49,7 @@ public IObservable> Run() => Observabl changeTracker.EmitChanges(observer); parentUpdate = false; }) - .Subscribe(); + .Subscribe(static _ => { }, observer.OnError); return new CompositeDisposable(shared.Connect(), subMergeMany, subRemove); }); diff --git a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs index 482c4f46b..68f1314f5 100644 --- a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Internal; namespace DynamicData.List.Internal; @@ -47,7 +45,7 @@ public IObservable> Run() => Observable.Create { }, observer.OnError); return new CompositeDisposable(shared.Connect(), subMergeMany, subRemove); }); diff --git a/src/DynamicData/List/Internal/OnItemAdded.cs b/src/DynamicData/List/Internal/OnItemAdded.cs index c99b48d92..1c9244786 100644 --- a/src/DynamicData/List/Internal/OnItemAdded.cs +++ b/src/DynamicData/List/Internal/OnItemAdded.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal static class OnItemAdded diff --git a/src/DynamicData/List/Internal/OnItemRefreshed.cs b/src/DynamicData/List/Internal/OnItemRefreshed.cs index f12e68294..5b7b1d795 100644 --- a/src/DynamicData/List/Internal/OnItemRefreshed.cs +++ b/src/DynamicData/List/Internal/OnItemRefreshed.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal static class OnItemRefreshed diff --git a/src/DynamicData/List/Internal/OnItemRemoved.cs b/src/DynamicData/List/Internal/OnItemRemoved.cs index 178066bf2..f87fa0bbf 100644 --- a/src/DynamicData/List/Internal/OnItemRemoved.cs +++ b/src/DynamicData/List/Internal/OnItemRemoved.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal static class OnItemRemoved diff --git a/src/DynamicData/List/Internal/Pager.cs b/src/DynamicData/List/Internal/Pager.cs index bd3238d2a..b9ac0fcbd 100644 --- a/src/DynamicData/List/Internal/Pager.cs +++ b/src/DynamicData/List/Internal/Pager.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Collections; -using System.Reactive.Linq; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/QueryWhenChanged.cs b/src/DynamicData/List/Internal/QueryWhenChanged.cs index ef58d4925..7f7b1ab1f 100644 --- a/src/DynamicData/List/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/List/Internal/QueryWhenChanged.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class QueryWhenChanged(IObservable> source) diff --git a/src/DynamicData/List/Internal/RefCount.cs b/src/DynamicData/List/Internal/RefCount.cs index b40036c3e..6994fcb15 100644 --- a/src/DynamicData/List/Internal/RefCount.cs +++ b/src/DynamicData/List/Internal/RefCount.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class RefCount(IObservable> source) diff --git a/src/DynamicData/List/Internal/Sort.cs b/src/DynamicData/List/Internal/Sort.cs index ff03e2e70..92c30a66e 100644 --- a/src/DynamicData/List/Internal/Sort.cs +++ b/src/DynamicData/List/Internal/Sort.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Sort(IObservable> source, IComparer? comparer, SortOptions sortOptions, IObservable? resort, IObservable>? comparerObservable, int resetThreshold) diff --git a/src/DynamicData/List/Internal/SubscribeMany.cs b/src/DynamicData/List/Internal/SubscribeMany.cs index 75075b04e..0d2f2f881 100644 --- a/src/DynamicData/List/Internal/SubscribeMany.cs +++ b/src/DynamicData/List/Internal/SubscribeMany.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class SubscribeMany(IObservable> source, Func subscriptionFactory) diff --git a/src/DynamicData/List/Internal/Switch.cs b/src/DynamicData/List/Internal/Switch.cs index 9425771dd..3e55c1bda 100644 --- a/src/DynamicData/List/Internal/Switch.cs +++ b/src/DynamicData/List/Internal/Switch.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Switch(IObservable>> sources) diff --git a/src/DynamicData/List/Internal/ToObservableChangeSet.cs b/src/DynamicData/List/Internal/ToObservableChangeSet.cs index 8d1f853d2..49632249c 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -1,11 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - using DynamicData.Internal; namespace DynamicData.List.Internal; @@ -234,7 +230,7 @@ private void OnSourceNext(IEnumerable upstreamItems) var lifetime = _expireAfter?.Invoke(item); if (lifetime is TimeSpan lifetimeValue) { - var expireAtTicks = (now + Scheduler.Normalize(lifetimeValue)).UtcTicks; + var expireAtTicks = (now + Sequencer.Normalize(lifetimeValue)).UtcTicks; var expireAt = new DateTimeOffset(ticks: expireAtTicks - (expireAtTicks % TimeSpan.TicksPerMillisecond), offset: TimeSpan.Zero); var expiration = new Expiration() diff --git a/src/DynamicData/List/Internal/TransformAsync.cs b/src/DynamicData/List/Internal/TransformAsync.cs index b43edc030..51671c5bd 100644 --- a/src/DynamicData/List/Internal/TransformAsync.cs +++ b/src/DynamicData/List/Internal/TransformAsync.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class TransformAsync diff --git a/src/DynamicData/List/Internal/TransformMany.cs b/src/DynamicData/List/Internal/TransformMany.cs index d7bb2a69e..2c7da46e6 100644 --- a/src/DynamicData/List/Internal/TransformMany.cs +++ b/src/DynamicData/List/Internal/TransformMany.cs @@ -4,8 +4,6 @@ using System.Collections; using System.Collections.ObjectModel; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; diff --git a/src/DynamicData/List/Internal/Transformer.cs b/src/DynamicData/List/Internal/Transformer.cs index 69dbb11b2..56689ac91 100644 --- a/src/DynamicData/List/Internal/Transformer.cs +++ b/src/DynamicData/List/Internal/Transformer.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Transformer diff --git a/src/DynamicData/List/Internal/Virtualiser.cs b/src/DynamicData/List/Internal/Virtualiser.cs index bb2f894c2..ff6438a86 100644 --- a/src/DynamicData/List/Internal/Virtualiser.cs +++ b/src/DynamicData/List/Internal/Virtualiser.cs @@ -1,9 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Virtualiser(IObservable> source, IObservable requests) diff --git a/src/DynamicData/List/ObservableListEx.Adapt.cs b/src/DynamicData/List/ObservableListEx.Adapt.cs index 942d943c7..5881b1da6 100644 --- a/src/DynamicData/List/ObservableListEx.Adapt.cs +++ b/src/DynamicData/List/ObservableListEx.Adapt.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.AddKey.cs b/src/DynamicData/List/ObservableListEx.AddKey.cs index 0ead13a87..5666a0512 100644 --- a/src/DynamicData/List/ObservableListEx.AddKey.cs +++ b/src/DynamicData/List/ObservableListEx.AddKey.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.And.cs b/src/DynamicData/List/ObservableListEx.And.cs index 2dee36d90..1bc72f159 100644 --- a/src/DynamicData/List/ObservableListEx.And.cs +++ b/src/DynamicData/List/ObservableListEx.And.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.AsObservableList.cs b/src/DynamicData/List/ObservableListEx.AsObservableList.cs index 478ae5b63..65aeab586 100644 --- a/src/DynamicData/List/ObservableListEx.AsObservableList.cs +++ b/src/DynamicData/List/ObservableListEx.AsObservableList.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs index d5e0660f8..495a29b8b 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs index dc3ede92c..6a10facb5 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Bind.cs b/src/DynamicData/List/ObservableListEx.Bind.cs index fe14bece5..05e6977e5 100644 --- a/src/DynamicData/List/ObservableListEx.Bind.cs +++ b/src/DynamicData/List/ObservableListEx.Bind.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.BufferIf.cs b/src/DynamicData/List/ObservableListEx.BufferIf.cs index 37224290f..befea2a75 100644 --- a/src/DynamicData/List/ObservableListEx.BufferIf.cs +++ b/src/DynamicData/List/ObservableListEx.BufferIf.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.BufferInitial.cs b/src/DynamicData/List/ObservableListEx.BufferInitial.cs index 17ad6d43b..222b74b77 100644 --- a/src/DynamicData/List/ObservableListEx.BufferInitial.cs +++ b/src/DynamicData/List/ObservableListEx.BufferInitial.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Cast.cs b/src/DynamicData/List/ObservableListEx.Cast.cs index 7c0f9aad7..1a258601e 100644 --- a/src/DynamicData/List/ObservableListEx.Cast.cs +++ b/src/DynamicData/List/ObservableListEx.Cast.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.CastToObject.cs b/src/DynamicData/List/ObservableListEx.CastToObject.cs index 4695297da..c7ebe885e 100644 --- a/src/DynamicData/List/ObservableListEx.CastToObject.cs +++ b/src/DynamicData/List/ObservableListEx.CastToObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Clone.cs b/src/DynamicData/List/ObservableListEx.Clone.cs index 2588c8927..51264a1e5 100644 --- a/src/DynamicData/List/ObservableListEx.Clone.cs +++ b/src/DynamicData/List/ObservableListEx.Clone.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Combine.cs b/src/DynamicData/List/ObservableListEx.Combine.cs index 13a617439..3e2911456 100644 --- a/src/DynamicData/List/ObservableListEx.Combine.cs +++ b/src/DynamicData/List/ObservableListEx.Combine.cs @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Convert.cs b/src/DynamicData/List/ObservableListEx.Convert.cs index 4380c296d..473c8768a 100644 --- a/src/DynamicData/List/ObservableListEx.Convert.cs +++ b/src/DynamicData/List/ObservableListEx.Convert.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs index 1e6b5d037..e30fdee68 100644 --- a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs +++ b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.DisposeMany.cs b/src/DynamicData/List/ObservableListEx.DisposeMany.cs index ec463f21d..28539195b 100644 --- a/src/DynamicData/List/ObservableListEx.DisposeMany.cs +++ b/src/DynamicData/List/ObservableListEx.DisposeMany.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.DistinctValues.cs b/src/DynamicData/List/ObservableListEx.DistinctValues.cs index 39181d6c8..08b03f670 100644 --- a/src/DynamicData/List/ObservableListEx.DistinctValues.cs +++ b/src/DynamicData/List/ObservableListEx.DistinctValues.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Except.cs b/src/DynamicData/List/ObservableListEx.Except.cs index 7c19912d8..04d954b43 100644 --- a/src/DynamicData/List/ObservableListEx.Except.cs +++ b/src/DynamicData/List/ObservableListEx.Except.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs index 4df348372..e6f997e74 100644 --- a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs +++ b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Filter.cs b/src/DynamicData/List/ObservableListEx.Filter.cs index 2165375b0..8cd9cd72e 100644 --- a/src/DynamicData/List/ObservableListEx.Filter.cs +++ b/src/DynamicData/List/ObservableListEx.Filter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs index bd49bf1db..a4976b6f7 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs index b9b297d77..1cb19a849 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs index 667a494ad..6d71f667c 100644 --- a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs +++ b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; @@ -24,7 +20,7 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Flattens buffered changesets (e.g. from ) back into single changesets. + /// Flattens buffered changesets back into single changesets. /// Empty buffers are dropped. /// /// The type of the item. diff --git a/src/DynamicData/List/ObservableListEx.ForEachChange.cs b/src/DynamicData/List/ObservableListEx.ForEachChange.cs index f4066e413..1a8a789bd 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachChange.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs index f39760fac..74feafd1d 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.GroupOn.cs b/src/DynamicData/List/ObservableListEx.GroupOn.cs index 180c98ff6..59b851f28 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOn.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOn.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs index 4bf1bb98a..97ebc337f 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs index dad726079..9cce8d9ea 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs index b607a56f4..d01b9d3c2 100644 --- a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs index fd01dcfa6..4c5aa3852 100644 --- a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs +++ b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs index 4f58c05cc..9a33edf9f 100644 --- a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.MergeMany.cs b/src/DynamicData/List/ObservableListEx.MergeMany.cs index 55dfa4f19..103a54efe 100644 --- a/src/DynamicData/List/ObservableListEx.MergeMany.cs +++ b/src/DynamicData/List/ObservableListEx.MergeMany.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs index e10118cef..f599b1bb1 100644 --- a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.NotEmpty.cs b/src/DynamicData/List/ObservableListEx.NotEmpty.cs index efc183cb6..42bb32c7f 100644 --- a/src/DynamicData/List/ObservableListEx.NotEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.NotEmpty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs index f07beed67..26fdc02c0 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs index 53824aba0..1974843b4 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs index 7a63f9247..9c17b1493 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Or.cs b/src/DynamicData/List/ObservableListEx.Or.cs index b47acd986..ff6878549 100644 --- a/src/DynamicData/List/ObservableListEx.Or.cs +++ b/src/DynamicData/List/ObservableListEx.Or.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Page.cs b/src/DynamicData/List/ObservableListEx.Page.cs index da8dc2c3d..40bee2a52 100644 --- a/src/DynamicData/List/ObservableListEx.Page.cs +++ b/src/DynamicData/List/ObservableListEx.Page.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.PopulateInto.cs b/src/DynamicData/List/ObservableListEx.PopulateInto.cs index d5431ff4a..b07b8ba14 100644 --- a/src/DynamicData/List/ObservableListEx.PopulateInto.cs +++ b/src/DynamicData/List/ObservableListEx.PopulateInto.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs index 0e9984894..ec45132fd 100644 --- a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs +++ b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.RefCount.cs b/src/DynamicData/List/ObservableListEx.RefCount.cs index 4e8f03a10..7dd16dbf4 100644 --- a/src/DynamicData/List/ObservableListEx.RefCount.cs +++ b/src/DynamicData/List/ObservableListEx.RefCount.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs index 9f0e434f7..ac9338511 100644 --- a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs +++ b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Reverse.cs b/src/DynamicData/List/ObservableListEx.Reverse.cs index 757954e35..6347982cf 100644 --- a/src/DynamicData/List/ObservableListEx.Reverse.cs +++ b/src/DynamicData/List/ObservableListEx.Reverse.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.SkipInitial.cs b/src/DynamicData/List/ObservableListEx.SkipInitial.cs index a7d50fbf0..41803eb3c 100644 --- a/src/DynamicData/List/ObservableListEx.SkipInitial.cs +++ b/src/DynamicData/List/ObservableListEx.SkipInitial.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Sort.cs b/src/DynamicData/List/ObservableListEx.Sort.cs index c0c67e484..b2e559197 100644 --- a/src/DynamicData/List/ObservableListEx.Sort.cs +++ b/src/DynamicData/List/ObservableListEx.Sort.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs index 91c7100e0..646d8d026 100644 --- a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs index 6f4745a2a..cbfbdcecb 100644 --- a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs +++ b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs index ac040d07f..77eada53a 100644 --- a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Switch.cs b/src/DynamicData/List/ObservableListEx.Switch.cs index 0df10e44b..9fdd2c2f8 100644 --- a/src/DynamicData/List/ObservableListEx.Switch.cs +++ b/src/DynamicData/List/ObservableListEx.Switch.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.ToCollection.cs b/src/DynamicData/List/ObservableListEx.ToCollection.cs index 072451c92..652e333e3 100644 --- a/src/DynamicData/List/ObservableListEx.ToCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs index 1c465dddc..5390ec9d3 100644 --- a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs +++ b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs index 860079901..bff9727a7 100644 --- a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Top.cs b/src/DynamicData/List/ObservableListEx.Top.cs index 17a128f99..4efe40a6c 100644 --- a/src/DynamicData/List/ObservableListEx.Top.cs +++ b/src/DynamicData/List/ObservableListEx.Top.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Transform.cs b/src/DynamicData/List/ObservableListEx.Transform.cs index 64a856a24..b8b4fcace 100644 --- a/src/DynamicData/List/ObservableListEx.Transform.cs +++ b/src/DynamicData/List/ObservableListEx.Transform.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.TransformAsync.cs b/src/DynamicData/List/ObservableListEx.TransformAsync.cs index 998eb1419..37fdec36c 100644 --- a/src/DynamicData/List/ObservableListEx.TransformAsync.cs +++ b/src/DynamicData/List/ObservableListEx.TransformAsync.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.TransformMany.cs b/src/DynamicData/List/ObservableListEx.TransformMany.cs index 6b3e3e327..e5f04b46a 100644 --- a/src/DynamicData/List/ObservableListEx.TransformMany.cs +++ b/src/DynamicData/List/ObservableListEx.TransformMany.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Virtualise.cs b/src/DynamicData/List/ObservableListEx.Virtualise.cs index a2d2ec09d..515b5a9b7 100644 --- a/src/DynamicData/List/ObservableListEx.Virtualise.cs +++ b/src/DynamicData/List/ObservableListEx.Virtualise.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs index a6529e3f3..52f88c75e 100644 --- a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs index 4a91bd035..5d7dfccaf 100644 --- a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs index 0328218fc..3ec0b886c 100644 --- a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs index c2e61653d..714bbd536 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs index aabb2b3c2..9562aa145 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.Xor.cs b/src/DynamicData/List/ObservableListEx.Xor.cs index b63b5c6d0..bb55c0215 100644 --- a/src/DynamicData/List/ObservableListEx.Xor.cs +++ b/src/DynamicData/List/ObservableListEx.Xor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/ObservableListEx.cs b/src/DynamicData/List/ObservableListEx.cs index ffe07170a..c215f03e5 100644 --- a/src/DynamicData/List/ObservableListEx.cs +++ b/src/DynamicData/List/ObservableListEx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -6,10 +6,6 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; diff --git a/src/DynamicData/List/SourceList.cs b/src/DynamicData/List/SourceList.cs index 3db42bc11..e0d347af8 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.cs @@ -3,9 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; using DynamicData.List.Internal; @@ -22,7 +19,7 @@ public sealed class SourceList : ISourceList { private readonly ISubject> _changes = new Subject>(); - private readonly Subject> _changesPreview = new(); + private readonly ISubject> _changesPreview = new Subject>(); private readonly IDisposable _cleanUp; @@ -111,7 +108,6 @@ public IObservable> Connect(Func? predicate = null) public void Dispose() { _cleanUp.Dispose(); - _changesPreview.Dispose(); } /// diff --git a/src/DynamicData/List/Tests/ChangeSetAggregator.cs b/src/DynamicData/List/Tests/ChangeSetAggregator.cs index afac4458b..4de790d0d 100644 --- a/src/DynamicData/List/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/List/Tests/ChangeSetAggregator.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData.Tests; diff --git a/src/DynamicData/ObservableChangeSet.cs b/src/DynamicData/ObservableChangeSet.cs index e9106b3e3..f4f48c45a 100644 --- a/src/DynamicData/ObservableChangeSet.cs +++ b/src/DynamicData/ObservableChangeSet.cs @@ -1,10 +1,7 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData; /// @@ -56,6 +53,7 @@ public static IObservable> Create(Func< { var cache = new SourceCache(keySelector); var disposable = new SingleAssignmentDisposable(); + var responder = cache.Connect().SubscribeSafe(observer); try { @@ -66,7 +64,7 @@ public static IObservable> Create(Func< observer.OnError(e); } - return new CompositeDisposable(disposable, Disposable.Create(observer.OnCompleted), cache.Connect().SubscribeSafe(observer), cache); + return new CompositeDisposable(disposable, Disposable.Create(observer.OnCompleted), responder, cache); }); } @@ -288,6 +286,7 @@ public static IObservable> Create(Func, IDisposa { var list = new SourceList(); IDisposable? disposeAction = null; + var responder = list.Connect().SubscribeSafe(observer); try { @@ -299,7 +298,7 @@ public static IObservable> Create(Func, IDisposa } return new CompositeDisposable( - list.Connect().SubscribeSafe(observer), + responder, list, Disposable.Create( () => diff --git a/src/DynamicData/Platforms/net45/PFilter.cs b/src/DynamicData/Platforms/net45/PFilter.cs index f4aff797e..375de57cc 100644 --- a/src/DynamicData/Platforms/net45/PFilter.cs +++ b/src/DynamicData/Platforms/net45/PFilter.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. #if P_LINQ -using System.Reactive.Linq; using DynamicData.Cache.Internal; diff --git a/src/DynamicData/Platforms/net45/PSubscribeMany.cs b/src/DynamicData/Platforms/net45/PSubscribeMany.cs index 4c9e4be35..d9a40ebe2 100644 --- a/src/DynamicData/Platforms/net45/PSubscribeMany.cs +++ b/src/DynamicData/Platforms/net45/PSubscribeMany.cs @@ -3,8 +3,6 @@ // See the LICENSE file in the project root for full license information. #if P_LINQ -using System.Reactive.Disposables; -using System.Reactive.Linq; // ReSharper disable once CheckNamespace namespace DynamicData.PLinq diff --git a/src/DynamicData/Platforms/net45/PTransform.cs b/src/DynamicData/Platforms/net45/PTransform.cs index a9871c335..4bfebda30 100644 --- a/src/DynamicData/Platforms/net45/PTransform.cs +++ b/src/DynamicData/Platforms/net45/PTransform.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. #if P_LINQ -using System.Reactive.Linq; // ReSharper disable once CheckNamespace namespace DynamicData.PLinq From c96163ac0402b97e554448304b062e96f01c0167 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Thu, 18 Jun 2026 01:00:18 +0100 Subject: [PATCH 02/36] Add Reactive project and update tests/benchmarks Add a new DynamicData.Reactive project (reactive-preprocessed.xml) and update the codebase to integrate reactive support. This change includes coordinated updates across benchmarks, test fixtures, cache internals, binding code, utilities, and many ObservableCache/ObservableCacheEx implementations to align with API/behavior changes and the new reactive module. --- src/Directory.Build.props | 3 +- src/Directory.Build.targets | 8 +- .../Cache/DeliveryQueueBenchmarks.cs | 5 - .../Cache/DisposeMany_Cache.cs | 2 - src/DynamicData.Benchmarks/Cache/EditDiff.cs | 4 - .../Cache/ExpireAfter_Cache_ForSource.cs | 4 +- .../Cache/ExpireAfter_Cache_ForStream.cs | 2 - .../Cache/FilterImmutable.cs | 3 - .../Cache/Filter_Cache_WithPredicateState.cs | 2 - .../Cache/SortAndBindChange.cs | 2 - .../Cache/SortAndBindInitial.cs | 2 - .../Cache/SourceCache.cs | 2 - .../Cache/StatelessFiltering.cs | 3 - .../Cache/StatelessTransforming.cs | 4 - .../Cache/ToObservableChangeSet_Cache.cs | 4 - .../Cache/TransformImmutable.cs | 4 - .../Cache/TransformMany.cs | 4 - .../DynamicData.Benchmarks.csproj | 2 +- .../List/DisposeMany_List.cs | 2 - .../List/ExpireAfter_List.cs | 4 +- ...lter_List_Static_RandomizedBoundedEdits.cs | 3 - ...er_List_Static_RandomizedUnboundedEdits.cs | 3 - .../List/Filter_List_WithPredicateState.cs | 2 - src/DynamicData.Benchmarks/List/GroupAdd.cs | 3 - .../List/GroupRemove.cs | 3 - src/DynamicData.Benchmarks/List/SourceList.cs | 2 - .../List/ToObservableChangeSet_List.cs | 2 - src/DynamicData.Benchmarks/Program.cs | 1 - .../DynamicData.Reactive.csproj | 54 + .../reactive-preprocessed.xml | 20024 ++++++++++++++++ ...s.DynamicDataTests.DotNet10_0.verified.txt | 3104 +++ src/DynamicData.Tests/API/ApiApprovalTests.cs | 2 - src/DynamicData.Tests/API/ApiExtensions.cs | 5 +- .../AggregationTests/AggregationFixture.cs | 4 - .../AggregationTests/AverageFixture.cs | 4 - .../AggregationTests/MaxFixture.cs | 4 - .../AggregationTests/MinFixture.cs | 4 - .../AggregationTests/SumFixture.cs | 4 - src/DynamicData.Tests/AutoRefreshFilter.cs | 4 - .../Binding/AvaloniaDictionaryFixture.cs | 6 +- .../Binding/BindingLIstBindListFixture.cs | 4 - .../Binding/BindingListBindCacheFixture.cs | 4 - .../BindingListBindCacheSortedFixture.cs | 5 - .../Binding/BindingListToChangeSetFixture.cs | 4 - ...eeplyNestedNotifyPropertyChangedFixture.cs | 5 - .../IObservableListBindCacheFixture.cs | 7 +- .../IObservableListBindCacheSortedFixture.cs | 6 - .../Binding/IObservableListBindListFixture.cs | 4 - .../Binding/NotifyPropertyChangedExFixture.cs | 8 +- .../ObservableCollectionBindCacheFixture.cs | 4 - ...ervableCollectionBindCacheSortedFixture.cs | 4 - .../ObservableCollectionBindListFixture.cs | 5 - ...bleCollectionExtendedToChangeSetFixture.cs | 4 - .../ObservableCollectionToChangeSetFixture.cs | 4 - ...yObservableCollectionToChangeSetFixture.cs | 4 - .../ReadonlyCollectionBindCacheFixture.cs | 3 - .../WhenPropertyChangedBehaviorFixture.cs | 4 - .../Binding/WhenPropertyChangedRaceFixture.cs | 8 - src/DynamicData.Tests/Cache/AndFixture.cs | 6 - ...syncDisposeManyFixture.IntegrationTests.cs | 7 - .../AsyncDisposeManyFixture.UnitTests.cs | 7 - .../Cache/AsyncDisposeManyFixture.cs | 5 +- .../Cache/AutoRefreshFixture.Base.cs | 6 - ...AutoRefreshFixture.WithPropertyAccessor.cs | 5 - ...oRefreshFixture.WithoutPropertyAccessor.cs | 6 - .../AutoRefreshOnObservableFixture.Base.cs | 6 - .../AutoRefreshOnObservableFixture.WithKey.cs | 3 - ...toRefreshOnObservableFixture.WithoutKey.cs | 3 - .../Cache/AutoRefreshOnObservableFixture.cs | 3 - src/DynamicData.Tests/Cache/BatchFixture.cs | 4 - src/DynamicData.Tests/Cache/BatchIfFixture.cs | 4 - .../Cache/BatchIfWithTimeOutFixture.cs | 4 - .../Cache/BufferInitialFixture.cs | 6 - .../Cache/CrossCacheDeadlockStressTest.cs | 9 - .../Cache/DeadlockTortureTest.cs | 6 - .../Cache/DeferUntilLoadedFixture.cs | 5 - .../Cache/DisposeManyFixture.cs | 5 - .../Cache/DistinctFixture.cs | 5 - .../Cache/DynamicAndFixture.cs | 5 - .../Cache/DynamicExceptFixture.cs | 5 - .../Cache/DynamicOrFixture.cs | 5 - .../Cache/DynamicXorFixture.cs | 5 - .../Cache/EditDiffChangeSetFixture.cs | 5 - .../Cache/EditDiffChangeSetOptionalFixture.cs | 5 - .../Cache/EditDiffFixture.cs | 7 +- .../Cache/EnsureUniqueKeysFixture.cs | 4 - src/DynamicData.Tests/Cache/ExceptFixture.cs | 5 - .../Cache/ExpireAfterFixture.ForSource.cs | 7 - .../Cache/ExpireAfterFixture.ForStream.cs | 7 - .../Cache/ExpireAfterFixture.cs | 2 - .../Cache/FilterFixture.Base.cs | 6 - ...xture.DynamicPredicate.IntegrationTests.cs | 7 - ...ilterFixture.DynamicPredicate.UnitTests.cs | 6 - ...redicateAndReFiltering.IntegrationTests.cs | 7 - ...ynamicPredicateAndReFiltering.UnitTests.cs | 6 - ....DynamicPredicateState.IntegrationTests.cs | 6 - ...Fixture.DynamicPredicateState.UnitTests.cs | 6 - .../Cache/FilterFixture.Static.cs | 5 - src/DynamicData.Tests/Cache/FilterFixture.cs | 3 - .../Cache/FilterImmutableFixture.cs | 4 - .../Cache/FilterOnConnectFixture.cs | 4 +- .../Cache/FilterOnObservableFixture.cs | 4 - .../Cache/FilterParallelFixture.cs | 5 - .../Cache/ForEachChangeFixture.cs | 5 - .../Cache/FromAsyncFixture.cs | 7 - .../Cache/FullJoinFixture.cs | 5 - .../Cache/FullJoinManyFixture.cs | 5 - .../Cache/GroupControllerFixture.cs | 5 - .../GroupControllerForFilteredItemsFixture.cs | 5 - src/DynamicData.Tests/Cache/GroupFixture.cs | 5 - .../Cache/GroupFromDistinctFixture.cs | 6 - .../Cache/GroupImmutableFixture.cs | 7 +- .../Cache/GroupOnDynamicFixture.cs | 6 - .../Cache/GroupOnObservableFixture.cs | 5 - .../Cache/GroupOnPropertyFixture.cs | 7 +- ...roupOnPropertyWithImmutableStateFixture.cs | 7 +- .../Cache/IgnoreUpdateFixture.cs | 6 +- .../Cache/IncludeUpdateFixture.cs | 6 +- .../Cache/InnerJoinFixture.cs | 6 - .../Cache/InnerJoinFixtureRaceCondition.cs | 4 - .../Cache/InnerJoinManyFixture.cs | 5 - .../Cache/KeyValueCollectionEx.cs | 3 - .../Cache/LeftJoinFixture.cs | 6 - .../Cache/LeftJoinManyFixture.cs | 5 - .../Cache/MergeChangeSetsFixture.cs | 6 - .../Cache/MergeManyChangeSetsCacheFixture.cs | 7 - ...ManyChangeSetsCacheSourceCompareFixture.cs | 7 - .../Cache/MergeManyChangeSetsListFixture.cs | 6 - .../Cache/MergeManyFixture.cs | 4 - .../Cache/MergeManyItemsFixture.cs | 4 - .../Cache/MergeManyWithKeyOverloadFixture.cs | 4 - .../Cache/MonitorStatusFixture.cs | 4 - .../Cache/ObservableCachePreviewFixture.cs | 7 +- .../Cache/ObservableChangeSetFixture.cs | 6 - src/DynamicData.Tests/Cache/OfTypeFixture.cs | 7 +- src/DynamicData.Tests/Cache/OnItemFixture.cs | 3 - src/DynamicData.Tests/Cache/OrFixture.cs | 6 - src/DynamicData.Tests/Cache/PageFixture.cs | 6 - .../Cache/QueryWhenChangedFixture.cs | 4 - .../Cache/RefCountFixture.cs | 6 - .../Cache/RightJoinFixture.cs | 6 - .../Cache/RightJoinManyFixture.cs | 5 - .../Cache/SizeLimitFixture.cs | 5 - .../Cache/SortAndBindFixture.cs | 4 - .../Cache/SortAndBindObservableFixture.cs | 4 - .../Cache/SortAndPageAndBindFixture.cs | 5 - .../Cache/SortAndPageFixture.cs | 6 - .../Cache/SortAndVirtualizeAndBindFixture.cs | 4 - .../Cache/SortAndVirtualizeFixture.cs | 5 - src/DynamicData.Tests/Cache/SortFixture.cs | 6 - .../Cache/SortObservableFixtureFixture.cs | 6 - .../Cache/SourceCacheFixture.cs | 8 - .../Cache/SubscribeManyFixture.cs | 5 - .../Cache/SuspendNotificationsFixture.cs | 7 - src/DynamicData.Tests/Cache/SwitchFixture.cs | 5 - ...ChangeSetFixture.Items.IntegrationTests.cs | 7 - ...ervableChangeSetFixture.Items.UnitTests.cs | 6 - ...geSetFixture.Sequences.IntegrationTests.cs | 7 - ...bleChangeSetFixture.Sequences.UnitTests.cs | 7 - .../Cache/ToObservableChangeSetFixture.cs | 4 +- .../Cache/ToObservableOptionalFixture.cs | 6 - .../Cache/ToSortedCollectionFixture.cs | 6 - .../Cache/TransformAsyncFixture.cs | 4 - .../Cache/TransformFixture.cs | 5 - .../Cache/TransformFixtureParallel.cs | 5 - .../Cache/TransformImmutableFixture.cs | 4 - .../Cache/TransformManyAsyncFixture.cs | 6 - .../Cache/TransformManyFixture.cs | 7 +- .../TransformManyObservableCacheFixture.cs | 4 - .../Cache/TransformManyRefreshFixture.cs | 7 +- .../Cache/TransformManySimpleFixture.cs | 6 +- .../Cache/TransformOnObservableFixture.cs | 6 - .../Cache/TransformSafeAsyncFixture.cs | 6 - .../Cache/TransformSafeFixture.cs | 6 - .../Cache/TransformSafeParallelFixture.cs | 6 - .../Cache/TransformTreeFixture.cs | 6 - .../Cache/TransformTreeWithRefreshFixture.cs | 7 +- .../Cache/TransformWithInlineUpdateFixture.cs | 4 - .../Cache/TrueForAllFixture.cs | 4 - .../Cache/TrueForAnyFixture.cs | 6 - src/DynamicData.Tests/Cache/WatchFixture.cs | 5 - src/DynamicData.Tests/Cache/WatcherFixture.cs | 6 - src/DynamicData.Tests/Cache/XorFixture.cs | 5 - src/DynamicData.Tests/Domain/Animal.cs | 5 +- src/DynamicData.Tests/Domain/AnimalOwner.cs | 2 - src/DynamicData.Tests/Domain/Fakers.cs | 5 +- src/DynamicData.Tests/Domain/Market.cs | 5 - src/DynamicData.Tests/Domain/MarketPrice.cs | 4 +- .../Domain/ParentAndChildren.cs | 4 +- src/DynamicData.Tests/Domain/Person.cs | 5 +- src/DynamicData.Tests/Domain/PersonObs.cs | 3 - .../Domain/PersonWithChildren.cs | 3 - .../Domain/PersonWithEmployment.cs | 2 - .../Domain/PersonWithFriends.cs | 3 - .../Domain/PersonWithGender.cs | 4 +- .../Domain/PersonWithRelations.cs | 3 - .../Domain/RandomPersonGenerator.cs | 6 +- .../Domain/SelfObservingPerson.cs | 2 - .../DynamicData.Tests.csproj | 2 +- src/DynamicData.Tests/EnumerableExFixtures.cs | 6 +- .../EnumerableIListFixture.cs | 3 - .../IntegrationTestFixtureBase.cs | 4 +- .../Internal/BitsetFixture.cs | 2 - .../CacheParentSubscriptionFixture.cs | 11 - .../Internal/DeliveryQueueFixture.cs | 8 - .../Internal/KeyedDisposableFixture.cs | 5 - .../Internal/NotificationFixture.cs | 4 - .../Internal/SharedDeliveryQueueFixture.cs | 8 - .../Internal/SwappableLockFixture.cs | 3 - .../Issues/EmptyToChangeSetIssue.cs | 1 - .../Issues/OnItemRemovedIssue.cs | 3 - .../Kernal/CacheUpdaterFixture.cs | 6 +- .../Kernal/DistinctUpdateFixture.cs | 6 +- src/DynamicData.Tests/Kernal/EnumerableEx.cs | 3 - .../Kernal/KeyValueFixture.cs | 6 +- src/DynamicData.Tests/Kernal/OptionFixture.cs | 5 +- .../Kernal/OptionObservableFixture.cs | 5 - .../Kernal/SourceUpdaterFixture.cs | 4 - src/DynamicData.Tests/Kernal/UpdateFixture.cs | 6 +- src/DynamicData.Tests/List/AndFixture.cs | 6 - .../List/AutoRefreshFixture.cs | 5 - src/DynamicData.Tests/List/BatchFixture.cs | 4 - src/DynamicData.Tests/List/BatchIfFixture.cs | 4 - .../List/BatchIfWithTimeOutFixture.cs | 4 - src/DynamicData.Tests/List/BufferFixture.cs | 4 - .../List/BufferInitialFixture.cs | 6 - src/DynamicData.Tests/List/CastFixture.cs | 7 +- .../List/ChangeAwareListFixture.cs | 7 +- .../List/ChangeSetFixture.cs | 14 +- .../List/CloneChangesFixture.cs | 4 - src/DynamicData.Tests/List/CloneFixture.cs | 7 +- .../List/CreationFixtures.cs | 5 - .../List/DeferUntilLoadedFixture.cs | 5 - .../List/DisposeManyFixture.cs | 5 - .../List/DistinctValuesFixture.cs | 5 - .../List/DynamicAndFixture.cs | 5 - .../List/DynamicExceptFixture.cs | 5 - .../List/DynamicOrFixture.cs | 5 - .../List/DynamicXOrFixture.cs | 5 - src/DynamicData.Tests/List/EditDiffFixture.cs | 7 +- src/DynamicData.Tests/List/ExceptFixture.cs | 6 - .../List/ExpireAfterFixture.cs | 7 - ...terControllerFixtureWithClearAndReplace.cs | 5 - .../FilterControllerFixtureWithDiffSet.cs | 5 - .../List/FilterFixture.Base.cs | 6 - .../List/FilterFixture.Static.cs | 6 - .../List/FilterFixture.WithPredicateState.cs | 9 - .../List/FilterOnObservableFixture.cs | 5 - .../List/FilterOnPropertyFixture.cs | 5 - .../List/FilterWithObservable.cs | 6 - .../List/ForEachChangeFixture.cs | 5 - .../List/FromAsyncFixture.cs | 7 - .../List/GroupImmutableFixture.cs | 5 - src/DynamicData.Tests/List/GroupOnFixture.cs | 5 - .../List/GroupOnPropertyFixture.cs | 7 +- ...roupOnPropertyWithImmutableStateFixture.cs | 7 +- .../List/MergeChangeSetsFixture.cs | 6 - .../List/MergeManyChangeSetsCacheFixture.cs | 7 - .../List/MergeManyChangeSetsFixture.cs | 3 - .../List/MergeManyChangeSetsListFixture.cs | 6 - .../List/MergeManyFixture.cs | 4 - .../List/OnItemAddedFixture.cs | 7 - .../List/OnItemRefreshedFixture.cs | 7 - .../List/OnItemRemovedFixture.cs | 6 - src/DynamicData.Tests/List/OrFixture.cs | 8 +- src/DynamicData.Tests/List/PageFixture.cs | 6 - .../List/QueryWhenChangedFixture.cs | 4 - .../List/RecursiveTransformManyFixture.cs | 5 - src/DynamicData.Tests/List/RefCountFixture.cs | 6 - .../List/RemoveManyFixture.cs | 6 - src/DynamicData.Tests/List/ReverseFixture.cs | 7 +- src/DynamicData.Tests/List/SelectFixture.cs | 7 +- .../List/SizeLimitFixture.cs | 5 - src/DynamicData.Tests/List/SortFixture.cs | 5 - .../List/SortMutableFixture.cs | 6 - .../List/SortPrimitiveFixture.cs | 6 - .../List/SourceListFixture.cs | 4 - .../List/SourceListPreviewFixture.cs | 7 +- .../List/SubscribeManyFixture.cs | 5 - src/DynamicData.Tests/List/SwitchFixture.cs | 5 - .../List/ToCollectionFixture.cs | 3 - ...ChangeSetFixture.Items.IntegrationTests.cs | 7 - ...ervableChangeSetFixture.Items.UnitTests.cs | 6 - ...geSetFixture.Sequences.IntegrationTests.cs | 7 - ...bleChangeSetFixture.Sequences.UnitTests.cs | 7 - .../List/ToObservableChangeSetFixture.cs | 4 +- .../List/TransformAsyncFixture.cs | 5 - .../List/TransformFixture.cs | 4 - .../List/TransformManyFixture.cs | 5 - ...ransformManyObservableCollectionFixture.cs | 6 +- .../List/TransformManyProjectionFixture.cs | 7 +- .../List/TransformManyRefreshFixture.cs | 6 - .../List/VirtualisationFixture.cs | 6 - src/DynamicData.Tests/List/XOrFixture.cs | 6 - .../ObservableCollectionExFixture.cs | 2 - .../Utilities/CacheChangeSetAssertions.cs | 5 +- .../Utilities/CacheItemRecordingObserver.cs | 2 - .../Utilities/ComparerExtensions.cs | 2 - .../Utilities/FakeScheduler.cs | 3 - .../Utilities/FakerExtensions.cs | 2 - .../Utilities/FunctionalExtensions.cs | 4 +- .../Utilities/ListChangeSetAssertions.cs | 5 +- .../Utilities/ListItemRecordingObserver.cs | 2 - .../Utilities/ObservableEx.cs | 2 - .../Utilities/ObservableExtensions.cs | 6 - .../Utilities/ObservableSpy.cs | 3 - .../Utilities/RandomizerExtensions.cs | 1 - .../Utilities/RawAnonymousObservable.cs | 4 +- .../Utilities/RawAnonymousObserver.cs | 4 +- .../Utilities/ReactiveTestCompatibility.cs | 3 - .../Utilities/RecordingObserverBase.cs | 4 - .../Utilities/SelectManyExtensions.cs | 6 +- .../Utilities/StressAddRemoveExtensions.cs | 3 - .../Utilities/TestSourceCache.cs | 3 - .../Utilities/TestSourceList.cs | 4 - .../UnsynchronizedNotificationException.cs | 2 - .../Utilities/ValueRecordingObserver.cs | 2 - src/DynamicData.sln | 20 +- .../Aggregation/AggregateEnumerator.cs | 4 - src/DynamicData/Attributes.cs | 2 - .../Binding/AbstractNotifyPropertyChanged.cs | 4 - src/DynamicData/Binding/BindPaged.cs | 2 - src/DynamicData/Binding/BindVirtualized.cs | 2 - src/DynamicData/Binding/BindingListAdaptor.cs | 3 - .../Binding/BindingListEventsSuspender.cs | 3 - src/DynamicData/Binding/BindingListEx.cs | 4 - src/DynamicData/Binding/ExpressionBuilder.cs | 1 - .../Binding/IObservableCollection.cs | 1 - .../Binding/NotifyPropertyChangedEx.cs | 1 - .../Binding/ObservableCollectionAdaptor.cs | 2 - .../Binding/ObservableCollectionExtended.cs | 1 - .../Binding/ObservablePropertyFactory.cs | 4 - .../Binding/ObservablePropertyFactoryCache.cs | 1 - src/DynamicData/Binding/SortAndBind.cs | 3 - .../Binding/SortedBindingListAdaptor.cs | 3 - src/DynamicData/Cache/ChangeAwareCache.cs | 2 - .../Cache/Internal/AsyncDisposeMany.cs | 133 +- .../Cache/Internal/ExpireAfter.ForSource.cs | 2 - .../Cache/Internal/ExpireAfter.ForStream.cs | 2 - .../Cache/Internal/Filter.Dynamic.cs | 2 - .../Cache/Internal/GroupOnObservable.cs | 2 - .../Cache/Internal/GroupOnProperty.cs | 1 - .../GroupOnPropertyWithImmutableState.cs | 1 - .../Cache/Internal/IndexAndNode.cs | 2 - src/DynamicData/Cache/Internal/KeySelector.cs | 2 - .../Cache/Internal/KeyValueCollection.cs | 2 - src/DynamicData/Cache/Internal/MergeMany.cs | 2 - .../Internal/MergeManyCacheChangeSets.cs | 2 - .../MergeManyCacheChangeSetsSourceCompare.cs | 2 - .../Cache/Internal/MergeManyListChangeSets.cs | 1 - src/DynamicData/Cache/Internal/OfType.cs | 2 - .../Cache/Internal/RemoveKeyEnumerator.cs | 2 - .../Cache/Internal/ToObservableChangeSet.cs | 2 - .../Cache/Internal/TransformMany.cs | 1 - .../Cache/Internal/TransformManyAsync.cs | 2 - .../Cache/Internal/TransformOnObservable.cs | 2 - src/DynamicData/Cache/ObservableCache.cs | 2 - .../Cache/ObservableCacheEx.Adapt.cs | 8 - .../Cache/ObservableCacheEx.AdaptSelector.cs | 10 - .../Cache/ObservableCacheEx.AddOrUpdate.cs | 10 - .../Cache/ObservableCacheEx.And.cs | 8 - .../ObservableCacheEx.AsObservableCache.cs | 8 - .../ObservableCacheEx.AsyncDisposeMany.cs | 10 - .../Cache/ObservableCacheEx.AutoRefresh.cs | 7 - ...servableCacheEx.AutoRefreshOnObservable.cs | 8 - .../Cache/ObservableCacheEx.Batch.cs | 10 - .../Cache/ObservableCacheEx.BatchIf.cs | 8 - .../Cache/ObservableCacheEx.Bind.cs | 7 - .../Cache/ObservableCacheEx.BufferInitial.cs | 10 - .../Cache/ObservableCacheEx.Cast.cs | 8 - .../Cache/ObservableCacheEx.ChangeKey.cs | 10 - .../Cache/ObservableCacheEx.Clear.cs | 8 - .../Cache/ObservableCacheEx.Clone.cs | 10 - .../Cache/ObservableCacheEx.Combine.cs | 8 - .../Cache/ObservableCacheEx.Convert.cs | 10 - ...vableCacheEx.CreateChangeSetTransformer.cs | 7 - .../ObservableCacheEx.DeferUntilLoaded.cs | 8 - .../Cache/ObservableCacheEx.DisposeMany.cs | 8 - .../Cache/ObservableCacheEx.DistinctValues.cs | 8 - .../Cache/ObservableCacheEx.EditDiff.cs | 8 - .../ObservableCacheEx.EnsureUniqueKeys.cs | 8 - .../Cache/ObservableCacheEx.Except.cs | 8 - .../Cache/ObservableCacheEx.ExpireAfter.cs | 10 - .../Cache/ObservableCacheEx.Filter.cs | 10 - .../ObservableCacheEx.FilterImmutable.cs | 8 - .../ObservableCacheEx.FilterOnObservable.cs | 8 - .../Cache/ObservableCacheEx.FinallySafe.cs | 8 - .../Cache/ObservableCacheEx.Flatten.cs | 10 - .../ObservableCacheEx.FlattenBufferResult.cs | 10 - .../Cache/ObservableCacheEx.ForEachChange.cs | 10 - .../Cache/ObservableCacheEx.ForForced.cs | 10 - .../Cache/ObservableCacheEx.FullJoin.cs | 8 - .../Cache/ObservableCacheEx.FullJoinMany.cs | 8 - .../Cache/ObservableCacheEx.Group.cs | 8 - .../ObservableCacheEx.GroupOnObservable.cs | 8 - .../ObservableCacheEx.GroupOnProperty.cs | 7 - ...cheEx.GroupOnPropertyWithImmutableState.cs | 7 - ...servableCacheEx.GroupWithImmutableState.cs | 8 - ...rvableCacheEx.IgnoreSameReferenceUpdate.cs | 10 - .../ObservableCacheEx.IgnoreUpdateWhen.cs | 10 - .../ObservableCacheEx.IncludeUpdateWhen.cs | 10 - .../Cache/ObservableCacheEx.InnerJoin.cs | 8 - .../Cache/ObservableCacheEx.InnerJoinMany.cs | 8 - .../Cache/ObservableCacheEx.InvokeEvaluate.cs | 8 - .../Cache/ObservableCacheEx.LeftJoin.cs | 8 - .../Cache/ObservableCacheEx.LeftJoinMany.cs | 8 - .../Cache/ObservableCacheEx.LimitSizeTo.cs | 8 - .../ObservableCacheEx.MergeChangeSets.cs | 8 - .../Cache/ObservableCacheEx.MergeMany.cs | 8 - .../ObservableCacheEx.MergeManyChangeSets.cs | 8 - .../Cache/ObservableCacheEx.MergeManyItems.cs | 8 - .../Cache/ObservableCacheEx.MonitorStatus.cs | 8 - .../Cache/ObservableCacheEx.NotEmpty.cs | 10 - .../Cache/ObservableCacheEx.OfType.cs | 8 - .../Cache/ObservableCacheEx.OnChangeAction.cs | 10 - .../Cache/ObservableCacheEx.OnItemAdded.cs | 10 - .../ObservableCacheEx.OnItemRefreshed.cs | 10 - .../Cache/ObservableCacheEx.OnItemRemoved.cs | 8 - .../Cache/ObservableCacheEx.OnItemUpdated.cs | 10 - src/DynamicData/Cache/ObservableCacheEx.Or.cs | 8 - .../Cache/ObservableCacheEx.PopulateFrom.cs | 10 - .../Cache/ObservableCacheEx.PopulateInto.cs | 8 - .../ObservableCacheEx.QueryWhenChanged.cs | 7 - .../Cache/ObservableCacheEx.RefCount.cs | 8 - .../Cache/ObservableCacheEx.Refresh.cs | 10 - .../Cache/ObservableCacheEx.Remove.cs | 10 - .../Cache/ObservableCacheEx.RemoveKey.cs | 8 - .../Cache/ObservableCacheEx.RemoveKeys.cs | 10 - .../Cache/ObservableCacheEx.RightJoin.cs | 8 - .../Cache/ObservableCacheEx.RightJoinMany.cs | 8 - .../Cache/ObservableCacheEx.SkipInitial.cs | 10 - .../Cache/ObservableCacheEx.Sort.cs | 8 - .../Cache/ObservableCacheEx.SortAndBind.cs | 1 - .../Cache/ObservableCacheEx.SortBy.cs | 8 - .../Cache/ObservableCacheEx.StartWithEmpty.cs | 8 - .../Cache/ObservableCacheEx.StartWithItem.cs | 10 - .../Cache/ObservableCacheEx.SubscribeMany.cs | 8 - .../ObservableCacheEx.SuppressRefresh.cs | 10 - .../Cache/ObservableCacheEx.Switch.cs | 8 - .../Cache/ObservableCacheEx.ToCollection.cs | 10 - ...ObservableCacheEx.ToObservableChangeSet.cs | 10 - .../ObservableCacheEx.ToObservableOptional.cs | 8 - .../ObservableCacheEx.ToSortedCollection.cs | 8 - .../Cache/ObservableCacheEx.Transform.cs | 8 - .../Cache/ObservableCacheEx.TransformAsync.cs | 8 - .../ObservableCacheEx.TransformImmutable.cs | 8 - .../Cache/ObservableCacheEx.TransformMany.cs | 7 - .../ObservableCacheEx.TransformManyAsync.cs | 7 - ...bservableCacheEx.TransformManySafeAsync.cs | 7 - ...ObservableCacheEx.TransformOnObservable.cs | 8 - .../Cache/ObservableCacheEx.TransformSafe.cs | 8 - .../ObservableCacheEx.TransformSafeAsync.cs | 8 - .../ObservableCacheEx.TransformToTree.cs | 8 - ...rvableCacheEx.TransformWithInlineUpdate.cs | 8 - ...ObservableCacheEx.TreatMovesAsRemoveAdd.cs | 10 - .../Cache/ObservableCacheEx.TrueFor.cs | 8 - .../Cache/ObservableCacheEx.TrueForAll.cs | 10 - .../Cache/ObservableCacheEx.TrueForAny.cs | 10 - .../Cache/ObservableCacheEx.UpdateIndex.cs | 8 - .../Cache/ObservableCacheEx.Watch.cs | 10 - .../Cache/ObservableCacheEx.WatchValue.cs | 10 - ...bservableCacheEx.WhenAnyPropertyChanged.cs | 8 - .../ObservableCacheEx.WhenPropertyChanged.cs | 7 - .../ObservableCacheEx.WhenValueChanged.cs | 7 - .../ObservableCacheEx.WhereReasonsAre.cs | 10 - .../ObservableCacheEx.WhereReasonsAreNot.cs | 10 - .../Cache/ObservableCacheEx.Xor.cs | 8 - src/DynamicData/Cache/ObservableCacheEx.cs | 10 - src/DynamicData/DynamicData.csproj | 25 +- .../Experimental/SubjectWithRefCount.cs | 12 +- src/DynamicData/Experimental/Watcher.cs | 8 +- src/DynamicData/Internal/Bitset.cs | 1 - src/DynamicData/Internal/Notification.cs | 2 - .../Internal/ReactiveCompatibility.cs | 3 - .../Internal/SharedDeliveryQueue.cs | 2 - src/DynamicData/Kernel/EnumerableIList.cs | 3 - src/DynamicData/Kernel/EnumeratorIList.cs | 2 - src/DynamicData/Kernel/Optional.cs | 2 - .../Kernel/ReadOnlyCollectionLight.cs | 2 - src/DynamicData/List/ChangeAwareList.cs | 2 - src/DynamicData/List/Internal/ExpireAfter.cs | 2 - .../Internal/Filter.WithPredicateState.cs | 2 - .../List/Internal/FilterOnProperty.cs | 1 - .../List/Internal/GroupOnProperty.cs | 1 - .../GroupOnPropertyWithImmutableState.cs | 1 - .../List/Internal/MergeManyCacheChangeSets.cs | 1 - .../List/Internal/MergeManyListChangeSets.cs | 2 - src/DynamicData/List/Internal/Pager.cs | 2 - .../List/Internal/ToObservableChangeSet.cs | 2 - .../List/Internal/TransformMany.cs | 1 - src/DynamicData/List/Linq/AddKeyEnumerator.cs | 2 - .../List/Linq/ItemChangeEnumerator.cs | 2 - .../List/Linq/UnifiedChangeEnumerator.cs | 2 - .../List/Linq/WithoutIndexEnumerator.cs | 2 - .../List/ObservableListEx.Adapt.cs | 7 - .../List/ObservableListEx.AddKey.cs | 7 - src/DynamicData/List/ObservableListEx.And.cs | 7 - .../List/ObservableListEx.AsObservableList.cs | 7 - .../List/ObservableListEx.AutoRefresh.cs | 6 - ...bservableListEx.AutoRefreshOnObservable.cs | 7 - src/DynamicData/List/ObservableListEx.Bind.cs | 6 - .../List/ObservableListEx.BufferIf.cs | 7 - .../List/ObservableListEx.BufferInitial.cs | 9 - src/DynamicData/List/ObservableListEx.Cast.cs | 9 - .../List/ObservableListEx.CastToObject.cs | 9 - .../List/ObservableListEx.Clone.cs | 7 - .../List/ObservableListEx.Combine.cs | 6 - .../List/ObservableListEx.Convert.cs | 9 - .../List/ObservableListEx.DeferUntilLoaded.cs | 7 - .../List/ObservableListEx.DisposeMany.cs | 7 - .../List/ObservableListEx.DistinctValues.cs | 7 - .../List/ObservableListEx.Except.cs | 7 - .../List/ObservableListEx.ExpireAfter.cs | 9 - .../List/ObservableListEx.Filter.cs | 9 - .../ObservableListEx.FilterOnObservable.cs | 7 - .../List/ObservableListEx.FilterOnProperty.cs | 6 - .../ObservableListEx.FlattenBufferResult.cs | 9 - .../List/ObservableListEx.ForEachChange.cs | 9 - .../ObservableListEx.ForEachItemChange.cs | 9 - .../List/ObservableListEx.GroupOn.cs | 6 - .../List/ObservableListEx.GroupOnProperty.cs | 6 - ...istEx.GroupOnPropertyWithImmutableState.cs | 6 - ...bservableListEx.GroupWithImmutableState.cs | 6 - .../List/ObservableListEx.LimitSizeTo.cs | 7 - .../List/ObservableListEx.MergeChangeSets.cs | 7 - .../List/ObservableListEx.MergeMany.cs | 6 - .../ObservableListEx.MergeManyChangeSets.cs | 7 - .../List/ObservableListEx.NotEmpty.cs | 9 - .../List/ObservableListEx.OnItemAdded.cs | 9 - .../List/ObservableListEx.OnItemRefreshed.cs | 9 - .../List/ObservableListEx.OnItemRemoved.cs | 9 - src/DynamicData/List/ObservableListEx.Or.cs | 7 - src/DynamicData/List/ObservableListEx.Page.cs | 7 - .../List/ObservableListEx.PopulateInto.cs | 7 - .../List/ObservableListEx.QueryWhenChanged.cs | 6 - .../List/ObservableListEx.RefCount.cs | 7 - .../List/ObservableListEx.RemoveIndex.cs | 9 - .../List/ObservableListEx.Reverse.cs | 7 - .../List/ObservableListEx.SkipInitial.cs | 9 - src/DynamicData/List/ObservableListEx.Sort.cs | 6 - .../List/ObservableListEx.StartWithEmpty.cs | 9 - .../List/ObservableListEx.SubscribeMany.cs | 7 - .../List/ObservableListEx.SuppressRefresh.cs | 9 - .../List/ObservableListEx.Switch.cs | 7 - .../List/ObservableListEx.ToCollection.cs | 7 - .../ObservableListEx.ToObservableChangeSet.cs | 9 - .../ObservableListEx.ToSortedCollection.cs | 7 - src/DynamicData/List/ObservableListEx.Top.cs | 9 - .../List/ObservableListEx.Transform.cs | 7 - .../List/ObservableListEx.TransformAsync.cs | 7 - .../List/ObservableListEx.TransformMany.cs | 6 - .../List/ObservableListEx.Virtualise.cs | 7 - ...ObservableListEx.WhenAnyPropertyChanged.cs | 6 - .../ObservableListEx.WhenPropertyChanged.cs | 6 - .../List/ObservableListEx.WhenValueChanged.cs | 6 - .../List/ObservableListEx.WhereReasonsAre.cs | 9 - .../ObservableListEx.WhereReasonsAreNot.cs | 9 - src/DynamicData/List/ObservableListEx.Xor.cs | 7 - src/DynamicData/List/ObservableListEx.cs | 9 - src/DynamicData/List/PageChangeSet.cs | 2 - src/DynamicData/List/RangeChange.cs | 2 - src/DynamicData/List/SourceList.cs | 12 +- src/DynamicData/List/VirtualChangeSet.cs | 2 - 563 files changed, 23414 insertions(+), 3087 deletions(-) create mode 100644 src/DynamicData.Reactive/DynamicData.Reactive.csproj create mode 100644 src/DynamicData.Reactive/reactive-preprocessed.xml create mode 100644 src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet10_0.verified.txt diff --git a/src/Directory.Build.props b/src/Directory.Build.props index bc6b11c9c..3073548db 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -29,7 +29,8 @@ true $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - CS8600;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8623;CS8624;CS8625;CS8626;CS8627;CS8628;CS8629;CS8630;CS8634;CS8766;CS8767 + CS8600;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8623;CS8624;CS8625;CS8626;CS8627;CS8628;CS8629;CS8630;CS8634;CS8766;CS8767 + enable diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 347ab888d..f831230b0 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -7,11 +7,7 @@ $(DefineConstants);P_LINQ;SUPPORTS_BINDINGLIST - - $(DefineConstants);NETSTANDARD;P_LINQ;SUPPORTS_BINDINGLIST;SUPPORTS_ASYNC_DISPOSABLE - - - - $(DefineConstants);SUPPORTS_DICTIONARY_MUTATION_DURING_ENUMERATION + + $(DefineConstants);NETSTANDARD;P_LINQ;SUPPORTS_BINDINGLIST;SUPPORTS_ASYNC_DISPOSABLE;SUPPORTS_DICTIONARY_MUTATION_DURING_ENUMERATION diff --git a/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs b/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs index 8aa5846da..707985d11 100644 --- a/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs +++ b/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs @@ -2,11 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - using BenchmarkDotNet.Attributes; using DynamicData.Binding; diff --git a/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs b/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs index 1e4f83e65..39d0fe666 100644 --- a/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; - using BenchmarkDotNet.Attributes; namespace DynamicData.Benchmarks.Cache diff --git a/src/DynamicData.Benchmarks/Cache/EditDiff.cs b/src/DynamicData.Benchmarks/Cache/EditDiff.cs index 6e580d9ac..e8ca3f5a7 100644 --- a/src/DynamicData.Benchmarks/Cache/EditDiff.cs +++ b/src/DynamicData.Benchmarks/Cache/EditDiff.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using BenchmarkDotNet.Attributes; using DynamicData.Kernel; diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs index 3c437f89f..5e7815bdf 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs index cfa804e76..e5e52eb5e 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Linq; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs index 583eac8c6..021d406fc 100644 --- a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - using BenchmarkDotNet.Attributes; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs index 401f3d085..3b2deb838 100644 --- a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Linq; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs index 2afd65c0d..a610cccf4 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.ObjectModel; -using System.Linq; using BenchmarkDotNet.Attributes; using DynamicData.Binding; diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs index 894a209cd..96b8048c0 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs @@ -1,6 +1,4 @@ using BenchmarkDotNet.Attributes; -using System; -using System.Linq; using DynamicData.Binding; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/SourceCache.cs b/src/DynamicData.Benchmarks/Cache/SourceCache.cs index f2157221d..3b2929067 100644 --- a/src/DynamicData.Benchmarks/Cache/SourceCache.cs +++ b/src/DynamicData.Benchmarks/Cache/SourceCache.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Linq; - using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; diff --git a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs index 9a63f6cc5..ee150510f 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - using BenchmarkDotNet.Attributes; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs index 1f1dc2b88..5f2ff1469 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using BenchmarkDotNet.Attributes; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs index 7867c3571..6dc7f665e 100644 --- a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; diff --git a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs index e1ccfd9b2..ac2d4f9f3 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using BenchmarkDotNet.Attributes; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/TransformMany.cs b/src/DynamicData.Benchmarks/Cache/TransformMany.cs index 86d04c135..b484344f9 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformMany.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformMany.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using BenchmarkDotNet.Attributes; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj index 2eb954106..753e591a6 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 AnyCPU false ;1591;1701;1702;1705;CA1822;CA1001 diff --git a/src/DynamicData.Benchmarks/List/DisposeMany_List.cs b/src/DynamicData.Benchmarks/List/DisposeMany_List.cs index bf5cc60fb..112022cf8 100644 --- a/src/DynamicData.Benchmarks/List/DisposeMany_List.cs +++ b/src/DynamicData.Benchmarks/List/DisposeMany_List.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; - using BenchmarkDotNet.Attributes; namespace DynamicData.Benchmarks.List diff --git a/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs b/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs index ec9a39316..7da1b6697 100644 --- a/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs +++ b/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs index 4bdc9f9eb..33fab8678 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; using System.Reflection; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs index 4cab054f5..6bb50473c 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; using System.Reflection; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs index dd1e57414..187a1c777 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Linq; using BenchmarkDotNet.Attributes; diff --git a/src/DynamicData.Benchmarks/List/GroupAdd.cs b/src/DynamicData.Benchmarks/List/GroupAdd.cs index 92572496e..025658282 100644 --- a/src/DynamicData.Benchmarks/List/GroupAdd.cs +++ b/src/DynamicData.Benchmarks/List/GroupAdd.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Linq; - using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; diff --git a/src/DynamicData.Benchmarks/List/GroupRemove.cs b/src/DynamicData.Benchmarks/List/GroupRemove.cs index d4ba95e05..1d0befcd1 100644 --- a/src/DynamicData.Benchmarks/List/GroupRemove.cs +++ b/src/DynamicData.Benchmarks/List/GroupRemove.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Linq; - using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; diff --git a/src/DynamicData.Benchmarks/List/SourceList.cs b/src/DynamicData.Benchmarks/List/SourceList.cs index 6556d6ecf..26c0fe05d 100644 --- a/src/DynamicData.Benchmarks/List/SourceList.cs +++ b/src/DynamicData.Benchmarks/List/SourceList.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Linq; - using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; diff --git a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs index b80e77629..6b70eef36 100644 --- a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs +++ b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs @@ -1,5 +1,3 @@ -using System; - using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; diff --git a/src/DynamicData.Benchmarks/Program.cs b/src/DynamicData.Benchmarks/Program.cs index 5bf5d888f..225fd0ee2 100644 --- a/src/DynamicData.Benchmarks/Program.cs +++ b/src/DynamicData.Benchmarks/Program.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.IO; using System.Runtime.CompilerServices; using BenchmarkDotNet.Configs; diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj new file mode 100644 index 000000000..742885c5e --- /dev/null +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -0,0 +1,54 @@ + + + + Dynamic Data + + Bring the power of Rx to collections using Dynamic Data. + Dynamic Data is a comprehensive caching and data manipulation solution which introduces domain centric observable collections. + Linq extensions enable dynamic filtering, sorting, grouping, transforms, binding, pagination, data virtualisation, expiration, disposal management plus more. + + net462;net472;net48;net481;net8.0;net9.0;net10.0;net11.0 + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/DynamicData.Reactive/reactive-preprocessed.xml b/src/DynamicData.Reactive/reactive-preprocessed.xml new file mode 100644 index 000000000..157602ff6 --- /dev/null +++ b/src/DynamicData.Reactive/reactive-preprocessed.xml @@ -0,0 +1,20024 @@ + + + + + + <_AfterSdkPublishDependsOn Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true'">AfterPublish + <_AfterSdkPublishDependsOn Condition="'$(UsingMicrosoftNETSdkWeb)' != 'true'">Publish + + + + + true + + true + $(CustomAfterDirectoryBuildProps);$(MSBuildThisFileDirectory)UseArtifactsOutputPath.props + + + $(ProjectExtensionsPathForSpecifiedProject) + + + + + $(MSBuildThisFileDirectory)..\..\..\Microsoft.NETCoreSdk.BundledVersions.props + + + + + + $([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)..\..\')) + $(MSBuildThisFileDirectory) + $([MSBuild]::EnsureTrailingSlash('$(NetCoreRoot)'))packs + $([MSBuild]::EnsureTrailingSlash('$(MSBuildThisFileDirectory)'))PrunePackageData + <_NetFrameworkHostedCompilersVersion>5.8.0-1.26302.115 + 11.0 + 11.0 + net11.0 + 11.0.0-preview.5.26302.115 + 2.1 + 2.1.0 + 11.0.0-preview.5.26302.115 + $(MSBuildThisFileDirectory)RuntimeIdentifierGraph.json + 11.0.100-preview.5.26302.115 + 11.0.100 + win-x64 + win-x64 + <_NETCoreSdkIsPreview>true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_KnownRuntimeIdentifierPlatforms Include="any;aot;freebsd;illumos;solaris;unix;any;aot;freebsd;openbsd;illumos;solaris;haiku;unix;any;aot;freebsd;openbsd;illumos;solaris;haiku;unix;any;aot;freebsd;openbsd;illumos;solaris;haiku;unix;any;aot;freebsd;openbsd;illumos;solaris;haiku;unix;any;aot;freebsd;openbsd;illumos;solaris;haiku;unix" /> + <_ExcludedKnownRuntimeIdentifierPlatforms Include="tizen.4.0.0;tizen.5.0.0;tizen.4.0.0;tizen.5.0.0;tizen.4.0.0;tizen.5.0.0;tizen.4.0.0;tizen.5.0.0;tizen.4.0.0;tizen.5.0.0;tizen.4.0.0;tizen.5.0.0" /> + + + + + + + + true + true + true + true + true + + + + <_DirectoryBuildPropsFile Condition="'$(_DirectoryBuildPropsFile)' == ''">Directory.Build.props + <_DirectoryBuildPropsBasePath Condition="'$(_DirectoryBuildPropsBasePath)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), '$(_DirectoryBuildPropsFile)')) + $([System.IO.Path]::Combine('$(_DirectoryBuildPropsBasePath)', '$(_DirectoryBuildPropsFile)')) + + + + + true + $(NoWarn);1591;1701;1702;1705;VSX1000;CA1510 + AnyCPU + enable + latest + $(MSBuildProjectName.Contains('Tests')) + $(MSBuildProjectName.Contains('Benchmarks')) + embedded + Roland Pheasant + Roland Pheasant + Copyright (c) Roland Pheasant 2011-$([System.DateTime]::Now.ToString(yyyy)) + MIT + https://github.com/reactiveui/DynamicData + DynamicData;Dynamic;Data;Rx;Reactive;Observable;Cache;Binding;ObservableCache;ObservableList;ObservableCollection;Collection;Linq + https://github.com/reactiveui/DynamicData/releases + https://github.com/reactiveui/DynamicData + git + logo.png + README.md + true + + true + + true + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + CS8600;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8623;CS8624;CS8625;CS8626;CS8627;CS8628;CS8629;CS8630;CS8634;CS8766;CS8767 + enable + + + true + + + false + + + + + + + + + + + + $(MSBuildThisFileDirectory) + + + + + + + + + + + + + + + + + + + + + true + $(MSBuildProjectName) + + + $(ArtifactsPath)\obj\$(ArtifactsProjectName)\ + $(ArtifactsPath)\obj\ + + + + <_ArtifactsPathSetEarly>true + + + + + + obj\ + $(BaseIntermediateOutputPath)\ + <_InitialBaseIntermediateOutputPath>$(BaseIntermediateOutputPath) + $(BaseIntermediateOutputPath) + + $([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(MSBuildProjectExtensionsPath)')) + $(MSBuildProjectExtensionsPath)\ + + false + true + <_InitialMSBuildProjectExtensionsPath Condition=" '$(ImportProjectExtensionProps)' == 'true' ">$(MSBuildProjectExtensionsPath) + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\chris\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 7.0.0 + + + + + + + + + + + + + + + + None + MSBuildTargetCaching + + $(MSBuildThisFileDirectory)PrivateP2PCaching.proj + + + + + + <_MicrosoftSourceLinkCommonAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\Microsoft.SourceLink.Common.dll + <_MicrosoftSourceLinkCommonAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\core\Microsoft.SourceLink.Common.dll + + + + true + + true + + + + + + $(MSBuildThisFileDirectory)..\tools\net472\Microsoft.Build.Tasks.Git.dll + $(MSBuildThisFileDirectory)..\tools\core\Microsoft.Build.Tasks.Git.dll + + + + + + + + + + + + + $(MSBuildThisFileDirectory)Microsoft.NET.ILLink.targets + + true + $(MSBuildThisFileDirectory)..\tools\net\ILLink.Tasks.dll + $(MSBuildThisFileDirectory)..\tools\netframework\ILLink.Tasks.dll + $(MSBuildThisFileDirectory)Microsoft.NET.ILLink.Analyzers.props + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 + C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.net.illink.tasks\10.0.8 + + + C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 + C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.net.illink.tasks\11.0.0-preview.5.26302.115 + + + C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 + C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 + + + C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 + C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 + + + C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 + C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 + + + C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 + C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 + + + C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 + C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.net.illink.tasks\8.0.27 + + + C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 + C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 + C:\Users\chris\.nuget\packages\microsoft.net.illink.tasks\9.0.16 + + + + + + + $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.Before.$(MSBuildThisFile) + $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.After.$(MSBuildThisFile) + + + + + true + + + $(DefaultProjectConfiguration) + $(DefaultProjectPlatform) + + + WJProject + JavaScript + + + + + + + + $([MSBuild]::IsRunningFromVisualStudio()) + $([MSBuild]::GetToolsDirectory32())\..\..\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.props + $(MSBuildToolsPath)\NuGet.props + + + + + + true + + + + <_DirectoryPackagesPropsFile Condition="'$(_DirectoryPackagesPropsFile)' == ''">Directory.Packages.props + <_DirectoryPackagesPropsBasePath Condition="'$(_DirectoryPackagesPropsBasePath)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)', '$(_DirectoryPackagesPropsFile)')) + $([MSBuild]::NormalizePath('$(_DirectoryPackagesPropsBasePath)', '$(_DirectoryPackagesPropsFile)')) + + + + true + + + + true + true + true + true + true + true + true + true + true + true + true + true + true + + + + + + + true + + + + Debug;Release + AnyCPU + Debug + AnyCPU + + + + + true + + + + Library + 512 + prompt + $(MSBuildProjectName) + $(MSBuildProjectName.Replace(" ", "_")) + true + + + + true + false + + + true + + + + + <_PlatformWithoutConfigurationInference>$(Platform) + + + x64 + + + x86 + + + ARM + + + arm64 + + + + + {CandidateAssemblyFiles} + $(AssemblySearchPaths);{HintPathFromItem} + $(AssemblySearchPaths);{TargetFrameworkDirectory} + $(AssemblySearchPaths);{RawFileName} + + + None + portable + + false + + true + true + + PackageReference + $(AssemblySearchPaths) + false + false + false + false + false + false + + false + false + false + false + true + 1.0.3 + false + true + true + + + + <_ImplicitFileBasedProgramUserSecretsId Condition="'$(FileBasedProgram)' == 'true'">$(AssemblyName)-$([MSBuild]::StableStringHash($(MSBuildProjectFullPath.ToLowerInvariant()), 'Sha256')) + $(_ImplicitFileBasedProgramUserSecretsId) + + + + $(MSBuildThisFileDirectory)GenerateDeps\GenerateDeps.proj + + + + + + $(MSBuildThisFileDirectory)..\..\..\Microsoft.NETCoreSdk.BundledMSBuildInformation.props + + + + + 18.6.0 + 18.8.0 + <_MSBuildVersionMajorMinor>$([System.Version]::Parse('$(MSBuildVersion)').ToString(2)) + <_IsDisjointMSBuildVersion>$([MSBuild]::VersionLessThan('$(_MSBuildVersionMajorMinor)', '18.8')) + + + + + false + + + <__WindowsAppSdkDefaultImageIncludes>**/*.png;**/*.bmp;**/*.jpg;**/*.dds;**/*.tif;**/*.tga;**/*.gif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <__DisableWorkloadResolverSentinelPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildBinPath)\DisableWorkloadResolver.sentinel + <__DisableWorkloadResolverSentinelPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildToolsPath32)\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\DisableWorkloadResolver.sentinel + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + false + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + true + + + + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) + true + + + + + + + + + + + + + + + + + net10.0 + true + + + + + + + + + + + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v1.0" DisplayName=".NET Core 1.0" Alias="netcoreapp1.0" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v1.1" DisplayName=".NET Core 1.1" Alias="netcoreapp1.1" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v2.0" DisplayName=".NET Core 2.0" Alias="netcoreapp2.0" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v2.1" DisplayName=".NET Core 2.1" Alias="netcoreapp2.1" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v2.2" DisplayName=".NET Core 2.2" Alias="netcoreapp2.2" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v3.0" DisplayName=".NET Core 3.0" Alias="netcoreapp3.0" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v3.1" DisplayName=".NET Core 3.1" Alias="netcoreapp3.1" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v5.0" DisplayName=".NET 5.0" Alias="net5.0" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v6.0" DisplayName=".NET 6.0" Alias="net6.0" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v7.0" DisplayName=".NET 7.0" Alias="net7.0" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v8.0" DisplayName=".NET 8.0" Alias="net8.0" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v9.0" DisplayName=".NET 9.0" Alias="net9.0" /> + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v10.0" DisplayName=".NET 10.0" Alias="net10.0" /> + + <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v11.0" DisplayName=".NET 11.0" Alias="net11.0" /> + + + + + + + + + $([MSBuild]::Add($(NETCoreAppMaximumVersion), 1)).0 + 19.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_NormalizedWindowsSdkSupportedTargetPlatformVersion Include="@(WindowsSdkSupportedTargetPlatformVersion)"> + $([System.Text.RegularExpressions.Regex]::Replace(%(Identity), '^((\d+\.){3})1$', '${1}0')) + + + + + + + + + true + <_SourceLinkPropsImported>true + + + + + + + + + + + + + + 1701;1702 + + $(WarningsAsErrors);NU1605 + + + $(DefineConstants); + $(DefineConstants)TRACE + + + + + + + + + + + + + + + + + + + + + + + + + $(TargetsForTfmSpecificContentInPackage);_PackProjectToolValidation + + + + + + MSBuild:Compile + $(DefaultXamlRuntime) + Designer + + + MSBuild:Compile + $(DefaultXamlRuntime) + Designer + + + + + + + + + + + + + + + + + + <_WpfCommonNetFxReference Include="WindowsBase" /> + <_WpfCommonNetFxReference Include="PresentationCore" /> + <_WpfCommonNetFxReference Include="PresentationFramework" /> + <_WpfCommonNetFxReference Include="System.Xaml" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.0'"> + 4.0 + + <_WpfCommonNetFxReference Include="UIAutomationClient" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.0'" /> + <_WpfCommonNetFxReference Include="UIAutomationClientSideProviders" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.0'" /> + <_WpfCommonNetFxReference Include="UIAutomationProvider" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.0'" /> + <_WpfCommonNetFxReference Include="UIAutomationTypes" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.0'" /> + <_WpfCommonNetFxReference Include="System.Windows.Controls.Ribbon" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.5'" /> + + + <_SDKImplicitReference Include="@(_WpfCommonNetFxReference)" Condition="'$(UseWPF)' == 'true'" /> + <_SDKImplicitReference Include="System.Windows.Forms" Condition="('$(UseWindowsForms)' == 'true') " /> + <_SDKImplicitReference Include="WindowsFormsIntegration" Condition=" ('$(UseWindowsForms)' == 'true') And ('$(UseWPF)' == 'true') " /> + + + + + + <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v1.0" /> + <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v1.1" /> + <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v2.0" /> + <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v2.1" /> + <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v2.2" /> + + <_UnsupportedNETStandardTargetFramework Include="@(SupportedNETStandardTargetFramework)" /> + + <_UnsupportedNETFrameworkTargetFramework Include=".NETFramework,Version=v2.0" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + <_TargetFrameworkVersionValue>0.0 + <_WindowsDesktopSdkTargetFrameworkVersionFloor>3.0 + + + + + + + + Dynamic Data + + Bring the power of Rx to collections using Dynamic Data. + Dynamic Data is a comprehensive caching and data manipulation solution which introduces domain centric observable collections. + Linq extensions enable dynamic filtering, sorting, grouping, transforms, binding, pagination, data virtualisation, expiration, disposal management plus more. + + net462;net472;net48;net481;net8.0;net9.0;net10.0;net11.0 + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + <_IsExecutable Condition="'$(OutputType)' == 'Exe' or '$(OutputType)'=='WinExe'">true + + + $(_IsExecutable) + <_UsingDefaultForHasRuntimeOutput>true + + + + + 1.0.0 + $(VersionPrefix)-$(VersionSuffix) + $(VersionPrefix) + + + $(AssemblyName) + $(Authors) + $(AssemblyName) + $(AssemblyName) + + + + + Debug + AnyCPU + $(Platform) + + + + + + + true + <_PublishProfileDesignerFolder Condition="'$(AppDesignerFolder)' != ''">$(AppDesignerFolder) + <_PublishProfileDesignerFolder Condition="'$(_PublishProfileDesignerFolder)' == ''">Properties + <_PublishProfileRootFolder Condition="'$(_PublishProfileRootFolder)' == ''">$(MSBuildProjectDirectory)\$(_PublishProfileDesignerFolder)\PublishProfiles\ + $([System.IO.Path]::GetFileNameWithoutExtension($(PublishProfile))) + $(_PublishProfileRootFolder)$(PublishProfileName).pubxml + $(PublishProfileFullPath) + + false + + + + + + + + + + + + + $([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) + v$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)', 2)) + + + <_TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion.TrimStart('vV')) + + + + $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) + $([MSBuild]::GetTargetPlatformVersion('$(TargetFramework)', 4)) + + <_TargetPlatformVersionUsesCsWinRT3>false + <_TargetPlatformVersionUsesCsWinRT3 Condition="'$(TargetPlatformIdentifier)' == 'Windows' and '$(TargetPlatformVersion)' != '' and $([System.Version]::Parse('$(TargetPlatformVersion)').Revision) == 1">true + $([System.Version]::Parse('$(TargetPlatformVersion)').Major).$([System.Version]::Parse('$(TargetPlatformVersion)').Minor).$([System.Version]::Parse('$(TargetPlatformVersion)').Build).0 + $([MSBuild]::GetTargetPlatformVersion('$(TargetFramework)', 2)) + + $(TargetPlatformVersion) + + Windows + + + + <_UnsupportedTargetFrameworkError>true + + + + + + + + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + v0.0 + + + _ + + + + + + + + + + true + + + + + + + + + + <_EnableDefaultWindowsPlatform>false + false + + + 2.1 + + + + + + + + + + + + + + <_ApplicableTargetPlatformVersion Include="@(SdkSupportedTargetPlatformVersion)" Condition="'@(SdkSupportedTargetPlatformVersion)' != '' and '%(SdkSupportedTargetPlatformVersion.DefineConstantsOnly)' != 'true'" RemoveMetadata="DefineConstantsOnly" /> + <_ValidTargetPlatformVersion Include="@(_ApplicableTargetPlatformVersion)" Condition="'@(_ApplicableTargetPlatformVersion)' != '' and $([MSBuild]::VersionEquals(%(Identity), $(TargetPlatformVersion)))" /> + + + @(_ValidTargetPlatformVersion->Distinct()) + + + + + true + <_ValidTargetPlatformVersions Condition="'@(_ApplicableTargetPlatformVersion)' != ''">@(_ApplicableTargetPlatformVersion, '%0a') + <_ValidTargetPlatformVersions Condition="'@(_ApplicableTargetPlatformVersion)' == ''">None + + + + + + + true + true + + + + + + + + + true + false + true + <_PlatformToAppendToOutputPath Condition="'$(AppendPlatformToOutputPath)' == 'true'">$(PlatformName)\ + + + + + + + + <_DefaultArtifactsPathPropsImported>true + + + + true + true + <_ArtifactsPathLocationType>ExplicitlySpecified + + + + + $(_DirectoryBuildPropsBasePath)\artifacts + true + <_ArtifactsPathLocationType>DirectoryBuildPropsFolder + + + + $(MSBuildProjectDirectory)\artifacts + <_ArtifactsPathLocationType>ProjectFolder + + + + <_CanonicalizedArtifactsPath Condition="'$(ArtifactsPath)' != ''">$([MSBuild]::EnsureTrailingSlash($([System.IO.Path]::GetFullPath('$(ArtifactsPath)')))) + + + + + + + $(MSBuildProjectName) + bin + publish + package + + true + + + $(Configuration.ToLowerInvariant()) + + $(ArtifactsPivots)_$(TargetFramework.ToLowerInvariant()) + + $(ArtifactsPivots)_$(RuntimeIdentifier.ToLowerInvariant()) + + + + $(ArtifactsPath)\$(ArtifactsBinOutputName)\$(ArtifactsProjectName)\ + $(ArtifactsPath)\obj\$(ArtifactsProjectName)\ + $(ArtifactsPath)\$(ArtifactsPublishOutputName)\$(ArtifactsProjectName)\$(ArtifactsPivots)\ + + + + $(ArtifactsPath)\$(ArtifactsBinOutputName)\ + $(ArtifactsPath)\obj\ + $(ArtifactsPath)\$(ArtifactsPublishOutputName)\$(ArtifactsPivots)\ + + + $(BaseOutputPath)$(ArtifactsPivots)\ + $(BaseIntermediateOutputPath)$(ArtifactsPivots)\ + + $(ArtifactsPath)\$(ArtifactsPackageOutputName)\$(Configuration.ToLowerInvariant())\ + + + bin\ + $(BaseOutputPath)\ + $(BaseOutputPath)$(_PlatformToAppendToOutputPath)$(Configuration)\ + $(OutputPath)\ + + + + obj\ + $(BaseIntermediateOutputPath)\ + $(BaseIntermediateOutputPath)$(_PlatformToAppendToOutputPath)$(Configuration)\ + $(IntermediateOutputPath)\ + + + + $(OutputPath) + + + + $(DefaultItemExcludes);$(OutputPath)/** + $(DefaultItemExcludes);$(IntermediateOutputPath)/** + + + $(DefaultItemExcludes);$(ArtifactsPath)/** + + $(DefaultItemExcludes);bin/**;obj/** + + + + $(OutputPath)$(TargetFramework.ToLowerInvariant())\ + + + $(IntermediateOutputPath)$(TargetFramework.ToLowerInvariant())\ + + + + + + + + + + + true + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_RuntimePackInWorkloadVersionCurrent>11.0.0-preview.5.26302.115 + <_RuntimePackInWorkloadVersion10>10.0.8 + <_RuntimePackInWorkloadVersion9>9.0.16 + <_RuntimePackInWorkloadVersion8>8.0.27 + <_RuntimePackInWorkloadVersion7>7.0.20 + <_RuntimePackInWorkloadVersion6>6.0.36 + true + + + + + true + true + true + true + true + + + + <_BrowserWorkloadNotSupportedForTFM Condition="$([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '6.0'))">true + <_BrowserWorkloadDisabled>$(_BrowserWorkloadNotSupportedForTFM) + <_UsingBlazorOrWasmSdk Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' or '$(UsingMicrosoftNETSdkWebAssembly)' == 'true'">true + + + $(WasmNativeWorkload11) + $(WasmNativeWorkload10) + $(WasmNativeWorkload9) + $(WasmNativeWorkload8) + $(WasmNativeWorkload7) + $(WasmNativeWorkload) + false + $(WasmNativeWorkloadAvailable) + + + + + + <_WasmNativeWorkloadNeeded Condition=" '$(WasmEnableSIMD)' == 'false' or '$(WasmEnableExceptionHandling)' == 'false' or '$(InvariantTimezone)' == 'true' or '$(WasmNativeStrip)' == 'false' or '$(WasmNativeDebugSymbols)' == 'true' or '$(WasmSingleFileBundle)' == 'false' or '$(EnableDiagnostics)' == 'true' or '$(WasmProfilers)' != '' or '$(RunAOTCompilation)' == 'true' or '$(WasmBuildNative)' == 'true' or '$(WasmGenerateAppBundle)' == 'true' or '$(EmccInitialHeapSize)' != '' or '$(EmccMaximumHeapSize)' != '' ">true + false + true + $(WasmNativeWorkloadAvailable) + + + + <_IsAndroidLibraryMode Condition="'$(RuntimeIdentifier)' == 'android-arm64' or '$(RuntimeIdentifier)' == 'android-arm' or '$(RuntimeIdentifier)' == 'android-x64' or '$(RuntimeIdentifier)' == 'android-x86'">true + <_IsAppleMobileLibraryMode Condition="'$(RuntimeIdentifier)' == 'ios-arm64' or '$(RuntimeIdentifier)' == 'iossimulator-arm64' or '$(RuntimeIdentifier)' == 'iossimulator-x64' or '$(RuntimeIdentifier)' == 'maccatalyst-arm64' or '$(RuntimeIdentifier)' == 'maccatalyst-x64' or '$(RuntimeIdentifier)' == 'tvos-arm64'">true + <_IsiOSLibraryMode Condition="'$(RuntimeIdentifier)' == 'ios-arm64' or '$(RuntimeIdentifier)' == 'iossimulator-arm64' or '$(RuntimeIdentifier)' == 'iossimulator-x64'">true + <_IsMacCatalystLibraryMode Condition="'$(RuntimeIdentifier)' == 'maccatalyst-arm64' or '$(RuntimeIdentifier)' == 'maccatalyst-x64'">true + <_IstvOSLibraryMode Condition="'$(RuntimeIdentifier)' == 'tvos-arm64'">true + + + true + + + <_MonoWorkloadTargetsMobile>true + + + false + true + + + + $(_RuntimePackInWorkloadVersionCurrent) + + + + + true + 1.0 + + + + + + + true + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersionCurrent) + + + + + %(RuntimePackRuntimeIdentifiers);wasi-wasm + $(_MonoWorkloadRuntimePackPackageVersion) + + Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** + + + $(_MonoWorkloadRuntimePackPackageVersion) + + + + + + true + + + <_NativeBuildNeeded Condition="'$(RunAOTCompilation)' == 'true'">true + WebAssembly workloads (required for AOT) are only supported for projects targeting net6.0+ + + + true + $(WasmNativeWorkload) + + + 10.0 + 11.0 + + + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_MonoWorkloadTargetsMobile>true + <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersion6) + + + + $(_MonoWorkloadRuntimePackPackageVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_MonoWorkloadTargetsMobile>true + <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersion7) + + + + $(_MonoWorkloadRuntimePackPackageVersion) + + Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_MonoWorkloadTargetsMobile>true + <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersion8) + + + + + %(RuntimePackRuntimeIdentifiers);wasi-wasm + $(_MonoWorkloadRuntimePackPackageVersion) + + Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersion9) + + + + + %(RuntimePackRuntimeIdentifiers);wasi-wasm + $(_MonoWorkloadRuntimePackPackageVersion) + + Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** + + + $(_MonoWorkloadRuntimePackPackageVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersion10) + <_KnownWebAssemblySdkPackVersion>$(_RuntimePackInWorkloadVersion10) + + + + + %(RuntimePackRuntimeIdentifiers);wasi-wasm + $(_MonoWorkloadRuntimePackPackageVersion) + + Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** + + + $(_MonoWorkloadRuntimePackPackageVersion) + + + $(_KnownWebAssemblySdkPackVersion) + + + + + + + + + + + + + + + + + + + + <_ResolvedSuggestedWorkload Include="@(SuggestedWorkload)" /> + <_ResolvedSuggestedWorkload Include="@(SuggestedWorkloadFromReference)" /> + + + + + + + + + <_UsingDefaultRuntimeIdentifier>true + win7-x64 + win7-x86 + win-x64 + win-x86 + + + + true + + + + <_IsPublishing>true + + + + $(PublishSelfContained) + + + + true + + + $(NETCoreSdkPortableRuntimeIdentifier) + + + + true + + + $(NETCoreSdkPortableRuntimeIdentifier) + + + + $(RuntimeIdentifiers);$(PublishRuntimeIdentifier) + + + $(PublishRuntimeIdentifier) + + + <_UsingDefaultPlatformTarget>true + + + + + + + x86 + + + + + x64 + + + + + arm + + + + + arm64 + + + + + AnyCPU + + + + + + + <_SelfContainedWasSpecified Condition="'$(SelfContained)' != ''">true + + + + true + false + <_RuntimeIdentifierUsesAppHost Condition="$(RuntimeIdentifier.StartsWith('ios')) or $(RuntimeIdentifier.StartsWith('tvos')) or $(RuntimeIdentifier.StartsWith('maccatalyst')) or $(RuntimeIdentifier.StartsWith('android')) or $(RuntimeIdentifier.StartsWith('browser')) or $(RuntimeIdentifier.StartsWith('wasi')) or $(RuntimeIdentifier) == 'any'">false + <_RuntimeIdentifierUsesAppHost Condition="'$(_IsPublishing)' == 'true' and '$(PublishAot)' == 'true'">false + <_RuntimeIdentifierUsesAppHost Condition="'$(_RuntimeIdentifierUsesAppHost)' == ''">true + true + false + + + + $(NETCoreSdkRuntimeIdentifier) + win-x64 + win-x86 + win-arm + win-arm64 + + $(DefaultAppHostRuntimeIdentifier.Replace("arm64", "x64")) + + $(DefaultAppHostRuntimeIdentifier.Replace("arm64", "x64")) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + false + + + + + + + + + + + + + true + + + + + + + + true + + + + $(IntermediateOutputPath)$(RuntimeIdentifier)\ + $(OutputPath)$(RuntimeIdentifier)\ + + + + + + + + + + + + + + + + + true + true + + + + <_EolNetCoreTargetFrameworkVersions Include="1.0;1.1;2.0;2.1;2.2;3.0;3.1;5.0;6.0;7.0" /> + + + <_MinimumNonEolSupportedNetCoreTargetFramework>net8.0 + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + <_IsNETCoreOrNETStandard Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true + <_IsNETCoreOrNETStandard Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">true + + + + true + true + true + + + true + + + + true + + true + + .dll + + false + + + + $(PreserveCompilationContext) + + + + publish + + $(OutputPath)$(RuntimeIdentifier)\$(PublishDirName)\ + $(OutputPath)$(PublishDirName)\ + + + + + + <_NugetFallbackFolder>$(MSBuildThisFileDirectory)..\..\..\..\NuGetFallbackFolder + <_IsNETCore1x Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_TargetFrameworkVersionWithoutV)' < '2.0' ">true + <_WorkloadLibraryPacksFolder Condition="'$(_WorkloadLibraryPacksFolder)' == ''">$([MSBuild]::EnsureTrailingSlash('$(NetCoreRoot)'))library-packs + + + $(RestoreAdditionalProjectSources);$(_NugetFallbackFolder) + $(RestoreAdditionalProjectFallbackFoldersExcludes);$(_NugetFallbackFolder) + $(RestoreAdditionalProjectFallbackFolders);$(_NugetFallbackFolder) + + + $(RestoreAdditionalProjectSources);$(_WorkloadLibraryPacksFolder) + + + + <_SDKImplicitReference Include="System" /> + <_SDKImplicitReference Include="System.Data" /> + <_SDKImplicitReference Include="System.Drawing" /> + <_SDKImplicitReference Include="System.Xml" /> + + + <_SDKImplicitReference Include="System.Core" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' " /> + <_SDKImplicitReference Include="System.Runtime.Serialization" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' " /> + <_SDKImplicitReference Include="System.Xml.Linq" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' " /> + + <_SDKImplicitReference Include="System.Numerics" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.0' " /> + + <_SDKImplicitReference Include="System.IO.Compression.FileSystem" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.5' " /> + <_SDKImplicitReference Update="@(_SDKImplicitReference)" Pack="false" IsImplicitlyDefined="true" /> + + <_SDKImplicitReference Remove="@(Reference)" /> + + + + + + false + + + $(AssetTargetFallback);net461;net462;net47;net471;net472;net48;net481 + + + + + <_FrameworkIdentifierForImplicitDefine>$(TargetFrameworkIdentifier.Replace('.', '').ToUpperInvariant()) + <_FrameworkIdentifierForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0)) ">NET + $(_FrameworkIdentifierForImplicitDefine) + <_FrameworkIdentifierForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'">NET + <_FrameworkVersionForImplicitDefine>$(TargetFrameworkVersion.TrimStart('vV')) + <_FrameworkVersionForImplicitDefine>$(_FrameworkVersionForImplicitDefine.Replace('.', '_')) + <_FrameworkVersionForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'">$(_FrameworkVersionForImplicitDefine.Replace('_', '')) + $(_FrameworkIdentifierForImplicitDefine)$(_FrameworkVersionForImplicitDefine) + $(TargetFrameworkIdentifier.Replace('.', '').ToUpperInvariant()) + + + <_ImplicitDefineConstant Include="$(VersionlessImplicitFrameworkDefine)" /> + <_ImplicitDefineConstant Include="$(ImplicitFrameworkDefine)" /> + <_ImplicitDefineConstant Include="$(BackwardsCompatFrameworkDefine)" /> + + + + + + <_PlatformIdentifierForImplicitDefine>$(TargetPlatformIdentifier.ToUpperInvariant()) + <_PlatformVersionForImplicitDefine>$(EffectiveTargetPlatformVersion.Replace('.', '_')) + + + <_ImplicitDefineConstant Include="$(_PlatformIdentifierForImplicitDefine)" /> + <_ImplicitDefineConstant Include="$(_PlatformIdentifierForImplicitDefine)$(_PlatformVersionForImplicitDefine)" /> + + + + <_ImplicitDefineConstant Include="CSWINRT3_0" /> + + + + + + <_SupportedFrameworkVersions Include="@(_NETCoreAppVersionsForDefines->'%(Identity)'->TrimStart('.NETCoreApp,Version=v'))" Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' " /> + <_SupportedFrameworkVersions Include="@(SupportedNETFrameworkTargetFramework->'%(Identity)'->TrimStart('.NETFramework,Version=v'))" Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' " /> + <_SupportedFrameworkVersions Include="@(SupportedNETStandardTargetFramework->'%(Identity)'->TrimStart('.NETStandard,Version=v'))" Condition=" '$(TargetFrameworkIdentifier)' == '.NETStandard' " /> + <_CompatibleFrameworkVersions Include="@(_SupportedFrameworkVersions)" Condition=" $([MSBuild]::VersionLessThanOrEquals(%(Identity), $(TargetFrameworkVersion))) " /> + <_FormattedCompatibleFrameworkVersions Include="@(_CompatibleFrameworkVersions)" Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' or '$(TargetFrameworkIdentifier)' == '.NETStandard' " /> + <_FormattedCompatibleFrameworkVersions Include="@(_CompatibleFrameworkVersions->'%(Identity)'->Replace('.', ''))" Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' " /> + <_ImplicitDefineConstant Include="@(_FormattedCompatibleFrameworkVersions->'$(_FrameworkIdentifierForImplicitDefine)%(Identity)_OR_GREATER'->Replace('.', '_'))" Condition=" '$(TargetFrameworkIdentifier)' != '.NETCoreApp' or $([MSBuild]::VersionGreaterThanOrEquals(%(_FormattedCompatibleFrameworkVersions.Identity), 5.0)) " /> + <_ImplicitDefineConstant Include="@(_FormattedCompatibleFrameworkVersions->'NETCOREAPP%(Identity)_OR_GREATER'->Replace('.', '_'))" Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionLessThan(%(_FormattedCompatibleFrameworkVersions.Identity), 5.0)) " /> + + + + + + + <_SupportedPlatformCompatibleVersions Include="@(SdkSupportedTargetPlatformVersion)" Condition=" %(Identity) != '' and '%(SdkSupportedTargetPlatformVersion.NormalizedSupportedTargetPlatformVersion)' == '' and $([MSBuild]::VersionLessThanOrEquals(%(Identity), $(TargetPlatformVersion))) " /> + <_SupportedPlatformCompatibleVersions Include="@(SdkSupportedTargetPlatformVersion->'%(NormalizedSupportedTargetPlatformVersion)')" Condition=" '%(SdkSupportedTargetPlatformVersion.NormalizedSupportedTargetPlatformVersion)' != '' and $([MSBuild]::VersionLessThanOrEquals('%(SdkSupportedTargetPlatformVersion.NormalizedSupportedTargetPlatformVersion)', $(TargetPlatformVersion))) " /> + <_ImplicitDefineConstant Include="@(_SupportedPlatformCompatibleVersions->Distinct()->'$(TargetPlatformIdentifier.ToUpper())%(Identity)_OR_GREATER'->Replace('.', '_'))" /> + + + + + + <_DefineConstantsWithoutTrace Include="$(DefineConstants)" /> + <_DefineConstantsWithoutTrace Remove="TRACE" /> + + + @(_DefineConstantsWithoutTrace) + + + + + + $(DefineConstants);@(_ImplicitDefineConstant) + $(FinalDefineConstants),@(_ImplicitDefineConstant->'%(Identity)=-1', ',') + + + + + false + true + + + $(AssemblyName).xml + $(IntermediateOutputPath)$(AssemblyName).xml + + + + + + true + true + true + true + + + + + + + true + + + + + + + + + FrameworkPackage + + + + + + Core + + + + + + FrameworkPackage + + + + + + Framework + + + + + + + + + + + $(RoslynTargetsPath) + $(MSBuildThisFileDirectory)..\..\..\Roslyn\bincore + + + $(MSBuildThisFileDirectory)..\..\..\Roslyn + $(MSBuildThisFileDirectory)..\..\..\Roslyn\Microsoft.Build.Tasks.CodeAnalysis.dll + $(RoslynCoreAssembliesPath) + $(MSBuildThisFileDirectory)..\..\..\Roslyn\binfx + $(MSBuildThisFileDirectory)..\..\..\Roslyn\binfx\Microsoft.Build.Tasks.CodeAnalysis.Sdk.dll + $(MSBuildThisFileDirectory)..\..\..\Roslyn\Microsoft.CSharp.Core.targets + $(MSBuildThisFileDirectory)..\..\..\Roslyn\Microsoft.VisualBasic.Core.targets + + + + $(MSBuildToolsPath)\Microsoft.CSharp.targets + $(MSBuildToolsPath)\Microsoft.VisualBasic.targets + $(MSBuildThisFileDirectory)..\targets\Microsoft.NET.Sdk.FSharpTargetsShim.targets + + $(MSBuildToolsPath)\Microsoft.Common.targets + + + + + + + + $(MSBuildToolsPath)\Microsoft.CSharp.CrossTargeting.targets + + + + + $(MSBuildToolsPath)\Microsoft.CSharp.CurrentVersion.targets + + + + + + + + true + + + + + + true + true + true + true + + + + + $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.Before.Microsoft.CSharp.targets + $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.After.Microsoft.CSharp.targets + + + + .cs + C# + Managed + true + true + true + true + true + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Properties + + + + + File + + + BrowseObject + + + + + + + + + + + + + <_Temporary Remove="@(_Temporary)" /> + + + + + + + + + + + + + <_Temporary Remove="@(_Temporary)" /> + + + + + + + + + + + + + + true + + + + + + <_DebugSymbolsIntermediatePathTemporary Include="$(PdbFile)" /> + + <_DebugSymbolsIntermediatePath Include="@(_DebugSymbolsIntermediatePathTemporary->'%(RootDir)%(Directory)%(Filename).pdb')" /> + + + $(CoreCompileDependsOn);_ComputeNonExistentFileProperty;ResolveCodeAnalysisRuleSet + true + + + + + + $(NoWarn);1701;1702 + + + + $(NoWarn);2008 + + + + + + + + + $(AppConfig) + + $(IntermediateOutputPath)$(TargetName).compile.pdb + + + + false + + + + + + + true + + + + + + + + + + $(RoslynTargetsPath)\Microsoft.CSharp.Core.targets + + + + + + + <_BuildTasksDirectory>$(MSBuildThisFileDirectory) + <_BuildTasksDirectory Condition="Exists('$(RoslynTargetsPath)')">$(RoslynTargetsPath)\ + <_BuildTasksAssemblyName>Microsoft.Build.Tasks.CodeAnalysis + <_BuildTasksAssemblyName Condition="!Exists('$(_BuildTasksDirectory)$(_BuildTasksAssemblyName)') and Exists('$(_BuildTasksDirectory)Microsoft.Build.Tasks.CodeAnalysis.Sdk.dll')">Microsoft.Build.Tasks.CodeAnalysis.Sdk + + + + + + roslyn5.8 + + + + + + + + + + + + + + + + + false + + + + + + + + true + + + + + + + + <_SkipAnalyzers /> + <_ImplicitlySkipAnalyzers /> + + + + <_SkipAnalyzers>true + + + + <_ImplicitlySkipAnalyzers>true + <_SkipAnalyzers>true + run-nullable-analysis=never;$(Features) + + + + + + <_LastBuildWithSkipAnalyzers>$(IntermediateOutputPath)$(MSBuildProjectFile).BuildWithSkipAnalyzers + + + + + + + + + + + + + + <_AllDirectoriesAbove Include="@(Compile->GetPathsOfAllDirectoriesAbove())" Condition="'$(DiscoverEditorConfigFiles)' != 'false' or '$(DiscoverGlobalAnalyzerConfigFiles)' != 'false'" /> + + + + + + + + + + + + $(IntermediateOutputPath)$(MSBuildProjectName).GeneratedMSBuildEditorConfig.editorconfig + true + <_GeneratedEditorConfigHasItems Condition="'@(CompilerVisibleItemMetadata->Count())' != '0'">true + <_GeneratedEditorConfigShouldRun Condition="'$(GenerateMSBuildEditorConfigFile)' == 'true' and ('$(_GeneratedEditorConfigHasItems)' == 'true' or '@(CompilerVisibleProperty->Count())' != '0')">true + + + + + + <_GeneratedEditorConfigProperty Include="@(CompilerVisibleProperty)"> + $(%(CompilerVisibleProperty.Identity)) + + + <_GeneratedEditorConfigMetadata Include="@(%(CompilerVisibleItemMetadata.Identity))" Condition="'$(_GeneratedEditorConfigHasItems)' == 'true'"> + %(Identity) + %(CompilerVisibleItemMetadata.MetadataName) + + + + + + + + + + + true + + + + + <_MappedSourceRoot Remove="@(_MappedSourceRoot)" /> + + + + + + + + + + + + true + + + + + + + <_TopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"> + $([MSBuild]::ValueOrDefault('%(Identity)', '').Replace(',', ',,').Replace('=', '==')) + $([MSBuild]::ValueOrDefault('%(MappedPath)', '').Replace(',', ',,').Replace('=', '==')) + + + + + @(_TopLevelSourceRoot->'%(EscapedKey)=%(EscapedValue)', ','),$(PathMap) + + + + + + + + + + + false + + $(IntermediateOutputPath)/generated + + + + + + + + + + + + + <_MaxSupportedLangVersion Condition="('$(TargetFrameworkIdentifier)' != '.NETCoreApp' OR '$(_TargetFrameworkVersionWithoutV)' < '3.0') AND ('$(TargetFrameworkIdentifier)' != '.NETStandard' OR '$(_TargetFrameworkVersionWithoutV)' < '2.1')">7.3 + + <_MaxSupportedLangVersion Condition="(('$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_TargetFrameworkVersionWithoutV)' < '5.0') OR ('$(TargetFrameworkIdentifier)' == '.NETStandard' AND '$(_TargetFrameworkVersionWithoutV)' == '2.1')) AND '$(_MaxSupportedLangVersion)' == ''">8.0 + + <_MaxSupportedLangVersion Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_MaxSupportedLangVersion)' == ''">$([MSBuild]::Add(9, $([MSBuild]::Subtract($(_TargetFrameworkVersionWithoutV.Split('.')[0]), 5)))).0 + + <_MaxAvailableLangVersion>14.0 + <_MaxSupportedLangVersion Condition="'$(_MaxSupportedLangVersion)' != '' AND '$(_MaxSupportedLangVersion)' > '$(_MaxAvailableLangVersion)'">$(_MaxAvailableLangVersion) + $(_MaxSupportedLangVersion) + $(_MaxSupportedLangVersion) + + + + + + + + + $(NoWarn);1701;1702 + + + + $(NoWarn);2008 + + + + $(NoWarn);8002 + + + + $(AppConfig) + + $(IntermediateOutputPath)$(TargetName).compile.pdb + + + + + + + <_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" /> + + + + + + -langversion:$(LangVersion) + $(CommandLineArgsForDesignTimeEvaluation) -checksumalgorithm:$(ChecksumAlgorithm) + $(CommandLineArgsForDesignTimeEvaluation) -define:$(DefineConstants) + $(CommandLineArgsForDesignTimeEvaluation) -features:$(Features) + $(CommandLineArgsForDesignTimeEvaluation) -doc:"$(DocumentationFile)" + + + + + + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets + + + + + + $(MSBuildToolsPath)\Microsoft.Common.CurrentVersion.targets + + + + + + true + true + true + true + + + + + + + 10.0 + + + $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.Before.Microsoft.Common.targets + $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.After.Microsoft.Common.targets + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\ReportingServices\Microsoft.ReportingServices.targets + + + + + Managed + + + + .NETFramework + v4.0 + + + + Any CPU,x86,x64,Itanium + Any CPU,x86,x64 + + + + + + + + $(SDK40ToolsPath) + + + + true + + + false + + + + + true + + true + + + $(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile) + $(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion) + + $(TargetFrameworkRootPath)$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion) + + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries($(TargetFrameworkIdentifier), $(TargetFrameworkVersion), $(TargetFrameworkProfile), $(PlatformTarget), $(TargetFrameworkRootPath), $(TargetFrameworkFallbackSearchPaths))) + $(MSBuildFrameworkToolsPath) + + + Windows + 7.0 + $(TargetPlatformSdkRootOverride)\ + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SDKs\Windows\v$(TargetPlatformVersion)', InstallationFolder, null, RegistryView.Registry32, RegistryView.Default)) + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKLocation($(TargetPlatformIdentifier), $(TargetPlatformVersion))) + $(TargetPlatformSdkPath)Windows Metadata + $(TargetPlatformSdkPath)References\CommonConfiguration\Neutral + $(TargetPlatformSdkMetadataLocation) + true + $(WinDir)\System32\WinMetadata + $(TargetPlatformIdentifier),Version=$(TargetPlatformVersion) + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKDisplayName($(TargetPlatformIdentifier), $(TargetPlatformVersion))) + + + + + <_OriginalPlatform>$(Platform) + + <_OriginalConfiguration>$(Configuration) + + <_OutputPathWasMissing Condition="'$(_OriginalPlatform)' != '' and '$(_OriginalConfiguration)' != '' and '$(OutputPath)' == ''">true + + true + + + AnyCPU + $(Platform) + Debug + $(Configuration) + bin\ + $(BaseOutputPath)\ + $(BaseOutputPath)$(Configuration)\ + $(BaseOutputPath)$(PlatformName)\$(Configuration)\ + $(OutputPath)\ + obj\ + $(BaseIntermediateOutputPath)\ + $(BaseIntermediateOutputPath)$(Configuration)\ + $(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\ + $(IntermediateOutputPath)\ + + + + $(TargetType) + library + exe + true + + <_DebugSymbolsProduced>false + <_DebugSymbolsProduced Condition="'$(DebugSymbols)'=='true'">true + <_DebugSymbolsProduced Condition="'$(DebugType)'=='none'">false + <_DebugSymbolsProduced Condition="'$(DebugType)'=='pdbonly'">true + <_DebugSymbolsProduced Condition="'$(DebugType)'=='full'">true + <_DebugSymbolsProduced Condition="'$(DebugType)'=='portable'">true + <_DebugSymbolsProduced Condition="'$(DebugType)'=='embedded'">false + <_DebugSymbolsProduced Condition="'$(ProduceOnlyReferenceAssembly)'=='true'">false + + <_DocumentationFileProduced>true + <_DocumentationFileProduced Condition="'$(DocumentationFile)'==''">false + + false + + + + + <_InvalidConfigurationMessageSeverity Condition=" '$(SkipInvalidConfigurations)' == 'true' ">Warning + <_InvalidConfigurationMessageSeverity Condition=" '$(SkipInvalidConfigurations)' != 'true' ">Error + + + + .exe + .exe + .exe + .dll + .netmodule + .winmdobj + + + + true + $(OutputPath) + + + $(OutDir)\ + $(MSBuildProjectName) + + + $(OutDir)$(ProjectName)\ + $(MSBuildProjectName) + $(RootNamespace) + $(AssemblyName) + + $(MSBuildProjectFile) + + $(MSBuildProjectExtension) + + $(TargetName).winmd + $(WinMDExpOutputWindowsMetadataFilename) + $(TargetName)$(TargetExt) + + + + + <_DeploymentPublishableProjectDefault Condition="'$(OutputType)'=='winexe' or '$(OutputType)'=='exe' or '$(OutputType)'=='appcontainerexe'">true + $(_DeploymentPublishableProjectDefault) + <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='library'">Native.$(AssemblyName).manifest + + <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='winexe'">$(TargetFileName).manifest + + <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='exe'">$(TargetFileName).manifest + + <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='appcontainerexe'">$(TargetFileName).manifest + + $(AssemblyName).application + + $(AssemblyName).xbap + + $(GenerateManifests) + <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='library'">Native.$(AssemblyName) + <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='winexe'">$(AssemblyName).exe + <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='exe'">$(AssemblyName).exe + <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='appcontainerexe'">$(AssemblyName).exe + <_DeploymentDeployManifestIdentity Condition="'$(HostInBrowser)' != 'true'">$(AssemblyName).application + <_DeploymentDeployManifestIdentity Condition="'$(HostInBrowser)' == 'true'">$(AssemblyName).xbap + <_DeploymentFileMappingExtension Condition="'$(MapFileExtensions)'=='true'">.deploy + <_DeploymentFileMappingExtension Condition="'$(MapFileExtensions)'!='true'" /> + <_DeploymentBuiltUpdateInterval Condition="'$(UpdatePeriodically)'=='true'">$(UpdateInterval) + <_DeploymentBuiltUpdateIntervalUnits Condition="'$(UpdatePeriodically)'=='true'">$(UpdateIntervalUnits) + <_DeploymentBuiltUpdateInterval Condition="'$(UpdatePeriodically)'!='true'">0 + <_DeploymentBuiltUpdateIntervalUnits Condition="'$(UpdatePeriodically)'!='true'">Days + <_DeploymentBuiltMinimumRequiredVersion Condition="'$(UpdateRequired)'=='true' and '$(Install)'=='true'">$(MinimumRequiredVersion) + <_DeploymentLauncherBased Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true + 100 + + + + * + $(UICulture) + + + + <_OutputPathItem Include="$(OutDir)" /> + <_UnmanagedRegistrationCache Include="$(BaseIntermediateOutputPath)$(MSBuildProjectFile).UnmanagedRegistration.cache" /> + <_ResolveComReferenceCache Include="$(IntermediateOutputPath)$(MSBuildProjectFile).ResolveComReference.cache" /> + + + + + $([MSBuild]::Escape($([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(OutDir)`))`)))) + + $(TargetDir)$(TargetFileName) + $([MSBuild]::NormalizePath($(TargetDir), 'ref', $(TargetFileName))) + $([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(IntermediateOutputPath), 'ref', $(TargetFileName))) + + $([MSBuild]::EnsureTrailingSlash($(MSBuildProjectDirectory))) + + $(ProjectDir)$(ProjectFileName) + + + + + + + + *Undefined* + *Undefined* + + *Undefined* + + *Undefined* + + *Undefined* + + *Undefined* + + + + true + + true + + + true + false + + + $(MSBuildProjectFile).FileListAbsolute.txt + + false + + true + true + <_ResolveReferenceDependencies Condition="'$(_ResolveReferenceDependencies)' == ''">false + <_GetChildProjectCopyToOutputDirectoryItems Condition="'$(_GetChildProjectCopyToOutputDirectoryItems)' == ''">true + false + false + + + <_GenerateBindingRedirectsIntermediateAppConfig>$(IntermediateOutputPath)$(TargetFileName).config + + + $(MSBuildProjectFile) + + $([MSBuild]::SubstringByAsciiChars($(MSBuildProjectFile), 0, 8)).$([MSBuild]::StableStringHash($(MSBuildProjectFile)).ToString("X8")) + $(MSBuildCopyMarkerName).Up2Date + + + + + + + + + + + + + + <_DebugSymbolsIntermediatePath Include="$(IntermediateOutputPath)$(TargetName).compile.pdb" Condition="'$(OutputType)' == 'winmdobj' and '@(_DebugSymbolsIntermediatePath)' == ''" /> + <_DebugSymbolsIntermediatePath Include="$(IntermediateOutputPath)$(TargetName).pdb" Condition="'$(OutputType)' != 'winmdobj' and '@(_DebugSymbolsIntermediatePath)' == ''" /> + <_DebugSymbolsOutputPath Include="@(_DebugSymbolsIntermediatePath->'$(OutDir)%(Filename)%(Extension)')" /> + + + $(IntermediateOutputPath)$(TargetName).pdb + <_WinMDDebugSymbolsOutputPath>$([System.IO.Path]::Combine('$(OutDir)', $([System.IO.Path]::GetFileName('$(WinMDExpOutputPdb)')))) + + + $(IntermediateOutputPath)$(TargetName).xml + <_WinMDDocFileOutputPath>$([System.IO.Path]::Combine('$(OutDir)', $([System.IO.Path]::GetFileName('$(WinMDOutputDocumentationFile)')))) + + + <_IntermediateWindowsMetadataPath>$(IntermediateOutputPath)$(WinMDExpOutputWindowsMetadataFilename) + <_WindowsMetadataOutputPath>$(OutDir)$(WinMDExpOutputWindowsMetadataFilename) + + + + <_SupportedArchitectures>amd64 arm64 + + + + <_DeploymentManifestEntryPoint Include="@(IntermediateAssembly)"> + $(TargetFileName) + + + + <_DeploymentManifestIconFile Include="$(ApplicationIcon)" Condition="Exists('$(ApplicationIcon)')"> + $(ApplicationIcon) + + + + $(_DeploymentTargetApplicationManifestFileName) + + + <_ApplicationManifestFinal Include="$(OutDir)$(_DeploymentTargetApplicationManifestFileName)"> + $(_DeploymentTargetApplicationManifestFileName) + + + + $(TargetDeployManifestFileName) + + + <_DeploymentIntermediateTrustInfoFile Include="$(IntermediateOutputPath)$(TargetName).TrustInfo.xml" Condition="'$(TargetZone)'!=''" /> + + + + <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(UpdateUrl) + <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(InstallUrl) + <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(PublishUrl) + <_DeploymentUrl Condition="!('$(UpdateUrl)'=='') and '$(Install)'=='false'" /> + <_DeploymentUrl Condition="'$(_DeploymentUrl)'!=''">$(_DeploymentUrl)$(TargetDeployManifestFileName) + + <_DeploymentUrl Condition="'$(UpdateUrl)'=='' and !('$(Install)'=='true' and '$(UpdateEnabled)'=='true')" /> + <_DeploymentUrl Condition="'$(ExcludeDeploymentUrl)'=='true'" /> + + + + <_DeploymentApplicationUrl Condition="'$(IsWebBootstrapper)'=='true'">$(InstallUrl) + <_DeploymentApplicationUrl Condition="'$(IsWebBootstrapper)'=='true' and '$(InstallUrl)'==''">$(PublishUrl) + <_DeploymentComponentsUrl Condition="'$(BootstrapperComponentsLocation)'=='Absolute'">$(BootstrapperComponentsUrl) + + + + $(PublishDir)\ + $([MSBuild]::EnsureTrailingSlash('$(OutputPath)'))app.publish\ + + + + $(PublishDir) + $(ClickOncePublishDir)\ + + + + + $(PlatformTarget) + + msil + amd64 + ia64 + x86 + arm + + + true + + + + $(Platform) + msil + amd64 + ia64 + x86 + arm + + None + $(PROCESSOR_ARCHITECTURE) + + + + CLR2 + CLR4 + CurrentRuntime + true + false + $(PlatformTarget) + x86 + x64 + CurrentArchitecture + + + + Client + + + + false + + + + + true + true + false + + + + AssemblyFoldersEx + Software\Microsoft\$(TargetFrameworkIdentifier) + Software\Microsoft\Microsoft SDKs\$(TargetPlatformIdentifier) + $([MSBuild]::GetToolsDirectory32())\AssemblyFolders.config + {AssemblyFoldersFromConfig:$(AssemblyFoldersConfigFile),$(TargetFrameworkVersion)}; + + + .winmd; + .dll; + .exe + + + + .pdb; + .xml; + .pri; + .dll.config; + .exe.config + + + Full + + + + {CandidateAssemblyFiles} + $(AssemblySearchPaths);$(ReferencePath) + $(AssemblySearchPaths);{HintPathFromItem} + $(AssemblySearchPaths);{TargetFrameworkDirectory} + $(AssemblySearchPaths);$(AssemblyFoldersConfigFileSearchPath) + $(AssemblySearchPaths);{Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)} + $(AssemblySearchPaths);{AssemblyFolders} + $(AssemblySearchPaths);{GAC} + $(AssemblySearchPaths);{RawFileName} + $(AssemblySearchPaths);$(OutDir) + + + + false + + + + $(MSBuildWarningsAsMessages);$(NoWarn) + $(WarningsAsErrors) + $(WarningsNotAsErrors) + + + + $(MSBuildThisFileDirectory)$(LangName)\ + + + + $(MSBuildThisFileDirectory)en-US\ + + + + + Project + + + BrowseObject + + + File + + + Invisible + + + File;BrowseObject + + + File;ProjectSubscriptionService + + + + $(DefineCommonItemSchemas) + + + + + ;BrowseObject + + + ProjectSubscriptionService;BrowseObject + + + + ;BrowseObject + + + ProjectSubscriptionService;BrowseObject + + + + ;BrowseObject + + + ProjectSubscriptionService;BrowseObject + + + + + + + + + Never + + + Never + + + Never + + + Never + + + + + + true + + + + + <_GlobalPropertiesToRemoveFromProjectReferences Condition="'$(PassOutputPathToReferencedProjects)'=='false'">$(_GlobalPropertiesToRemoveFromProjectReferences);OutputPath + + + + + + <_InvalidConfigurationMessageResourceName Condition=" '$(BuildingInsideVisualStudio)' == 'true' ">CommonSdk.InvalidConfigurationTextWhenBuildingInsideVisualStudio + <_InvalidConfigurationMessageResourceName Condition=" '$(BuildingInsideVisualStudio)' != 'true' ">CommonSdk.InvalidConfigurationTextWhenBuildingOutsideVisualStudio + + + + + + + + + + + x86 + + + + + + + + + + + + + BeforeBuild; + CoreBuild; + AfterBuild + + + + + + + + + + + BuildOnlySettings; + PrepareForBuild; + PreBuildEvent; + ResolveReferences; + PrepareResources; + ResolveKeySource; + Compile; + ExportWindowsMDFile; + UnmanagedUnregistration; + GenerateSerializationAssemblies; + CreateSatelliteAssemblies; + GenerateManifests; + GetTargetPath; + PrepareForRun; + UnmanagedRegistration; + IncrementalClean; + PostBuildEvent + + + + + + + + + <_ProjectDefaultTargets Condition="'$(MSBuildProjectDefaultTargets)' != ''">$(MSBuildProjectDefaultTargets) + <_ProjectDefaultTargets Condition="'$(MSBuildProjectDefaultTargets)' == ''">Build + + BeforeRebuild; + Clean; + $(_ProjectDefaultTargets); + AfterRebuild; + + + BeforeRebuild; + Clean; + Build; + AfterRebuild; + + + + + + + + + + Build + + + + + + + + + + + Build + + + + + + + + + + + Build + + + + + + + + + + + + + + + + + + + + + + + false + + + + true + + + + + + $(PrepareForBuildDependsOn);GetFrameworkPaths;GetReferenceAssemblyPaths;AssignLinkMetadata + + + + + $(TargetFileName).config + + + + + + + + + + + + + @(_TargetFramework40DirectoryItem) + @(_TargetFramework35DirectoryItem) + @(_TargetFramework30DirectoryItem) + @(_TargetFramework20DirectoryItem) + + @(_TargetFramework20DirectoryItem) + @(_TargetFramework40DirectoryItem) + @(_TargetedFrameworkDirectoryItem) + @(_TargetFrameworkSDKDirectoryItem) + + + + + + + + + + + + + + + + + + $(_TargetFrameworkDirectories);$(TargetFrameworkDirectory);$(WinFXAssemblyDirectory) + $(TargetFrameworkDirectory);$(TargetPlatformWinMDLocation) + + + + true + + + $(AssemblySearchPaths.Replace('{AssemblyFolders}', '').Split(';')) + + + + + + + $(TargetFrameworkDirectory);@(DesignTimeFacadeDirectories) + + + + + + + + + + + + + + + + + + + + + <_Temp Remove="@(_Temp)" /> + + + + + + + + + <_Temp Remove="@(_Temp)" /> + + + + + + + + + <_Temp Remove="@(_Temp)" /> + + + + + + + + + <_Temp Remove="@(_Temp)" /> + + + + + + + + + <_Temp Remove="@(_Temp)" /> + + + + + + + + + <_Temp Remove="@(_Temp)" /> + + + + + + + + + + + + + + + + + + $(PlatformTargetAsMSBuildArchitecture) + + + + $(TargetFrameworkAsMSBuildRuntime) + + CurrentRuntime + + + + + + + + + + BeforeResolveReferences; + AssignProjectConfiguration; + ResolveProjectReferences; + FindInvalidProjectReferences; + ResolveNativeReferences; + ResolveAssemblyReferences; + GenerateBindingRedirects; + GenerateBindingRedirectsUpdateAppConfig; + ResolveComReferences; + AfterResolveReferences + + + + + + + + + + + + false + + + + + + + true + true + false + + false + + true + + + + + + + + + + + <_ProjectReferenceWithConfiguration> + true + true + + + true + true + + + + + + + + + + + + + <_MSBuildProjectReference Include="@(ProjectReferenceWithConfiguration)" Condition="'$(BuildingInsideVisualStudio)'!='true' and '@(ProjectReferenceWithConfiguration)'!=''" /> + + + + <_MSBuildProjectReferenceExistent Include="@(_MSBuildProjectReference)" Condition="'$(_BuildNonexistentProjectsByDefault)' == 'true' or Exists('%(Identity)')" /> + <_MSBuildProjectReferenceNonexistent Include="@(_MSBuildProjectReference)" Condition="'$(_BuildNonexistentProjectsByDefault)' != 'true' and !Exists('%(Identity)')" /> + + + + + true + + + + + + <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SetPlatform)' != ''"> + true + + + + <_ProjectReferencePlatformPossibilities Include="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.SkipGetPlatformProperties)' != 'true'" /> + + + + + <_ProjectReferencePlatformPossibilities Condition="'$(MSBuildProjectExtension)' != '.vcxproj' and '$(MSBuildProjectExtension)' != '.nativeproj' and '%(_ProjectReferencePlatformPossibilities.IsVcxOrNativeProj)' == 'true'"> + + x86=Win32 + + + <_ProjectReferencePlatformPossibilities Condition="('$(MSBuildProjectExtension)' == '.vcxproj' or '$(MSBuildProjectExtension)' == '.nativeproj') and '%(_ProjectReferencePlatformPossibilities.IsVcxOrNativeProj)' != 'true'"> + Win32=x86 + + + + + + + + + + Platform=%(ProjectsWithNearestPlatform.NearestPlatform) + + + + %(ProjectsWithNearestPlatform.UndefineProperties);Platform + + <_MSBuildProjectReferenceExistent Remove="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.SkipGetPlatformProperties)' != 'true'" /> + <_MSBuildProjectReferenceExistent Include="@(ProjectsWithNearestPlatform)" /> + + + + + + + $(NuGetTargetMoniker) + $(TargetFrameworkMoniker) + + + + <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SkipGetTargetFrameworkProperties)' == '' and ('%(Extension)' == '.vcxproj' or '%(Extension)' == '.nativeproj')"> + + true + %(_MSBuildProjectReferenceExistent.UndefineProperties);TargetFramework + + + + + <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SetTargetFramework)' != ''"> + + true + + + + + + + + + + + + + <_ProjectReferenceTargetFrameworkPossibilitiesOriginalItemSpec Include="@(_ProjectReferenceTargetFrameworkPossibilities->'%(OriginalItemSpec)')" /> + <_ProjectReferenceTargetFrameworkPossibilities Remove="@(_ProjectReferenceTargetFrameworkPossibilities)" /> + <_ProjectReferenceTargetFrameworkPossibilities Include="@(_ProjectReferenceTargetFrameworkPossibilitiesOriginalItemSpec)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + TargetFramework=%(AnnotatedProjects.NearestTargetFramework) + + + + %(AnnotatedProjects.UndefineProperties);TargetFramework + + + + %(AnnotatedProjects.UndefineProperties);RuntimeIdentifier;SelfContained + + + <_MSBuildProjectReferenceExistent Remove="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.SkipGetTargetFrameworkProperties)' != 'true'" /> + <_MSBuildProjectReferenceExistent Include="@(AnnotatedProjects)" /> + + + + + + + + + <_ThisProjectBuildMetadata Include="$(MSBuildProjectFullPath)"> + @(_TargetFrameworkInfo) + @(_TargetFrameworkInfo->'%(TargetFrameworkMonikers)') + @(_TargetFrameworkInfo->'%(TargetPlatformMonikers)') + $(_AdditionalPropertiesFromProject) + true + @(_TargetFrameworkInfo->'%(IsRidAgnostic)') + + true + $(Platform) + $(Platforms) + + @(ProjectConfiguration->'%(Platform)'->Distinct()) + + + + + + <_AdditionalTargetFrameworkInfoPropertyWithValue Include="@(AdditionalTargetFrameworkInfoProperty)"> + $(%(AdditionalTargetFrameworkInfoProperty.Identity)) + + + + <_UseAttributeForTargetFrameworkInfoPropertyNames Condition="'$(_UseAttributeForTargetFrameworkInfoPropertyNames)' == ''">false + + + + + + <_TargetFrameworkInfo Include="$(TargetFramework)"> + $(TargetFramework) + $(TargetFrameworkMoniker) + $(TargetPlatformMoniker) + None + $(_AdditionalTargetFrameworkInfoProperties) + + $(IsRidAgnostic) + true + false + + + + + + + + + AssignProjectConfiguration; + _SplitProjectReferencesByFileExistence; + _GetProjectReferenceTargetFrameworkProperties; + _GetProjectReferencePlatformProperties + + + + + + + + + $(ProjectReferenceBuildTargets) + + + ProjectReference + + + + + + + + + + + + + + + + + + + <_ResolvedProjectReferencePaths Remove="@(_ResolvedProjectReferencePaths)" Condition="'%(_ResolvedProjectReferencePaths.ResolveableAssembly)' == 'false'" /> + + <_ResolvedProjectReferencePaths> + %(_ResolvedProjectReferencePaths.OriginalItemSpec) + + + + + <_NonExistentProjectReferenceSeverity Condition="'@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceNonexistent)' != '' and '$(ErrorOnMissingProjectReference)' != 'True'">Warning + <_NonExistentProjectReferenceSeverity Condition="'@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceNonexistent)' != '' and '$(ErrorOnMissingProjectReference)' == 'True'">Error + + + + + + + <_ProjectReferencesFromRAR Include="@(ReferencePath->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))"> + %(ReferencePath.ProjectReferenceOriginalItemSpec) + + + + + + + + + $(GetTargetPathDependsOn) + + + + + + $(TargetPlatformMoniker) + $(TargetPlatformIdentifier) + $(TargetFrameworkIdentifier) + $(TargetFrameworkVersion.TrimStart('vV')) + $(TargetRefPath) + @(CopyUpToDateMarker) + + + + + + + + %(_ApplicationManifestFinal.FullPath) + + + + + + + + + + + + + + + + + + ResolveProjectReferences; + FindInvalidProjectReferences; + GetFrameworkPaths; + GetReferenceAssemblyPaths; + PrepareForBuild; + ResolveSDKReferences; + ExpandSDKReferences; + + + + + <_ReferenceInstalledAssemblyDirectory Include="$(TargetFrameworkDirectory)" /> + <_ReferenceInstalledAssemblySubsets Include="$(TargetFrameworkSubset)" /> + + + + $(IntermediateOutputPath)$(MSBuildProjectFile).AssemblyReference.cache + + + false + + + + <_ResolveAssemblyReferencesApplicationConfigFileForExes Include="@(AppConfigWithTargetPath)" Condition="'$(AutoGenerateBindingRedirects)'=='true' or '$(AutoUnifyAssemblyReferences)'=='false'" /> + + + + <_FindDependencies Condition="'$(BuildingProject)' != 'true' and '$(_ResolveReferenceDependencies)' != 'true'">false + true + false + Warning + $(BuildingProject) + $(BuildingProject) + $(BuildingProject) + false + + + + + + true + + + + + + + + false + + + + false + true + + + + + + + + + + + + + + + + + + + + + + + %(FullPath) + + + %(ReferencePath.Identity) + + + + + + + + + + + + + + + <_NewGenerateBindingRedirectsIntermediateAppConfig Condition="Exists('$(_GenerateBindingRedirectsIntermediateAppConfig)')">true + $(_GenerateBindingRedirectsIntermediateAppConfig) + + + + + $(TargetFileName).config + + + + + + Software\Microsoft\Microsoft SDKs + $(LocalAppData)\Microsoft SDKs;$(MSBuildProgramFiles32)\Microsoft SDKs + + $(MSBuildProgramFiles32)\Microsoft SDKs\Windows Kits\10;$(WindowsKitsRoot) + + true + Windows + 8.1 + + false + WindowsPhoneApp + 8.1 + + + + + + + + + + + + + + + + + GetInstalledSDKLocations + + + + Debug + Retail + Retail + $(ProcessorArchitecture) + Neutral + + + true + + + + + + + + + + + + + + + + GetReferenceTargetPlatformMonikers + + + + + + + + <_ResolvedProjectReferencePaths Remove="@(InvalidProjectReferences)" /> + + + + + + + + + + + + + + ResolveSDKReferences + + + .winmd; + .dll + + + + + + + + + + + + + + + + false + false + false + $(TargetFrameworkSDKToolsDirectory) + true + + + + + + + + + + + + + + + <_ReferencesFromRAR Include="@(ReferencePath->WithMetadataValue('ReferenceSourceTarget', 'ResolveAssemblyReference'))" /> + + + + + {CandidateAssemblyFiles}; + $(ReferencePath); + {HintPathFromItem}; + {TargetFrameworkDirectory}; + {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)}; + {RawFileName}; + $(TargetDir) + + + + + + GetFrameworkPaths; + GetReferenceAssemblyPaths; + ResolveReferences + + + + + <_DesignTimeReferenceInstalledAssemblyDirectory Include="$(TargetFrameworkDirectory)" /> + + + $(IntermediateOutputPath)$(MSBuildProjectFile)DesignTimeResolveAssemblyReferences.cache + + + + {CandidateAssemblyFiles}; + $(ReferencePath); + {HintPathFromItem}; + {TargetFrameworkDirectory}; + {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)}; + {RawFileName}; + $(OutDir) + + + + false + false + false + false + false + true + false + + + <_DesignTimeReferenceAssemblies Include="$(DesignTimeReference)" /> + + + <_RARResolvedReferencePath Include="@(ReferencePath)" /> + + + + + + + + + + false + + + + $(IntermediateOutputPath) + + + + + $(PlatformTargetAsMSBuildArchitecture) + $(TargetFrameworkSDKToolsDirectory) + false + + + + + + + + + + + + + + + + + + + + + + + + + + + $(PrepareResourcesDependsOn); + PrepareResourceNames; + ResGen; + CompileLicxFiles + + + + + + + AssignTargetPaths; + SplitResourcesByCulture; + CreateManifestResourceNames; + CreateCustomManifestResourceNames + + + + + + + + + + <_Temporary Remove="@(_Temporary)" /> + + + + + + + + + + <_Temporary Remove="@(_Temporary)" /> + + + + + + + + + + + + + + + + + + + + false + false + + + + + + + <_LicxFile Include="@(EmbeddedResource)" Condition="'%(Extension)'=='.licx'" /> + + + Resx + + + Non-Resx + + + + + + + + + + + + + + + + Resx + + + Non-Resx + + + + + + + + + + + + <_MixedResourceWithNoCulture Remove="@(_MixedResourceWithNoCulture)" /> + <_MixedResourceWithCulture Remove="@(_MixedResourceWithCulture)" /> + + + + + + + + + + ResolveAssemblyReferences;SplitResourcesByCulture;BeforeResGen;CoreResGen;AfterResGen + FindReferenceAssembliesForReferences + true + false + + + + + + + + + + <_Temporary Remove="@(_Temporary)" /> + + + $(PlatformTargetAsMSBuildArchitecture) + $(TargetFrameworkSDKToolsDirectory) + + + + $(TargetFrameworkAsMSBuildRuntime) + + CurrentRuntime + + + + + + + + + + + + + + + + + + + + <_Temporary Remove="@(_Temporary)" /> + + + true + + + true + + + + true + + + true + + + + + + + + + + $(PlatformTargetAsMSBuildArchitecture) + + + + + + + + + + + + + + + + + + + + ResolveReferences; + ResolveKeySource; + SetWin32ManifestProperties; + _SetPreferNativeArm64Win32ManifestProperties; + FindReferenceAssembliesForReferences; + _GenerateCompileInputs; + BeforeCompile; + _TimeStampBeforeCompile; + _GenerateCompileDependencyCache; + CoreCompile; + _TimeStampAfterCompile; + AfterCompile; + + + + + + + + + + <_CoreCompileResourceInputs Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)' == 'false' and '%(EmbeddedResource.Type)' == 'Resx'" /> + <_CoreCompileResourceInputs Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)' == 'false' and '%(EmbeddedResource.Type)' == 'Non-Resx' " /> + + <_CoreCompileResourceInputs Include="@(ManifestResourceWithNoCulture)" Condition="'%(ManifestResourceWithNoCulture.EmittedForCompatibilityOnly)'==''"> + Resx + false + + <_CoreCompileResourceInputs Include="@(ManifestNonResxWithNoCultureOnDisk)" Condition="'%(ManifestNonResxWithNoCultureOnDisk.EmittedForCompatibilityOnly)'==''"> + Non-Resx + false + + + + + + + true + $([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)')) + + + true + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + <_AssemblyTimestampBeforeCompile>%(IntermediateAssembly.ModifiedTime) + + + + + + $(IntermediateOutputPath)$(MSBuildProjectFile).SuggestedBindingRedirects.cache + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_AssemblyTimestampAfterCompile>%(IntermediateAssembly.ModifiedTime) + + + + + + __NonExistentSubDir__\__NonExistentFile__ + + + + + <_SGenDllName>$(TargetName).XmlSerializers.dll + <_SGenDllCreated>false + <_SGenGenerateSerializationAssembliesConfig>$(GenerateSerializationAssemblies) + <_SGenGenerateSerializationAssembliesConfig Condition="'$(GenerateSerializationAssemblies)' == ''">Auto + <_SGenGenerateSerializationAssembliesConfig Condition="'$(ConfigurationName)'=='Debug' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto'">Off + true + false + true + + + + + $(PlatformTargetAsMSBuildArchitecture) + + + + + + + + + + $(CreateSatelliteAssembliesDependsOn); + _GenerateSatelliteAssemblyInputs; + ComputeIntermediateSatelliteAssemblies; + GenerateSatelliteAssemblies + + + + + + + + + + <_SatelliteAssemblyResourceInputs Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Resx'" /> + <_SatelliteAssemblyResourceInputs Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Non-Resx'" /> + + <_SatelliteAssemblyResourceInputs Include="@(ManifestResourceWithCulture)" Condition="'%(ManifestResourceWithCulture.EmittedForCompatibilityOnly)'==''"> + Resx + true + + <_SatelliteAssemblyResourceInputs Include="@(ManifestNonResxWithCultureOnDisk)" Condition="'%(ManifestNonResxWithCultureOnDisk.EmittedForCompatibilityOnly)'==''"> + Non-Resx + true + + + + + + + <_ALExeToolPath Condition="'$(_ALExeToolPath)' == ''">$(TargetFrameworkSDKToolsDirectory) + + + + + + + + + + CreateManifestResourceNames + + + + + + %(EmbeddedResource.Culture) + %(EmbeddedResource.Culture)\$(TargetName).resources.dll + + + + + + $(Win32Manifest) + + + + + + + <_DeploymentBaseManifest>$(ApplicationManifest) + <_DeploymentBaseManifest Condition="'$(_DeploymentBaseManifest)'==''">@(_DeploymentBaseManifestWithTargetPath) + + true + + + + + $(ApplicationManifest) + $(ApplicationManifest) + + + + + + + $(_FrameworkVersion40Path)\default.win32manifest + + + + + + + + + $(_Win32Manifest) + + + + + + + SetWin32ManifestProperties; + GenerateApplicationManifest; + GenerateDeploymentManifest + + + + + + <_DeploymentPublishFileOfTypeManifestEntryPoint Include="@(PublishFile)" Condition="'%(FileType)'=='ManifestEntryPoint'" /> + + + + + + + + + + + + + + + + + <_DeploymentCopyApplicationManifest>true + + + + + + <_DeploymentManifestTargetFrameworkMoniker>$(TargetFrameworkMoniker) + <_DeploymentManifestTargetFrameworkVersion>$(TargetFrameworkVersion) + + + + + + + + + + + + + + + + + + + <_DeploymentManifestTargetFrameworkVersion Condition="'$(DeploymentManifestTargetFrameworkVersionOverride)' == ''">v4.5 + <_DeploymentManifestTargetFrameworkVersion Condition="'$(DeploymentManifestTargetFrameworkVersionOverride)' != ''">$(DeploymentManifestTargetFrameworkVersionOverride) + <_DeploymentManifestTargetFrameworkMoniker>.NETFramework,Version=$(_DeploymentManifestTargetFrameworkVersion) + + + + + + + + + + + <_DeploymentManifestEntryPoint Remove="@(_DeploymentManifestEntryPoint)" /> + <_DeploymentManifestEntryPoint Include="@(_DeploymentManifestLauncherEntryPoint)" /> + + + + + + + + + + <_DeploymentManifestType>Native + + + + + + + <_DeploymentManifestVersion>@(_IntermediateAssemblyIdentity->'%(Version)') + + + + + + + <_SGenDllsRelatedToCurrentDll Include="@(_ReferenceSerializationAssemblyPaths->'%(FullPath)')" Condition="'%(Extension)' == '.dll'" /> + <_SGenDllsRelatedToCurrentDll Include="@(SerializationAssembly->'%(FullPath)')" Condition="'%(Extension)' == '.dll'" /> + + + <_CopyLocalFalseRefPaths Include="@(ReferencePath)" Condition="'%(CopyLocal)' == 'false'" /> + <_CopyLocalFalseRefPathsWithExclusion Include="@(_CopyLocalFalseRefPaths)" Exclude="@(ReferenceCopyLocalPaths);@(_NETStandardLibraryNETFrameworkLib)" /> + + + <_ClickOnceSatelliteAssemblies Include="@(IntermediateSatelliteAssembliesWithTargetPath);@(ReferenceSatellitePaths)" /> + + + + <_DeploymentReferencePaths Include="@(ReferenceCopyLocalPaths)" Condition="('%(Extension)' == '.dll' Or '%(Extension)' == '.exe' Or '%(Extension)' == '.md') and ('%(ReferenceCopyLocalPaths.CopyToPublishDirectory)' != 'false')"> + true + + <_DeploymentReferencePaths Include="@(_CopyLocalFalseRefPathsWithExclusion)" /> + + + + <_ManifestManagedReferences Include="@(_DeploymentReferencePaths);@(ReferenceDependencyPaths);@(_SGenDllsRelatedToCurrentDll);@(SerializationAssembly);@(ReferenceCOMWrappersToCopyLocal)" Exclude="@(_ClickOnceSatelliteAssemblies);@(_ReferenceScatterPaths);@(_ExcludedAssembliesFromManifestGeneration)" /> + + + + + <_ClickOnceRuntimeCopyLocalItems Include="@(RuntimeTargetsCopyLocalItems)" Condition="'%(RuntimeTargetsCopyLocalItems.CopyLocal)' == 'true'" /> + <_ClickOnceRuntimeCopyLocalItems Include="@(NativeCopyLocalItems)" Condition="'%(NativeCopyLocalItems.CopyLocal)' == 'true'" /> + <_ClickOnceRuntimeCopyLocalItems Remove="@(_DeploymentReferencePaths)" /> + + <_ClickOnceTransitiveContentItemsTemp Include="@(_TransitiveItemsToCopyToOutputDirectory->WithoutMetadataValue('CopyToPublishDirectory', 'Never')->'%(TargetPath)')" Condition="'$(PublishProtocol)' == 'ClickOnce'"> + %(Identity) + + <_ClickOnceTransitiveContentItems Include="@(_ClickOnceTransitiveContentItemsTemp->'%(SavedIdentity)')" Condition="'%(Identity)'=='@(PublishFile)' Or '%(Extension)'=='.exe' Or '%(Extension)'=='.dll'" /> + + <_ClickOnceContentItems Include="@(ContentWithTargetPath->WithoutMetadataValue('CopyToPublishDirectory', 'Never'))" /> + <_ClickOnceContentItems Include="@(_ClickOnceTransitiveContentItems)" /> + + + <_ClickOnceNoneItemsTemp Include="@(_NoneWithTargetPath->WithoutMetadataValue('CopyToPublishDirectory', 'Never')->'%(TargetPath)')" Condition="'$(PublishProtocol)'=='Clickonce' And ('%(_NoneWithTargetPath.CopyToOutputDirectory)'=='Always' or '%(_NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' or '%(_NoneWithTargetPath.CopyToOutputDirectory)'=='IfDifferent')"> + %(Identity) + + <_ClickOnceNoneItems Include="@(_ClickOnceNoneItemsTemp->'%(SavedIdentity)')" Condition="'%(Identity)'=='@(PublishFile)' Or '%(Extension)'=='.exe' Or '%(Extension)'=='.dll'" /> + <_ClickOnceFiles Include="@(_ClickOnceContentItems);@(_DeploymentManifestIconFile);@(AppConfigWithTargetPath);@(NetCoreRuntimeJsonFilesForClickOnce);@(_ClickOnceRuntimeCopyLocalItems);@(_ClickOnceNoneItems)" /> + + <_ClickOnceNoneItemsTemp Remove="@(_ClickOnceNoneItemsTemp)" /> + <_ClickOnceNoneItems Remove="@(_ClickOnceNoneItems)" /> + <_ClickOnceTransitiveContentItemsTemp Remove="@(_ClickOnceTransitiveContentItemsTemp)" /> + <_ClickOnceTransitiveContentItems Remove="@(_ClickOnceTransitiveContentItems)" /> + <_ClickOnceContentItems Remove="@(_ClickOnceContentItems)" /> + <_ClickOnceRuntimeCopyLocalItems Remove="@(_ClickOnceRuntimeCopyLocalItems)" /> + + + + <_ClickOnceFiles Include="$(PublishedSingleFilePath);@(_DeploymentManifestIconFile)" /> + <_ClickOnceFiles Include="@(_FilesExcludedFromBundle)" /> + + <_FileAssociationIcons Include="%(FileAssociation.DefaultIcon)" /> + <_ClickOnceFiles Include="@(ContentWithTargetPath)" Condition="'%(Identity)'=='@(_FileAssociationIcons)'" /> + + + + + + <_ManifestManagedReferences Remove="@(_ReadyToRunCompileList)" /> + <_ClickOnceFiles Remove="@(_ReadyToRunCompileList)" /> + <_ClickOnceFiles Include="@(_ReadyToRunFilesToPublish)" /> + <_ClickOnceTargetFile Include="@(_ReadyToRunFilesToPublish)" Condition="'%(Filename)%(Extension)' == '$(TargetFileName)'" /> + + + + + + + + + + + + + + + + + + + <_DeploymentManifestDependencies Include="@(_DeploymentManifestDependenciesUnfiltered)" Condition="!('%(_DeploymentManifestDependenciesUnfiltered.CopyLocal)' == 'false' And '%(_DeploymentManifestDependenciesUnfiltered.DependencyType)' != 'Install')" /> + + + <_DeploymentManifestType>ClickOnce + + + + <_DeploymentPlatformTarget Condition="'$(_DeploymentLauncherBased)' != 'true'">$(PlatformTarget) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + + CopyFilesToOutputDirectory + + + + + + + false + false + + + + + false + false + false + + + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + false + + + + + + + + + + + + + + + + + <_TargetsThatPrepareProjectReferences>_SplitProjectReferencesByFileExistence + + true + <_TargetsThatPrepareProjectReferences Condition=" '$(MSBuildCopyContentTransitively)' == 'true' "> + AssignProjectConfiguration; + _SplitProjectReferencesByFileExistence + + + $(GetCopyToOutputDirectoryItemsDependsOn); + AssignTargetPaths; + $(_TargetsThatPrepareProjectReferences); + _GetProjectReferenceTargetFrameworkProperties; + _PopulateCommonStateForGetCopyToOutputDirectoryItems + + + <_RecursiveTargetForContentCopying>GetCopyToOutputDirectoryItems + + <_RecursiveTargetForContentCopying Condition=" '$(MSBuildCopyContentTransitively)' == 'false' ">_GetCopyToOutputDirectoryItemsFromThisProject + + + + + <_GCTODIKeepDuplicates>false + <_GCTODIKeepMetadata>CopyToOutputDirectory;TargetPath + + + + + + + + + + <_CopyToOutputDirectoryTransitiveItems KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always'" /> + <_CopyToOutputDirectoryTransitiveItems KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'" /> + <_CopyToOutputDirectoryTransitiveItems KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='IfDifferent'" /> + + + + <_AllChildProjectItemsWithTargetPath Remove="@(_AllChildProjectItemsWithTargetPath)" /> + + + + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='Always' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'!=''" /> + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'!=''" /> + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='IfDifferent' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'!=''" /> + + + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='Always' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'!=''" /> + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='PreserveNewest' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'!=''" /> + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='IfDifferent' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'!=''" /> + + + <_CompileItemsToCopy Include="@(Compile->'%(FullPath)')" Condition="('%(Compile.CopyToOutputDirectory)'=='Always' or '%(Compile.CopyToOutputDirectory)'=='PreserveNewest' or '%(Compile.CopyToOutputDirectory)'=='IfDifferent') AND '%(Compile.MSBuildSourceProjectFile)'!=''" /> + + + + + + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='Always'" /> + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'" /> + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='IfDifferent'" /> + + + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='Always' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'!=''" /> + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'!=''" /> + <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='IfDifferent' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'!=''" /> + + + + + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='Always' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'==''" /> + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'==''" /> + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='IfDifferent' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'==''" /> + + + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='Always' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'==''" /> + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='PreserveNewest' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'==''" /> + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='IfDifferent' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'==''" /> + + + <_CompileItemsToCopy Include="@(Compile->'%(FullPath)')" Condition="('%(Compile.CopyToOutputDirectory)'=='Always' or '%(Compile.CopyToOutputDirectory)'=='PreserveNewest' or '%(Compile.CopyToOutputDirectory)'=='IfDifferent') AND '%(Compile.MSBuildSourceProjectFile)'==''" /> + + + + + + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='Always'" /> + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'" /> + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='IfDifferent'" /> + + + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='Always' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'==''" /> + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'==''" /> + <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='IfDifferent' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'==''" /> + + + + + + + + + + + + + <_TransitiveItemsToCopyToOutputDirectory Remove="@(_ThisProjectItemsToCopyToOutputDirectory)" MatchOnMetadata="TargetPath" MatchOnMetadataOptions="PathLike" /> + + + <_TransitiveItemsToCopyToOutputDirectoryAlways KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_TransitiveItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_TransitiveItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='Always'" /> + <_TransitiveItemsToCopyToOutputDirectoryPreserveNewest KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_TransitiveItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_TransitiveItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='PreserveNewest'" /> + <_TransitiveItemsToCopyToOutputDirectoryIfDifferent KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_TransitiveItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_TransitiveItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='IfDifferent'" /> + <_ThisProjectItemsToCopyToOutputDirectoryAlways KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_ThisProjectItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_ThisProjectItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='Always'" /> + <_ThisProjectItemsToCopyToOutputDirectoryPreserveNewest KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_ThisProjectItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_ThisProjectItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='PreserveNewest'" /> + <_ThisProjectItemsToCopyToOutputDirectoryIfDifferent KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_ThisProjectItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_ThisProjectItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='IfDifferent'" /> + + <_SourceItemsToCopyToOutputDirectoryAlways Include="@(_TransitiveItemsToCopyToOutputDirectoryAlways);@(_ThisProjectItemsToCopyToOutputDirectoryAlways)" /> + <_SourceItemsToCopyToOutputDirectory Include="@(_TransitiveItemsToCopyToOutputDirectoryPreserveNewest);@(_ThisProjectItemsToCopyToOutputDirectoryPreserveNewest)" /> + <_SourceItemsToCopyToOutputDirectoryIfDifferent Include="@(_TransitiveItemsToCopyToOutputDirectoryIfDifferent);@(_ThisProjectItemsToCopyToOutputDirectoryIfDifferent)" /> + + + <_TransitiveItemsToCopyToOutputDirectoryAlways Remove="@(_TransitiveItemsToCopyToOutputDirectoryAlways)" /> + <_TransitiveItemsToCopyToOutputDirectoryPreserveNewest Remove="@(_TransitiveItemsToCopyToOutputDirectoryPreserveNewest)" /> + <_TransitiveItemsToCopyToOutputDirectoryIfDifferent Remove="@(_TransitiveItemsToCopyToOutputDirectoryIfDifferent)" /> + <_ThisProjectItemsToCopyToOutputDirectoryAlways Remove="@(_ThisProjectItemsToCopyToOutputDirectoryAlways)" /> + <_ThisProjectItemsToCopyToOutputDirectoryPreserveNewest Remove="@(_ThisProjectItemsToCopyToOutputDirectoryPreserveNewest)" /> + <_ThisProjectItemsToCopyToOutputDirectory Remove="@(_ThisProjectItemsToCopyToOutputDirectory)" /> + <_ThisProjectItemsToCopyToOutputDirectoryIfDifferent Remove="@(_ThisProjectItemsToCopyToOutputDirectoryIfDifferent)" /> + + + + + + + %(CopyToOutputDirectory) + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_DocumentationFileProduced Condition="!Exists('@(DocFileItem)')">false + + + + + + + <_DebugSymbolsProduced Condition="!Exists('@(_DebugSymbolsIntermediatePath)')">false + + + + + + + + + + <_SGenDllCreated Condition="Exists('$(IntermediateOutputPath)$(_SGenDllName)')">true + + + + + + + + + + + + + $(PlatformTargetAsMSBuildArchitecture) + + + + $(TargetFrameworkAsMSBuildRuntime) + + CurrentRuntime + + + + + + + + + + + + <_CleanOrphanFileWrites Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanCurrentFileWrites)" /> + + + + + + + + + + + + + + + + <_CleanRemainingFileWritesAfterIncrementalClean Include="@(_CleanPriorFileWrites);@(_CleanCurrentFileWrites)" Exclude="@(_CleanOrphanFilesDeleted)" /> + + + + + + + + + + + + + + + + + + + + + <_CleanPriorFileWrites Include="@(_CleanUnfilteredPriorFileWrites)" Exclude="@(_ResolveAssemblyReferenceResolvedFilesAbsolute)" /> + + + + false + + + + + + + + + + + + + + + + + + + + + + <_CleanCurrentFileWritesWithNoReferences Include="@(_CleanCurrentFileWritesInOutput);@(_CleanCurrentFileWritesInIntermediate)" Exclude="@(_ResolveAssemblyReferenceResolvedFilesAbsolute)" /> + + + + + + + + + + + BeforeClean; + UnmanagedUnregistration; + CoreClean; + CleanReferencedProjects; + CleanPublishFolder; + AfterClean + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_CleanRemainingFileWritesAfterClean Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanPriorFileWritesDeleted)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CleanPublishFolder; + $(_RecursiveTargetForContentCopying); + _DeploymentGenerateTrustInfo; + $(DeploymentComputeClickOnceManifestInfoDependsOn) + + + + + + SetGenerateManifests; + Build; + PublishOnly + + + _DeploymentUnpublishable + + + + + + + + + + + + + true + + + + + + SetGenerateManifests; + PublishBuild; + BeforePublish; + GenerateManifests; + CopyFilesToOutputDirectory; + _CopyFilesToPublishFolder; + _DeploymentGenerateBootstrapper; + ResolveKeySource; + _DeploymentSignClickOnceDeployment; + AfterPublish + + + + + + + + + + + BuildOnlySettings; + PrepareForBuild; + ResolveReferences; + PrepareResources; + ResolveKeySource; + GenerateSerializationAssemblies; + CreateSatelliteAssemblies; + + + + + + + + + + + <_DeploymentApplicationFolderName>Application Files\$(AssemblyName)_$(_DeploymentApplicationVersionFragment) + <_DeploymentApplicationDir>$(ClickOncePublishDir)$(_DeploymentApplicationFolderName)\ + + + + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(TargetPath) + $(TargetFileName) + true + + + + + + true + $(TargetPath) + $(TargetFileName) + + + + + PrepareForBuild + true + + + + <_BuiltProjectOutputGroupOutputIntermediate Include="@(BuiltProjectOutputGroupKeyOutput)" /> + + + + <_BuiltProjectOutputGroupOutputIntermediate Include="$(AppConfig)" Condition="'$(AddAppConfigToBuildOutputs)'=='true'"> + $(TargetDir)$(TargetFileName).config + $(TargetFileName).config + + $(AppConfig) + + + + <_IsolatedComReference Include="@(COMReference)" Condition=" '%(COMReference.Isolated)' == 'true' " /> + <_IsolatedComReference Include="@(COMFileReference)" Condition=" '%(COMFileReference.Isolated)' == 'true' " /> + + + + <_BuiltProjectOutputGroupOutputIntermediate Include="$(OutDir)$(_DeploymentTargetApplicationManifestFileName)" Condition="('@(NativeReference)'!='' or '@(_IsolatedComReference)'!='') And Exists('$(OutDir)$(_DeploymentTargetApplicationManifestFileName)')"> + $(_DeploymentTargetApplicationManifestFileName) + + $(OutDir)$(_DeploymentTargetApplicationManifestFileName) + + + + + + + %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) + + + + + + + + + + @(_DebugSymbolsOutputPath->'%(FullPath)') + @(_DebugSymbolsIntermediatePath->'%(Filename)%(Extension)') + + + + + + + @(WinMDExpFinalOutputPdbItem->'%(FullPath)') + @(WinMDExpOutputPdbItem->'%(Filename)%(Extension)') + + + + + + + + + + @(FinalDocFile->'%(FullPath)') + true + @(DocFileItem->'%(Filename)%(Extension)') + + + + + + + @(WinMDExpFinalOutputDocItem->'%(FullPath)') + @(WinMDOutputDocumentationFileItem->'%(Filename)%(Extension)') + + + + + + $(SatelliteDllsProjectOutputGroupDependsOn);PrepareForBuild;PrepareResourceNames + + + + + %(EmbeddedResource.Culture)\$(TargetName).resources.dll + %(EmbeddedResource.Culture) + + + + + + $(TargetDir)%(SatelliteDllsProjectOutputGroupOutputIntermediate.TargetPath) + + %(SatelliteDllsProjectOutputGroupOutputIntermediate.Identity) + + + + + + PrepareForBuild;AssignTargetPaths + + + + + + + + + + + + $(MSBuildProjectFullPath) + $(ProjectFileName) + + + + + + + + PrepareForBuild;AssignTargetPaths + + + + + + + + + + + + + + @(_OutputPathItem->'%(FullPath)$(_SGenDllName)') + $(_SGenDllName) + + + + + + + + + + + + + + + + + + + ResolveSDKReferences;ExpandSDKReferences + + + + + + + + + + + + + $(CommonOutputGroupsDependsOn); + BuildOnlySettings; + PrepareForBuild; + AssignTargetPaths; + ResolveReferences + + + + + + + + $(BuiltProjectOutputGroupDependenciesDependsOn); + $(CommonOutputGroupsDependsOn) + + + + + + + + + + + $(DebugSymbolsProjectOutputGroupDependenciesDependsOn); + $(CommonOutputGroupsDependsOn) + + + + + + + + + + + + $(SatelliteDllsProjectOutputGroupDependenciesDependsOn); + $(CommonOutputGroupsDependsOn) + + + + + + + + + + + + $(DocumentationProjectOutputGroupDependenciesDependsOn); + $(CommonOutputGroupsDependsOn) + + + + + + + + + + + + $(SGenFilesOutputGroupDependenciesDependsOn); + $(CommonOutputGroupsDependsOn) + + + + + + + + + + + + $(ReferenceCopyLocalPathsOutputGroupDependsOn); + $(CommonOutputGroupsDependsOn) + + + + + + %(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension) + + + + + + + $(DesignerRuntimeImplementationProjectOutputGroupDependsOn); + $(CommonOutputGroupsDependsOn) + + + + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeAnalysis\Microsoft.CodeAnalysis.targets + + + + + + true + + + + + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TeamTest\Microsoft.TeamTest.targets + + + + false + + + + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\AppxPackage\Microsoft.AppXPackage.Targets + + true + + + + + + + + $([MSBuild]::IsRunningFromVisualStudio()) + $([MSBuild]::GetToolsDirectory32())\..\..\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets + $(MSBuildToolsPath)\NuGet.targets + + + + + + true + + NuGet.Build.Tasks.dll + + false + + true + true + + false + + WarnAndContinue + + $(BuildInParallel) + true + + <_RestoreSolutionFileUsed Condition=" '$(_RestoreSolutionFileUsed)' == '' AND '$(SolutionDir)' != '' AND $(MSBuildProjectFullPath.EndsWith('.metaproj')) == 'true' ">true + + $(MSBuildInteractive) + + true + + true + + true + + <_CentralPackageVersionsEnabled Condition="'$(ManagePackageVersionsCentrally)' == 'true' AND '$(CentralPackageVersionsFileImported)' == 'true'">true + + + + + true + + low + + all + direct + + + + + true + false + true + false + + + + <_GenerateRestoreGraphProjectEntryInputProperties>ExcludeRestorePackageImports=true + + <_GenerateRestoreGraphProjectEntryInputProperties Condition=" '$(RestoreUseCustomAfterTargets)' == 'true' "> + $(_GenerateRestoreGraphProjectEntryInputProperties); + NuGetRestoreTargets=$(MSBuildThisFileFullPath); + RestoreUseCustomAfterTargets=$(RestoreUseCustomAfterTargets); + CustomAfterMicrosoftCommonCrossTargetingTargets=$(MSBuildThisFileFullPath); + CustomAfterMicrosoftCommonTargets=$(MSBuildThisFileFullPath); + + + <_GenerateRestoreGraphProjectEntryInputProperties Condition=" '$(_RestoreSolutionFileUsed)' == 'true' "> + $(_GenerateRestoreGraphProjectEntryInputProperties); + _RestoreSolutionFileUsed=true; + SolutionDir=$(SolutionDir); + SolutionName=$(SolutionName); + SolutionFileName=$(SolutionFileName); + SolutionPath=$(SolutionPath); + SolutionExt=$(SolutionExt); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(ContinueOnError) + false + + + + + + + + + + + + + + $(ContinueOnError) + false + + + + + + + + + + + + + + $(ContinueOnError) + false + + + + + + + + + + + + + <_FrameworkReferenceForRestore Include="@(FrameworkReference)" Condition="'%(FrameworkReference.IsTransitiveFrameworkReference)' != 'true'" /> + + + + + + + $(ContinueOnError) + false + + + + + + + + + + + + + $(ContinueOnError) + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + exclusionlist + + + + <_FilteredRestoreGraphProjectInputItemsTmp Include="@(RestoreGraphProjectInputItems)" Condition=" '%(RestoreGraphProjectInputItems.Extension)' == '.csproj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.vbproj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.fsproj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.nuproj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.proj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.msbuildproj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.vcxproj' " /> + + + + <_FilteredRestoreGraphProjectInputItemsTmp Include="@(RestoreGraphProjectInputItems)" Condition=" '%(RestoreGraphProjectInputItems.Extension)' != '.metaproj' AND '%(RestoreGraphProjectInputItems.Extension)' != '.shproj' AND '%(RestoreGraphProjectInputItems.Extension)' != '.vcxitems' AND '%(RestoreGraphProjectInputItems.Extension)' != '.vdproj' AND '%(RestoreGraphProjectInputItems.Extension)' != '' " /> + + + + <_FilteredRestoreGraphProjectInputItemsTmp Include="@(RestoreGraphProjectInputItems)" /> + + + + + + + + + + + + + + + + + + + + + + + + <_GenerateRestoreGraphProjectEntryInput Include="@(FilteredRestoreGraphProjectInputItems)" Condition=" '$(RestoreRecursive)' != 'true' " /> + <_GenerateRestoreGraphProjectEntryInput Include="@(_RestoreProjectPathItems)" Condition=" '$(RestoreRecursive)' == 'true' " /> + + + + + + + + + + + + + + + + + + + + <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())" Condition=" '$(RestoreProjectStyle)' != 'Unknown' "> + RestoreSpec + $(MSBuildProjectFullPath) + + + + + + + netcoreapp1.0 + + + + + + + + + + + <_HasPackageReferenceItems Condition="'@(PackageReference)' != ''">true + + + <_HasPackageReferenceItems Condition="@(PackageReference->Count()) > 0">true + + + + + + + <_HasPackageReferenceItems /> + + + + + + true + + + + + + <_RestoreProjectFramework /> + <_TargetFrameworkToBeUsed Condition=" '$(_TargetFrameworkOverride)' == '' ">$(TargetFrameworks) + + + + + + <_RestoreTargetFrameworksOutputFiltered Include="$(_RestoreProjectFramework.Split(';'))" /> + + + + + + <_RestoreTargetFrameworkItems Include="$(TargetFrameworks.Split(';'))" /> + + + <_RestoreTargetFrameworkItems Include="$(_TargetFrameworkOverride)" /> + + + + + + $(SolutionDir) + + + + + + + + + + + + + + + + + + + + + + + <_RestoreSettingsPerFramework Include="$([System.Guid]::NewGuid())"> + $(RestoreAdditionalProjectSources) + $(RestoreAdditionalProjectFallbackFolders) + $(RestoreAdditionalProjectFallbackFoldersExcludes) + + + + + + + + $(MSBuildProjectExtensionsPath) + + + + + + + <_RestoreProjectName>$(MSBuildProjectName) + <_RestoreProjectName Condition=" '$(PackageReferenceCompatibleProjectStyle)' == 'true' AND '$(AssemblyName)' != '' ">$(AssemblyName) + <_RestoreProjectName Condition=" '$(PackageReferenceCompatibleProjectStyle)' == 'true' AND '$(PackageId)' != '' ">$(PackageId) + + + + <_RestoreProjectVersion>1.0.0 + <_RestoreProjectVersion Condition=" '$(Version)' != '' ">$(Version) + <_RestoreProjectVersion Condition=" '$(PackageVersion)' != '' ">$(PackageVersion) + + + + <_RestoreCrossTargeting>true + + + + <_RestoreSkipContentFileWrite Condition=" '$(TargetFrameworks)' == '' AND '$(TargetFramework)' == '' ">true + + + + <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())"> + ProjectSpec + $(_RestoreProjectVersion) + $(MSBuildProjectFullPath) + $(MSBuildProjectFullPath) + $(_RestoreProjectName) + $(_OutputSources) + $(_OutputFallbackFolders) + $(_OutputPackagesPath) + $(RestoreProjectStyle) + $(RestoreOutputAbsolutePath) + $(RuntimeIdentifiers);$(RuntimeIdentifier) + $(RuntimeSupports) + $(_RestoreCrossTargeting) + $(RestoreLegacyPackagesDirectory) + $(ValidateRuntimeIdentifierCompatibility) + $(_RestoreSkipContentFileWrite) + $(_OutputConfigFilePaths) + $(TreatWarningsAsErrors) + $(WarningsAsErrors) + $(WarningsNotAsErrors) + $(NoWarn) + $(RestorePackagesWithLockFile) + $(NuGetLockFilePath) + $(RestoreLockedMode) + <_CentralPackageVersionsEnabled>$(_CentralPackageVersionsEnabled) + $(CentralPackageFloatingVersionsEnabled) + $(CentralPackageVersionOverrideEnabled) + $(CentralPackageTransitivePinningEnabled) + $(NuGetAudit) + $(NuGetAuditLevel) + $(NuGetAuditMode) + $(SdkAnalysisLevel) + $(UsingMicrosoftNETSdk) + $(NETCoreSdkVersion) + $(RestoreUseLegacyDependencyResolver) + $(RestoreDoNotWriteDependencyGraphSpec) + + + + + <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())"> + ProjectSpec + $(MSBuildProjectFullPath) + $(MSBuildProjectFullPath) + $(_RestoreProjectName) + $(RestoreProjectStyle) + $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config + $(MSBuildProjectDirectory)\packages.config + $(RestorePackagesWithLockFile) + $(NuGetLockFilePath) + $(RestoreLockedMode) + $(_OutputSources) + $(SolutionDir) + $(_OutputRepositoryPath) + $(_OutputConfigFilePaths) + $(_OutputPackagesPath) + @(_RestoreTargetFrameworksOutputFiltered) + $(NuGetAudit) + $(NuGetAuditLevel) + + + + + <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())"> + ProjectSpec + $(MSBuildProjectFullPath) + $(MSBuildProjectFullPath) + $(_RestoreProjectName) + $(RestoreProjectStyle) + @(_RestoreTargetFrameworksOutputFiltered) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())"> + TargetFrameworkInformation + $(MSBuildProjectFullPath) + $(PackageTargetFallback) + $(AssetTargetFallback) + $(TargetFramework) + $(TargetFrameworkIdentifier) + $(TargetFrameworkVersion) + $(TargetFrameworkMoniker) + $(TargetFrameworkProfile) + $(TargetPlatformMoniker) + $(TargetPlatformIdentifier) + $(TargetPlatformVersion) + $(TargetPlatformMinVersion) + $(CLRSupport) + $(RuntimeIdentifierGraphPath) + $(WindowsTargetPlatformMinVersion) + $(RestoreEnablePackagePruning) + $(RestorePackagePruningDefault) + $(NuGetAuditMode) + + + + + + + + + + + + + <_RestoreProjectPathItems Include="$(_RestoreGraphAbsoluteProjectPaths)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_GenerateRestoreProjectPathWalkOutputs Include="$(MSBuildProjectFullPath)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_RestorePackagesPathOverride>$(RestorePackagesPath) + + + + + + <_RestorePackagesPathOverride>$(RestoreRepositoryPath) + + + + + + <_RestoreSourcesOverride>$(RestoreSources) + + + + + + <_RestoreFallbackFoldersOverride>$(RestoreFallbackFolders) + + + + + + + + + + + + + <_TargetFrameworkOverride Condition=" '$(TargetFrameworks)' == '' ">$(TargetFramework) + + + + + + <_ValidProjectsForRestore Include="$(MSBuildProjectFullPath)" /> + + + + + + + + + + $(MSBuildExtensionsPath)\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets + + + + + <_TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion.TrimStart('vV')) + $(MSBuildThisFileDirectory)\tools\net11.0\Microsoft.NET.Build.Extensions.Tasks.dll + $(MSBuildThisFileDirectory)\tools\net472\Microsoft.NET.Build.Extensions.Tasks.dll + + true + + + + + + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + $(MSBuildExtensionsPath)\Microsoft.TestPlatform.targets + + + + + + Microsoft.TestPlatform.Build.dll + $([System.IO.Path]::Combine($(MSBuildThisFileDirectory),"vstest.console.dll")) + False + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + true + + + + + + + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + GetNuPkgVersion; + $(VersionDependsOn) + + + GetBuildVersion; + $(CleanDependsOn) + + + GetBuildVersion; + $(GenerateNuspecDependsOn) + + + GetBuildVersion; + $(GetPackageVersionDependsOn) + + + false + false + false + + + + <_NBGV_Common_Targets_Imported>true + <_NBGV_PlatformSuffix Condition=" '$(_NBGV_PlatformSuffix)' == '' and '$(MSBuildRuntimeType)' == 'Core' ">MSBuildCore/ + <_NBGV_PlatformSuffix Condition=" '$(_NBGV_PlatformSuffix)' == '' ">MSBuildFull/ + $(MSBuildThisFileDirectory)$(_NBGV_PlatformSuffix) + + + + + + + + + + + + + false + false + + <_NBGV_LanguageMode Condition=" '$(Language)' == 'c++' ">Native + <_NBGV_LanguageMode Condition=" '$(Language)' == 'c#' ">Managed + <_NBGV_LanguageMode Condition=" '$(Language)' == 'cs' ">Managed + <_NBGV_LanguageMode Condition=" '$(Language)' == 'csharp' ">Managed + <_NBGV_LanguageMode Condition=" '$(Language)' == 'vb' ">Managed + <_NBGV_LanguageMode Condition=" '$(Language)' == 'visualbasic' ">Managed + <_NBGV_LanguageMode Condition=" '$(Language)' == 'visual basic' ">Managed + <_NBGV_LanguageMode Condition=" '$(Language)' == 'f#' ">Managed + <_NBGV_LanguageMode Condition=" '$(Language)' == 'fs' ">Managed + <_NBGV_LanguageMode Condition=" '$(Language)' == 'fsharp' ">Managed + false + + + GenerateNativeNBGVVersionInfo; + $(PrepareForBuildDependsOn); + + + GenerateAssemblyNBGVVersionInfo; + $(PrepareResourcesDependsOn) + + + GenerateAssemblyNBGVVersionInfo; + $(CoreCompileDependsOn) + + + + + + <_NBGV_BuildingRef>$(_NBGV_BuildingTag) + <_NBGV_BuildingRef Condition=" '$(_NBGV_BuildingRef)' == '' ">$(_NBGV_BuildingBranch) + $(MSBuildProjectDirectory) + + + + + + + + + %(Value) + + + + + + $(NBGV_InnerGlobalProperties)GitRepoRoot=$(GitRepoRoot); + $(NBGV_InnerGlobalProperties)PublicRelease=$(PublicRelease); + $(NBGV_InnerGlobalProperties)_NBGV_BuildingRef=$(_NBGV_BuildingRef); + $(NBGV_InnerGlobalProperties)ProjectPathRelativeToGitRepoRoot=$(ProjectPathRelativeToGitRepoRoot); + $(NBGV_InnerGlobalProperties)GitVersionBaseDirectory=$(GitVersionBaseDirectory); + $(NBGV_InnerGlobalProperties)OverrideBuildNumberOffset=$(OverrideBuildNumberOffset); + $(NBGV_InnerGlobalProperties)NBGV_PrivateP2PAuxTargets=$(NBGV_PrivateP2PAuxTargets); + $(NBGV_InnerGlobalProperties)NBGV_GitEngine=$(NBGV_GitEngine); + + + + + + <_BuildMetadataSnapped Include="@(BuildMetadata)" /> + <_PrereleaseIdentifierSnapped Include="@(PrereleaseIdentifier)" /> + + + + GetBuildVersion_Properties;GetBuildVersion_CloudBuildVersionVars + $(NBGV_InnerGlobalProperties)BuildMetadata=@(BuildMetadata, ',');PrereleaseIdentifiers=@(PrereleaseIdentifier, ',');Configuration=Release;Platform=AnyCPU + Configuration=Release + Platform=AnyCPU + @(NBGV_GlobalPropertiesToRemove) + + false + false + true + false + all + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $([MSBuild]::NormalizePath('$(IntermediateOutputPath)', '$(AssemblyName).Version$(DefaultLanguageSourceExtension)')) + $(VersionSourceFile).new + + $(RootNamespace) + $(_TargetAssemblyProjectName) + + + + + + + + + + + + + + <_CompileWithVersionFile Include="$(VersionSourceFile);@(Compile)" /> + + + <_CompileWithVersionFile Remove="@(_CompileWithVersionFile)" /> + + + + + $([MSBuild]::NormalizePath('$(IntermediateOutputPath)', '$(AssemblyName).Version.rc')) + $(VersionSourceFile).new + + + + + + + + + + + + + + + + + $(NuGetPackageVersion) + + + + + + + $(NuGetPackageVersion) + $(NuSpecProperties);$(NuGetProperties);GitCommitIdShort=$(GitCommitIdShort) + + + + + + + + + + + + + + + + <_NBGV_Major_Shifted>$([MSBuild]::Multiply($([System.Version]::Parse('$(BuildVersion)').Major), 16777216)) + <_NBGV_Minor_Shifted>$([MSBuild]::Multiply($([System.Version]::Parse('$(BuildVersion)').Minor), 65536)) + $([MSBuild]::Add($([MSBuild]::Add($(_NBGV_Major_Shifted), $(_NBGV_Minor_Shifted))), $(BuildNumber))) + $(Version) + + + + + + $(BuildVersionSimple) + + $(BuildVersionSimple) + + + + + + + + $(BuildVersion) + + + + + + <_NBGV_OriginalServerJson Include="@(None)" Condition="'%(None.FileName)%(None.Extension)'=='server.json'" /> + <_NBGV_StampedServerJson Include="@(_NBGV_OriginalServerJson->'$(IntermediateOutputPath)\nb.gv\server.json')" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(RepositoryUrl) + $(ScmRepositoryUrl) + + + + %(SourceRoot.ScmRepositoryUrl) + + + + + + + + <_SourceLinkFilePath>$(IntermediateOutputPath)$(MSBuildProjectName).sourcelink.json + + + + + + + + + <_GenerateSourceLinkFileBeforeTargets>Link + <_GenerateSourceLinkFileDependsOnTargets>ComputeLinkSwitches + + + <_GenerateSourceLinkFileBeforeTargets>CoreCompile + <_GenerateSourceLinkFileDependsOnTargets /> + + + + + + + + + + + + + + + + %(Link.AdditionalOptions) /sourcelink:"$(SourceLink)" + + + + + + + + + + + + local + + + + + + + + + + + git + + + + + + + + + + + + + <_SourceLinkGitHubAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\Microsoft.SourceLink.GitHub.dll + <_SourceLinkGitHubAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\core\Microsoft.SourceLink.GitHub.dll + + + + + $(SourceLinkUrlInitializerTargets);_InitializeGitHubSourceLinkUrl + $(SourceControlManagerUrlTranslationTargets);TranslateGitHubUrlsInSourceControlInformation + + + + + + + + + + + + + + + <_TranslatedSourceRoot Remove="@(_TranslatedSourceRoot)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + <_DirectoryBuildTargetsFile Condition="'$(_DirectoryBuildTargetsFile)' == ''">Directory.Build.targets + <_DirectoryBuildTargetsBasePath Condition="'$(_DirectoryBuildTargetsBasePath)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), '$(_DirectoryBuildTargetsFile)')) + $([System.IO.Path]::Combine('$(_DirectoryBuildTargetsBasePath)', '$(_DirectoryBuildTargetsFile)')) + + + + + $(AssemblyName) ($(TargetFramework)) + + + $(DefineConstants);P_LINQ;SUPPORTS_BINDINGLIST + + + $(DefineConstants);NETSTANDARD;P_LINQ;SUPPORTS_BINDINGLIST;SUPPORTS_ASYNC_DISPOSABLE;SUPPORTS_DICTIONARY_MUTATION_DURING_ENUMERATION + + + + + + + + +// <autogenerated /> +using System%3b +using System.Reflection%3b +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute("$(TargetFrameworkMoniker)", FrameworkDisplayName = "$(TargetFrameworkMonikerDisplayName)")] + + + + + true + + true + true + + $([System.Globalization.CultureInfo]::CurrentUICulture.Name) + + + + + <_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" /> + + + + + + + + + + + TargetFramework + TargetFrameworks + + + true + + + + + + + + + <_MainReferenceTargetForBuild Condition="'$(BuildProjectReferences)' == '' or '$(BuildProjectReferences)' == 'true'">.projectReferenceTargetsOrDefaultTargets + <_MainReferenceTargetForBuild Condition="'$(_MainReferenceTargetForBuild)' == ''">GetTargetPath + $(_MainReferenceTargetForBuild);GetNativeManifest;$(_RecursiveTargetForContentCopying);$(ProjectReferenceTargetsForBuild) + + <_MainReferenceTargetForPublish Condition="'$(NoBuild)' == 'true'">GetTargetPath + <_MainReferenceTargetForPublish Condition="'$(NoBuild)' != 'true'">$(_MainReferenceTargetForBuild) + GetTargetFrameworks;$(_MainReferenceTargetForPublish);GetNativeManifest;GetCopyToPublishDirectoryItems;$(ProjectReferenceTargetsForPublish) + + $(ProjectReferenceTargetsForBuild);$(ProjectReferenceTargetsForPublish) + $(ProjectReferenceTargetsForRebuild);$(ProjectReferenceTargetsForPublish) + GetCopyToPublishDirectoryItems;$(ProjectReferenceTargetsForGetCopyToPublishDirectoryItems) + + + .default;$(ProjectReferenceTargetsForBuild) + + + Clean;$(ProjectReferenceTargetsForClean) + $(ProjectReferenceTargetsForClean);$(ProjectReferenceTargetsForBuild);$(ProjectReferenceTargetsForRebuild) + + + + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildThisFileDirectory)..\tools\ + net11.0 + net472 + $(MicrosoftNETBuildTasksDirectoryRoot)$(MicrosoftNETBuildTasksTFM)\ + $(MicrosoftNETBuildTasksDirectory)Microsoft.NET.Build.Tasks.dll + + Microsoft.NETCore.App;NETStandard.Library + + + + <_IsExecutable Condition="'$(OutputType)' == 'Exe' or '$(OutputType)'=='WinExe'">true + $(_IsExecutable) + + + + netcoreapp2.2 + + + Preview + + + + + + + $(NuGetPackageRoot)\microsoft.net.sdk.compilers.toolset\$(NETCoreSdkVersion) + $(RoslynTargetsPath)\Microsoft.Build.Tasks.CodeAnalysis.dll + <_NeedToDownloadMicrosoftNetSdkCompilersToolsetPackage>true + <_MicrosoftNetSdkCompilersToolsetPackageRootEmpty Condition="'$(NuGetPackageRoot)' == ''">true + + + + true + + + + + + + + $(MSBuildProjectExtensionsPath)/project.assets.json + $([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(ProjectAssetsFile))) + + $(IntermediateOutputPath)$(MSBuildProjectName).assets.cache + $([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(ProjectAssetsCacheFile))) + + false + + false + + true + $(IntermediateOutputPath)NuGet\ + true + $(TargetPlatformIdentifier),Version=v$([System.Version]::Parse('$(TargetPlatformMinVersion)').ToString(3)) + $(TargetFrameworkMoniker) + true + + false + + true + + + + <_NugetTargetMonikerAndRID Condition="'$(RuntimeIdentifier)' == ''">$(NuGetTargetMoniker) + <_NugetTargetMonikerAndRID Condition="'$(RuntimeIdentifier)' != ''">$(NuGetTargetMoniker)/$(RuntimeIdentifier) + + + + + + + + + $(ResolveAssemblyReferencesDependsOn); + ResolvePackageDependenciesForBuild; + _HandlePackageFileConflicts; + + + ResolvePackageDependenciesForBuild; + _HandlePackageFileConflicts; + $(PrepareResourcesDependsOn) + + + + + + $(RootNamespace) + + + $(AssemblyName) + + + $(MSBuildProjectDirectory) + + + $(TargetFileName) + + + $(MSBuildProjectFile) + + + + + + true + + + + + + ResolveLockFileReferences; + ResolveLockFileAnalyzers; + ResolveLockFileCopyLocalFiles; + ResolveRuntimePackAssets; + RunProduceContentAssets; + IncludeTransitiveProjectReferences + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_RoslynApiVersion>$([System.Version]::Parse(%(_CodeAnalysisIdentity.Version)).Major).$([System.Version]::Parse(%(_CodeAnalysisIdentity.Version)).Minor) + roslyn$(_RoslynApiVersion) + + + + + + false + + + true + + + true + + + + true + + + <_PackAsToolShimRuntimeIdentifiers Condition="@(_PackAsToolShimRuntimeIdentifiers) ==''" Include="$(PackAsToolShimRuntimeIdentifiers)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_NativeRestoredAppHostNETCore Include="@(NativeCopyLocalItems)" Condition="'%(NativeCopyLocalItems.FileName)%(NativeCopyLocalItems.Extension)' == '$(_DotNetAppHostExecutableName)'" /> + + + <_ApphostsForShimRuntimeIdentifiers Include="@(_ApphostsForShimRuntimeIdentifiersResolvePackageAssets)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ResolvedCopyLocalBuildAssets Include="@(RuntimeCopyLocalItems)" Condition="'%(RuntimeCopyLocalItems.CopyLocal)' == 'true'" /> + <_ResolvedCopyLocalBuildAssets Include="@(ResourceCopyLocalItems)" Condition="'%(ResourceCopyLocalItems.CopyLocal)' == 'true'" /> + + <_ResolvedCopyLocalBuildAssets Include="@(NativeCopyLocalItems)" Exclude="@(_NativeRestoredAppHostNETCore)" Condition="'%(NativeCopyLocalItems.CopyLocal)' == 'true'" /> + <_ResolvedCopyLocalBuildAssets Include="@(RuntimeTargetsCopyLocalItems)" Condition="'%(RuntimeTargetsCopyLocalItems.CopyLocal)' == 'true'" /> + + + + + + + + + + + + + + + false + true + true + true + true + + + + + $(DefaultItemExcludes);$(BaseOutputPath)/** + + $(DefaultItemExcludes);$(BaseIntermediateOutputPath)/** + + $(DefaultItemExcludes);$(PublishDir)/** + + $(DefaultItemExcludes);**/*.user + $(DefaultItemExcludes);**/*.*proj + $(DefaultItemExcludes);**/*.sln + $(DefaultItemExcludes);**/*.slnx + $(DefaultItemExcludes);**/*.vssscc + $(DefaultItemExcludes);**/.DS_Store + + $(DefaultExcludesInProjectFolder);$(DefaultItemExcludesInProjectFolder);**/.*/** + + + + + 1.6.1 + + 2.0.3 + + + + + + + + true + false + <_TargetLatestRuntimePatchIsDefault>true + + + + true + + + + + all + true + + + all + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(_TargetFrameworkVersionWithoutV) + + + + + + + + https://aka.ms/sdkimplicitrefs + + + + + + + + + + + <_PackageReferenceToAdd Remove="@(_PackageReferenceToAdd)" /> + + + + false + + + + + + https://aka.ms/sdkimplicititems + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_WindowsDesktopTransitiveFrameworkReference Include="@(TransitiveFrameworkReference)" Condition="'%(Identity)' == 'Microsoft.WindowsDesktop.App' Or '%(Identity)' == 'Microsoft.WindowsDesktop.App.WPF' Or '%(Identity)' == 'Microsoft.WindowsDesktop.App.WindowsForms'" /> + + + + + + + + + + + + + $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) + + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + + + $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + + + $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + + + $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + + + $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + + + $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + + + $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + $(ResolveAssemblyReferencesDependsOn); + ResolveTargetingPackAssets; + + + + + + + + + + + + + + + + + + + + + + $(NetCoreRoot)\sdk\$(NETCoreSdkVersion)\PrunePackageData\ + $(NetCoreTargetingPackRoot) + false + false + + + + + + + + + + + + + + + + + true + true + false + + + <_NuGetRestoreSupported Condition="('$(Language)' == 'C++' and '$(_EnablePackageReferencesInVCProjects)' != 'true')">false + + + <_PackAsToolShimRuntimeIdentifiers Condition="@(_PackAsToolShimRuntimeIdentifiers) ==''" Include="$(PackAsToolShimRuntimeIdentifiers)" /> + + + + + + + + + + + + + + + $(RuntimeIdentifier) + $(DefaultAppHostRuntimeIdentifier) + + + + + + + + + + + true + true + false + + + + [%(_PackageToDownload.Version)] + + + + + + + + <_ImplicitPackageReference Remove="@(PackageReference)" /> + + + + + + + + + + + + + + + + + + %(ResolvedTargetingPack.PackageDirectory) + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ApphostsForShimRuntimeIdentifiers Include="%(_ApphostsForShimRuntimeIdentifiersGetPackageDirectory.PackageDirectory)\%(_ApphostsForShimRuntimeIdentifiersGetPackageDirectory.PathInPackage)"> + %(_ApphostsForShimRuntimeIdentifiersGetPackageDirectory.RuntimeIdentifier) + + + + + %(ResolvedAppHostPack.PackageDirectory)\%(ResolvedAppHostPack.PathInPackage) + + + + @(ResolvedAppHostPack->'%(Path)') + + + + %(ResolvedSingleFileHostPack.PackageDirectory)\%(ResolvedSingleFileHostPack.PathInPackage) + + + + @(ResolvedSingleFileHostPack->'%(Path)') + + + + %(ResolvedComHostPack.PackageDirectory)\%(ResolvedComHostPack.PathInPackage) + + + + @(ResolvedComHostPack->'%(Path)') + + + + %(ResolvedIjwHostPack.PackageDirectory)\%(ResolvedIjwHostPack.PathInPackage) + + + + @(ResolvedIjwHostPack->'%(Path)') + + + + + + + + + + + + + + + true + false + + + + + + + + + + + + $([MSBuild]::Unescape($(PackageConflictPreferredPackages))) + + + + + + + + + + + + + true + true + + + + $(InterceptorsPreviewNamespaces);Microsoft.AspNetCore.Http.Generated + + $(InterceptorsPreviewNamespaces);Microsoft.Extensions.Configuration.Binder.SourceGeneration + + $(InterceptorsPreviewNamespaces);Microsoft.Extensions.Validation.Generated + + + + + + + + + + + + + + + + + + <_ExistingReferenceAssembliesPackageReference Include="@(PackageReference)" Condition="'%(PackageReference.Identity)' == 'Microsoft.NETFramework.ReferenceAssemblies'" /> + + + + + + + + + + + + + + + + + + <_Parameter1>$(UserSecretsId.Trim()) + + + + + + + + + + $(_IsNETCoreOrNETStandard) + + + true + false + true + $(MSBuildProjectDirectory)/runtimeconfig.template.json + true + true + <_GenerateRuntimeConfigurationPropertyInputsCache Condition="'$(_GenerateRuntimeConfigurationPropertyInputsCache)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).genruntimeconfig.cache + <_GenerateRuntimeConfigurationPropertyInputsCache>$([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(_GenerateRuntimeConfigurationPropertyInputsCache))) + <_GeneratePublishDependencyFilePropertyInputsCache Condition="'$(_GeneratePublishDependencyFilePropertyInputsCache)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).genpublishdeps.cache + <_GeneratePublishDependencyFilePropertyInputsCache>$([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(_GeneratePublishDependencyFilePropertyInputsCache))) + <_GenerateSingleFileBundlePropertyInputsCache Condition="'$(_GenerateSingleFileBundlePropertyInputsCache)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).genbundle.cache + <_GenerateSingleFileBundlePropertyInputsCache>$([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(_GenerateSingleFileBundlePropertyInputsCache))) + + + + <_UseRidGraphWasSpecified Condition="'$(UseRidGraph)' != ''">true + + + false + true + + + $(BundledRuntimeIdentifierGraphFile) + + $([System.IO.Path]::GetDirectoryName($(BundledRuntimeIdentifierGraphFile)))/PortableRuntimeIdentifierGraph.json + + + + + + + + + + + true + + + false + + + $(AssemblyName).deps.json + $(TargetDir)$(ProjectDepsFileName) + $(AssemblyName).runtimeconfig.json + $(TargetDir)$(ProjectRuntimeConfigFileName) + $(TargetDir)$(AssemblyName).runtimeconfig.dev.json + true + true + + + + + + true + true + + + + CurrentArchitecture + CurrentRuntime + + + <_NativeLibraryPrefix Condition="'$(_NativeLibraryPrefix)' == '' and !$(RuntimeIdentifier.StartsWith('win'))">lib + <_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == '' and $(RuntimeIdentifier.StartsWith('win'))">.dll + <_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == '' and $(RuntimeIdentifier.StartsWith('osx'))">.dylib + <_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == ''">.so + <_NativeExecutableExtension Condition="'$(_NativeExecutableExtension)' == '' and ($(RuntimeIdentifier.StartsWith('win')) or $(DefaultAppHostRuntimeIdentifier.StartsWith('win')))">.exe + <_ComHostLibraryExtension Condition="'$(_ComHostLibraryExtension)' == '' and ($(RuntimeIdentifier.StartsWith('win')) or $(DefaultAppHostRuntimeIdentifier.StartsWith('win')))">.dll + <_IjwHostLibraryExtension Condition="'$(_IjwHostLibraryExtension)' == '' and ($(RuntimeIdentifier.StartsWith('win')) or $(DefaultAppHostRuntimeIdentifier.StartsWith('win')))">.dll + <_DotNetHostExecutableName>dotnet$(_NativeExecutableExtension) + <_DotNetAppHostExecutableNameWithoutExtension>apphost + <_DotNetAppHostExecutableName>$(_DotNetAppHostExecutableNameWithoutExtension)$(_NativeExecutableExtension) + <_DotNetSingleFileHostExecutableNameWithoutExtension>singlefilehost + <_DotNetComHostLibraryNameWithoutExtension>comhost + <_DotNetComHostLibraryName>$(_DotNetComHostLibraryNameWithoutExtension)$(_ComHostLibraryExtension) + <_DotNetIjwHostLibraryNameWithoutExtension>Ijwhost + <_DotNetIjwHostLibraryName>$(_DotNetIjwHostLibraryNameWithoutExtension)$(_IjwHostLibraryExtension) + <_DotNetHostPolicyLibraryName>$(_NativeLibraryPrefix)hostpolicy$(_NativeLibraryExtension) + <_DotNetHostFxrLibraryName>$(_NativeLibraryPrefix)hostfxr$(_NativeLibraryExtension) + + + + + + <_ExcludeFromPublishPackageReference Include="@(PackageReference)" Condition="('%(PackageReference.Publish)' == 'false')" /> + + + + + + Microsoft.NETCore.App + + + + + <_DefaultUserProfileRuntimeStorePath>$(HOME) + <_DefaultUserProfileRuntimeStorePath Condition="$([MSBuild]::IsOSPlatform(`Windows`))">$(USERPROFILE) + <_DefaultUserProfileRuntimeStorePath>$([System.IO.Path]::Combine($(_DefaultUserProfileRuntimeStorePath), '.dotnet', 'store')) + $(_DefaultUserProfileRuntimeStorePath) + + + true + + + true + + + true + + + + + + + false + true + + + + true + + + true + + + $(AvailablePlatforms),ARM32 + + + $(AvailablePlatforms),ARM64 + + + $(AvailablePlatforms),ARM64 + + + + false + + + + true + + + + + <_ProjectTypeRequiresBinaryFormatter Condition="'$(UseWindowsForms)' == 'true' AND $([MSBuild]::VersionLessThanOrEquals($(TargetFrameworkVersion), '8.0'))">true + <_ProjectTypeRequiresBinaryFormatter Condition="'$(UseWPF)' == 'true' AND $([MSBuild]::VersionLessThanOrEquals($(TargetFrameworkVersion), '8.0'))">true + + <_BinaryFormatterObsoleteAsError>true + + false + + + + _CheckForBuildWithNoBuild; + $(CoreBuildDependsOn); + GenerateBuildDependencyFile; + GenerateBuildRuntimeConfigurationFiles + + + + + _SdkBeforeClean; + $(CoreCleanDependsOn) + + + + + _SdkBeforeRebuild; + $(RebuildDependsOn) + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0.0 + + + + + + + + + + + + + <_ValidRuntimeIdentifierPlatformsForAssets Include="@(_KnownRuntimeIdentifierPlatforms)" /> + + <_ValidRuntimeIdentifierPlatformsForAssets Include="@(_KnownRuntimeIdentifierPlatformsForTargetFramework)" Exclude="@(_ExcludedKnownRuntimeIdentifierPlatforms)" /> + + + + + + + + + + + + <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="@(AdditionalProbingPath->'%(Identity)')" /> + <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(EnableDynamicLoading)" /> + <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(RollForward)" /> + <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="@(RuntimeHostConfigurationOption->'%(Identity)%(Value)')" /> + <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(RuntimeIdentifier)" /> + <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(SelfContained)" /> + <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(TargetFramework)" /> + <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(UserRuntimeConfig)" /> + <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(_WriteIncludedFrameworks)" /> + + + + + + + + + + + + + <_IsRollForwardSupported Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'">true + LatestMinor + + + + + <_WriteIncludedFrameworks Condition="'$(SelfContained)' == 'true' and '$(_TargetFrameworkVersionWithoutV)' >= '3.1'">true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_CleaningWithoutRebuilding>true + false + + + + + <_CleaningWithoutRebuilding>false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(CompileDependsOn); + _CreateAppHost; + _CreateComHost; + _GetIjwHostPaths; + + + + + + <_UseWindowsGraphicalUserInterface Condition="($(RuntimeIdentifier.StartsWith('win')) or $(DefaultAppHostRuntimeIdentifier.StartsWith('win'))) and '$(OutputType)'=='WinExe'">true + <_EnableMacOSCodeSign Condition="'$(_EnableMacOSCodeSign)' == '' and ($(RuntimeIdentifier.StartsWith('osx')) or $(AppHostRuntimeIdentifier.StartsWith('osx')))">true + <_UseSingleFileHostForPublish Condition="'$(PublishSingleFile)' == 'true' and '$(SelfContained)' == 'true' and '$(SingleFileHostSourcePath)' != '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0))">true + <_DisableCetCompat Condition="'$(CetCompat)' == 'false'">true + + AppRelative + <_UpdateAppHostForPublish Condition="'$(_UseSingleFileHostForPublish)' != 'true' and ('$(AppHostRelativeDotNet)' != '' or '$(AppHostDotNetSearch)' != '')">true + + + + + + + + + + + + + @(_NativeRestoredAppHostNETCore) + + + $([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)apphost$(_NativeExecutableExtension)')) + $([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)apphost_publish$(_NativeExecutableExtension)')) + $([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)singlefilehost$(_NativeExecutableExtension)')) + + + + + + + + + + + + + + + + + + + + + + + + + $(AssemblyName).comhost$(_ComHostLibraryExtension) + $([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(ComHostFileName)')) + + + + + + + + + + + + <_CopyAndRenameDotnetHost Condition="'$(_CopyAndRenameDotnetHost)' == ''">true + + + + $(AssemblyName)$(_NativeExecutableExtension) + PreserveNewest + PreserveNewest + + + + + + PreserveNewest + Never + + + + + $(AssemblyName)$(_NativeExecutableExtension) + PreserveNewest + + Always + + + + + $(AssemblyName).$(_DotNetComHostLibraryName) + PreserveNewest + PreserveNewest + + + %(FileName)%(Extension) + PreserveNewest + PreserveNewest + + + + + $(_DotNetIjwHostLibraryName) + PreserveNewest + PreserveNewest + + + + + + + <_FrameworkReferenceAssemblies Include="@(ReferencePath)" Condition="(%(ReferencePath.FrameworkFile) == 'true' or %(ReferencePath.ResolvedFrom) == 'ImplicitlyExpandDesignTimeFacades') and ('%(ReferencePath.NuGetSourceType)' == '' or '%(ReferencePath.NuGetIsFrameworkReference)' == 'true')" /> + + <_ReferenceOnlyAssemblies Include="@(ReferencePath)" Exclude="@(_FrameworkReferenceAssemblies)" Condition="%(ReferencePath.CopyLocal) != 'true' and %(ReferencePath.NuGetSourceType) == ''" /> + <_ReferenceAssemblies Include="@(_FrameworkReferenceAssemblies)" /> + <_ReferenceAssemblies Include="@(_ReferenceOnlyAssemblies)" /> + + + + + + + + true + + + true + + + + + + + + + $(CreateSatelliteAssembliesDependsOn); + CoreGenerateSatelliteAssemblies + + + + + + + <_AssemblyInfoFile>$(IntermediateOutputPath)%(_SatelliteAssemblyResourceInputs.Culture)\$(TargetName).resources.cs + <_OutputAssembly>$(IntermediateOutputPath)%(_SatelliteAssemblyResourceInputs.Culture)\$(TargetName).resources.dll + + + + <_Parameter1>%(_SatelliteAssemblyResourceInputs.Culture) + + + + + + + true + + + <_SatelliteAssemblyReferences Remove="@(_SatelliteAssemblyReferences)" /> + <_SatelliteAssemblyReferences Include="@(ReferencePath)" Condition="'%(Filename)' == 'mscorlib' or '%(Filename)' == 'netstandard' or '%(Filename)' == 'System.Runtime' " /> + + + + + + + + + + + + + + + + + + + + + + + + + $(TargetFrameworkIdentifier) + $(_TargetFrameworkVersionWithoutV) + + + + + + + + + + + + + + + + + + + + false + + + + <_UseAttributeForTargetFrameworkInfoPropertyNames Condition="$([MSBuild]::VersionGreaterThanOrEquals($(MSBuildVersion), '17.0'))">true + + + + + + <_IsVSTestTestProject Condition="'$(IsTestProject)' == 'true' and '$(IsTestingPlatformApplication)' != 'true'">true + <_IsVSTestTestProject Condition="'$(_IsVSTestTestProject)' == ''">false + + false + + false + + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildThisFileDirectory)Microsoft.NET.CrossGen.targets + + + + + + + + .NET Standard $(_TargetFrameworkVersionWithoutV) + .NET Core $(_TargetFrameworkVersionWithoutV) + .NET $(_TargetFrameworkVersionWithoutV) + <_TargetFrameworkDirectories /> + + + + true + + + + + + + $(CommonOutputGroupsDependsOn); + + + + + $(DesignerRuntimeImplementationProjectOutputGroupDependsOn); + _GenerateDesignerDepsFile; + _GenerateDesignerRuntimeConfigFile; + GetCopyToOutputDirectoryItems; + _GatherDesignerShadowCopyFiles; + + <_DesignerDepsFileName>$(AssemblyName).designer.deps.json + <_DesignerRuntimeConfigFileName>$(AssemblyName).designer.runtimeconfig.json + <_DesignerDepsFilePath>$(IntermediateOutputPath)$(_DesignerDepsFileName) + <_DesignerRuntimeConfigFilePath>$(IntermediateOutputPath)$(_DesignerRuntimeConfigFileName) + + + + + + + + + + + + + + <_DesignerHostConfigurationOption Include="Microsoft.NETCore.DotNetHostPolicy.SetAppPaths" Value="true" /> + + + + + + + + + + + <_DesignerShadowCopy Include="@(ReferenceCopyLocalPaths)" /> + + <_DesignerShadowCopy Remove="@(_ResolvedCopyLocalBuildAssets)" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" /> + + <_DesignerShadowCopy Remove="@(RuntimePackAsset)" Condition="'%(RuntimePackAsset.RuntimePackAlwaysCopyLocal)' != 'true'" /> + + + + + + + + + + + $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyInfo$(DefaultLanguageSourceExtension) + true + + + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + + + + + + + <_InformationalVersionContainsPlus>false + <_InformationalVersionContainsPlus Condition="$(InformationalVersion.Contains('+'))">true + $(InformationalVersion)+$(SourceRevisionId) + $(InformationalVersion).$(SourceRevisionId) + + + + + + <_Parameter1>$(Company) + + + <_Parameter1>$(Configuration) + + + <_Parameter1>$(Copyright) + + + <_Parameter1>$(Description) + + + <_Parameter1>$(FileVersion) + + + <_Parameter1>$(InformationalVersion) + + + <_Parameter1>$(Product) + + + <_Parameter1>$(Trademark) + + + <_Parameter1>$(AssemblyTitle) + + + <_Parameter1>$(AssemblyVersion) + + + <_Parameter1>RepositoryUrl + <_Parameter2 Condition="'$(RepositoryUrl)' != ''">$(RepositoryUrl) + <_Parameter2 Condition="'$(RepositoryUrl)' == ''">$(PrivateRepositoryUrl) + + + <_Parameter1>$(NeutralLanguage) + + + %(InternalsVisibleTo.PublicKey) + + + <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' != ''">%(InternalsVisibleTo.Identity), PublicKey=%(InternalsVisibleTo.Key) + <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' == '' and '$(PublicKey)' != ''">%(InternalsVisibleTo.Identity), PublicKey=$(PublicKey) + <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' == '' and '$(PublicKey)' == ''">%(InternalsVisibleTo.Identity) + + + <_Parameter1>%(AssemblyMetadata.Identity) + <_Parameter2>%(AssemblyMetadata.Value) + + + + + + <_Parameter1>$(TargetPlatformIdentifier)$(TargetPlatformVersion) + + + + + <_Parameter1>$(TargetPlatformIdentifier)$(SupportedOSPlatformVersion) + + + <_Parameter1>$(TargetPlatformIdentifier) + + + + + + + + + + $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyInfoInputs.cache + + + + + + + + + + + + + + + + + + + + + + + + + + + $(AssemblyVersion) + $(Version) + + + + + + + + + $(IntermediateOutputPath)$(MSBuildProjectName).GlobalUsings.g$(DefaultLanguageSourceExtension) + + + + + + + + + + + + + + + + + + + <_GenerateSupportedRuntimeIntermediateAppConfig>$(IntermediateOutputPath)$(TargetFileName).withSupportedRuntime.config + + + + + + + + + + + + + + + + + + + + + + + + + + <_AllProjects Include="$(AdditionalProjects.Split('%3B'))" /> + <_AllProjects Include="$(MSBuildProjectFullPath)" /> + + + + + + + + + + %(PackageReference.Identity) + %(PackageReference.Version) + + StorePackageName=%(PackageReference.Identity); + StorePackageVersion=%(PackageReference.Version); + ComposeWorkingDir=$(ComposeWorkingDir); + PublishDir=$(PublishDir); + StoreStagingDir=$(StoreStagingDir); + TargetFramework=$(TargetFramework); + RuntimeIdentifier=$(RuntimeIdentifier); + JitPath=$(JitPath); + Crossgen=$(Crossgen); + SkipUnchangedFiles=$(SkipUnchangedFiles); + PreserveStoreLayout=$(PreserveStoreLayout); + CreateProfilingSymbols=$(CreateProfilingSymbols); + StoreSymbolsStagingDir=$(StoreSymbolsStagingDir); + DisableImplicitFrameworkReferences=false; + + + + + + + + + + + + + + + + + + + + + + + <_StoreArtifactContent> +@(ListOfPackageReference) + +]]> + + + + + + + + + + <_OptimizedResolvedFileToPublish Include="$(StoreStagingDir)\**\*.*" /> + <_OptimizedSymbolFileToPublish Include="$(StoreSymbolsStagingDir)\**\*.*" /> + + + + + + + + + + + + true + true + <_TFM Condition="'$(_TFM)' == ''">$(TargetFramework) + true + + + + + + $(UserProfileRuntimeStorePath) + <_ProfilingSymbolsDirectoryName>symbols + $([System.IO.Path]::Combine($(DefaultComposeDir), $(_ProfilingSymbolsDirectoryName))) + $([System.IO.Path]::Combine($(ComposeDir), $(_ProfilingSymbolsDirectoryName))) + $([System.IO.Path]::Combine($(ProfilingSymbolsDir), $(PlatformTarget))) + $(DefaultProfilingSymbolsDir) + $([System.IO.Path]::Combine($(ProfilingSymbolsDir), $(_TFM))) + $(ProfilingSymbolsDir)\ + $(DefaultComposeDir) + $([System.IO.Path]::Combine($(ComposeDir), $(PlatformTarget))) + $([System.IO.Path]::Combine($(ComposeDir), $(_TFM))) + $([System.IO.Path]::Combine($(ComposeDir),"artifact.xml")) + $([System.IO.Path]::GetFullPath($(ComposeDir))) + <_RandomFileName>$([System.IO.Path]::GetRandomFileName()) + $([System.IO.Path]::GetTempPath()) + $([System.IO.Path]::Combine($(TEMP), $(_RandomFileName))) + $([System.IO.Path]::GetFullPath($(ComposeWorkingDir))) + $([System.IO.Path]::Combine($(ComposeWorkingDir),"StagingDir")) + + $([System.IO.Path]::Combine($(ComposeWorkingDir),"SymbolsStagingDir")) + + $(PublishDir)\ + + + + false + true + + + + + + + + $(StorePackageVersion.Replace('*','-')) + $([System.IO.Path]::Combine($(ComposeWorkingDir),"$(StorePackageName)_$(StorePackageVersionForFolderName)")) + <_PackageProjFile>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "Restore.csproj")) + $(StoreWorkerWorkingDir)\ + $(BaseIntermediateOutputPath)\project.assets.json + + + $(MicrosoftNETPlatformLibrary) + true + + + + + + + + + + + + + + + + + + + + + + + <_ManagedResolvedFileToPublishCandidates Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.AssetType)'=='runtime'" /> + <_UnOptimizedResolvedFileToPublish Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.AssetType)'!='runtime'" /> + + + true + + + + + + <_UnOptimizedResolvedFileToPublish Include="@(ResolvedFileToPublish)" /> + + + + + + + true + true + + + + + + + + + + + + + + + + + + + + + + true + true + false + true + false + true + 1 + false + pe + true + false + false + false + false + false + false + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + $(PublishReadyToRunCrossgen2ExtraArgs);--strip-inlining-info + $(PublishReadyToRunCrossgen2ExtraArgs);--strip-debug-info + + + $(MicrosoftNETBuildTasksAssembly) + + + + + + <_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='coreclr'" /> + <_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libcoreclr'" /> + <_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='clrjit'" /> + <_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libclrjit'" /> + + + + + + + + <_CoreclrPath>@(_CoreclrResolvedPath) + @(_JitResolvedPath) + <_CoreclrDir>$([System.IO.Path]::GetDirectoryName($(_CoreclrPath))) + <_CoreclrPkgDir>$([System.IO.Path]::Combine($(_CoreclrDir),"..\..\..\")) + $([System.IO.Path]::Combine($(_CoreclrPkgDir),"tools")) + + $([System.IO.Path]::Combine($(CrossgenDir),"crossgen")) + $([System.IO.Path]::Combine($(CrossgenDir),"crossgen.exe")) + + + + + + + + $([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine($(_NetCoreRefDir), $([System.IO.Path]::GetFileName($(Crossgen))))))) + + + + + + + + CrossgenExe=$(Crossgen); + CrossgenJit=$(JitPath); + CrossgenInputAssembly=%(_ManagedResolvedFilesToOptimize.Fullpath); + CrossgenOutputAssembly=$(_RuntimeOptimizedDir)$(DirectorySeparatorChar)%(_ManagedResolvedFilesToOptimize.FileName)%(_ManagedResolvedFilesToOptimize.Extension); + CrossgenSubOutputPath=%(_ManagedResolvedFilesToOptimize.DestinationSubPath); + _RuntimeOptimizedDir=$(_RuntimeOptimizedDir); + PublishDir=$(StoreStagingDir); + CrossgenPlatformAssembliesPath=$(_RuntimeRefDir)$(PathSeparator)$(_NetCoreRefDir); + CreateProfilingSymbols=$(CreateProfilingSymbols); + StoreSymbolsStagingDir=$(StoreSymbolsStagingDir); + _RuntimeSymbolsDir=$(_RuntimeSymbolsDir) + + + + + + + + + + $([System.IO.Path]::GetDirectoryName($(_RuntimeSymbolsDir)\$(CrossgenSubOutputPath))) + $([System.IO.Path]::GetDirectoryName($(StoreSymbolsStagingDir)\$(CrossgenSubOutputPath))) + $(CrossgenExe) -nologo -readytorun -in "$(CrossgenInputAssembly)" -out "$(CrossgenOutputAssembly)" -jitpath "$(CrossgenJit)" -platform_assemblies_paths "$(CrossgenPlatformAssembliesPath)" + CreatePDB + CreatePerfMap + + + + + + + + + + + + <_ProfilingSymbols Include="$(CrossgenProfilingSymbolsOutputDirectory)\*" Condition="'$(CreateProfilingSymbols)' == 'true'" /> + + + + + + + + $([System.IO.Path]::PathSeparator) + $([System.IO.Path]::DirectorySeparatorChar) + + + + + + <_CrossProjFileDir>$([System.IO.Path]::Combine($(ComposeWorkingDir),"Optimize")) + <_NetCoreRefDir>$([System.IO.Path]::Combine($(_CrossProjFileDir), "netcoreapp")) + + + + + <_CrossProjAssetsFile>$([System.IO.Path]::Combine($(_CrossProjFileDir), project.assets.json)) + + + + + + <_RuntimeRefDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimeref")) + + <_RuntimeOptimizedDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimopt")) + + <_RuntimeSymbolsDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimesymbols")) + + + <_ManagedResolvedFilesToOptimize Include="@(_ManagedResolvedFileToPublishCandidates)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ReadyToRunOutputPath>$(IntermediateOutputPath)R2R + + + + <_ReadyToRunImplementationAssemblies Include="@(ResolvedFileToPublish->WithMetadataValue('PostprocessAssembly', 'true'))" /> + + + + <_ReadyToRunImplementationAssemblies Include="@(_ManagedRuntimePackAssembly)" ReferenceOnly="true" /> + + + + + + <_ReadyToRunImplementationAssemblies Remove="@(_ReadyToRunImplementationAssemblies)" /> + <_ReadyToRunImplementationAssemblies Include="@(_ReadyToRunImplementationAssembliesWithoutConflicts)" /> + + + <_ReadyToRunPgoFiles Include="@(PublishReadyToRunPgoFiles)" /> + <_ReadyToRunPgoFiles Include="@(RuntimePackAsset)" Condition="'%(RuntimePackAsset.AssetType)' == 'pgodata' and '%(RuntimePackAsset.Extension)' == '.mibc' and '$(PublishReadyToRunUseRuntimePackOptimizationData)' == 'true'" /> + + + + + + + + + + + + <_ReadyToRunNativeObjectOutputs Include="@(_ReadyToRunFilesToPublish->WithMetadataValue('RequiresNativeLink', 'true'))" /> + <_ReadyToRunNativeObjectOutputs OutputPath="%(Identity)" /> + + + $(PublishReadyToRunCrossgen2CompositeExtraArgs);--strip-il-bodies + + + + + + + + + + + + + + + + + + + <_ReadyToRunCompilerHasWarnings Condition="'$(_ReadyToRunWarningsDetected)' == 'true'">true + + + <_ReadyToRunCompilationFailures Condition="'$(_ReadyToRunCompilerExitCode)' != '' And $(_ReadyToRunCompilerExitCode) != 0" Include="@(_ReadyToRunCompileList)" /> + + + + + + + + + + + <_ReadyToRunCompilerHasWarnings Condition="'$(_ReadyToRunWarningsDetected)' == 'true'">true + + + <_ReadyToRunCompilationFailures Condition="'$(_ReadyToRunCompilerExitCode)' != '' And $(_ReadyToRunCompilerExitCode) != 0" Include="@(_ReadyToRunSymbolsCompileList)" /> + + + + + <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('ios-'))">ios + <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('tvos-'))">tvos + <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('iossimulator-'))">iossimulator + <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('tvossimulator-'))">tvossimulator + <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('maccatalyst-'))">maccatalyst + <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('osx-'))">osx + <_AppleTargetArchitecture Condition="$(RuntimeIdentifier.EndsWith('-x64'))">x86_64 + <_AppleTargetArchitecture Condition="$(RuntimeIdentifier.EndsWith('-arm64'))">arm64 + + + 12.0 + 15.0 + 12.2 + <_AppleSdkName Condition="'$(_AppleTargetOS)' == 'ios'">iphoneos + <_AppleSdkName Condition="'$(_AppleTargetOS)' == 'iossimulator'">iphonesimulator + <_AppleSdkName Condition="'$(_AppleTargetOS)' == 'tvos'">appletvos + <_AppleSdkName Condition="'$(_AppleTargetOS)' == 'tvossimulator'">appletvsimulator + <_AppleSdkName Condition="'$(_AppleTargetOS)' == 'maccatalyst' or '$(_AppleTargetOS)' == 'osx'">macosx + <_AppleTripleOS Condition="'$(_AppleTargetOS)' == 'osx'">macos + <_AppleTripleOS Condition="'$(_AppleTargetOS)' == 'maccatalyst' or $(_AppleTargetOS.StartsWith('ios'))">ios + <_AppleTripleOS Condition="$(_AppleTargetOS.StartsWith('tvos'))">tvos + <_AppleTripleAbi Condition="'$(_AppleTargetOS)' == 'ios' or '$(_AppleTargetOS)' == 'tvos'">macho + <_AppleTripleAbi Condition="'$(_AppleTargetOS)' == 'maccatalyst'">macabi + <_AppleTripleAbi Condition="$(_AppleTargetOS.EndsWith('simulator'))">simulator + $(_AppleTargetArchitecture)-apple-$(_AppleTripleOS)$(AppleMinOSVersion) + $(_AppleTargetArchitecture)-apple-$(_AppleTripleOS)$(AppleMinOSVersion)-$(_AppleTripleAbi) + + + xcrun + <_WhereXcrun>0 + + + + + + + + + + + + + + + + + + $(DsymUtilOptions) --minimize + + + <_MachLinkerArg Include="-gz=zlib" Condition="'$(CompressSymbols)' != 'false'" /> + <_MachLinkerArg Include="-isysroot "$(SysRoot)"" Condition="'$(SysRoot)' != ''" /> + <_MachLinkerArg Include="--target=$(TargetTriple)" /> + <_MachLinkerArg Include="-g" Condition="'$(NativeDebugSymbols)' == 'true'" /> + <_MachLinkerArg Include="-dynamiclib" /> + <_MachLinkerArg Include="-Wl,-dead_strip" /> + + + + + + + <_XcodeVersion>$([System.Text.RegularExpressions.Regex]::Match($(_XcodeVersionString), '[1-9]\d*')) + + + <_MachLinkerArg Condition="'$(UseLdClassicXCodeLinker)' == 'true' or '$(_XcodeVersion)' == '15' or '$(_XcodeVersion)' == '16'" Include="-ld_classic" /> + + + + <_IgnoreLinkerWarnings Condition="'$(_XcodeVersion)' == '16'">true + + + + + + @rpath/%(_ReadyToRunNativeObjectOutputs.Filename)%(_ReadyToRunNativeObjectOutputs.Extension) + + + <_MachLinkerArg Include="-Wl,-install_name,"$(SharedLibraryInstallName)"" /> + <_MachLinkerArg Include="%(_ReadyToRunNativeObjectOutputs.NativeLinkerInputPath)" /> + <_MachLinkerArg Include="-o %(_ReadyToRunNativeObjectOutputs.Identity)" /> + + + + + + + + + + + + $(MSBuildThisFileDirectory)..\..\..\Microsoft.NETCoreSdk.BundledCliTools.props + + + + + + + <_ReferenceToObsoleteDotNetCliTool Include="@(DotNetCliToolReference)" /> + + <_ReferenceToObsoleteDotNetCliTool Remove="@(DotNetCliToolReference)" /> + + + + + + + + + true + <_GetChildProjectCopyToPublishDirectoryItems Condition="'$(_GetChildProjectCopyToPublishDirectoryItems)' == ''">true + true + + + + + true + true + <_FirstTargetFrameworkToSupportTrimming>net6.0 + <_FirstTargetFrameworkToSupportAot>net7.0 + <_FirstTargetFrameworkToSupportSingleFile>net6.0 + <_FirstTargetFrameworkVersionToSupportTrimAnalyzer>$([MSBuild]::GetTargetFrameworkVersion('$(_FirstTargetFrameworkToSupportTrimming)')) + <_FirstTargetFrameworkVersionToSupportAotAnalyzer>$([MSBuild]::GetTargetFrameworkVersion('$(_FirstTargetFrameworkToSupportAot)')) + <_FirstTargetFrameworkVersionToSupportSingleFileAnalyzer>$([MSBuild]::GetTargetFrameworkVersion('$(_FirstTargetFrameworkToSupportSingleFile)')) + + + + + + + + + + + + Always + + + + + + <_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == '' And ( '$(PublishAot)' == 'true' Or '$(IsAotCompatible)' == 'true' Or '$(EnableAotAnalyzer)' == 'true' Or '$(PublishTrimmed)' == 'true' Or '$(IsTrimmable)' == 'true' Or '$(EnableTrimAnalyzer)' == 'true' Or '$(EnableSingleFileAnalyzer)' == 'true')">true + <_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == ''">false + + + + + <_MinNonEolTargetFrameworkForTrimming>$(_MinimumNonEolSupportedNetCoreTargetFramework) + <_MinNonEolTargetFrameworkForSingleFile>$(_MinimumNonEolSupportedNetCoreTargetFramework) + + <_MinNonEolTargetFrameworkForAot>$(_MinimumNonEolSupportedNetCoreTargetFramework) + <_MinNonEolTargetFrameworkForAot Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(_FirstTargetFrameworkToSupportAot)', '$(_MinimumNonEolSupportedNetCoreTargetFramework)'))">$(_FirstTargetFrameworkToSupportAot) + + + <_TargetFramework Include="$(TargetFrameworks)" /> + <_DecomposedTargetFramework Include="@(_TargetFramework)"> + $([MSBuild]::IsTargetFrameworkCompatible('%(Identity)', '$(_FirstTargetFrameworkToSupportTrimming)')) + $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForTrimming)', '%(Identity)')) + $([MSBuild]::IsTargetFrameworkCompatible('%(Identity)', '$(_FirstTargetFrameworkToSupportAot)')) + $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForAot)', '%(Identity)')) + $([MSBuild]::IsTargetFrameworkCompatible('%(Identity)', '$(_FirstTargetFrameworkToSupportSingleFile)')) + $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForSingleFile)', '%(Identity)')) + + <_TargetFrameworkToSilenceIsTrimmableUnsupportedWarning Include="@(_DecomposedTargetFramework)" Condition="'%(SupportsTrimming)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForTrimming)' == 'true'" /> + <_TargetFrameworkToSilenceIsAotCompatibleUnsupportedWarning Include="@(_DecomposedTargetFramework->'%(Identity)')" Condition="'%(SupportsAot)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForAot)' == 'true'" /> + <_TargetFrameworkToSilenceEnableSingleFileAnalyzerUnsupportedWarning Include="@(_DecomposedTargetFramework)" Condition="'%(SupportsSingleFile)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForSingleFile)' == 'true'" /> + + + + <_SilenceIsTrimmableUnsupportedWarning Condition="'$(_SilenceIsTrimmableUnsupportedWarning)' == '' And @(_TargetFrameworkToSilenceIsTrimmableUnsupportedWarning->Count()) > 0">true + <_SilenceIsAotCompatibleUnsupportedWarning Condition="'$(_SilenceIsAotCompatibleUnsupportedWarning)' == '' And @(_TargetFrameworkToSilenceIsAotCompatibleUnsupportedWarning->Count()) > 0">true + <_SilenceEnableSingleFileAnalyzerUnsupportedWarning Condition="'$(_SilenceEnableSingleFileAnalyzerUnsupportedWarning)' == '' And @(_TargetFrameworkToSilenceEnableSingleFileAnalyzerUnsupportedWarning->Count()) > 0">true + + + + + + + + <_BeforePublishNoBuildTargets> + BuildOnlySettings; + _PreventProjectReferencesFromBuilding; + ResolveReferences; + PrepareResourceNames; + ComputeIntermediateSatelliteAssemblies; + ComputeEmbeddedApphostPaths; + + <_CorePublishTargets> + PrepareForPublish; + ComputeAndCopyFilesToPublishDirectory; + $(PublishProtocolProviderTargets); + PublishItemsOutputGroup; + + <_PublishNoBuildAlternativeDependsOn>$(_BeforePublishNoBuildTargets);$(_CorePublishTargets) + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + $(PublishDir)\ + + + + + + + + + + + + <_OrphanPublishFileWrites Include="@(_PriorPublishFileWrites)" Exclude="@(_CurrentPublishFileWrites)" /> + + + + + + + + + + + + <_NormalizedPublishDir>$([MSBuild]::NormalizeDirectory($(PublishDir))) + + + + + + <_PublishCleanFile Condition="'$(PublishCleanFile)'==''">PublishOutputs.$(_NormalizedPublishDirHash.Substring(0, 10)).txt + + + + + + + + + + + + + + + + + + <_CurrentPublishFileWritesUnfiltered Include="@(ResolvedFileToPublish->'$(_NormalizedPublishDir)%(RelativePath)')" /> + <_CurrentPublishFileWritesUnfiltered Include="$(_NormalizedPublishDir)$(AssemblyName)$(_NativeExecutableExtension)" Condition="'$(UseAppHost)' == 'true'" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ResolvedFileToPublishPreserveNewest Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.CopyToPublishDirectory)'=='PreserveNewest'" /> + <_ResolvedFileToPublishAlways Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.CopyToPublishDirectory)'=='Always'" /> + <_ResolvedFileToPublishIfDifferent Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.CopyToPublishDirectory)'=='IfDifferent'" /> + + + <_ResolvedUnbundledFileToPublishPreserveNewest Include="@(_ResolvedFileToPublishPreserveNewest)" Condition="'$(PublishSingleFile)' != 'true' or '%(_ResolvedFileToPublishPreserveNewest.ExcludeFromSingleFile)'=='true'" /> + <_ResolvedUnbundledFileToPublishAlways Include="@(_ResolvedFileToPublishAlways)" Condition="'$(PublishSingleFile)' != 'true' or '%(_ResolvedFileToPublishAlways.ExcludeFromSingleFile)'=='true'" /> + <_ResolvedUnbundledFileToPublishIfDifferent Include="@(_ResolvedFileToPublishIfDifferent)" Condition="'$(PublishSingleFile)' != 'true' or '%(_ResolvedFileToPublishIfDifferent.ExcludeFromSingleFile)'=='true'" /> + + + + + <_ComputeFilesToPublishDependsOn> + $(_ComputeFilesToPublishDependsOn); + PrepareForPublish; + ComputeResolvedFilesToPublishList; + ILLink; + NativeCompile; + CreateReadyToRunImages; + GeneratePublishDependencyFile; + GenerateSingleFileBundle; + + + + + + + + + true + true + false + + + + + + + + @(IntermediateAssembly->'%(Filename)%(Extension)') + PreserveNewest + + + + $(ProjectDepsFileName) + PreserveNewest + + + + $(ProjectRuntimeConfigFileName) + PreserveNewest + + + + @(AppConfigWithTargetPath->'%(TargetPath)') + PreserveNewest + + + + @(_DebugSymbolsIntermediatePath->'%(Filename)%(Extension)') + PreserveNewest + true + + + + %(IntermediateSatelliteAssembliesWithTargetPath.Culture)\%(Filename)%(Extension) + PreserveNewest + + + + %(Filename)%(Extension) + PreserveNewest + + + + + + + + + <_ResolvedCopyLocalPublishAssets Remove="@(_ResolvedCopyLocalPublishAssetsRemoved)" /> + + + + %(_ResolvedCopyLocalPublishAssets.DestinationSubDirectory)%(Filename)%(Extension) + PreserveNewest + + + + @(FinalDocFile->'%(Filename)%(Extension)') + PreserveNewest + + + + shims/%(_EmbeddedApphostPaths.ShimRuntimeIdentifier)/%(_EmbeddedApphostPaths.Filename)%(_EmbeddedApphostPaths.Extension) + PreserveNewest + + + <_FilesToDrop Include="@(ResolvedFileToPublish)" Condition="'$(PublishSingleFile)' == 'true' and '%(ResolvedFileToPublish.DropFromSingleFile)' == 'true'" /> + + + + + + + + + + + + <_ResolvedCopyLocalPublishAssets Include="@(RuntimePackAsset)" Condition="('$(SelfContained)' == 'true' Or '%(RuntimePackAsset.RuntimePackAlwaysCopyLocal)' == 'true') and '%(RuntimePackAsset.AssetType)' != 'pgodata'" /> + + + + <_ResolvedCopyLocalPublishAssets Remove="@(_NativeRestoredAppHostNETCore)" /> + + + <_ResolvedCopyLocalPublishAssets Include="@(_ResolvedCopyLocalBuildAssets)" Condition="'%(_ResolvedCopyLocalBuildAssets.CopyToPublishDirectory)' != 'false' " /> + + + + + + + + + + + + + <_PublishSatelliteResources Include="@(_ResolvedCopyLocalPublishAssets)" Condition="'%(_ResolvedCopyLocalPublishAssets.AssetType)' == 'resources'" /> + + + + + + <_ResolvedCopyLocalPublishAssets Remove="@(_PublishSatelliteResources)" /> + <_ResolvedCopyLocalPublishAssets Include="@(_FilteredPublishSatelliteResources)" /> + + + + + + <_ResolvedCopyLocalPublishAssets Include="@(ReferenceCopyLocalPaths)" Exclude="@(_ResolvedCopyLocalBuildAssets);@(RuntimePackAsset)" Condition="(('$(PublishReferencesDocumentationFiles)' == 'true' and '%(ReferenceCopyLocalPaths.Extension)' == '.xml') or ('$(PublishReferencesSymbols)' == 'true' and '%(ReferenceCopyLocalPaths.Extension)' == '.pdb') or ('%(ReferenceCopyLocalPaths.Extension)' != '.xml' and '%(ReferenceCopyLocalPaths.Extension)' != '.pdb')) and '%(ReferenceCopyLocalPaths.Private)' != 'false'"> + %(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension) + + + + + + + + + + + + + + + + %(_SourceItemsToCopyToPublishDirectoryAlways.TargetPath) + Always + True + + + %(_SourceItemsToCopyToPublishDirectory.TargetPath) + PreserveNewest + True + + + %(_SourceItemsToCopyToPublishDirectoryIfDifferent.TargetPath) + IfDifferent + True + + + + + + + <_ContentWithPublishMetadata Include="@(Content)" Condition="'%(Content.CopyToPublishDirectory)' != '' and '%(Content.CopyToPublishDirectory)' != 'Never' and '%(Content.CopyToOutputDirectory)' == ''"> + + %(Content.TargetPath) + %(Content.Link) + + $([MSBuild]::MakeRelative('$(MSBuildProjectDirectory)', '%(Content.FullPath)')) + + + + + + + + + <_GCTPDIKeepDuplicates>false + <_GCTPDIKeepMetadata>CopyToPublishDirectory;ExcludeFromSingleFile;TargetPath + + + + + + + + <_SourceItemsToCopyToPublishDirectoryAlways KeepDuplicates=" '$(_GCTPDIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_AllChildProjectPublishItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectPublishItemsWithTargetPath.CopyToPublishDirectory)'=='Always'" /> + <_SourceItemsToCopyToPublishDirectory KeepDuplicates=" '$(_GCTPDIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_AllChildProjectPublishItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectPublishItemsWithTargetPath.CopyToPublishDirectory)'=='PreserveNewest'" /> + <_SourceItemsToCopyToPublishDirectoryIfDifferent KeepDuplicates=" '$(_GCTPDIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_AllChildProjectPublishItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectPublishItemsWithTargetPath.CopyToPublishDirectory)'=='IfDifferent'" /> + + + + <_AllChildProjectPublishItemsWithTargetPath Remove="@(_AllChildProjectPublishItemsWithTargetPath)" /> + + + + <_SourceItemsToCopyToPublishDirectoryAlways KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToPublishDirectory)'=='Always'" /> + <_SourceItemsToCopyToPublishDirectory KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToPublishDirectory)'=='PreserveNewest'" /> + <_SourceItemsToCopyToPublishDirectoryIfDifferent KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToPublishDirectory)'=='IfDifferent'" /> + + + <_SourceItemsToCopyToPublishDirectoryAlways KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToPublishDirectory)'=='Always'" /> + <_SourceItemsToCopyToPublishDirectory KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToPublishDirectory)'=='PreserveNewest'" /> + <_SourceItemsToCopyToPublishDirectoryIfDifferent KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToPublishDirectory)'=='IfDifferent'" /> + + + <_CompileItemsToPublish Include="@(Compile->'%(FullPath)')" Condition="'%(Compile.CopyToPublishDirectory)'=='Always' or '%(Compile.CopyToPublishDirectory)'=='PreserveNewest' or '%(Compile.CopyToPublishDirectory)'=='IfDifferent'" /> + + + + + + <_SourceItemsToCopyToPublishDirectoryAlways KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_CompileItemsToPublishWithTargetPath)" Condition="'%(_CompileItemsToPublishWithTargetPath.CopyToPublishDirectory)'=='Always'" /> + <_SourceItemsToCopyToPublishDirectory KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_CompileItemsToPublishWithTargetPath)" Condition="'%(_CompileItemsToPublishWithTargetPath.CopyToPublishDirectory)'=='PreserveNewest'" /> + <_SourceItemsToCopyToPublishDirectoryIfDifferent KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_CompileItemsToPublishWithTargetPath)" Condition="'%(_CompileItemsToPublishWithTargetPath.CopyToPublishDirectory)'=='IfDifferent'" /> + + + <_SourceItemsToCopyToPublishDirectoryAlways KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToPublishDirectory)'=='Always'" /> + <_SourceItemsToCopyToPublishDirectory KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToPublishDirectory)'=='PreserveNewest'" /> + <_SourceItemsToCopyToPublishDirectoryIfDifferent KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToPublishDirectory)'=='IfDifferent'" /> + + + + <_SourceItemsToCopyToPublishDirectoryAlways Remove="$(AppHostIntermediatePath)" /> + <_SourceItemsToCopyToPublishDirectory Remove="$(AppHostIntermediatePath)" /> + <_SourceItemsToCopyToPublishDirectoryIfDifferent Remove="$(AppHostIntermediatePath)" /> + + <_SourceItemsToCopyToPublishDirectoryAlways Include="$(SingleFileHostIntermediatePath)" CopyToOutputDirectory="Always" TargetPath="$(AssemblyName)$(_NativeExecutableExtension)" /> + + + + <_SourceItemsToCopyToPublishDirectoryAlways Remove="$(AppHostIntermediatePath)" /> + <_SourceItemsToCopyToPublishDirectory Remove="$(AppHostIntermediatePath)" /> + <_SourceItemsToCopyToPublishDirectoryIfDifferent Remove="$(AppHostIntermediatePath)" /> + + <_SourceItemsToCopyToPublishDirectoryAlways Include="$(AppHostForPublishIntermediatePath)" CopyToOutputDirectory="Always" TargetPath="$(AssemblyName)$(_NativeExecutableExtension)" /> + + + + + + + + + + Always + + + PreserveNewest + + + IfDifferent + + + Always + + + PreserveNewest + + + IfDifferent + + + Always + + + PreserveNewest + + + IfDifferent + + <_NoneWithTargetPath Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='Always' and '%(_NoneWithTargetPath.CopyToPublishDirectory)' == ''"> + Always + + <_NoneWithTargetPath Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' and '%(_NoneWithTargetPath.CopyToPublishDirectory)' == ''"> + PreserveNewest + + <_NoneWithTargetPath Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='IfDifferent' and '%(_NoneWithTargetPath.CopyToPublishDirectory)' == ''"> + IfDifferent + + + + + <_ComputeManagedRuntimePackAssembliesIfSelfContained>_ComputeManagedRuntimePackAssemblies + + + + + + + <_ManagedRuntimeAssembly Include="@(RuntimeCopyLocalItems)" /> + + <_ManagedRuntimeAssembly Include="@(UserRuntimeAssembly)" /> + + <_ManagedRuntimeAssembly Include="@(IntermediateAssembly)" /> + + + + <_ManagedRuntimeAssembly Include="@(_ManagedRuntimePackAssembly)" /> + + + + + + + + + + + + + + + <_ManagedRuntimePackAssembly Include="@(RuntimePackAsset)" Condition="'%(RuntimePackAsset.AssetType)' == 'runtime' or '%(RuntimePackAsset.Filename)' == 'System.Private.Corelib'" /> + + + + + + <_TrimRuntimeAssets Condition="'$(PublishSingleFile)' == 'true' and '$(SelfContained)' == 'true'">true + <_UseBuildDependencyFile Condition="'@(_ExcludeFromPublishPackageReference)' == '' and '@(RuntimeStorePackages)' == '' and '$(PreserveStoreLayout)' != 'true' and '$(PublishTrimmed)' != 'true' and '$(_TrimRuntimeAssets)' != 'true'">true + + + + + + $(AssemblyName)$(_NativeExecutableExtension) + $(PublishDir)$(PublishedSingleFileName) + false + false + $(IncludeAllContentForSelfExtract) + + + <_FilesToBundle Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.ExcludeFromSingleFile)' != 'true'" /> + + + + + + <_BundleExcludedFiles Include="@(_FilesToBundle)" Condition="$([MSBuild]::ValueOrDefault('%(_FilesToBundle.RelativePath)', '').EndsWith('.runtimeconfig.dev.json'))" /> + + <_BundleExcludedFiles Include="@(_FilesToBundle)" Condition=" $([MSBuild]::VersionGreaterThan($(_TargetFrameworkVersionWithoutV), '3.1' )) and (('%(_FilesToBundle.FileName)' == 'hostfxr' or '%(_FilesToBundle.FileName)' == 'libhostfxr' or '%(_FilesToBundle.FileName)' == 'hostpolicy' or '%(_FilesToBundle.FileName)' == 'libhostpolicy') and ('%(_FilesToBundle.Extension)' == '.dll' or '%(_FilesToBundle.Extension)' == '.so' or '%(_FilesToBundle.Extension)' == '.dylib'))" /> + + <_BundleExcludedFiles Include="@(_FilesToBundle)" Condition="'%(_FilesToBundle.AssetType)' == 'native' and '$(IncludeNativeLibrariesForSelfExtract)' != 'true'" /> + + <_BundleExcludedFiles Include="@(_FilesToBundle)" Condition="'%(_FilesToBundle.Extension)' == '.pdb' and '$(IncludeSymbolsInSingleFile)' != 'true'" /> + + <_BundleExcludedFiles Include="@(_FilesToBundle)" Condition="'$(IncludeAllContentForSelfExtract)' != 'true' and '%(_FilesToBundle.Extension)' != '.dll' and '%(_FilesToBundle.Extension)' != '.exe' and '%(_FilesToBundle.Extension)' != '.pdb' and '%(_FilesToBundle.AssetType)' != 'native' and '%(_FilesToBundle.AssetType)' != 'runtime' and '%(_FilesToBundle.IsKeyOutput)' != 'true' and !$([MSBuild]::ValueOrDefault('%(_FilesToBundle.RelativePath)', '').EndsWith('.deps.json')) and !$([MSBuild]::ValueOrDefault('%(_FilesToBundle.RelativePath)', '').EndsWith('.runtimeconfig.json'))" /> + + + + + + + + + + + $(PublishedSingleFileName) + + + + + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(PublishedSingleFilePath)" /> + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(TraceSingleFileBundler)" /> + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(IncludeSymbolsInSingleFile)" /> + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(IncludeAllContentForSelfExtract)" /> + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(IncludeNativeLibrariesForSelfExtract)" /> + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(EnableCompressionInSingleFile)" /> + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(PublishedSingleFileName)" /> + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(RuntimeIdentifier)" /> + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(PublishDir)" /> + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(_TargetFrameworkVersionWithoutV)" /> + <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="@(FilesToBundle)" /> + + + + + + + + + + false + false + + + + + + + + + + + + + $(PublishDepsFilePath) + $(IntermediateOutputPath)$(ProjectDepsFileName) + + + + + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(PublishDepsFilePath)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(PublishSingleFile)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(MSBuildProjectFullPath)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(ProjectAssetsFile)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IntermediateDepsFilePath)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(TargetFramework)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(AssemblyName)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(TargetExt)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(Version)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IncludeMainProjectInDepsFile)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(RuntimeIdentifier)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(MicrosoftNETPlatformLibrary)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(SelfContained)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IncludeFileVersionsInDependencyFile)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(RuntimeIdentifierGraphPath)" /> + <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IncludeProjectsNotInAssetsFileInDepsFile)" /> + + + + + + + + + + + + + + $(PublishDir)$(ProjectDepsFileName) + <_IsSingleFilePublish Condition="'$(PublishSingleFile)' == ''">false + <_IsSingleFilePublish Condition="'$(PublishSingleFile)' != ''">$(PublishSingleFile) + + + + + + <_ResolvedNuGetFilesForPublish Include="@(NativeCopyLocalItems)" Condition="'%(NativeCopyLocalItems.CopyToPublishDirectory)' != 'false'" /> + <_ResolvedNuGetFilesForPublish Include="@(ResourceCopyLocalItems)" Condition="'%(ResourceCopyLocalItems.CopyToPublishDirectory)' != 'false'" /> + <_ResolvedNuGetFilesForPublish Include="@(RuntimeCopyLocalItems)" Condition="'%(RuntimeCopyLocalItems.CopyToPublishDirectory)' != 'false'" /> + <_ResolvedNuGetFilesForPublish Remove="@(_PublishConflictPackageFiles)" Condition="'%(_PublishConflictPackageFiles.ConflictItemType)' != 'Reference'" /> + + + + + $(ProjectDepsFileName) + + + + + + + + <_PackAsToolShimRuntimeIdentifiers Condition="@(_PackAsToolShimRuntimeIdentifiers) ==''" Include="$(PackAsToolShimRuntimeIdentifiers)" /> + + + + + + + + + + + + + + + + + + $(PublishItemsOutputGroupDependsOn); + ResolveReferences; + ComputeResolvedFilesToPublishList; + _ComputeFilesToBundle; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + refs + $(PreserveCompilationContext) + + + + + $(DefineConstants) + $(LangVersion) + $(PlatformTarget) + $(AllowUnsafeBlocks) + $(TreatWarningsAsErrors) + $(Optimize) + $(AssemblyOriginatorKeyFile) + $(DelaySign) + $(PublicSign) + $(DebugType) + $(OutputType) + $(GenerateDocumentationFile) + + + + + + + + + + + <_RefAssembliesToExclude Include="@(_ResolvedCopyLocalPublishAssets->'%(FullPath)')" /> + + <_RefAssembliesToExclude Include="@(_RuntimeItemsInRuntimeStore)" /> + + $(RefAssembliesFolderName)\%(Filename)%(Extension) + + + + + + + + + + + + + + + + + + Microsoft.CSharp|4.4.0; + Microsoft.Win32.Primitives|4.3.0; + Microsoft.Win32.Registry|4.4.0; + runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; + runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; + runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; + runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; + runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; + runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple|4.3.0; + runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; + runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; + runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; + runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; + runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; + System.AppContext|4.3.0; + System.Buffers|4.4.0; + System.Collections|4.3.0; + System.Collections.Concurrent|4.3.0; + System.Collections.Immutable|1.4.0; + System.Collections.NonGeneric|4.3.0; + System.Collections.Specialized|4.3.0; + System.ComponentModel|4.3.0; + System.ComponentModel.EventBasedAsync|4.3.0; + System.ComponentModel.Primitives|4.3.0; + System.ComponentModel.TypeConverter|4.3.0; + System.Console|4.3.0; + System.Data.Common|4.3.0; + System.Diagnostics.Contracts|4.3.0; + System.Diagnostics.Debug|4.3.0; + System.Diagnostics.DiagnosticSource|4.4.0; + System.Diagnostics.FileVersionInfo|4.3.0; + System.Diagnostics.Process|4.3.0; + System.Diagnostics.StackTrace|4.3.0; + System.Diagnostics.TextWriterTraceListener|4.3.0; + System.Diagnostics.Tools|4.3.0; + System.Diagnostics.TraceSource|4.3.0; + System.Diagnostics.Tracing|4.3.0; + System.Dynamic.Runtime|4.3.0; + System.Globalization|4.3.0; + System.Globalization.Calendars|4.3.0; + System.Globalization.Extensions|4.3.0; + System.IO|4.3.0; + System.IO.Compression|4.3.0; + System.IO.Compression.ZipFile|4.3.0; + System.IO.FileSystem|4.3.0; + System.IO.FileSystem.AccessControl|4.4.0; + System.IO.FileSystem.DriveInfo|4.3.0; + System.IO.FileSystem.Primitives|4.3.0; + System.IO.FileSystem.Watcher|4.3.0; + System.IO.IsolatedStorage|4.3.0; + System.IO.MemoryMappedFiles|4.3.0; + System.IO.Pipes|4.3.0; + System.IO.UnmanagedMemoryStream|4.3.0; + System.Linq|4.3.0; + System.Linq.Expressions|4.3.0; + System.Linq.Queryable|4.3.0; + System.Net.Http|4.3.0; + System.Net.NameResolution|4.3.0; + System.Net.Primitives|4.3.0; + System.Net.Requests|4.3.0; + System.Net.Security|4.3.0; + System.Net.Sockets|4.3.0; + System.Net.WebHeaderCollection|4.3.0; + System.ObjectModel|4.3.0; + System.Private.DataContractSerialization|4.3.0; + System.Reflection|4.3.0; + System.Reflection.Emit|4.3.0; + System.Reflection.Emit.ILGeneration|4.3.0; + System.Reflection.Emit.Lightweight|4.3.0; + System.Reflection.Extensions|4.3.0; + System.Reflection.Metadata|1.5.0; + System.Reflection.Primitives|4.3.0; + System.Reflection.TypeExtensions|4.3.0; + System.Resources.ResourceManager|4.3.0; + System.Runtime|4.3.0; + System.Runtime.Extensions|4.3.0; + System.Runtime.Handles|4.3.0; + System.Runtime.InteropServices|4.3.0; + System.Runtime.InteropServices.RuntimeInformation|4.3.0; + System.Runtime.Loader|4.3.0; + System.Runtime.Numerics|4.3.0; + System.Runtime.Serialization.Formatters|4.3.0; + System.Runtime.Serialization.Json|4.3.0; + System.Runtime.Serialization.Primitives|4.3.0; + System.Security.AccessControl|4.4.0; + System.Security.Claims|4.3.0; + System.Security.Cryptography.Algorithms|4.3.0; + System.Security.Cryptography.Cng|4.4.0; + System.Security.Cryptography.Csp|4.3.0; + System.Security.Cryptography.Encoding|4.3.0; + System.Security.Cryptography.OpenSsl|4.4.0; + System.Security.Cryptography.Primitives|4.3.0; + System.Security.Cryptography.X509Certificates|4.3.0; + System.Security.Cryptography.Xml|4.4.0; + System.Security.Principal|4.3.0; + System.Security.Principal.Windows|4.4.0; + System.Text.Encoding|4.3.0; + System.Text.Encoding.Extensions|4.3.0; + System.Text.RegularExpressions|4.3.0; + System.Threading|4.3.0; + System.Threading.Overlapped|4.3.0; + System.Threading.Tasks|4.3.0; + System.Threading.Tasks.Extensions|4.3.0; + System.Threading.Tasks.Parallel|4.3.0; + System.Threading.Thread|4.3.0; + System.Threading.ThreadPool|4.3.0; + System.Threading.Timer|4.3.0; + System.ValueTuple|4.3.0; + System.Xml.ReaderWriter|4.3.0; + System.Xml.XDocument|4.3.0; + System.Xml.XmlDocument|4.3.0; + System.Xml.XmlSerializer|4.3.0; + System.Xml.XPath|4.3.0; + System.Xml.XPath.XDocument|4.3.0; + + + + + Microsoft.Win32.Primitives|4.3.0; + System.AppContext|4.3.0; + System.Collections|4.3.0; + System.Collections.Concurrent|4.3.0; + System.Collections.Immutable|1.4.0; + System.Collections.NonGeneric|4.3.0; + System.Collections.Specialized|4.3.0; + System.ComponentModel|4.3.0; + System.ComponentModel.EventBasedAsync|4.3.0; + System.ComponentModel.Primitives|4.3.0; + System.ComponentModel.TypeConverter|4.3.0; + System.Console|4.3.0; + System.Data.Common|4.3.0; + System.Diagnostics.Contracts|4.3.0; + System.Diagnostics.Debug|4.3.0; + System.Diagnostics.FileVersionInfo|4.3.0; + System.Diagnostics.Process|4.3.0; + System.Diagnostics.StackTrace|4.3.0; + System.Diagnostics.TextWriterTraceListener|4.3.0; + System.Diagnostics.Tools|4.3.0; + System.Diagnostics.TraceSource|4.3.0; + System.Diagnostics.Tracing|4.3.0; + System.Dynamic.Runtime|4.3.0; + System.Globalization|4.3.0; + System.Globalization.Calendars|4.3.0; + System.Globalization.Extensions|4.3.0; + System.IO|4.3.0; + System.IO.Compression|4.3.0; + System.IO.Compression.ZipFile|4.3.0; + System.IO.FileSystem|4.3.0; + System.IO.FileSystem.DriveInfo|4.3.0; + System.IO.FileSystem.Primitives|4.3.0; + System.IO.FileSystem.Watcher|4.3.0; + System.IO.IsolatedStorage|4.3.0; + System.IO.MemoryMappedFiles|4.3.0; + System.IO.Pipes|4.3.0; + System.IO.UnmanagedMemoryStream|4.3.0; + System.Linq|4.3.0; + System.Linq.Expressions|4.3.0; + System.Linq.Queryable|4.3.0; + System.Net.Http|4.3.0; + System.Net.NameResolution|4.3.0; + System.Net.Primitives|4.3.0; + System.Net.Requests|4.3.0; + System.Net.Security|4.3.0; + System.Net.Sockets|4.3.0; + System.Net.WebHeaderCollection|4.3.0; + System.ObjectModel|4.3.0; + System.Private.DataContractSerialization|4.3.0; + System.Reflection|4.3.0; + System.Reflection.Emit|4.3.0; + System.Reflection.Emit.ILGeneration|4.3.0; + System.Reflection.Emit.Lightweight|4.3.0; + System.Reflection.Extensions|4.3.0; + System.Reflection.Primitives|4.3.0; + System.Reflection.TypeExtensions|4.3.0; + System.Resources.ResourceManager|4.3.0; + System.Runtime|4.3.0; + System.Runtime.Extensions|4.3.0; + System.Runtime.Handles|4.3.0; + System.Runtime.InteropServices|4.3.0; + System.Runtime.InteropServices.RuntimeInformation|4.3.0; + System.Runtime.Loader|4.3.0; + System.Runtime.Numerics|4.3.0; + System.Runtime.Serialization.Formatters|4.3.0; + System.Runtime.Serialization.Json|4.3.0; + System.Runtime.Serialization.Primitives|4.3.0; + System.Security.AccessControl|4.4.0; + System.Security.Claims|4.3.0; + System.Security.Cryptography.Algorithms|4.3.0; + System.Security.Cryptography.Csp|4.3.0; + System.Security.Cryptography.Encoding|4.3.0; + System.Security.Cryptography.Primitives|4.3.0; + System.Security.Cryptography.X509Certificates|4.3.0; + System.Security.Cryptography.Xml|4.4.0; + System.Security.Principal|4.3.0; + System.Security.Principal.Windows|4.4.0; + System.Text.Encoding|4.3.0; + System.Text.Encoding.Extensions|4.3.0; + System.Text.RegularExpressions|4.3.0; + System.Threading|4.3.0; + System.Threading.Overlapped|4.3.0; + System.Threading.Tasks|4.3.0; + System.Threading.Tasks.Extensions|4.3.0; + System.Threading.Tasks.Parallel|4.3.0; + System.Threading.Thread|4.3.0; + System.Threading.ThreadPool|4.3.0; + System.Threading.Timer|4.3.0; + System.ValueTuple|4.3.0; + System.Xml.ReaderWriter|4.3.0; + System.Xml.XDocument|4.3.0; + System.Xml.XmlDocument|4.3.0; + System.Xml.XmlSerializer|4.3.0; + System.Xml.XPath|4.3.0; + System.Xml.XPath.XDocument|4.3.0; + + + + + + + + + + + <_RuntimeAssetsForConflictResolution Include="@(RuntimeCopyLocalItems); @(NativeCopyLocalItems); @(ResourceCopyLocalItems); @(RuntimeTargetsCopyLocalItems)" Exclude="@(ReferenceCopyLocalPaths)" /> + + + + + + + + + + + + + + + + + + + + + + + + + <_ResolvedCopyLocalPublishAssets Remove="@(_ResolvedCopyLocalPublishAssets)" /> + <_ResolvedCopyLocalPublishAssets Include="@(_ResolvedCopyLocalPublishAssetsWithoutConflicts)" /> + + + + + + + + + + + + + + + Properties + + + $(Configuration.ToUpperInvariant()) + + $(ImplicitConfigurationDefine.Replace('-', '_')) + $(ImplicitConfigurationDefine.Replace('.', '_')) + $(ImplicitConfigurationDefine.Replace(' ', '_')) + $(DefineConstants);$(ImplicitConfigurationDefine) + + + + + + + + $(WarningsAsErrors);SYSLIB0011 + + + + + + + + + + $(IntermediateOutputPath)linked\ + $(IntermediateLinkDir)\ + + <_LinkSemaphore>$(IntermediateLinkDir)Link.semaphore + + + + <_Parameter1>IsTrimmable + <_Parameter2>True + + + <_Parameter1>IsAotCompatible + <_Parameter2>True + + + + + false + false + false + false + false + false + false + + false + false + false + false + + <_EnableConsumingManagedCodeFromNativeHosting Condition="'$(EnableCppCLIHostActivation)' == 'true'">true + <_EnableConsumingManagedCodeFromNativeHosting Condition="'$(_EnableConsumingManagedCodeFromNativeHosting)' == ''">false + true + false + false + + <_UseManagedNtlm Condition="'$(_UseManagedNtlm)' == '' and $(RuntimeIdentifier.StartsWith('linux-bionic'))">true + + <_UseManagedNtlm Condition="'$(_UseManagedNtlm)' == '' and $(RuntimeIdentifier.StartsWith('linux'))">false + <_ComObjectDescriptorSupport Condition="'$(_ComObjectDescriptorSupport)' == ''">false + <_DesignerHostSupport Condition="'$(_DesignerHostSupport)' == ''">false + <_DefaultValueAttributeSupport Condition="'$(_DefaultValueAttributeSupport)' == ''">false + true + false + <_DataSetXmlSerializationSupport Condition="'$(_DataSetXmlSerializationSupport)' == ''">false + + + + true + + false + + + + <_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --notrimwarn + false + + + + $(NoWarn);IL2121 + + + + + + <_LinkedResolvedFileToPublish Include="@(_LinkedResolvedFileToPublishCandidate)" Condition="Exists('%(Identity)')" /> + + + + + + + <_RemovedManagedAssembly Include="@(ManagedAssemblyToLink)" Condition="!Exists('$(IntermediateLinkDir)%(Filename)%(Extension)')" /> + + + + + + + + + + + + + + <_DotNetHostDirectory>$(NetCoreRoot) + <_DotNetHostFileName>dotnet + <_DotNetHostFileName Condition="$([MSBuild]::IsOSPlatform(`Windows`))">dotnet.exe + + + + + + + + + + + + + + + + 5 + 0 + + + + + <_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --link-attributes "@(_ILLinkSuppressions->'%(Identity)', '" --link-attributes "')" + + + + full + + + $(TreatWarningsAsErrors) + true + + + + + true + false + + + + <_TrimmerKeepMetadata Include="all" Condition=" '$(DebuggerSupport)' != 'false' " /> + + + <_TrimmerPreserveSymbolPaths Condition=" '$(_TrimmerPreserveSymbolPaths)' == '' and '$(DeterministicSourcePaths)' == 'true' ">true + <_TrimmerPreserveSymbolPaths Condition=" '$(_TrimmerPreserveSymbolPaths)' == '' ">false + + + + + true + + + + + + + + + + + + + + + + + + <__SingleWarnIntermediateAssembly Include="@(ManagedAssemblyToLink)" /> + <__SingleWarnIntermediateAssembly Remove="@(IntermediateAssembly)" /> + + <_SingleWarnIntermediateAssembly Include="@(ManagedAssemblyToLink)" /> + <_SingleWarnIntermediateAssembly Remove="@(__SingleWarnIntermediateAssembly)" /> + + <_SingleWarnIntermediateAssembly> + false + + + + + + + false + + + + <_TrimmerFeatureSettings Include="@(RuntimeHostConfigurationOption)" Condition="'%(RuntimeHostConfigurationOption.Trim)' == 'true'" /> + + + + + + + + + + + + <__PDBToLink Include="@(ResolvedFileToPublish)" Exclude="@(ManagedAssemblyToLink->'%(RelativeDir)%(Filename).pdb')" /> + <_PDBToLink Include="@(ResolvedFileToPublish)" Exclude="@(__PDBToLink)" /> + + + <_LinkedResolvedFileToPublishCandidate Include="@(ManagedAssemblyToLink->'$(IntermediateLinkDir)%(Filename)%(Extension)')" /> + <_LinkedResolvedFileToPublishCandidate Include="@(_PDBToLink->'$(IntermediateLinkDir)%(Filename)%(Extension)')" /> + + + + + + + + + <_NoneAnalysisLevel>4.0 + + <_LatestAnalysisLevel>11.0 + <_PreviewAnalysisLevel>12.0 + latest + $(_TargetFrameworkVersionWithoutV) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevel), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevel), '$(AnalysisLevelPrefix)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefix) + $(AnalysisLevel) + + + + 9999 + + 4 + + $(_TargetFrameworkVersionWithoutV.Split('.')[0]) + + + + + true + + true + + true + + true + + false + + + + false + false + false + false + false + + + + + + + + <_NETAnalyzersSDKAssemblyVersion>11.0.100 + + + + CA1000;CA1001;CA1002;CA1003;CA1005;CA1008;CA1010;CA1012;CA1014;CA1016;CA1017;CA1018;CA1019;CA1021;CA1024;CA1027;CA1028;CA1030;CA1031;CA1032;CA1033;CA1034;CA1036;CA1040;CA1041;CA1043;CA1044;CA1045;CA1046;CA1047;CA1050;CA1051;CA1052;CA1054;CA1055;CA1056;CA1058;CA1060;CA1061;CA1062;CA1063;CA1064;CA1065;CA1066;CA1067;CA1068;CA1069;CA1070;CA1200;CA1303;CA1304;CA1305;CA1307;CA1308;CA1309;CA1310;CA1311;CA1401;CA1416;CA1417;CA1418;CA1419;CA1420;CA1421;CA1422;CA1501;CA1502;CA1505;CA1506;CA1507;CA1508;CA1509;CA1510;CA1511;CA1512;CA1513;CA1514;CA1515;CA1516;CA1517;CA1700;CA1707;CA1708;CA1710;CA1711;CA1712;CA1713;CA1715;CA1716;CA1720;CA1721;CA1724;CA1725;CA1727;CA1802;CA1805;CA1806;CA1810;CA1812;CA1813;CA1814;CA1815;CA1816;CA1819;CA1820;CA1821;CA1822;CA1823;CA1824;CA1825;CA1826;CA1827;CA1828;CA1829;CA1830;CA1831;CA1832;CA1833;CA1834;CA1835;CA1836;CA1837;CA1838;CA1839;CA1840;CA1841;CA1842;CA1843;CA1844;CA1845;CA1846;CA1847;CA1848;CA1849;CA1850;CA1851;CA1852;CA1853;CA1854;CA1855;CA1856;CA1857;CA1858;CA1859;CA1860;CA1861;CA1862;CA1863;CA1864;CA1865;CA1866;CA1867;CA1868;CA1869;CA1870;CA1871;CA1872;CA1873;CA1874;CA1875;CA1876;CA1877;CA2000;CA2002;CA2007;CA2008;CA2009;CA2011;CA2012;CA2013;CA2014;CA2015;CA2016;CA2017;CA2018;CA2019;CA2020;CA2021;CA2022;CA2023;CA2024;CA2025;CA2026;CA2027;CA2028;CA2100;CA2101;CA2119;CA2153;CA2200;CA2201;CA2207;CA2208;CA2211;CA2213;CA2214;CA2215;CA2216;CA2217;CA2218;CA2219;CA2224;CA2225;CA2226;CA2227;CA2231;CA2234;CA2235;CA2237;CA2241;CA2242;CA2243;CA2244;CA2245;CA2246;CA2247;CA2248;CA2249;CA2250;CA2251;CA2252;CA2253;CA2254;CA2255;CA2256;CA2257;CA2258;CA2259;CA2260;CA2261;CA2262;CA2263;CA2264;CA2265;CA2266;CA2300;CA2301;CA2302;CA2305;CA2310;CA2311;CA2312;CA2315;CA2321;CA2322;CA2326;CA2327;CA2328;CA2329;CA2330;CA2350;CA2351;CA2352;CA2353;CA2354;CA2355;CA2356;CA2361;CA2362;CA3001;CA3002;CA3003;CA3004;CA3005;CA3006;CA3007;CA3008;CA3009;CA3010;CA3011;CA3012;CA3061;CA3075;CA3076;CA3077;CA3147;CA5350;CA5351;CA5358;CA5359;CA5360;CA5361;CA5362;CA5363;CA5364;CA5365;CA5366;CA5367;CA5368;CA5369;CA5370;CA5371;CA5372;CA5373;CA5374;CA5375;CA5376;CA5377;CA5378;CA5379;CA5380;CA5381;CA5382;CA5383;CA5384;CA5385;CA5386;CA5387;CA5388;CA5389;CA5390;CA5391;CA5392;CA5393;CA5394;CA5395;CA5396;CA5397;CA5398;CA5399;CA5400;CA5401;CA5402;CA5403;CA5404;CA5405 + $(CodeAnalysisTreatWarningsAsErrors) + $(WarningsNotAsErrors);$(CodeAnalysisRuleIds) + + + + + + + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevel), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers>$(AnalysisLevelSuffix) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers)' == ''">$(AnalysisMode) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(MicrosoftCodeAnalysisNetAnalyzersRulesVersion)' != ''">AnalysisLevel_$(MicrosoftCodeAnalysisNetAnalyzersRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzers)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzers)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers) + + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelDesign), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelDesign), '$(AnalysisLevelPrefixDesign)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixDesign) + $(AnalysisLevelDesign) + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelDesign), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign>$(AnalysisLevelSuffixDesign) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign)' == ''">$(AnalysisModeDesign) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(MicrosoftCodeAnalysisNetAnalyzersDesignRulesVersion)' != ''">AnalysisLevelDesign_$(MicrosoftCodeAnalysisNetAnalyzersDesignRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDesign)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDesign)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign) + + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelDocumentation), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelDocumentation), '$(AnalysisLevelPrefixDocumentation)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixDocumentation) + $(AnalysisLevelDocumentation) + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelDocumentation), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation>$(AnalysisLevelSuffixDocumentation) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' == ''">$(AnalysisModeDocumentation) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(MicrosoftCodeAnalysisNetAnalyzersDocumentationRulesVersion)' != ''">AnalysisLevelDocumentation_$(MicrosoftCodeAnalysisNetAnalyzersDocumentationRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDocumentation)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation) + + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelGlobalization), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelGlobalization), '$(AnalysisLevelPrefixGlobalization)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixGlobalization) + $(AnalysisLevelGlobalization) + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelGlobalization), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization>$(AnalysisLevelSuffixGlobalization) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' == ''">$(AnalysisModeGlobalization) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(MicrosoftCodeAnalysisNetAnalyzersGlobalizationRulesVersion)' != ''">AnalysisLevelGlobalization_$(MicrosoftCodeAnalysisNetAnalyzersGlobalizationRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersGlobalization)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization) + + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelInteroperability), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelInteroperability), '$(AnalysisLevelPrefixInteroperability)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixInteroperability) + $(AnalysisLevelInteroperability) + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelInteroperability), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability>$(AnalysisLevelSuffixInteroperability) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' == ''">$(AnalysisModeInteroperability) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(MicrosoftCodeAnalysisNetAnalyzersInteroperabilityRulesVersion)' != ''">AnalysisLevelInteroperability_$(MicrosoftCodeAnalysisNetAnalyzersInteroperabilityRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersInteroperability)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability) + + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelMaintainability), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelMaintainability), '$(AnalysisLevelPrefixMaintainability)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixMaintainability) + $(AnalysisLevelMaintainability) + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelMaintainability), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability>$(AnalysisLevelSuffixMaintainability) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' == ''">$(AnalysisModeMaintainability) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(MicrosoftCodeAnalysisNetAnalyzersMaintainabilityRulesVersion)' != ''">AnalysisLevelMaintainability_$(MicrosoftCodeAnalysisNetAnalyzersMaintainabilityRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersMaintainability)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability) + + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelNaming), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelNaming), '$(AnalysisLevelPrefixNaming)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixNaming) + $(AnalysisLevelNaming) + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelNaming), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming>$(AnalysisLevelSuffixNaming) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming)' == ''">$(AnalysisModeNaming) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(MicrosoftCodeAnalysisNetAnalyzersNamingRulesVersion)' != ''">AnalysisLevelNaming_$(MicrosoftCodeAnalysisNetAnalyzersNamingRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersNaming)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersNaming)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming) + + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelPerformance), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelPerformance), '$(AnalysisLevelPrefixPerformance)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixPerformance) + $(AnalysisLevelPerformance) + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelPerformance), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance>$(AnalysisLevelSuffixPerformance) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance)' == ''">$(AnalysisModePerformance) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(MicrosoftCodeAnalysisNetAnalyzersPerformanceRulesVersion)' != ''">AnalysisLevelPerformance_$(MicrosoftCodeAnalysisNetAnalyzersPerformanceRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersPerformance)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersPerformance)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance) + + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelReliability), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelReliability), '$(AnalysisLevelPrefixReliability)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixReliability) + $(AnalysisLevelReliability) + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelReliability), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability>$(AnalysisLevelSuffixReliability) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability)' == ''">$(AnalysisModeReliability) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(MicrosoftCodeAnalysisNetAnalyzersReliabilityRulesVersion)' != ''">AnalysisLevelReliability_$(MicrosoftCodeAnalysisNetAnalyzersReliabilityRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersReliability)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersReliability)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability) + + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelSecurity), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelSecurity), '$(AnalysisLevelPrefixSecurity)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixSecurity) + $(AnalysisLevelSecurity) + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelSecurity), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity>$(AnalysisLevelSuffixSecurity) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity)' == ''">$(AnalysisModeSecurity) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(MicrosoftCodeAnalysisNetAnalyzersSecurityRulesVersion)' != ''">AnalysisLevelSecurity_$(MicrosoftCodeAnalysisNetAnalyzersSecurityRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersSecurity)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersSecurity)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity) + + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelUsage), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelUsage), '$(AnalysisLevelPrefixUsage)-', '')) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixUsage) + $(AnalysisLevelUsage) + + $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelUsage), '(\.0)*$', '')) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage>$(AnalysisLevelSuffixUsage) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage)' == ''">$(AnalysisModeUsage) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage)' == ''">Default + + + $(CodeAnalysisTreatWarningsAsErrors) + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror + + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(MicrosoftCodeAnalysisNetAnalyzersUsageRulesVersion)' != ''">AnalysisLevelUsage_$(MicrosoftCodeAnalysisNetAnalyzersUsageRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage_WarnAsErrorSuffix).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersUsage)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersUsage)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage) + + + + + + + + + + + + + + + + + + + + + <_SupportedPlatformList>@(SupportedPlatform, ',') + + + + + + + + + $(CodeAnalysisTreatWarningsAsErrors) + $(WarningsNotAsErrors);$(CodeAnalysisRuleIds) + + + + + + + + + $(AnalysisLevel) + + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelStyle), '-(.)*', '')) + $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelStyle), '$(AnalysisLevelPrefixStyle)-', '')) + + $(AnalysisLevelSuffix) + + $(AnalysisMode) + + $(_NoneAnalysisLevel) + $(_LatestAnalysisLevel) + $(_PreviewAnalysisLevel) + + $(AnalysisLevelPrefixStyle) + $(AnalysisLevelStyle) + + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle>$(AnalysisModeStyle) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle)' == ''">$(AnalysisLevelSuffixStyle) + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle)' == 'AllEnabledByDefault'">All + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle)' == 'AllDisabledByDefault'">None + <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle)' == ''">Default + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle>AnalysisLevelStyle_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle).globalconfig + <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle.ToLowerInvariant()) + <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisCSharpCodeStyle)' == ''">$(MSBuildThisFileDirectory)config + <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisCSharpCodeStyle)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(StartWorkingDirectory) + + + + + $(StartProgram) + $(StartArguments) + + + + + + dotnet + <_NetCoreRunArguments>exec "$(TargetPath)" + $(_NetCoreRunArguments) $(StartArguments) + $(_NetCoreRunArguments) + + + $(TargetDir)$(AssemblyName)$(_NativeExecutableExtension) + $(StartArguments) + + + + + $(TargetPath) + $(StartArguments) + + + + + + $([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(RunWorkingDirectory)')))) + + + + + + + + + + + + + + true + true + + + $(AfterMicrosoftNETSdkTargets);$(MSBuildThisFileDirectory)../../Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets + + + + + + + + + + 0.0 + $(TargetPlatformIdentifier),Version=$(TargetPlatformVersion) + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKDisplayName($(TargetPlatformIdentifier), $(TargetPlatformVersion))) + + + + $(TargetPlatformVersion) + + + + $(EffectiveTargetPlatformVersion) + + + + + + + $(MSBuildThisFileDirectory)..\tools\net11.0\Microsoft.DotNet.ApiCompat.Task.dll + + + + + + + + + + + + + + + <_UseRoslynToolsetPackage Condition="'$(ApiCompatUseRoslynToolsetPackagePath)' == 'true' and '@(PackageReference->AnyHaveMetadataValue('Identity', 'Microsoft.Net.Compilers.Toolset'))' == 'true'">true + + $([System.IO.Path]::GetDirectoryName('$(CSharpCoreTargetsPath)')) + + $(RoslynTargetsPath) + + $([System.IO.Path]::Combine('$(RoslynAssembliesPath)', 'bincore')) + + + + $(GenerateCompatibilitySuppressionFile) + + + + + + + <_apiCompatDefaultProjectSuppressionFile>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', 'CompatibilitySuppressions.xml')) + + $(_apiCompatDefaultProjectSuppressionFile) + + + + + + + + + + + <_ApiCompatValidatePackageSemaphoreFile>$(IntermediateOutputPath)$(MSBuildThisFileName).semaphore + + CollectApiCompatInputs;_GetReferencePathFromInnerProjects;$(RunPackageValidationDependsOn) + + + + $(PackageId) + $([MSBuild]::NormalizePath('$(NuGetPackageRoot)', '$(PackageValidationBaselineName.ToLower())', '$(PackageValidationBaselineVersion)', '$(PackageValidationBaselineName.ToLower()).$(PackageValidationBaselineVersion).nupkg')) + <_packageValidationBaselinePath Condition="'$(DisablePackageBaselineValidation)' != 'true'">$(PackageValidationBaselinePath) + + + <_PackageTargetPath Include="@(NuGetPackOutput->WithMetadataValue('Extension', '.nupkg'))" Condition="!$([System.String]::new('%(Identity)').EndsWith('.symbols.nupkg'))" /> + + + + + + + + + + $(TargetPlatformMoniker) + + + + + + + + + + + + + + + $(MSBuildThisFileDirectory)..\..\..\NuGet.Build.Tasks.Pack.targets + true + + + + + + Sdks\Microsoft.NET.Sdk\tools\net472\NuGet.Build.Tasks.Pack.dll + NuGet.Build.Tasks.Pack.dll + + + + + + + + + $(AssemblyName) + $(Version) + true + _LoadPackInputItems; _GetTargetFrameworksOutput; _WalkEachTargetPerFramework; _GetPackageFiles; $(GenerateNuspecDependsOn) + $(Description) + Package Description + false + true + true + tools + lib + content;contentFiles + $(BeforePack); _GetRestoreProjectStyle; _IntermediatePack; GenerateNuspec; $(PackDependsOn) + true + symbols.nupkg + DeterminePortableBuildCapabilities + false + false + .dll; .exe; .winmd; .json; .pri; .xml + $(DefaultAllowedOutputExtensionsInPackageBuildOutputFolder) ;$(AllowedOutputExtensionsInPackageBuildOutputFolder) + .pdb; .mdb; $(AllowedOutputExtensionsInPackageBuildOutputFolder); $(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder) + .pdb + false + + + $(GenerateNuspecDependsOn) + + + Build;$(GenerateNuspecDependsOn) + + + + + + + $(TargetFramework) + + + + $(MSBuildProjectExtensionsPath) + $(BaseOutputPath)$(Configuration)\ + $(BaseIntermediateOutputPath)$(Configuration)\ + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFrameworks /> + + + + + + <_TargetFrameworks Include="$(_ProjectFrameworks.Split(';'))" /> + + + + + + + <_PackageFilesToDelete Include="@(_OutputPackItems)" /> + + + + + + false + + + + + + + + + + + + + + + + + + + + true + + + + + + + + $(SOURCE_DATE_EPOCH) + + + + + + + + + $(PrivateRepositoryUrl) + $(SourceRevisionId) + $(SourceBranchName) + + + + + + + $(MSBuildProjectFullPath) + + + + + + + + + + + + + + + + + <_ProjectPathWithVersion Include="$(MSBuildProjectFullPath)"> + $(PackageVersion) + 1.0.0 + + + + + + <_ProjectsWithTFM Include="$(MSBuildProjectFullPath)" AdditionalProperties="TargetFramework=%(_TargetFrameworks.Identity)" /> + <_ProjectsWithTFMNoBuild Include="$(MSBuildProjectFullPath)" AdditionalProperties="TargetFramework=%(_TargetFrameworks.Identity);BuildProjectReferences=false" /> + + + + + + + + + + + + + + + + + + + + + + + <_TfmWithDependenciesSuppressed Include="$(TargetFramework)" Condition="'$(SuppressDependenciesWhenPacking)' == 'true'" /> + + + + + + $(TargetFramework) + + + + + + + + + + + + + %(TfmSpecificPackageFile.RecursiveDir) + %(TfmSpecificPackageFile.BuildAction) + + + + + + <_TargetPathsToSymbolsWithTfm Include="@(DebugSymbolsProjectOutputGroupOutput)"> + $(TargetFramework) + + + + <_TargetPathsToSymbolsWithTfm Include="@(TfmSpecificDebugSymbolsFile)" /> + + + + + + <_PathToPriFile Include="$(ProjectPriFullPath)"> + $(ProjectPriFullPath) + $(ProjectPriFileName) + + + + + + + <_PackageFilesToExclude Include="@(Content)" Condition="'%(Content.Pack)' == 'false'" /> + + + + <_PackageFiles Include="@(Content)" Condition=" %(Content.Pack) != 'false' "> + Content + + <_PackageFiles Include="@(Compile)" Condition=" %(Compile.Pack) == 'true' "> + Compile + + <_PackageFiles Include="@(None)" Condition=" %(None.Pack) == 'true' "> + None + + <_PackageFiles Include="@(EmbeddedResource)" Condition=" %(EmbeddedResource.Pack) == 'true' "> + EmbeddedResource + + <_PackageFiles Include="@(ApplicationDefinition)" Condition=" %(ApplicationDefinition.Pack) == 'true' "> + ApplicationDefinition + + <_PackageFiles Include="@(Page)" Condition=" %(Page.Pack) == 'true' "> + Page + + <_PackageFiles Include="@(Resource)" Condition=" %(Resource.Pack) == 'true' "> + Resource + + <_PackageFiles Include="@(SplashScreen)" Condition=" %(SplashScreen.Pack) == 'true' "> + SplashScreen + + <_PackageFiles Include="@(DesignData)" Condition=" %(DesignData.Pack) == 'true' "> + DesignData + + <_PackageFiles Include="@(DesignDataWithDesignTimeCreatableTypes)" Condition=" %(DesignDataWithDesignTimeCreatableTypes.Pack) == 'true' "> + DesignDataWithDesignTimeCreatableTypes + + <_PackageFiles Include="@(CodeAnalysisDictionary)" Condition=" %(CodeAnalysisDictionary.Pack) == 'true' "> + CodeAnalysisDictionary + + <_PackageFiles Include="@(AndroidAsset)" Condition=" %(AndroidAsset.Pack) == 'true' "> + AndroidAsset + + <_PackageFiles Include="@(AndroidResource)" Condition=" %(AndroidResource.Pack) == 'true' "> + AndroidResource + + <_PackageFiles Include="@(BundleResource)" Condition=" %(BundleResource.Pack) == 'true' "> + BundleResource + + + + + + + <_IsNotSetContainersTargetsDir>false + <_IsNotSetContainersTargetsDir Condition=" '$(_ContainersTargetsDir)'=='' ">true + <_ContainersTargetsDir Condition="$(_IsNotSetContainersTargetsDir)">$(MSBuildThisFileDirectory)..\..\..\Containers\build\ + + + + + true + tasks + net11.0 + + true + + $(MSBuildThisFileDirectory)..\$(ContainerTaskFolderName)\$(ContainerTaskFramework)\ + + $(ContainerCustomTasksFolder)$(MSBuildThisFileName).dll + + + + + + + + + + <_IsSDKContainerAllowedVersion>false + + <_IsSDKContainerAllowedVersion Condition="$([MSBuild]::VersionGreaterThan($(NetCoreSdkVersion), 7.0.100)) OR ( $([MSBuild]::VersionEquals($(NetCoreSdkVersion), 7.0.100)) AND ( $(NETCoreSdkVersion.Contains('-preview.7')) OR $(NETCoreSdkVersion.Contains('-rc')) OR $(NETCoreSdkVersion.Contains('-')) == false ) )">true + <_ContainerIsTargetingNet8TFM>false + <_ContainerIsTargetingNet8TFM Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionGreaterThanOrEquals($(_TargetFrameworkVersionWithoutV), '8.0'))">true + <_ContainerIsSelfContained>false + <_ContainerIsSelfContained Condition="'$(SelfContained)' == 'true' or '$(PublishSelfContained)' == 'true'">true + true + + + + + + + + + + + + $(RuntimeIdentifier) + $(RuntimeIdentifiers) + linux-$(NETCoreSdkPortableRuntimeIdentifier.Split('-')[1]) + + <_InitialContainerBaseImage>$(ContainerBaseImage) + + + <_TargetRuntimeIdentifiers Include="$(ContainerRuntimeIdentifier)" Condition="'$(ContainerRuntimeIdentifier)' != ''" /> + <_TargetRuntimeIdentifiers Include="$(ContainerRuntimeIdentifiers)" Condition="@(_TargetRuntimeIdentifiers->Count()) == 0" /> + + + + + + <_TargetRuntimeIdentifiers Remove="$(_TargetRuntimeIdentifiers)" /> + + + + + + + $(RegistryUrl) + + $(PublishImageTag) + + $([System.DateTime]::UtcNow.ToString('yyyyMMddhhmmss')) + + + + + + + + + + + $(ContainerImageName) + + $(AssemblyName) + + latest + $([System.DateTime]::UtcNow.ToString('yyyyMMddhhmmss')) + + + + + + + + + + + + + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + + + $(Description) + $(Authors) + $(PackageProjectUrl) + $(PackageProjectUrl) + $(PackageVersion) + $(PackageLicenseExpression) + $(Title) + + + + + + + + + + + + + + + + + + + + + + <_TrimmedRepositoryUrl Condition="'$(RepositoryType)' == 'git' and '$(PrivateRepositoryUrl)' != '' and $(PrivateRepositoryUrl.EndsWith('.git'))">$(PrivateRepositoryUrl.Substring(0, $(PrivateRepositoryUrl.LastIndexOf('.git')))) + <_TrimmedRepositoryUrl Condition="'$(_TrimmedRepositoryUrl)' == '' and '$(PrivateRepositoryUrl)' != ''">$(PrivateRepositoryUrl) + + + + + + + + + _ContainerVerifySDKVersion; + ComputeContainerConfig; + _CheckContainersPackage; + + + + + + + <_ContainerIsTargetingWindows>false + <_ContainerIsTargetingWindows Condition="$(ContainerRuntimeIdentifier.StartsWith('win'))">true + + /app/ + C:\app\ + <_ContainerIsUsingMicrosoftDefaultImages Condition="'$(_InitialContainerBaseImage)' == ''">true + <_ContainerIsUsingMicrosoftDefaultImages Condition="'$(_InitialContainerBaseImage)' != ''">false + + + + ContainerUser + + + + + + + + + + + + <_ContainersPackageIdentity>Microsoft.NET.Build.Containers + <_WebDefaultSdkVersion>7.0.300 + <_WorkerDefaultSdkVersion>8.0.100 + <_ConsoleDefaultSdkVersion>8.0.200 + + <_SdkCanPublishWeb>$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '$(_WebDefaultSdkVersion)')) + <_SdkCanPublishWorker>$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '$(_WorkerDefaultSdkVersion)')) + <_SdkCanPublishConsole>$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '$(_ConsoleDefaultSdkVersion)')) + + <_ContainerPackageIsPresent>false + <_ContainerPackageIsPresent Condition="@(PackageReference->AnyHaveMetadataValue('Identity', '$(_ContainersPackageIdentity)'))">true + <_IsWebProject>false + <_IsWebProject Condition="@(ProjectCapability->AnyHaveMetadataValue('Identity', 'DotNetCoreWeb'))">true + <_IsWorkerProject>false + <_IsWorkerProject Condition="@(ProjectCapability->AnyHaveMetadataValue('Identity', 'DotNetCoreWorker'))">true + + + + + + + + + + + + + + + + + + $(GeneratedContainerManifest) + $(GeneratedContainerConfiguration) + $(GeneratedContainerDigest) + $(GeneratedContainerMediaType) + + + + + + + + + <_SkipContainerPublishing>false + <_SkipContainerPublishing Condition="$(ContainerArchiveOutputPath) != '' or ( $(ContainerRegistry) == '' and ( $(LocalRegistry) == '' or $(LocalRegistry) == 'Docker' ) )">true + + <_SkipCreateImageIndex>false + <_SkipCreateImageIndex Condition="$(ContainerArchiveOutputPath) == '' and $(ContainerRegistry) == '' and $(LocalRegistry) == 'Podman'">true + + + <_SingleImageContainerFormat Condition="'$(ContainerImageFormat)' != ''">$(ContainerImageFormat) + + <_SingleImageContainerFormat Condition="$(_SkipContainerPublishing) == 'true' ">OCI + + + <_rids Include="$(ContainerRuntimeIdentifiers)" Condition="'$(ContainerRuntimeIdentifiers)' != ''" /> + <_rids Include="$(RuntimeIdentifiers)" Condition="'$(ContainerRuntimeIdentifiers)' == '' and '$(RuntimeIdentifiers)' != ''" /> + <_InnerBuild Include="$(MSBuildProjectFullPath)" AdditionalProperties=" ContainerRuntimeIdentifier=%(_rids.Identity); RuntimeIdentifier=%(_rids.Identity); ContainerBaseRegistry=$(ContainerBaseRegistry); ContainerBaseName=$(ContainerBaseName); ContainerBaseTag=$(ContainerBaseTag); ContainerBaseDigest=$(ContainerBaseDigest); ContainerRegistry=$(ContainerRegistry); _ContainerImageTags=@(ContainerImageTags, ';'); ContainerRepository=$(ContainerRepository); _ContainerLabel=@(ContainerLabel->'%(Identity):%(Value)'); _ContainerPort=@(ContainerPort->'%(Identity):%(Type)'); _ContainerEnvironmentVariables=@(ContainerEnvironmentVariable->'%(Identity):%(Value)'); ContainerGenerateLabels=$(ContainerGenerateLabels); ContainerGenerateLabelsImageBaseDigest=$(ContainerGenerateLabelsImageBaseDigest); _SkipContainerPublishing=$(_SkipContainerPublishing); ContainerImageFormat=$(_SingleImageContainerFormat); _IsMultiRIDBuild=false; _IsSingleRIDBuild=true; _InitialContainerBaseImage=$(_InitialContainerBaseImage) " /> + <_rids Remove="$(_rids)" /> + + + + + + + + + + + + + + <_ParsedContainerLabel Condition="'$(_ContainerLabel)' != ':'" Include="$(_ContainerLabel)" /> + + <_ParsedContainerPort Condition="'$(_ContainerPort)' != ':'" Include="$(_ContainerPort)" /> + + <_ParsedContainerEnvironmentVariables Condition="'$(_ContainerEnvironmentVariables)' != ':'" Include="$(_ContainerEnvironmentVariables)" /> + + + + + + <_IsMultiTFMBuild Condition="'$(TargetFrameworks)' != '' and '$(TargetFramework)' == ''">true + + <_HasCRIDsAndNoCRID Condition="'$(ContainerRuntimeIdentifiers)' != '' and '$(ContainerRuntimeIdentifier)' == ''">true + <_HasRIDs Condition="'$(RuntimeIdentifiers)' != ''">true + <_NoCRIDsOrCRIDorRID Condition="'$(ContainerRuntimeIdentifiers)' == '' and '$(ContainerRuntimeIdentifier)' == '' and '$(RuntimeIdentifier)' == ''">true + + <_IsMultiRIDBuild Condition="'$(BuildingInsideVisualStudio)' != 'true' and ('$(_HasCRIDsAndNoCRID)' == true or ('$(_HasRIDs)' == 'true' and '$(_NoCRIDsOrCRIDorRID)' == 'true'))">true + <_IsSingleRIDBuild Condition="'$(_IsMultiRIDBuild)' == ''">true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet10_0.verified.txt b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet10_0.verified.txt new file mode 100644 index 000000000..dfc954f44 --- /dev/null +++ b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet10_0.verified.txt @@ -0,0 +1,3104 @@ +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.Benchmarks")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.Profile")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.ReactiveUI")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.Tests")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v10.0", FrameworkDisplayName=".NET 10.0")] +namespace DynamicData.Aggregation +{ + public readonly struct AggregateItem : System.IEquatable> + { + public AggregateItem(DynamicData.Aggregation.AggregateType type, TObject item) { } + public TObject Item { get; } + public DynamicData.Aggregation.AggregateType Type { get; } + public bool Equals(DynamicData.Aggregation.AggregateItem other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public static bool operator !=(in DynamicData.Aggregation.AggregateItem left, in DynamicData.Aggregation.AggregateItem right) { } + public static bool operator ==(in DynamicData.Aggregation.AggregateItem left, in DynamicData.Aggregation.AggregateItem right) { } + } + public enum AggregateType + { + Add = 0, + Remove = 1, + } + public static class AggregationEx + { + public static System.IObservable> ForAggregation(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable> ForAggregation(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable InvalidateWhen(this System.IObservable source, System.IObservable invalidate) { } + public static System.IObservable InvalidateWhen(this System.IObservable source, System.IObservable invalidate) { } + } + public static class AvgEx + { + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + } + public static class CountEx + { + public static System.IObservable Count(this System.IObservable> source) { } + public static System.IObservable Count(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable Count(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable Count(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable IsEmpty(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable IsEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable IsNotEmpty(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable IsNotEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + } + public interface IAggregateChangeSet : System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable { } + public static class MaxEx + { + public static System.IObservable Maximum(this System.IObservable> source, System.Func valueSelector, TResult emptyValue = default) + where TObject : notnull + where TResult : struct, System.IComparable { } + public static System.IObservable Maximum(this System.IObservable> source, System.Func valueSelector, TResult emptyValue = default) + where TObject : notnull + where TKey : notnull + where TResult : struct, System.IComparable { } + public static System.IObservable Minimum(this System.IObservable> source, System.Func valueSelector, TResult emptyValue = default) + where TObject : notnull + where TResult : struct, System.IComparable { } + public static System.IObservable Minimum(this System.IObservable> source, System.Func valueSelector, TResult emptyValue = default) + where TObject : notnull + where TKey : notnull + where TResult : struct, System.IComparable { } + } + public static class StdDevEx + { + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal fallbackValue) { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, double fallbackValue = 0) { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, float fallbackValue = 0) { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, int fallbackValue = 0) { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, long fallbackValue = 0) { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, decimal fallbackValue) + where T : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, double fallbackValue) + where T : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, float fallbackValue = 0) + where T : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, int fallbackValue) + where T : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, long fallbackValue) + where T : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, decimal fallbackValue) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, double fallbackValue) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, float fallbackValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, int fallbackValue) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, long fallbackValue) + where TObject : notnull + where TKey : notnull { } + } + public static class SumEx + { + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + } +} +namespace DynamicData.Alias +{ + public static class ObservableCacheAlias + { + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> SelectMany(this System.IObservable> source, System.Func> manySelector, System.Func keySelector) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable, TKey>> SelectTree(this System.IObservable> source, System.Func pivotOn) + where TObject : class + where TKey : notnull { } + public static System.IObservable> Where(this System.IObservable> source, System.Func filter) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicateChanged) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicateChanged, System.IObservable reapplyFilter) + where TObject : notnull + where TKey : notnull { } + } + public static class ObservableListAlias + { + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> SelectMany(this System.IObservable> source, System.Func> manySelector) + where TDestination : notnull + where TSource : notnull { } + public static System.IObservable> Where(this System.IObservable> source, System.Func predicate) + where T : notnull { } + public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicate) + where T : notnull { } + } +} +namespace DynamicData.Binding +{ + public abstract class AbstractNotifyPropertyChanged : System.ComponentModel.INotifyPropertyChanged + { + protected AbstractNotifyPropertyChanged() { } + public event System.ComponentModel.PropertyChangedEventHandler? PropertyChanged; + protected virtual void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string? propertyName = null) { } + protected virtual void SetAndRaise(ref T backingField, T newValue, [System.Runtime.CompilerServices.CallerMemberName] string? propertyName = null) { } + protected virtual void SetAndRaise(ref T backingField, T newValue, System.Collections.Generic.IEqualityComparer? comparer, [System.Runtime.CompilerServices.CallerMemberName] string? propertyName = null) { } + } + public class BindingListAdaptor<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T> : DynamicData.IChangeSetAdaptor + where T : notnull + { + public BindingListAdaptor(System.ComponentModel.BindingList list, int refreshThreshold = 25) { } + public void Adapt(DynamicData.IChangeSet changes) { } + } + public class BindingListAdaptor<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey> : DynamicData.IChangeSetAdaptor + where TObject : notnull + where TKey : notnull + { + public BindingListAdaptor(System.ComponentModel.BindingList list, int refreshThreshold = 25) { } + public void Adapt(DynamicData.IChangeSet changes) { } + } + public static class BindingListEx + { + public static System.IObservable> ObserveCollectionChanges(this System.ComponentModel.IBindingList source) { } + public static System.IObservable> ToObservableChangeSet<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this System.ComponentModel.BindingList source) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this TCollection source) + where TCollection : System.ComponentModel.IBindingList, System.Collections.Generic.IEnumerable + where T : notnull { } + public static System.IObservable> ToObservableChangeSet<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.ComponentModel.BindingList source, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + } + public struct BindingOptions : System.IEquatable + { + public const bool DefaultResetOnFirstTimeLoad = true; + public const int DefaultResetThreshold = 25; + public const bool DefaultUseReplaceForUpdates = true; + public BindingOptions(int ResetThreshold, bool UseReplaceForUpdates = true, bool ResetOnFirstTimeLoad = true) { } + public bool ResetOnFirstTimeLoad { get; set; } + public int ResetThreshold { get; set; } + public bool UseReplaceForUpdates { get; set; } + public static DynamicData.Binding.BindingOptions NeverFireReset(bool useReplaceForUpdates = true) { } + } + public interface IEvaluateAware + { + void Evaluate(); + } + public interface IIndexAware + { + int Index { get; set; } + } + public interface INotifyCollectionChangedSuspender + { + System.IDisposable SuspendCount(); + System.IDisposable SuspendNotifications(); + } + public interface IObservableCollectionAdaptor + where TObject : notnull + where TKey : notnull + { + void Adapt(DynamicData.IChangeSet changes, DynamicData.Binding.IObservableCollection collection); + } + public interface IObservableCollection : DynamicData.Binding.INotifyCollectionChangedSuspender, System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.IEnumerable, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.INotifyPropertyChanged + { + void Load(System.Collections.Generic.IEnumerable items); + void Move(int oldIndex, int newIndex); + } + public static class IObservableListEx + { + public static System.IObservable> BindToObservableList(this System.IObservable> source, out DynamicData.IObservableList observableList) + where TObject : notnull { } + public static System.IObservable> BindToObservableList(this System.IObservable> source, out DynamicData.IObservableList observableList) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BindToObservableList(this System.IObservable> source, out DynamicData.IObservableList observableList) + where TObject : notnull + where TKey : notnull { } + } + public interface ISortedObservableCollectionAdaptor + where TObject : notnull + where TKey : notnull + { + void Adapt(DynamicData.ISortedChangeSet changes, DynamicData.Binding.IObservableCollection collection); + } + public static class NotifyPropertyChangedEx + { + public static System.IObservable WhenAnyPropertyChanged(this TObject source, params string[] propertiesToMonitor) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Func resultSelector, System.Func? p1Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Linq.Expressions.Expression> p2, System.Func resultSelector, System.Func? p1Fallback = null, System.Func? p2Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Linq.Expressions.Expression> p2, System.Linq.Expressions.Expression> p3, System.Func resultSelector, System.Func? p1Fallback = null, System.Func? p2Fallback = null, System.Func? p3Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Linq.Expressions.Expression> p2, System.Linq.Expressions.Expression> p3, System.Linq.Expressions.Expression> p4, System.Func resultSelector, System.Func? p1Fallback = null, System.Func? p2Fallback = null, System.Func? p3Fallback = null, System.Func? p4Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Linq.Expressions.Expression> p2, System.Linq.Expressions.Expression> p3, System.Linq.Expressions.Expression> p4, System.Linq.Expressions.Expression> p5, System.Func resultSelector, System.Func? p1Fallback = null, System.Func? p2Fallback = null, System.Func? p3Fallback = null, System.Func? p4Fallback = null, System.Func? p5Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Linq.Expressions.Expression> p2, System.Linq.Expressions.Expression> p3, System.Linq.Expressions.Expression> p4, System.Linq.Expressions.Expression> p5, System.Linq.Expressions.Expression> p6, System.Func resultSelector, System.Func? p1Fallback = null, System.Func? p2Fallback = null, System.Func? p3Fallback = null, System.Func? p4Fallback = null, System.Func? p5Fallback = null, System.Func? p6Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> WhenPropertyChanged(this TObject source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true, System.Func? fallbackValue = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenValueChanged(this TObject source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true, System.Func? fallbackValue = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + } + public class ObservableCollectionAdaptor : DynamicData.IChangeSetAdaptor + where T : notnull + { + public ObservableCollectionAdaptor(DynamicData.Binding.IObservableCollection collection) { } + public ObservableCollectionAdaptor(DynamicData.Binding.IObservableCollection collection, DynamicData.Binding.BindingOptions options) { } + public ObservableCollectionAdaptor(DynamicData.Binding.IObservableCollection collection, int refreshThreshold, bool allowReplace = true, bool resetOnFirstTimeLoad = true) { } + public void Adapt(DynamicData.IChangeSet changes) { } + } + public class ObservableCollectionAdaptor : DynamicData.Binding.IObservableCollectionAdaptor + where TObject : notnull + where TKey : notnull + { + public ObservableCollectionAdaptor(DynamicData.Binding.BindingOptions options) { } + public ObservableCollectionAdaptor(int refreshThreshold = 25, bool useReplaceForUpdates = true, bool resetOnFirstTimeLoad = true) { } + public void Adapt(DynamicData.IChangeSet changes, DynamicData.Binding.IObservableCollection collection) { } + } + public static class ObservableCollectionEx + { + public static System.IObservable> ObserveCollectionChanges(this System.Collections.Specialized.INotifyCollectionChanged source) { } + public static System.IObservable> ToObservableChangeSet(this System.Collections.ObjectModel.ObservableCollection source) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.Collections.ObjectModel.ReadOnlyObservableCollection source) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this TCollection source) + where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.Collections.ObjectModel.ObservableCollection source, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.Collections.ObjectModel.ReadOnlyObservableCollection source, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + } + public class ObservableCollectionExtended : System.Collections.ObjectModel.ObservableCollection, DynamicData.Binding.INotifyCollectionChangedSuspender, DynamicData.Binding.IObservableCollection, DynamicData.IExtendedList, System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.IEnumerable, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.INotifyPropertyChanged + { + public ObservableCollectionExtended() { } + public ObservableCollectionExtended(System.Collections.Generic.IEnumerable collection) { } + public ObservableCollectionExtended(System.Collections.Generic.List list) { } + public void AddRange(System.Collections.Generic.IEnumerable collection) { } + public void InsertRange(System.Collections.Generic.IEnumerable collection, int index) { } + public void Load(System.Collections.Generic.IEnumerable items) { } + protected override void OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { } + protected override void OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs e) { } + public void RemoveRange(int index, int count) { } + public System.IDisposable SuspendCount() { } + public System.IDisposable SuspendNotifications() { } + } + public sealed class PropertyValue : System.IEquatable> + { + public PropertyValue(TObject sender, TValue value) { } + public TObject Sender { get; } + public TValue Value { get; } + public bool Equals(DynamicData.Binding.PropertyValue? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(DynamicData.Binding.PropertyValue? left, DynamicData.Binding.PropertyValue? right) { } + public static bool operator ==(DynamicData.Binding.PropertyValue? left, DynamicData.Binding.PropertyValue? right) { } + } + public readonly struct SortAndBindOptions : System.IEquatable + { + public SortAndBindOptions() { } + public int InitialCapacity { get; init; } + public bool ResetOnFirstTimeLoad { get; init; } + public int ResetThreshold { get; init; } + public ReactiveUI.Primitives.Concurrency.ISequencer? Scheduler { get; init; } + public bool UseBinarySearch { get; init; } + public bool UseReplaceForUpdates { get; init; } + } + public enum SortDirection + { + Ascending = 0, + Descending = 1, + } + public class SortExpressionComparer : System.Collections.Generic.List>, System.Collections.Generic.IComparer + { + public SortExpressionComparer() { } + public int Compare(T? x, T? y) { } + public DynamicData.Binding.SortExpressionComparer ThenByAscending(System.Func expression) { } + public DynamicData.Binding.SortExpressionComparer ThenByDescending(System.Func expression) { } + public static DynamicData.Binding.SortExpressionComparer Ascending(System.Func expression) { } + public static DynamicData.Binding.SortExpressionComparer Descending(System.Func expression) { } + } + public class SortExpression + { + public SortExpression(System.Func expression, DynamicData.Binding.SortDirection direction = 0) { } + public DynamicData.Binding.SortDirection Direction { get; } + public System.Func Expression { get; } + } + public class SortedBindingListAdaptor<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey> : DynamicData.ISortedChangeSetAdaptor + where TObject : notnull + where TKey : notnull + { + public SortedBindingListAdaptor(System.ComponentModel.BindingList list, int refreshThreshold = 25) { } + public void Adapt(DynamicData.ISortedChangeSet changes) { } + } + public class SortedObservableCollectionAdaptor : DynamicData.Binding.ISortedObservableCollectionAdaptor + where TObject : notnull + where TKey : notnull + { + public SortedObservableCollectionAdaptor() { } + public SortedObservableCollectionAdaptor(DynamicData.Binding.BindingOptions options) { } + public SortedObservableCollectionAdaptor(int refreshThreshold, bool useReplaceForUpdates = true, bool resetOnFirstTimeLoad = true) { } + public void Adapt(DynamicData.ISortedChangeSet changes, DynamicData.Binding.IObservableCollection collection) { } + } +} +namespace DynamicData.Cache.Internal +{ + public enum CombineOperator + { + And = 0, + Or = 1, + Xor = 2, + Except = 3, + } + [System.Serializable] + public class KeySelectorException : System.Exception + { + public KeySelectorException() { } + public KeySelectorException(string message) { } + public KeySelectorException(string message, System.Exception innerException) { } + } + [System.Diagnostics.DebuggerDisplay("LockFreeObservableCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Ite" + + "ms)")] + public sealed class LockFreeObservableCache : DynamicData.IConnectableCache, DynamicData.IObservableCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + public LockFreeObservableCache() { } + public LockFreeObservableCache(System.IObservable> source) { } + public int Count { get; } + public System.IObservable CountChanged { get; } + public System.Collections.Generic.IReadOnlyList Items { get; } + public System.Collections.Generic.IReadOnlyDictionary KeyValues { get; } + public System.Collections.Generic.IReadOnlyList Keys { get; } + public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } + public void Dispose() { } + public void Edit(System.Action> editAction) { } + public DynamicData.Kernel.Optional Lookup(TKey key) { } + public System.IObservable> Preview(System.Func? predicate = null) { } + public System.IObservable> Watch(TKey key) { } + } +} +namespace DynamicData +{ + public sealed class ChangeAwareCache : DynamicData.ICache, DynamicData.IQuery + where TObject : notnull + where TKey : notnull + { + public ChangeAwareCache() { } + public ChangeAwareCache(System.Collections.Generic.Dictionary data) { } + public ChangeAwareCache(int capacity) { } + public int Count { get; } + public System.Collections.Generic.IEnumerable Items { get; } + public System.Collections.Generic.IEnumerable> KeyValues { get; } + public System.Collections.Generic.IEnumerable Keys { get; } + public void Add(TObject item, TKey key) { } + public void AddOrUpdate(TObject item, TKey key) { } + public DynamicData.ChangeSet CaptureChanges() { } + public void Clear() { } + public void Clone(DynamicData.IChangeSet changes) { } + public DynamicData.Kernel.Optional Lookup(TKey key) { } + public void Refresh() { } + public void Refresh(System.Collections.Generic.IEnumerable keys) { } + public void Refresh(TKey key) { } + public void Remove(System.Collections.Generic.IEnumerable keys) { } + public void Remove(TKey key) { } + } + public class ChangeAwareList : DynamicData.IExtendedList, System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.IEnumerable + where T : notnull + { + public ChangeAwareList(System.Collections.Generic.IEnumerable items) { } + public ChangeAwareList(int capacity = -1) { } + public ChangeAwareList(DynamicData.ChangeAwareList list, bool copyChanges) { } + public int Capacity { get; set; } + public int Count { get; } + public bool IsReadOnly { get; } + public T this[int index] { get; set; } + public void Add(T item) { } + public void AddRange(System.Collections.Generic.IEnumerable collection) { } + public DynamicData.IChangeSet CaptureChanges() { } + public virtual void Clear() { } + public virtual bool Contains(T item) { } + public void CopyTo(T[] array, int arrayIndex) { } + public System.Collections.Generic.IEnumerator GetEnumerator() { } + public int IndexOf(T item) { } + public int IndexOf(T item, System.Collections.Generic.IEqualityComparer equalityComparer) { } + public void Insert(int index, T item) { } + protected virtual void InsertItem(int index, T item) { } + public void InsertRange(System.Collections.Generic.IEnumerable collection, int index) { } + public virtual void Move(T item, int destination) { } + public virtual void Move(int original, int destination) { } + protected virtual void OnInsertItems(int startIndex, System.Collections.Generic.IEnumerable items) { } + protected virtual void OnRemoveItems(int startIndex, System.Collections.Generic.IEnumerable items) { } + protected virtual void OnSetItem(int index, T newItem, T oldItem) { } + public bool Refresh(T item) { } + public void Refresh(T item, int index) { } + public void RefreshAt(int index) { } + public bool Remove(T item) { } + public void RemoveAt(int index) { } + protected void RemoveItem(int index) { } + protected virtual void RemoveItem(int index, T item) { } + public void RemoveRange(int index, int count) { } + protected virtual void SetItem(int index, T item) { } + } + public enum ChangeReason + { + Add = 0, + Update = 1, + Remove = 2, + Refresh = 3, + Moved = 4, + } + public static class ChangeSetEx + { + public static System.Collections.Generic.IEnumerable> Flatten(this DynamicData.IChangeSet source) + where T : notnull { } + public static DynamicData.ChangeType GetChangeType(this DynamicData.ListChangeReason source) { } + public static DynamicData.IChangeSet Transform(this DynamicData.IChangeSet source, System.Func transformer) + where TSource : notnull + where TDestination : notnull { } + public static System.Collections.Generic.IEnumerable> YieldWithoutIndex(this System.Collections.Generic.IEnumerable> source) + where T : notnull { } + } + public class ChangeSet : System.Collections.Generic.List>, DynamicData.IChangeSet, DynamicData.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where T : notnull + { + public static readonly DynamicData.IChangeSet Empty; + public ChangeSet() { } + public ChangeSet(System.Collections.Generic.IEnumerable> items) { } + public ChangeSet(int capacity) { } + public int Adds { get; } + public int Moves { get; } + public int Refreshes { get; } + public int Removes { get; } + public int Replaced { get; } + public int TotalChanges { get; } + public override string ToString() { } + } + public class ChangeSet : System.Collections.Generic.List>, DynamicData.IChangeSet, DynamicData.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + public static readonly DynamicData.ChangeSet Empty; + public ChangeSet() { } + public ChangeSet(System.Collections.Generic.IEnumerable> collection) { } + public ChangeSet(int capacity) { } + public int Adds { get; } + public int Moves { get; } + public int Refreshes { get; } + public int Removes { get; } + public int Updates { get; } + public override string ToString() { } + } + public sealed class ChangeSet : DynamicData.ChangeSet, DynamicData.IChangeSet, DynamicData.IChangeSet, DynamicData.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + public ChangeSet(TContext context) { } + public ChangeSet(System.Collections.Generic.IEnumerable> collection, TContext context) { } + public ChangeSet(int capacity, TContext context) { } + public TContext Context { get; } + } + public enum ChangeType + { + Item = 0, + Range = 1, + } + public sealed class Change : System.IEquatable> + where T : notnull + { + public Change(DynamicData.ListChangeReason reason, System.Collections.Generic.IEnumerable items, int index = -1) { } + public Change(DynamicData.ListChangeReason reason, T current, int index = -1) { } + public Change(T current, int currentIndex, int previousIndex) { } + public Change(DynamicData.ListChangeReason reason, T current, in DynamicData.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public DynamicData.ItemChange Item { get; } + public DynamicData.RangeChange Range { get; } + public DynamicData.ListChangeReason Reason { get; } + public DynamicData.ChangeType Type { get; } + public bool Equals(DynamicData.Change? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(DynamicData.Change left, DynamicData.Change right) { } + public static bool operator ==(DynamicData.Change left, DynamicData.Change right) { } + } + public readonly struct Change : System.IEquatable> + where TObject : notnull + where TKey : notnull + { + public Change(DynamicData.ChangeReason reason, TKey key, TObject current, int index = -1) { } + public Change(TKey key, TObject current, int currentIndex, int previousIndex) { } + public Change(DynamicData.ChangeReason reason, TKey key, TObject current, in DynamicData.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public TObject Current { get; } + public int CurrentIndex { get; } + public TKey Key { get; } + public DynamicData.Kernel.Optional Previous { get; } + public int PreviousIndex { get; } + public DynamicData.ChangeReason Reason { get; } + public bool Equals(DynamicData.Change other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(in DynamicData.Change left, in DynamicData.Change right) { } + public static bool operator ==(in DynamicData.Change left, in DynamicData.Change right) { } + } + public static class DynamicDataOptions + { + public static DynamicData.Binding.BindingOptions Binding { get; set; } + public static DynamicData.Binding.SortAndBindOptions SortAndBind { get; set; } + } + public static class EnumerableEx + { + public static System.IObservable> AsObservableChangeSet(this System.Collections.Generic.IEnumerable source, bool completable = false) + where TObject : notnull { } + public static System.IObservable> AsObservableChangeSet(this System.Collections.Generic.IEnumerable source, System.Func keySelector, bool completable = false) + where TObject : notnull + where TKey : notnull { } + } + public interface ICacheUpdater : DynamicData.IQuery + where TObject : notnull + where TKey : notnull + { + void AddOrUpdate(System.Collections.Generic.IEnumerable> keyValuePairs); + void AddOrUpdate(System.Collections.Generic.KeyValuePair item); + void AddOrUpdate(TObject item, TKey key); + void Clear(); + void Clone(DynamicData.IChangeSet changes); + TKey GetKey(TObject item); + System.Collections.Generic.IEnumerable> GetKeyValues(System.Collections.Generic.IEnumerable items); + void Refresh(); + void Refresh(System.Collections.Generic.IEnumerable keys); + void Refresh(TKey key); + void Remove(System.Collections.Generic.IEnumerable> items); + void Remove(System.Collections.Generic.IEnumerable keys); + void Remove(System.Collections.Generic.KeyValuePair item); + void Remove(TKey key); + void RemoveKey(TKey key); + void RemoveKeys(System.Collections.Generic.IEnumerable key); + [System.Obsolete("Use Clone()")] + void Update(DynamicData.IChangeSet changes); + } + public interface ICache : DynamicData.IQuery + where TObject : notnull + where TKey : notnull + { + void AddOrUpdate(TObject item, TKey key); + void Clear(); + void Clone(DynamicData.IChangeSet changes); + void Refresh(); + void Refresh(System.Collections.Generic.IEnumerable keys); + void Refresh(TKey key); + void Remove(System.Collections.Generic.IEnumerable keys); + void Remove(TKey key); + } + public interface IChangeSet + { + int Adds { get; } + int Capacity { get; set; } + int Count { get; } + int Moves { get; } + int Refreshes { get; } + int Removes { get; } + } + public interface IChangeSetAdaptor + where T : notnull + { + void Adapt(DynamicData.IChangeSet changes); + } + public interface IChangeSetAdaptor + where TObject : notnull + where TKey : notnull + { + void Adapt(DynamicData.IChangeSet changes); + } + public interface IChangeSet : DynamicData.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + { + int Replaced { get; } + int TotalChanges { get; } + } + public interface IChangeSet : DynamicData.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + int Updates { get; } + } + public interface IChangeSet : DynamicData.IChangeSet, DynamicData.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + TContext Context { get; } + } + public interface IConnectableCache + where TObject : notnull + where TKey : notnull + { + System.IObservable CountChanged { get; } + System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true); + System.IObservable> Preview(System.Func? predicate = null); + System.IObservable> Watch(TKey key); + } + public interface IDistinctChangeSet : DynamicData.IChangeSet, DynamicData.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where T : notnull { } + public interface IExtendedList : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.IEnumerable + { + void AddRange(System.Collections.Generic.IEnumerable collection); + void InsertRange(System.Collections.Generic.IEnumerable collection, int index); + void Move(int original, int destination); + void RemoveRange(int index, int count); + } + public interface IGroupChangeSet : DynamicData.IChangeSet, DynamicData.IChangeSet, TGroupKey>, System.Collections.Generic.IEnumerable, TGroupKey>>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public interface IGroup + where TObject : notnull + { + TGroup GroupKey { get; } + DynamicData.IObservableList List { get; } + } + public interface IGroup : DynamicData.IKey + where TObject : notnull + where TKey : notnull + { + DynamicData.IObservableCache Cache { get; } + } + public interface IGrouping + where TObject : notnull + { + int Count { get; } + System.Collections.Generic.IEnumerable Items { get; } + TGroupKey Key { get; } + System.Collections.Generic.IEnumerable> KeyValues { get; } + System.Collections.Generic.IEnumerable Keys { get; } + DynamicData.Kernel.Optional Lookup(TKey key); + } + public interface IImmutableGroupChangeSet : DynamicData.IChangeSet, DynamicData.IChangeSet, TGroupKey>, System.Collections.Generic.IEnumerable, TGroupKey>>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public interface IIntermediateCache : DynamicData.IConnectableCache, DynamicData.IObservableCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + void Edit(System.Action> updateAction); + } + public interface IKeyValueCollection : System.Collections.Generic.IEnumerable>, System.Collections.Generic.IReadOnlyCollection>, System.Collections.Generic.IReadOnlyList>, System.Collections.IEnumerable + { + System.Collections.Generic.IComparer> Comparer { get; } + DynamicData.SortOptimisations Optimisations { get; } + DynamicData.SortReason SortReason { get; } + } + public interface IKeyValue : DynamicData.IKey + { + TObject Value { get; } + } + public interface IKey + { + T Key { get; } + } + public interface IObservableCache : DynamicData.IConnectableCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + int Count { get; } + System.Collections.Generic.IReadOnlyList Items { get; } + System.Collections.Generic.IReadOnlyDictionary KeyValues { get; } + System.Collections.Generic.IReadOnlyList Keys { get; } + DynamicData.Kernel.Optional Lookup(TKey key); + } + public interface IObservableList : System.IDisposable + where T : notnull + { + int Count { get; } + System.IObservable CountChanged { get; } + System.Collections.Generic.IReadOnlyList Items { get; } + System.IObservable> Connect(System.Func? predicate = null); + System.IObservable> Preview(System.Func? predicate = null); + } + public interface IPageChangeSet : DynamicData.IChangeSet, DynamicData.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where T : notnull + { + DynamicData.Operators.IPageResponse Response { get; } + } + public interface IPageRequest + { + int Page { get; } + int Size { get; } + } + public interface IPagedChangeSet : DynamicData.IChangeSet, DynamicData.IChangeSet, DynamicData.ISortedChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + DynamicData.Operators.IPageResponse Response { get; } + } + public interface IQuery + where TObject : notnull + { + int Count { get; } + System.Collections.Generic.IEnumerable Items { get; } + System.Collections.Generic.IEnumerable> KeyValues { get; } + System.Collections.Generic.IEnumerable Keys { get; } + DynamicData.Kernel.Optional Lookup(TKey key); + } + public interface ISortedChangeSetAdaptor + where TObject : notnull + where TKey : notnull + { + void Adapt(DynamicData.ISortedChangeSet changes); + } + public interface ISortedChangeSet : DynamicData.IChangeSet, DynamicData.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + DynamicData.IKeyValueCollection SortedItems { get; } + } + public interface ISourceCache : DynamicData.IConnectableCache, DynamicData.IObservableCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + System.Func KeySelector { get; } + void Edit(System.Action> updateAction); + } + public interface ISourceList : DynamicData.IObservableList, System.IDisposable + where T : notnull + { + void Edit(System.Action> updateAction); + } + public interface ISourceUpdater : DynamicData.ICacheUpdater, DynamicData.IQuery + where TObject : notnull + where TKey : notnull + { + void AddOrUpdate(System.Collections.Generic.IEnumerable items); + void AddOrUpdate(TObject item); + void AddOrUpdate(System.Collections.Generic.IEnumerable items, System.Collections.Generic.IEqualityComparer comparer); + void AddOrUpdate(TObject item, System.Collections.Generic.IEqualityComparer comparer); + void Load(System.Collections.Generic.IEnumerable items); + void Refresh(System.Collections.Generic.IEnumerable items); + void Refresh(TObject item); + void Remove(System.Collections.Generic.IEnumerable items); + void Remove(TObject item); + } + public interface IVirtualChangeSet : DynamicData.IChangeSet, DynamicData.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where T : notnull + { + DynamicData.IVirtualResponse Response { get; } + } + public interface IVirtualChangeSet : DynamicData.IChangeSet, DynamicData.IChangeSet, DynamicData.ISortedChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + DynamicData.IVirtualResponse Response { get; } + } + public interface IVirtualRequest + { + int Size { get; } + int StartIndex { get; } + } + public interface IVirtualResponse + { + int Size { get; } + int StartIndex { get; } + int TotalSize { get; } + } + public sealed class IndexedItem : System.IEquatable> + { + public IndexedItem(TObject value, TKey key, int index) { } + public int Index { get; } + public TKey Key { get; } + public TObject Value { get; } + public bool Equals(DynamicData.IndexedItem? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + } + [System.Diagnostics.DebuggerDisplay("IntermediateCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] + public sealed class IntermediateCache : DynamicData.Binding.INotifyCollectionChangedSuspender, DynamicData.IConnectableCache, DynamicData.IIntermediateCache, DynamicData.IObservableCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + public IntermediateCache() { } + public IntermediateCache(System.IObservable> source) { } + public int Count { get; } + public System.IObservable CountChanged { get; } + public System.Collections.Generic.IReadOnlyList Items { get; } + public System.Collections.Generic.IReadOnlyDictionary KeyValues { get; } + public System.Collections.Generic.IReadOnlyList Keys { get; } + public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } + public void Dispose() { } + public void Edit(System.Action> updateAction) { } + public DynamicData.Kernel.Optional Lookup(TKey key) { } + public System.IObservable> Preview(System.Func? predicate = null) { } + public System.IDisposable SuspendCount() { } + public System.IDisposable SuspendNotifications() { } + public System.IObservable> Watch(TKey key) { } + } + public readonly struct ItemChange : System.IEquatable> + where T : notnull + { + public static readonly DynamicData.ItemChange Empty; + public ItemChange(DynamicData.ListChangeReason reason, T current, int currentIndex) { } + public ItemChange(DynamicData.ListChangeReason reason, T current, in DynamicData.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public T Current { get; } + public int CurrentIndex { get; } + public DynamicData.Kernel.Optional Previous { get; } + public int PreviousIndex { get; } + public DynamicData.ListChangeReason Reason { get; } + public bool Equals(DynamicData.ItemChange other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(in DynamicData.ItemChange left, in DynamicData.ItemChange right) { } + public static bool operator ==(in DynamicData.ItemChange left, in DynamicData.ItemChange right) { } + } + public enum ListChangeReason + { + Add = 0, + AddRange = 1, + Replace = 2, + Remove = 3, + RemoveRange = 4, + Refresh = 5, + Moved = 6, + Clear = 7, + } + public static class ListEx + { + public static void Add(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items) { } + public static void AddOrInsertRange(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items, int index) { } + public static void AddRange(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items) { } + public static void AddRange(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items, int index) { } + public static int BinarySearch(this System.Collections.Generic.IList list, TItem value) { } + public static int BinarySearch(this System.Collections.Generic.IList list, TItem value, System.Collections.Generic.IComparer comparer) { } + public static int BinarySearch(this System.Collections.Generic.IList list, TSearch value, System.Func comparer) { } + public static void Clone(this System.Collections.Generic.IList source, DynamicData.IChangeSet changes) + where T : notnull { } + public static void Clone(this System.Collections.Generic.IList source, DynamicData.IChangeSet changes, System.Collections.Generic.IEqualityComparer? equalityComparer) + where T : notnull { } + public static void Clone(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable> changes, System.Collections.Generic.IEqualityComparer? equalityComparer) + where T : notnull { } + public static int IndexOf(this System.Collections.Generic.IEnumerable source, T item) { } + public static int IndexOf(this System.Collections.Generic.IEnumerable source, T item, System.Collections.Generic.IEqualityComparer equalityComparer) { } + public static DynamicData.Kernel.Optional> IndexOfOptional(this System.Collections.Generic.IEnumerable source, T item, System.Collections.Generic.IEqualityComparer? equalityComparer = null) { } + public static void Remove(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items) { } + public static void RemoveMany(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable itemsToRemove) { } + public static void Replace(this System.Collections.Generic.IList source, T original, T replaceWith) { } + public static void Replace(this System.Collections.Generic.IList source, T original, T replaceWith, System.Collections.Generic.IEqualityComparer comparer) { } + public static void ReplaceOrAdd(this System.Collections.Generic.IList source, T original, T replaceWith) { } + } + public enum ListFilterPolicy + { + ClearAndReplace = 0, + CalculateDiff = 1, + } + [System.Serializable] + public class MissingKeyException : System.Exception + { + public MissingKeyException() { } + public MissingKeyException(string message) { } + public MissingKeyException(string message, System.Exception innerException) { } + } + public class Node : System.IDisposable, System.IEquatable> + where TObject : class + where TKey : notnull + { + public Node(TObject item, TKey key) { } + public Node(TObject item, TKey key, in DynamicData.Kernel.Optional> parent) { } + public DynamicData.IObservableCache, TKey> Children { get; } + public int Depth { get; } + public bool IsRoot { get; } + public TObject Item { get; } + public TKey Key { get; } + public DynamicData.Kernel.Optional> Parent { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + public bool Equals(DynamicData.Node? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(DynamicData.Node left, DynamicData.Node right) { } + public static bool operator ==(DynamicData.Node? left, DynamicData.Node? right) { } + } + public static class ObservableCacheEx + { + public static System.IObservable> Adapt(this System.IObservable> source, DynamicData.IChangeSetAdaptor adaptor) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Adapt(this System.IObservable> source, DynamicData.ISortedChangeSetAdaptor adaptor) + where TObject : notnull + where TKey : notnull { } + public static void AddOrUpdate(this DynamicData.ISourceCache source, System.Collections.Generic.IEnumerable items) + where TObject : notnull + where TKey : notnull { } + public static void AddOrUpdate(this DynamicData.ISourceCache source, TObject item) + where TObject : notnull + where TKey : notnull { } + public static void AddOrUpdate(this DynamicData.IIntermediateCache source, TObject item, TKey key) + where TObject : notnull + where TKey : notnull { } + public static void AddOrUpdate(this DynamicData.ISourceCache source, System.Collections.Generic.IEnumerable items, System.Collections.Generic.IEqualityComparer equalityComparer) + where TObject : notnull + where TKey : notnull { } + public static void AddOrUpdate(this DynamicData.ISourceCache source, TObject item, System.Collections.Generic.IEqualityComparer equalityComparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this DynamicData.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this DynamicData.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this DynamicData.IObservableList>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this System.Collections.Generic.ICollection>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this System.IObservable> source, params System.IObservable>[] others) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.IObservableCache AsObservableCache(this DynamicData.IObservableCache source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.IObservableCache AsObservableCache(this System.IObservable> source, bool applyLocking = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> AsyncDisposeMany(this System.IObservable> source, System.Action> disposalsCompletedAccessor) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull { } + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull { } + public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Batch(this System.IObservable> source, System.TimeSpan timeSpan, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.TimeSpan? timeOut = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, System.IObservable? timer = null, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, System.TimeSpan? timeOut = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, System.Collections.Generic.IList targetList) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, System.Collections.Generic.IList targetList) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Binding.IObservableCollection destination) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Binding.IObservableCollection destination, DynamicData.Binding.BindingOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Binding.IObservableCollection destination, DynamicData.Binding.IObservableCollectionAdaptor updater) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Binding.IObservableCollection destination, int refreshThreshold = 25) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Binding.BindingOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.ComponentModel.BindingList bindingList, int resetThreshold = 25) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, System.Collections.Generic.IList targetList, DynamicData.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, System.Collections.Generic.IList targetList, DynamicData.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Binding.IObservableCollection destination, DynamicData.Binding.BindingOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Binding.IObservableCollection destination, DynamicData.Binding.ISortedObservableCollectionAdaptor updater) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Binding.BindingOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.ComponentModel.BindingList bindingList, int resetThreshold = 25) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = 25, bool useReplaceForUpdates = true, DynamicData.Binding.IObservableCollectionAdaptor? adaptor = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = 25, bool useReplaceForUpdates = true, DynamicData.Binding.ISortedObservableCollectionAdaptor? adaptor = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BufferInitial(this System.IObservable> source, System.TimeSpan initialBuffer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Cast(this System.IObservable> source, System.Func converter) + where TSource : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> ChangeKey(this System.IObservable> source, System.Func keySelector) + where TObject : notnull + where TSourceKey : notnull + where TDestinationKey : notnull { } + public static System.IObservable> ChangeKey(this System.IObservable> source, System.Func keySelector) + where TObject : notnull + where TSourceKey : notnull + where TDestinationKey : notnull { } + public static void Clear(this DynamicData.Cache.Internal.LockFreeObservableCache source) + where TObject : notnull + where TKey : notnull { } + public static void Clear(this DynamicData.IIntermediateCache source) + where TObject : notnull + where TKey : notnull { } + public static void Clear(this DynamicData.ISourceCache source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Clone(this System.IObservable> source, System.Collections.Generic.ICollection target) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("This was an experiment that did not work. Use Transform instead")] + public static System.IObservable> Convert(this System.IObservable> source, System.Func conversionFactory) + where TObject : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> DeferUntilLoaded(this DynamicData.IObservableCache source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> DeferUntilLoaded(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> DisposeMany(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> DistinctValues(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull + where TValue : notnull { } + public static void EditDiff(this DynamicData.ISourceCache source, System.Collections.Generic.IEnumerable allItems, System.Collections.Generic.IEqualityComparer equalityComparer) + where TObject : notnull + where TKey : notnull { } + public static void EditDiff(this DynamicData.ISourceCache source, System.Collections.Generic.IEnumerable allItems, System.Func areItemsEqual) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> EditDiff(this System.IObservable> source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> EditDiff(this System.IObservable> source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> EnsureUniqueKeys(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Except(this DynamicData.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Except(this DynamicData.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Except(this DynamicData.IObservableList>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Except(this System.Collections.Generic.ICollection>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Except(this System.IObservable> source, params System.IObservable>[] others) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, ReactiveUI.Primitives.Concurrency.ISequencer scheduler) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, System.TimeSpan? pollingInterval) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> ExpireAfter(this DynamicData.ISourceCache source, System.Func timeSelector, System.TimeSpan? pollingInterval = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, System.TimeSpan? pollingInterval, ReactiveUI.Primitives.Concurrency.ISequencer scheduler) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.Func filter, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicateChanged, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicateChanged, System.IObservable reapplyFilter, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable predicateState, System.Func predicate, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> FilterImmutable(this System.IObservable> source, System.Func predicate, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> filterFactory, System.TimeSpan? buffer = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> filterFactory, System.TimeSpan? buffer = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("This can cause unhandled exception issues so do not use")] + public static System.IObservable FinallySafe(this System.IObservable source, System.Action finallyAction) { } + public static System.IObservable> Flatten(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> FlattenBufferResult(this System.IObservable>> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ForEachChange(this System.IObservable> source, System.Action> action) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Kernel.Optional, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Kernel.Optional, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> Group(this System.IObservable> source, System.Func groupSelectorKey) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> Group(this System.IObservable> source, System.Func groupSelector, System.IObservable> resultGroupSource) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> Group(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable regrouper) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> Group(this System.IObservable> source, System.IObservable> groupSelectorKeyObservable, System.IObservable? regrouper = null) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> Group(this System.IObservable> source, System.IObservable> groupSelectorKeyObservable, System.IObservable? regrouper = null) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> GroupOnObservable(this System.IObservable> source, System.Func> groupObservableSelector) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> GroupOnObservable(this System.IObservable> source, System.Func> groupObservableSelector) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> GroupOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> GroupOnPropertyWithImmutableState(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> GroupWithImmutableState(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable? regrouper = null) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> IgnoreSameReferenceUpdate(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> IgnoreUpdateWhen(this System.IObservable> source, System.Func ignoreFunction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> IncludeUpdateWhen(this System.IObservable> source, System.Func includeFunction) + where TObject : notnull + where TKey : notnull { } + [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + "leftKey", + "rightKey"})] + public static System.IObservable>> InnerJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + "leftKey", + "rightKey"})] + public static System.IObservable>> InnerJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, [System.Runtime.CompilerServices.TupleElementNames(new string[] { + "leftKey", + "rightKey"})] System.Func, TLeft, TRight, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> InnerJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> InnerJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> InvokeEvaluate(this System.IObservable> source) + where TObject : DynamicData.Binding.IEvaluateAware + where TKey : notnull { } + public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> LeftJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> LeftJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> LimitSizeTo(this System.IObservable> source, int size) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> LimitSizeTo(this DynamicData.ISourceCache source, int sizeLimit, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IEqualityComparer equalityComparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer equalityComparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer equalityComparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable MergeMany(this System.IObservable> source, System.Func> observableSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable MergeMany(this System.IObservable> source, System.Func> observableSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, System.Collections.Generic.IComparer childComparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, System.Collections.Generic.IComparer childComparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? childComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, bool resortOnSourceRefresh, System.Collections.Generic.IComparer childComparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? childComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, bool resortOnSourceRefresh, System.Collections.Generic.IComparer childComparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, bool resortOnSourceRefresh, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? childComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, bool resortOnSourceRefresh, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? childComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyItems(this System.IObservable> source, System.Func> observableSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeManyItems(this System.IObservable> source, System.Func> observableSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable MonitorStatus(this System.IObservable source) { } + public static System.IObservable> NotEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OfType(this System.IObservable> source, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> OnItemAdded(this System.IObservable> source, System.Action addAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemAdded(this System.IObservable> source, System.Action addAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemRefreshed(this System.IObservable> source, System.Action refreshAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemRefreshed(this System.IObservable> source, System.Action refreshAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemRemoved(this System.IObservable> source, System.Action removeAction, bool invokeOnUnsubscribe = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemRemoved(this System.IObservable> source, System.Action removeAction, bool invokeOnUnsubscribe = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemUpdated(this System.IObservable> source, System.Action updateAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemUpdated(this System.IObservable> source, System.Action updateAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Or(this DynamicData.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Or(this DynamicData.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Or(this DynamicData.IObservableList>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Or(this System.Collections.Generic.ICollection>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Or(this System.IObservable> source, params System.IObservable>[] others) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("Use SortAndPage as it\'s more efficient")] + public static System.IObservable> Page(this System.IObservable> source, System.IObservable pageRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IDisposable PopulateFrom(this DynamicData.ISourceCache source, System.IObservable> observable) + where TObject : notnull + where TKey : notnull { } + public static System.IDisposable PopulateFrom(this DynamicData.ISourceCache source, System.IObservable observable) + where TObject : notnull + where TKey : notnull { } + public static System.IDisposable PopulateInto(this System.IObservable> source, DynamicData.Cache.Internal.LockFreeObservableCache destination) + where TObject : notnull + where TKey : notnull { } + public static System.IDisposable PopulateInto(this System.IObservable> source, DynamicData.IIntermediateCache destination) + where TObject : notnull + where TKey : notnull { } + public static System.IDisposable PopulateInto(this System.IObservable> source, DynamicData.ISourceCache destination) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> QueryWhenChanged(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable QueryWhenChanged(this System.IObservable> source, System.Func, TDestination> resultSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> QueryWhenChanged(this System.IObservable> source, System.Func> itemChangedTrigger) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> RefCount(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static void Refresh(this DynamicData.ISourceCache source) + where TObject : notnull + where TKey : notnull { } + public static void Refresh(this DynamicData.ISourceCache source, System.Collections.Generic.IEnumerable items) + where TObject : notnull + where TKey : notnull { } + public static void Refresh(this DynamicData.ISourceCache source, TObject item) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.IIntermediateCache source, System.Collections.Generic.IEnumerable keys) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.IIntermediateCache source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.ISourceCache source, System.Collections.Generic.IEnumerable keys) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.ISourceCache source, System.Collections.Generic.IEnumerable items) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.ISourceCache source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.ISourceCache source, TObject item) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> RemoveKey(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static void RemoveKey(this DynamicData.ISourceCache source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static void RemoveKeys(this DynamicData.ISourceCache source, System.Collections.Generic.IEnumerable keys) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> SkipInitial(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("Use SortAndBind as it\'s more efficient")] + public static System.IObservable> Sort(this System.IObservable> source, System.Collections.Generic.IComparer comparer, DynamicData.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("Use SortAndBind as it\'s more efficient")] + public static System.IObservable> Sort(this System.IObservable> source, System.IObservable> comparerObservable, DynamicData.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("Use SortAndBind as it\'s more efficient")] + public static System.IObservable> Sort(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable resorter, DynamicData.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("Use SortAndBind as it\'s more efficient")] + public static System.IObservable> Sort(this System.IObservable> source, System.IObservable> comparerObservable, System.IObservable resorter, DynamicData.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList) + where TObject : notnull, System.IComparable + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection) + where TObject : notnull, System.IComparable + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList, DynamicData.Binding.SortAndBindOptions options) + where TObject : notnull, System.IComparable + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList, System.IObservable> comparerChanged) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Binding.SortAndBindOptions options) + where TObject : notnull, System.IComparable + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, System.IObservable> comparerChanged) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList, System.Collections.Generic.IComparer comparer, DynamicData.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList, System.IObservable> comparerChanged, DynamicData.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, System.Collections.Generic.IComparer comparer, DynamicData.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, System.IObservable> comparerChanged, DynamicData.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndPage(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable pageRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndPage(this System.IObservable> source, System.IObservable> comparerChanged, System.IObservable pageRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndPage(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable pageRequests, DynamicData.SortAndPageOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndPage(this System.IObservable> source, System.IObservable> comparerChanged, System.IObservable pageRequests, DynamicData.SortAndPageOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndVirtualize(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable virtualRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndVirtualize(this System.IObservable> source, System.IObservable> comparerChanged, System.IObservable virtualRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndVirtualize(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable virtualRequests, DynamicData.SortAndVirtualizeOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndVirtualize(this System.IObservable> source, System.IObservable> comparerChanged, System.IObservable virtualRequests, DynamicData.SortAndVirtualizeOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortBy(this System.IObservable> source, System.Func expression, DynamicData.Binding.SortDirection sortOrder = 0, DynamicData.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> StartWithItem(this System.IObservable> source, TObject item) + where TObject : DynamicData.IKey + where TKey : notnull { } + public static System.IObservable> StartWithItem(this System.IObservable> source, TObject item, TKey key) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SubscribeMany(this System.IObservable> source, System.Func subscriptionFactory) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SubscribeMany(this System.IObservable> source, System.Func subscriptionFactory) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SuppressRefresh(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Switch(this System.IObservable> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Switch(this System.IObservable>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToCollection(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func keySelector, System.Func? expireAfter = null, int limitSizeTo = -1, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func keySelector, System.Func? expireAfter = null, int limitSizeTo = -1, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, bool initialOptionalWhenMissing, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Func sort, DynamicData.Binding.SortDirection sortOrder = 0) + where TObject : notnull + where TKey : notnull + where TSortKey : notnull { } + [System.Obsolete("Use Overload with comparer as it\'s more efficient")] + public static System.IObservable> Top(this System.IObservable> source, int size) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> Top(this System.IObservable> source, System.Collections.Generic.IComparer comparer, int size) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, bool transformOnRefresh) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, DynamicData.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, DynamicData.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, DynamicData.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformImmutable(this System.IObservable> source, System.Func transformFactory) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Func keySelector) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Func keySelector) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Func keySelector) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Func keySelector) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func>> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func>> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func>> manySelector, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func>> manySelector, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func> manySelector, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull + where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func> manySelector, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull + where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func>> manySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func>> manySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func>> manySelector, System.Func keySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func>> manySelector, System.Func keySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func> manySelector, System.Func keySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull + where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func> manySelector, System.Func keySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull + where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable { } + public static System.IObservable> TransformOnObservable(this System.IObservable> source, System.Func> transformFactory) + where TSource : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> TransformOnObservable(this System.IObservable> source, System.Func> transformFactory) + where TSource : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func> transformFactory, System.Action> errorHandler, DynamicData.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func> transformFactory, System.Action> errorHandler, DynamicData.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, DynamicData.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable, TKey>> TransformToTree(this System.IObservable> source, System.Func pivotOn, System.IObservable, bool>>? predicateChanged = null) + where TObject : class + where TKey : notnull { } + public static System.IObservable> TransformWithInlineUpdate(this System.IObservable> source, System.Func transformFactory, System.Action updateAction) + where TDestination : class + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformWithInlineUpdate(this System.IObservable> source, System.Func transformFactory, System.Action updateAction, System.Action> errorHandler) + where TDestination : class + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformWithInlineUpdate(this System.IObservable> source, System.Func transformFactory, System.Action updateAction, bool transformOnRefresh) + where TDestination : class + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformWithInlineUpdate(this System.IObservable> source, System.Func transformFactory, System.Action updateAction, System.Action> errorHandler, bool transformOnRefresh) + where TDestination : class + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TreatMovesAsRemoveAdd(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable TrueForAll(this System.IObservable> source, System.Func> observableSelector, System.Func equalityCondition) + where TObject : notnull + where TKey : notnull + where TValue : notnull { } + public static System.IObservable TrueForAll(this System.IObservable> source, System.Func> observableSelector, System.Func equalityCondition) + where TObject : notnull + where TKey : notnull + where TValue : notnull { } + public static System.IObservable TrueForAny(this System.IObservable> source, System.Func> observableSelector, System.Func equalityCondition) + where TObject : notnull + where TKey : notnull + where TValue : notnull { } + public static System.IObservable TrueForAny(this System.IObservable> source, System.Func> observableSelector, System.Func equalityCondition) + where TObject : notnull + where TKey : notnull + where TValue : notnull { } + public static System.IObservable> UpdateIndex(this System.IObservable> source) + where TObject : DynamicData.Binding.IIndexAware + where TKey : notnull { } + [System.Obsolete("Use SortAndVirtualize as it\'s more efficient")] + public static System.IObservable> Virtualise(this System.IObservable> source, System.IObservable virtualRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Watch(this System.IObservable> source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable WatchValue(this DynamicData.IObservableCache source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable WatchValue(this System.IObservable> source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable WhenAnyPropertyChanged(this System.IObservable> source, params string[] propertiesToMonitor) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull { } + public static System.IObservable> WhenPropertyChanged(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull { } + public static System.IObservable WhenValueChanged(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull { } + public static System.IObservable> WhereReasonsAre(this System.IObservable> source, params DynamicData.ChangeReason[] reasons) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> WhereReasonsAreNot(this System.IObservable> source, params DynamicData.ChangeReason[] reasons) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Xor(this DynamicData.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Xor(this DynamicData.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Xor(this DynamicData.IObservableList>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Xor(this System.Collections.Generic.ICollection>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Xor(this System.IObservable> source, params System.IObservable>[] others) + where TObject : notnull + where TKey : notnull { } + } + public static class ObservableChangeSet + { + public static System.IObservable> Create(System.Func, System.Action> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.IDisposable> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Action> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.IDisposable> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + } + public static class ObservableListEx + { + public static System.IObservable> Adapt(this System.IObservable> source, DynamicData.IChangeSetAdaptor adaptor) + where T : notnull { } + public static System.IObservable> AddKey(this System.IObservable> source, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this DynamicData.IObservableList> sources) + where T : notnull { } + public static System.IObservable> And(this DynamicData.IObservableList> sources) + where T : notnull { } + public static System.IObservable> And(this DynamicData.IObservableList>> sources) + where T : notnull { } + public static System.IObservable> And(this System.Collections.Generic.ICollection>> sources) + where T : notnull { } + public static System.IObservable> And(this System.IObservable> source, params System.IObservable>[] others) + where T : notnull { } + public static DynamicData.IObservableList AsObservableList(this DynamicData.ISourceList source) + where T : notnull { } + public static DynamicData.IObservableList AsObservableList(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Binding.IObservableCollection targetCollection, DynamicData.Binding.BindingOptions options) + where T : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Binding.IObservableCollection targetCollection, int resetThreshold = 25) + where T : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Binding.BindingOptions options) + where T : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = 25) + where T : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this System.IObservable> source, System.ComponentModel.BindingList bindingList, int resetThreshold = 25) + where T : notnull { } + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.TimeSpan? timeOut, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState, System.TimeSpan? timeOut, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> BufferInitial(this System.IObservable> source, System.TimeSpan initialBuffer, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull { } + public static System.IObservable> Cast(this System.IObservable> source) + where TDestination : notnull { } + public static System.IObservable> Cast(this System.IObservable> source, System.Func conversionFactory) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> CastToObject(this System.IObservable> source) + where T : class { } + public static System.IObservable> Clone(this System.IObservable> source, System.Collections.Generic.IList target) + where T : notnull { } + [System.Obsolete("Prefer Cast as it is does the same thing but is semantically correct")] + public static System.IObservable> Convert(this System.IObservable> source, System.Func conversionFactory) + where TObject : notnull + where TDestination : notnull { } + public static System.IObservable> DeferUntilLoaded(this DynamicData.IObservableList source) + where T : notnull { } + public static System.IObservable> DeferUntilLoaded(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> DisposeMany(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> DistinctValues(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TValue : notnull { } + public static System.IObservable> Except(this DynamicData.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Except(this DynamicData.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Except(this DynamicData.IObservableList>> sources) + where T : notnull { } + public static System.IObservable> Except(this System.Collections.Generic.ICollection>> sources) + where T : notnull { } + public static System.IObservable> Except(this System.IObservable> source, params System.IObservable>[] others) + where T : notnull { } + public static System.IObservable> ExpireAfter(this DynamicData.ISourceList source, System.Func timeSelector, System.TimeSpan? pollingInterval = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.Func predicate) + where T : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicate, DynamicData.ListFilterPolicy filterPolicy = 1) + where T : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable predicateState, System.Func predicate, DynamicData.ListFilterPolicy filterPolicy = 1, bool suppressEmptyChangeSets = true) + where T : notnull { } + public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> objectFilterObservable, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull { } + [System.Obsolete("Use AutoRefresh(), followed by Filter() instead")] + public static System.IObservable> FilterOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.Func predicate, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> FlattenBufferResult(this System.IObservable>> source) + where T : notnull { } + public static System.IObservable> ForEachChange(this System.IObservable> source, System.Action> action) + where TObject : notnull { } + public static System.IObservable> ForEachItemChange(this System.IObservable> source, System.Action> action) + where TObject : notnull { } + public static System.IObservable>> GroupOn(this System.IObservable> source, System.Func groupSelector, System.IObservable? regrouper = null) + where TObject : notnull + where TGroup : notnull { } + public static System.IObservable>> GroupOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TGroup : notnull { } + public static System.IObservable>> GroupOnPropertyWithImmutableState(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TGroup : notnull { } + public static System.IObservable>> GroupWithImmutableState(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable? regrouper = null) + where TObject : notnull + where TGroupKey : notnull { } + public static System.IObservable> LimitSizeTo(this DynamicData.ISourceList source, int sizeLimit, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> MergeChangeSets(this DynamicData.IObservableList>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer? equalityComparer = null, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer? equalityComparer = null, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null, bool completable = true) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this DynamicData.IObservableList>> source, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>>> source, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this DynamicData.IObservableList>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable MergeMany(this System.IObservable> source, System.Func> observableSelector) + where T : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TDestination : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TObject : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> NotEmpty(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> OnItemAdded(this System.IObservable> source, System.Action addAction) + where T : notnull { } + public static System.IObservable> OnItemRefreshed(this System.IObservable> source, System.Action refreshAction) + where T : notnull { } + public static System.IObservable> OnItemRemoved(this System.IObservable> source, System.Action removeAction, bool invokeOnUnsubscribe = true) + where T : notnull { } + public static System.IObservable> Or(this DynamicData.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Or(this DynamicData.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Or(this DynamicData.IObservableList>> sources) + where T : notnull { } + public static System.IObservable> Or(this System.Collections.Generic.ICollection>> sources) + where T : notnull { } + public static System.IObservable> Or(this System.IObservable> source, params System.IObservable>[] others) + where T : notnull { } + public static System.IObservable> Page(this System.IObservable> source, System.IObservable requests) + where T : notnull { } + public static System.IDisposable PopulateInto(this System.IObservable> source, DynamicData.ISourceList destination) + where T : notnull { } + public static System.IObservable> QueryWhenChanged(this System.IObservable> source) + where T : notnull { } + public static System.IObservable QueryWhenChanged(this System.IObservable> source, System.Func, TDestination> resultSelector) + where TObject : notnull { } + public static System.IObservable> RefCount(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> RemoveIndex(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> Reverse(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> SkipInitial(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> Sort(this System.IObservable> source, System.IObservable> comparerChanged, DynamicData.SortOptions options = 0, System.IObservable? resort = null, int resetThreshold = 50) + where T : notnull { } + public static System.IObservable> Sort(this System.IObservable> source, System.Collections.Generic.IComparer comparer, DynamicData.SortOptions options = 0, System.IObservable? resort = null, System.IObservable>? comparerChanged = null, int resetThreshold = 50) + where T : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> SubscribeMany(this System.IObservable> source, System.Func subscriptionFactory) + where T : notnull { } + public static System.IObservable> SuppressRefresh(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> Switch(this System.IObservable> sources) + where T : notnull { } + public static System.IObservable> Switch(this System.IObservable>> sources) + where T : notnull { } + public static System.IObservable> ToCollection(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func expireAfter, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, int limitSizeTo, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func expireAfter, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, int limitSizeTo, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func? expireAfter, int limitSizeTo, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func? expireAfter, int limitSizeTo, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where T : notnull { } + public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Collections.Generic.IComparer comparer) + where TObject : notnull { } + public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Func sort, DynamicData.Binding.SortDirection sortOrder = 0) + where TObject : notnull { } + public static System.IObservable> Top(this System.IObservable> source, int numberOfItems) + where T : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TDestination> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func, int, TDestination> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, int, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TDestination : notnull + where TSource : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TDestination : notnull + where TSource : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TDestination : notnull + where TSource : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TDestination : notnull + where TSource : notnull { } + public static System.IObservable> Virtualise(this System.IObservable> source, System.IObservable requests) + where T : notnull { } + public static System.IObservable WhenAnyPropertyChanged(this System.IObservable> source, params string[] propertiesToMonitor) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> WhenPropertyChanged(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenValueChanged(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> WhereReasonsAre(this System.IObservable> source, params DynamicData.ListChangeReason[] reasons) + where T : notnull { } + public static System.IObservable> WhereReasonsAreNot(this System.IObservable> source, params DynamicData.ListChangeReason[] reasons) + where T : notnull { } + public static System.IObservable> Xor(this DynamicData.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Xor(this DynamicData.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Xor(this DynamicData.IObservableList>> sources) + where T : notnull { } + public static System.IObservable> Xor(this System.Collections.Generic.ICollection>> sources) + where T : notnull { } + public static System.IObservable> Xor(this System.IObservable> source, params System.IObservable>[] others) + where T : notnull { } + } + public class PageContext : System.IEquatable> + { + public PageContext(DynamicData.Operators.IPageResponse Response, System.Collections.Generic.IComparer Comparer, DynamicData.SortAndPageOptions Options) { } + public System.Collections.Generic.IComparer Comparer { get; init; } + public DynamicData.SortAndPageOptions Options { get; init; } + public DynamicData.Operators.IPageResponse Response { get; init; } + } + public sealed class PageRequest : DynamicData.IPageRequest, System.IEquatable + { + public static readonly DynamicData.IPageRequest Default; + public static readonly DynamicData.IPageRequest Empty; + public PageRequest() { } + public PageRequest(int page, int size) { } + public int Page { get; } + public int Size { get; } + public static System.Collections.Generic.IEqualityComparer DefaultComparer { get; } + public bool Equals(DynamicData.IPageRequest? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + } + public sealed class RangeChange : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + public RangeChange(System.Collections.Generic.IEnumerable items, int index = -1) { } + public int Count { get; } + public int Index { get; } + public static DynamicData.RangeChange Empty { get; } + public void Add(T item) { } + public System.Collections.Generic.IEnumerator GetEnumerator() { } + public void Insert(int index, T item) { } + public void SetStartingIndex(int index) { } + public override string ToString() { } + } + public struct SortAndPageOptions : System.IEquatable + { + public SortAndPageOptions() { } + public int InitialCapacity { get; init; } + public int ResetThreshold { get; init; } + public bool UseBinarySearch { get; init; } + } + public struct SortAndVirtualizeOptions : System.IEquatable + { + public SortAndVirtualizeOptions() { } + public int InitialCapacity { get; init; } + public int ResetThreshold { get; init; } + public bool UseBinarySearch { get; init; } + } + [System.Serializable] + public class SortException : System.Exception + { + public SortException() { } + public SortException(string message) { } + public SortException(string message, System.Exception innerException) { } + } + [System.Flags] + public enum SortOptimisations + { + None = 0, + ComparesImmutableValuesOnly = 1, + IgnoreEvaluates = 2, + [System.Obsolete("This is no longer being used. Use one of the other options instead.")] + InsertAtEndThenSort = 3, + } + public enum SortOptions + { + None = 0, + UseBinarySearch = 1, + } + public enum SortReason + { + InitialLoad = 0, + ComparerChanged = 1, + DataChanged = 2, + Reorder = 3, + Reset = 4, + } + public static class SourceCacheEx + { + public static System.IObservable> Cast(this DynamicData.IObservableCache source, System.Func converter) + where TSource : notnull + where TKey : notnull + where TDestination : notnull { } + } + [System.Diagnostics.DebuggerDisplay("SourceCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] + public sealed class SourceCache : DynamicData.Binding.INotifyCollectionChangedSuspender, DynamicData.IConnectableCache, DynamicData.IObservableCache, DynamicData.ISourceCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + public SourceCache(System.Func keySelector) { } + public int Count { get; } + public System.IObservable CountChanged { get; } + public System.Collections.Generic.IReadOnlyList Items { get; } + public System.Func KeySelector { get; } + public System.Collections.Generic.IReadOnlyDictionary KeyValues { get; } + public System.Collections.Generic.IReadOnlyList Keys { get; } + public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } + public void Dispose() { } + public void Edit(System.Action> updateAction) { } + public DynamicData.Kernel.Optional Lookup(TKey key) { } + public System.IObservable> Preview(System.Func? predicate = null) { } + public System.IDisposable SuspendCount() { } + public System.IDisposable SuspendNotifications() { } + public System.IObservable> Watch(TKey key) { } + } + public static class SourceListEditConvenienceEx + { + public static void Add(this DynamicData.ISourceList source, T item) + where T : notnull { } + public static void AddRange(this DynamicData.ISourceList source, System.Collections.Generic.IEnumerable items) + where T : notnull { } + public static void Clear(this DynamicData.ISourceList source) + where T : notnull { } + public static void EditDiff(this DynamicData.ISourceList source, System.Collections.Generic.IEnumerable allItems, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where T : notnull { } + public static void Insert(this DynamicData.ISourceList source, int index, T item) + where T : notnull { } + public static void InsertRange(this DynamicData.ISourceList source, System.Collections.Generic.IEnumerable items, int index) + where T : notnull { } + public static void Move(this DynamicData.ISourceList source, int original, int destination) + where T : notnull { } + public static bool Remove(this DynamicData.ISourceList source, T item) + where T : notnull { } + public static void RemoveAt(this DynamicData.ISourceList source, int index) + where T : notnull { } + public static void RemoveMany(this DynamicData.ISourceList source, System.Collections.Generic.IEnumerable itemsToRemove) + where T : notnull { } + public static void RemoveRange(this DynamicData.ISourceList source, int index, int count) + where T : notnull { } + public static void Replace(this DynamicData.ISourceList source, T original, T destination) + where T : notnull { } + public static void ReplaceAt(this DynamicData.ISourceList source, int index, T item) + where T : notnull { } + } + public static class SourceListEx + { + public static System.IObservable> Cast(this DynamicData.ISourceList source, System.Func conversionFactory) + where TSource : notnull + where TDestination : notnull { } + } + [System.Diagnostics.DebuggerDisplay("SourceList<{typeof(T).Name}> ({Count} Items)")] + public sealed class SourceList : DynamicData.IObservableList, DynamicData.ISourceList, System.IDisposable + where T : notnull + { + public SourceList(System.IObservable>? source = null) { } + public int Count { get; } + public System.IObservable CountChanged { get; } + public System.Collections.Generic.IReadOnlyList Items { get; } + public System.IObservable> Connect(System.Func? predicate = null) { } + public void Dispose() { } + public void Edit(System.Action> updateAction) { } + public System.IObservable> Preview(System.Func? predicate = null) { } + } + public struct TransformAsyncOptions : System.IEquatable + { + public static readonly DynamicData.TransformAsyncOptions Default; + public TransformAsyncOptions(int? MaximumConcurrency, bool TransformOnRefresh) { } + public int? MaximumConcurrency { get; set; } + public bool TransformOnRefresh { get; set; } + } + [System.Serializable] + public class UnspecifiedIndexException : System.Exception + { + public UnspecifiedIndexException() { } + public UnspecifiedIndexException(string message) { } + public UnspecifiedIndexException(string message, System.Exception innerException) { } + } + public class VirtualContext : System.IEquatable> + { + public VirtualContext(DynamicData.IVirtualResponse Response, System.Collections.Generic.IComparer Comparer, DynamicData.SortAndVirtualizeOptions Options) { } + public System.Collections.Generic.IComparer Comparer { get; init; } + public DynamicData.SortAndVirtualizeOptions Options { get; init; } + public DynamicData.IVirtualResponse Response { get; init; } + } + public class VirtualRequest : DynamicData.IVirtualRequest, System.IEquatable + { + public static readonly DynamicData.VirtualRequest Default; + public VirtualRequest() { } + public VirtualRequest(int startIndex, int size) { } + public int Size { get; } + public int StartIndex { get; } + public static System.Collections.Generic.IEqualityComparer StartIndexSizeComparer { get; } + public bool Equals(DynamicData.IVirtualRequest? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + } +} +namespace DynamicData.Diagnostics +{ + public class ChangeStatistics : System.IEquatable + { + public ChangeStatistics() { } + public ChangeStatistics(int index, int adds, int updates, int removes, int refreshes, int moves, int count) { } + public int Adds { get; } + public int Count { get; } + public int Index { get; } + public System.DateTime LastUpdated { get; } + public int Moves { get; } + public int Refreshes { get; } + public int Removes { get; } + public int Updates { get; } + public bool Equals(DynamicData.Diagnostics.ChangeStatistics? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(DynamicData.Diagnostics.ChangeStatistics left, DynamicData.Diagnostics.ChangeStatistics right) { } + public static bool operator ==(DynamicData.Diagnostics.ChangeStatistics left, DynamicData.Diagnostics.ChangeStatistics right) { } + } + public class ChangeSummary + { + public static readonly DynamicData.Diagnostics.ChangeSummary Empty; + public ChangeSummary(int index, DynamicData.Diagnostics.ChangeStatistics latest, DynamicData.Diagnostics.ChangeStatistics overall) { } + public DynamicData.Diagnostics.ChangeStatistics Latest { get; } + public DynamicData.Diagnostics.ChangeStatistics Overall { get; } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + } + public static class DiagnosticOperators + { + public static System.IObservable CollectUpdateStats(this System.IObservable> source) + where TSource : notnull { } + public static System.IObservable CollectUpdateStats(this System.IObservable> source) + where TSource : notnull + where TKey : notnull { } + } +} +namespace DynamicData.Experimental +{ + public static class ExperimentalEx + { + public static DynamicData.Experimental.IWatcher AsWatcher(this System.IObservable> source, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) + where TObject : notnull + where TKey : notnull { } + } + public interface IWatcher : System.IDisposable + where TObject : notnull + where TKey : notnull + { + System.IObservable> Watch(TKey key); + } +} +namespace DynamicData.Kernel +{ + public enum ConnectionStatus + { + Pending = 0, + Loaded = 1, + Errored = 2, + Completed = 3, + } + public static class EnumerableEx + { + public static T[] AsArray(this System.Collections.Generic.IEnumerable source) { } + public static System.Collections.Generic.List AsList(this System.Collections.Generic.IEnumerable source) { } + public static System.Collections.Generic.IEnumerable Duplicates(this System.Collections.Generic.IEnumerable source, System.Func valueSelector) { } + public static System.Collections.Generic.IEnumerable> IndexOfMany(this System.Collections.Generic.IEnumerable source, System.Collections.Generic.IEnumerable itemsToFind) { } + public static System.Collections.Generic.IEnumerable IndexOfMany(this System.Collections.Generic.IEnumerable source, System.Collections.Generic.IEnumerable itemsToFind, System.Func resultSelector) { } + } + public sealed class Error : DynamicData.IKeyValue, DynamicData.IKey, System.IEquatable> + where TKey : notnull + { + public Error(System.Exception? exception, TObject value, TKey key) { } + public System.Exception? Exception { get; } + public TKey Key { get; } + public TObject Value { get; } + public bool Equals(DynamicData.Kernel.Error? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(DynamicData.Kernel.Error left, DynamicData.Kernel.Error right) { } + public static bool operator ==(DynamicData.Kernel.Error left, DynamicData.Kernel.Error right) { } + } + public static class InternalEx + { + public static System.IObservable RetryWithBackOff(this System.IObservable source, System.Func backOffStrategy) + where TException : System.Exception { } + public static System.IDisposable ScheduleRecurringAction(this ReactiveUI.Primitives.Concurrency.ISequencer scheduler, System.Func interval, System.Action action) { } + public static System.IDisposable ScheduleRecurringAction(this ReactiveUI.Primitives.Concurrency.ISequencer scheduler, System.TimeSpan interval, System.Action action) { } + } + public readonly struct ItemWithIndex : System.IEquatable> + { + public ItemWithIndex(T item, int index) { } + public int Index { get; } + public T Item { get; } + public bool Equals(DynamicData.Kernel.ItemWithIndex other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(in DynamicData.Kernel.ItemWithIndex left, in DynamicData.Kernel.ItemWithIndex right) { } + public static bool operator ==(in DynamicData.Kernel.ItemWithIndex left, in DynamicData.Kernel.ItemWithIndex right) { } + } + public readonly struct ItemWithValue : System.IEquatable> + { + public ItemWithValue(TObject item, TValue value) { } + public TObject Item { get; } + public TValue Value { get; } + public bool Equals(DynamicData.Kernel.ItemWithValue other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(in DynamicData.Kernel.ItemWithValue left, in DynamicData.Kernel.ItemWithValue right) { } + public static bool operator ==(in DynamicData.Kernel.ItemWithValue left, in DynamicData.Kernel.ItemWithValue right) { } + } + public sealed class OptionElse + { + public void Else(System.Action action) { } + } + public static class OptionExtensions + { + public static DynamicData.Kernel.Optional Convert(this in DynamicData.Kernel.Optional source, System.Func> converter) + where TSource : notnull + where TDestination : notnull { } + public static DynamicData.Kernel.Optional Convert(this in DynamicData.Kernel.Optional source, System.Func converter) + where TSource : notnull + where TDestination : notnull { } + public static TDestination? ConvertOr(this in DynamicData.Kernel.Optional source, System.Func converter, System.Func fallbackConverter) + where TSource : notnull { } + public static DynamicData.Kernel.Optional FirstOrOptional(this System.Collections.Generic.IEnumerable source, System.Func selector) + where T : notnull { } + public static DynamicData.Kernel.OptionElse IfHasValue(this DynamicData.Kernel.Optional? source, System.Action action) + where T : notnull { } + public static DynamicData.Kernel.OptionElse IfHasValue(this in DynamicData.Kernel.Optional source, System.Action action) + where T : notnull { } + public static DynamicData.Kernel.Optional Lookup(this System.Collections.Generic.IDictionary source, TKey key) + where TValue : notnull { } + public static DynamicData.Kernel.Optional OrElse(this in DynamicData.Kernel.Optional source, System.Func> fallbackOperation) + where T : notnull { } + public static bool RemoveIfContained(this System.Collections.Generic.IDictionary source, TKey key) { } + public static System.Collections.Generic.IEnumerable SelectValues(this System.Collections.Generic.IEnumerable> source) + where T : notnull { } + public static T ValueOr(this T? source, T defaultValue) + where T : struct { } + public static T ValueOr(this in DynamicData.Kernel.Optional source, System.Func valueSelector) + where T : notnull { } + public static T? ValueOrDefault(this in DynamicData.Kernel.Optional source) + where T : notnull { } + public static T ValueOrThrow(this in DynamicData.Kernel.Optional source, System.Func exceptionGenerator) + where T : notnull { } + } + public static class OptionObservableExtensions + { + public static System.IObservable> Convert(this System.IObservable> source, System.Func> converter) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> Convert(this System.IObservable> source, System.Func converter) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable ConvertOr(this System.IObservable> source, System.Func converter, System.Func fallbackConverter) + where TSource : notnull { } + public static System.IObservable> OnHasNoValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) + where T : notnull { } + public static System.IObservable> OnHasValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) + where T : notnull { } + public static System.IObservable> OrElse(this System.IObservable> source, System.Func> fallbackOperation) + where T : notnull { } + public static System.IObservable SelectValues(this System.IObservable> source) + where T : notnull { } + public static System.IObservable ValueOr(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable ValueOrDefault(this System.IObservable> source) + where T : notnull { } + public static System.IObservable ValueOrThrow(this System.IObservable> source, System.Func exceptionGenerator) + where T : notnull { } + } + public static class Optional + { + public static DynamicData.Kernel.Optional None() + where T : notnull { } + public static DynamicData.Kernel.Optional Some(T? value) + where T : notnull { } + } + public readonly struct Optional : System.IEquatable> + where T : notnull + { + public bool HasValue { get; } + public T Value { get; } + public static DynamicData.Kernel.Optional None { get; } + public bool Equals(DynamicData.Kernel.Optional other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string? ToString() { } + public static DynamicData.Kernel.Optional Create(T? value) { } + public static T? FromOptional(in DynamicData.Kernel.Optional value) { } + public static DynamicData.Kernel.Optional ToOptional(T? value) { } + public static T? op_Explicit(in DynamicData.Kernel.Optional value) { } + public static DynamicData.Kernel.Optional op_Implicit(T? value) { } + public static bool operator !=(in DynamicData.Kernel.Optional left, in DynamicData.Kernel.Optional right) { } + public static bool operator ==(in DynamicData.Kernel.Optional left, in DynamicData.Kernel.Optional right) { } + } +} +namespace DynamicData.List +{ + public interface IGrouping + { + int Count { get; } + System.Collections.Generic.IEnumerable Items { get; } + TGroupKey Key { get; } + } +} +namespace DynamicData.Operators +{ + public interface IPageResponse + { + int Page { get; } + int PageSize { get; } + int Pages { get; } + int TotalSize { get; } + } +} +namespace DynamicData.PLinq +{ + public static class ParallelOperators + { + public static System.IObservable> Filter(this System.IObservable> source, System.Func filter, DynamicData.PLinq.ParallelisationOptions parallelisationOptions) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SubscribeMany(this System.IObservable> source, System.Func subscriptionFactory, DynamicData.PLinq.ParallelisationOptions parallelisationOptions) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SubscribeMany(this System.IObservable> source, System.Func subscriptionFactory, DynamicData.PLinq.ParallelisationOptions parallelisationOptions) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, DynamicData.PLinq.ParallelisationOptions parallelisationOptions) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, DynamicData.PLinq.ParallelisationOptions parallelisationOptions) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, DynamicData.PLinq.ParallelisationOptions parallelisationOptions) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, DynamicData.PLinq.ParallelisationOptions parallelisationOptions) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + } + public enum ParallelType + { + None = 0, + Parallelise = 1, + Ordered = 2, + } + public class ParallelisationOptions + { + public static readonly DynamicData.PLinq.ParallelisationOptions Default; + public static readonly DynamicData.PLinq.ParallelisationOptions None; + public ParallelisationOptions(DynamicData.PLinq.ParallelType type = 0, int threshold = 0, int maxDegreeOfParallelisation = 0) { } + public int MaxDegreeOfParallelisation { get; } + public int Threshold { get; } + public DynamicData.PLinq.ParallelType Type { get; } + } +} +namespace DynamicData.Tests +{ + public class ChangeSetAggregator : System.IDisposable + where TObject : notnull + { + public ChangeSetAggregator(System.IObservable> source) { } + public DynamicData.IObservableList Data { get; } + public System.Exception? Exception { get; set; } + public bool IsCompleted { get; } + public System.Collections.Generic.IList> Messages { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + } + public sealed class ChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + { + public ChangeSetAggregator(System.IObservable> source) { } + public DynamicData.IObservableCache Data { get; } + public System.Exception? Error { get; } + public bool IsCompleted { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + } + public sealed class ChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + { + public ChangeSetAggregator(System.IObservable> source) { } + public DynamicData.IObservableCache Data { get; } + public System.Exception? Error { get; } + public bool IsCompleted { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + } + public class DistinctChangeSetAggregator : System.IDisposable + where TValue : notnull + { + public DistinctChangeSetAggregator(System.IObservable> source) { } + public DynamicData.IObservableCache Data { get; } + public System.Exception? Error { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + } + public class GroupChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull + { + public GroupChangeSetAggregator(System.IObservable> source) { } + public DynamicData.IObservableCache, TGroupKey> Data { get; } + public System.Exception? Error { get; } + public DynamicData.IObservableCache, TGroupKey> Groups { get; } + public bool IsCompleted { get; } + public System.Collections.Generic.IReadOnlyList> Messages { get; } + public DynamicData.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + } + public static class ListTextEx + { + public static DynamicData.Tests.ChangeSetAggregator AsAggregator(this System.IObservable> source) + where T : notnull { } + } + public class PagedChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + { + public PagedChangeSetAggregator(System.IObservable> source) { } + public DynamicData.IObservableCache Data { get; } + public System.Exception? Error { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + } + public class SortedChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + { + public SortedChangeSetAggregator(System.IObservable> source) { } + public DynamicData.IObservableCache Data { get; } + public System.Exception? Error { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + } + public static class TestEx + { + public static DynamicData.Tests.DistinctChangeSetAggregator AsAggregator(this System.IObservable> source) + where TValue : notnull { } + public static DynamicData.Tests.ChangeSetAggregator AsAggregator(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Tests.PagedChangeSetAggregator AsAggregator(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Tests.SortedChangeSetAggregator AsAggregator(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Tests.VirtualChangeSetAggregator AsAggregator(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Tests.ChangeSetAggregator AsAggregator(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Tests.GroupChangeSetAggregator AsAggregator(this System.IObservable> source) + where TValue : notnull + where TKey : notnull + where TGroupKey : notnull { } + } + public class VirtualChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + { + public VirtualChangeSetAggregator(System.IObservable> source) { } + public DynamicData.IObservableCache Data { get; } + public System.Exception? Error { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + } +} \ No newline at end of file diff --git a/src/DynamicData.Tests/API/ApiApprovalTests.cs b/src/DynamicData.Tests/API/ApiApprovalTests.cs index 4799b73eb..7711d218f 100644 --- a/src/DynamicData.Tests/API/ApiApprovalTests.cs +++ b/src/DynamicData.Tests/API/ApiApprovalTests.cs @@ -1,6 +1,4 @@ using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; -using Xunit; namespace DynamicData.APITests { diff --git a/src/DynamicData.Tests/API/ApiExtensions.cs b/src/DynamicData.Tests/API/ApiExtensions.cs index cd465eb86..749aef265 100644 --- a/src/DynamicData.Tests/API/ApiExtensions.cs +++ b/src/DynamicData.Tests/API/ApiExtensions.cs @@ -1,10 +1,7 @@ -using System; -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.CompilerServices; -using System.Threading.Tasks; using PublicApiGenerator; -using VerifyXunit; namespace DynamicData.APITests; diff --git a/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs b/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs index 8610dbd7c..04456afbf 100644 --- a/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs @@ -1,13 +1,9 @@ -using System; - using DynamicData.Aggregation; using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.AggregationTests; public class AggregationFixture : IDisposable diff --git a/src/DynamicData.Tests/AggregationTests/AverageFixture.cs b/src/DynamicData.Tests/AggregationTests/AverageFixture.cs index 400461a92..1121228fa 100644 --- a/src/DynamicData.Tests/AggregationTests/AverageFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/AverageFixture.cs @@ -1,12 +1,8 @@ -using System; - using DynamicData.Aggregation; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.AggregationTests; public class AverageFixture : IDisposable diff --git a/src/DynamicData.Tests/AggregationTests/MaxFixture.cs b/src/DynamicData.Tests/AggregationTests/MaxFixture.cs index 89f274619..bcfbcfa2e 100644 --- a/src/DynamicData.Tests/AggregationTests/MaxFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/MaxFixture.cs @@ -1,12 +1,8 @@ -using System; - using DynamicData.Aggregation; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.AggregationTests; public class MaxFixture : IDisposable diff --git a/src/DynamicData.Tests/AggregationTests/MinFixture.cs b/src/DynamicData.Tests/AggregationTests/MinFixture.cs index 168babdbd..fd698998c 100644 --- a/src/DynamicData.Tests/AggregationTests/MinFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/MinFixture.cs @@ -1,12 +1,8 @@ -using System; - using DynamicData.Aggregation; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.AggregationTests; public class MinFixture : IDisposable diff --git a/src/DynamicData.Tests/AggregationTests/SumFixture.cs b/src/DynamicData.Tests/AggregationTests/SumFixture.cs index 6fecbcabc..e84bf1436 100644 --- a/src/DynamicData.Tests/AggregationTests/SumFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/SumFixture.cs @@ -1,12 +1,8 @@ -using System; - using DynamicData.Aggregation; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.AggregationTests; public class SumFixture : IDisposable diff --git a/src/DynamicData.Tests/AutoRefreshFilter.cs b/src/DynamicData.Tests/AutoRefreshFilter.cs index 81577cd92..ad12e8358 100644 --- a/src/DynamicData.Tests/AutoRefreshFilter.cs +++ b/src/DynamicData.Tests/AutoRefreshFilter.cs @@ -1,12 +1,8 @@ -using System; using System.Collections.ObjectModel; using System.ComponentModel; -using System.Linq; using DynamicData.Binding; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests; public class AutoRefreshFilter diff --git a/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs b/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs index e1407662d..daceaf39d 100644 --- a/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs +++ b/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs @@ -1,15 +1,11 @@ -using System; using System.Collections; -using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; -using System.Linq; -using DynamicData.Binding; +using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Binding; diff --git a/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs b/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs index cbc1e3e86..28e5549f7 100644 --- a/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs @@ -1,15 +1,11 @@ #if SUPPORTS_BINDINGLIST -using System; using System.ComponentModel; -using System.Linq; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding { public class BindingLIstBindListFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs b/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs index 5df6444f5..2dd593227 100644 --- a/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs @@ -1,15 +1,11 @@ #if SUPPORTS_BINDINGLIST -using System; using System.ComponentModel; -using System.Linq; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding { public class BindingListCacheFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs index 83cb29a78..0c12b0ea2 100644 --- a/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs @@ -1,17 +1,12 @@ #if SUPPORTS_BINDINGLIST -using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding { public class BindingListBindCacheSortedFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs index b9ab66157..f5e496996 100644 --- a/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs @@ -1,13 +1,9 @@ -using System; using System.ComponentModel; -using System.Linq; using DynamicData.Binding; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class BindingListToChangeSetFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs index 0dc2ff518..922ad531a 100644 --- a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs +++ b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs @@ -1,14 +1,9 @@ -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using DynamicData.Binding; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class DeeplyNestedNotifyPropertyChangedFixture diff --git a/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs index 2c01a256d..b2437bc6e 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - -using DynamicData.Binding; +using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class IObservableListBindCacheFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs index e769d81be..87238fb6b 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class IObservableListBindCacheSortedFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs index d08791e8d..83f132e06 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs @@ -1,14 +1,10 @@ -using System; using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class IObservableListBindListFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs b/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs index 2de2402f2..97dfb4eb5 100644 --- a/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs +++ b/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs @@ -1,17 +1,11 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; +using System.ComponentModel; using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class NotifyPropertyChangedExFixture diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs index d38ebf1b2..a548d5b39 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs @@ -1,15 +1,11 @@ -using System; using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class ObservableCollectionBindCacheFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs index 86ebfcce1..66d8abfc6 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs @@ -1,14 +1,10 @@ -using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Binding; diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs index 8e71766e3..c47157427 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class ObservableCollectionBindListFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs index a3d89a0d1..62e6aee50 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs @@ -1,13 +1,9 @@ -using System; using System.Collections.ObjectModel; -using System.Linq; using DynamicData.Binding; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class ObservableCollectionExtendedToChangeSetFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs index da7252cef..6dd2153b9 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs @@ -1,14 +1,10 @@ -using System; using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.Linq; using DynamicData.Binding; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class ObservableCollectionToChangeSetFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs index 13efc2a87..0effe981b 100644 --- a/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs @@ -1,14 +1,10 @@ -using System; using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.Linq; using DynamicData.Binding; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; public class ReadOnlyObservableCollectionToChangeSetFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs b/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs index 9194ee66c..b1a283432 100644 --- a/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs @@ -1,11 +1,8 @@ -using System; using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Binding; diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs index 48a60e35d..8f004155a 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs @@ -2,16 +2,12 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; using System.ComponentModel; using DynamicData.Binding; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; /// diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs index 4354bbf6e..6bc85c5e0 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs @@ -2,20 +2,12 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using DynamicData.Binding; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Binding; /// diff --git a/src/DynamicData.Tests/Cache/AndFixture.cs b/src/DynamicData.Tests/Cache/AndFixture.cs index 0f0ec2ad0..0861bef8b 100644 --- a/src/DynamicData.Tests/Cache/AndFixture.cs +++ b/src/DynamicData.Tests/Cache/AndFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class AndFixture : AndFixtureBase diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs index 68bf7489b..418472924 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs @@ -1,14 +1,7 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using DynamicData.Kernel; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public static partial class AsyncDisposeManyFixture diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs index 2e938e7cb..3dc65893c 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs @@ -1,15 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Cache.Internal; using DynamicData.Kernel; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public static partial class AsyncDisposeManyFixture diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs index 38da53d5d..959042438 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.cs @@ -1,7 +1,4 @@ -using System; -using System.Threading.Tasks; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AsyncDisposeManyFixture { diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs index ec3af62ae..06de9ce0c 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs index 135461be0..60290ea9d 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs @@ -1,11 +1,6 @@ -using System; -using System.Linq; using System.Linq.Expressions; using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs index e2847abe8..817619897 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs index 475399420..3ae75dad5 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs index d198a628e..0ea85b187 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs @@ -1,7 +1,4 @@ -using System; - using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs index 29b396f08..21321ca43 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs @@ -1,7 +1,4 @@ -using System; - using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs index f4ddfdbd7..34a4a3c83 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs @@ -1,6 +1,3 @@ -using System; -using System.Threading; - namespace DynamicData.Tests.Cache; public static partial class AutoRefreshOnObservableFixture diff --git a/src/DynamicData.Tests/Cache/BatchFixture.cs b/src/DynamicData.Tests/Cache/BatchFixture.cs index fba1312ab..c08f6219c 100644 --- a/src/DynamicData.Tests/Cache/BatchFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchFixture.cs @@ -1,11 +1,7 @@ -using System; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class BatchFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/BatchIfFixture.cs b/src/DynamicData.Tests/Cache/BatchIfFixture.cs index 698acdb3b..d09dd5f02 100644 --- a/src/DynamicData.Tests/Cache/BatchIfFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfFixture.cs @@ -1,11 +1,7 @@ -using System; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class BatchIfFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs index b9b033be0..33d78d1f9 100644 --- a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs @@ -1,11 +1,7 @@ -using System; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class BatchIfWithTimeoutFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/BufferInitialFixture.cs b/src/DynamicData.Tests/Cache/BufferInitialFixture.cs index b4426dd68..fd82bde5c 100644 --- a/src/DynamicData.Tests/Cache/BufferInitialFixture.cs +++ b/src/DynamicData.Tests/Cache/BufferInitialFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class BufferInitialFixture diff --git a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs index 0055de966..d5511b5e5 100644 --- a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs +++ b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs @@ -2,21 +2,12 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - using Bogus; using DynamicData.Binding; -using DynamicData.Kernel; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; /// diff --git a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs index 264bcebe8..d9fcc426a 100644 --- a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs +++ b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs @@ -2,17 +2,11 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Threading; -using System.Threading.Tasks; - using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; /// diff --git a/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs b/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs index 1e19ba079..490011ea7 100644 --- a/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs +++ b/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class DeferAnsdSkipFixture diff --git a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs index d12e2b345..0206fe515 100644 --- a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public sealed class DisposeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/DistinctFixture.cs b/src/DynamicData.Tests/Cache/DistinctFixture.cs index 4067b3b14..91b1dc838 100644 --- a/src/DynamicData.Tests/Cache/DistinctFixture.cs +++ b/src/DynamicData.Tests/Cache/DistinctFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class DistinctFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/DynamicAndFixture.cs b/src/DynamicData.Tests/Cache/DynamicAndFixture.cs index c9b79b545..5b3e34bb9 100644 --- a/src/DynamicData.Tests/Cache/DynamicAndFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicAndFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class DynamicAndFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs b/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs index 43a993e46..30478a420 100644 --- a/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class DynamicExceptFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/DynamicOrFixture.cs b/src/DynamicData.Tests/Cache/DynamicOrFixture.cs index d02c37649..70e4142b3 100644 --- a/src/DynamicData.Tests/Cache/DynamicOrFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicOrFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class DynamicOrFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/DynamicXorFixture.cs b/src/DynamicData.Tests/Cache/DynamicXorFixture.cs index e2e70119a..6900562df 100644 --- a/src/DynamicData.Tests/Cache/DynamicXorFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicXorFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class DynamicXorFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs index ad3b6d323..a732b2505 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class EditDiffChangeSetFixture diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs index 28b098834..9e5a2f291 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; -using System.Linq; using DynamicData.Kernel; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class EditDiffChangeSetOptionalFixture diff --git a/src/DynamicData.Tests/Cache/EditDiffFixture.cs b/src/DynamicData.Tests/Cache/EditDiffFixture.cs index da98c9aa0..c92b8e0ff 100644 --- a/src/DynamicData.Tests/Cache/EditDiffFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; +using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class EditDiffFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs b/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs index 236e0f5df..e0acc195b 100644 --- a/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs +++ b/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs @@ -1,9 +1,5 @@ -using System; -using System.Linq; using DynamicData.Tests.Domain; using FluentAssertions; -using Mono.Cecil; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ExceptFixture.cs b/src/DynamicData.Tests/Cache/ExceptFixture.cs index 17c4996e8..7ed527cf7 100644 --- a/src/DynamicData.Tests/Cache/ExceptFixture.cs +++ b/src/DynamicData.Tests/Cache/ExceptFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Collections.Generic; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class ExceptFixture : ExceptFixtureBase diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs index 17fda4c7e..a5108a6e9 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs @@ -1,16 +1,9 @@ -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; using Bogus; using FluentAssertions; -using Xunit; using Xunit.Abstractions; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Cache; public static partial class ExpireAfterFixture diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs index af667005c..121c3b8e8 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs @@ -1,14 +1,7 @@ -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; using Bogus; using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs index 7bb929de3..c5b2ee2d8 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs @@ -1,5 +1,3 @@ -using System; - namespace DynamicData.Tests.Cache; public static partial class ExpireAfterFixture diff --git a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs index 096886140..e3c7b4cca 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs index 57de70973..8028f7fc8 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs @@ -1,12 +1,5 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using Bogus; using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs index 4a7b3221f..3ce3f5e7f 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs index 1db36ea31..51e3f36b4 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs @@ -1,12 +1,5 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using Bogus; using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs index b530a9814..1e797bc96 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs index d99537010..a3004d95f 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs @@ -1,11 +1,5 @@ -using System.Linq; -using System.Threading.Tasks; - using Bogus; using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs index 7b50ab570..6ececdca8 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs index 36b1b2f30..464e7bb78 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs @@ -1,9 +1,4 @@ -using System; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.cs b/src/DynamicData.Tests/Cache/FilterFixture.cs index fa12f02ab..bace7bca4 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Linq; - using Bogus; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs index 0c9eea4b4..dd08677c4 100644 --- a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs @@ -1,8 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs b/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs index 7ed96e287..edbd7684f 100644 --- a/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs @@ -1,6 +1,4 @@ -using System.Linq; -using FluentAssertions; -using Xunit; +using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs index 6a95dfe9a..5965e450c 100644 --- a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterParallelFixture.cs b/src/DynamicData.Tests/Cache/FilterParallelFixture.cs index bc1411684..f7a0788b3 100644 --- a/src/DynamicData.Tests/Cache/FilterParallelFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterParallelFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - using DynamicData.PLinq; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class FilterParallelFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs b/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs index 1da5de03a..c33ec9d17 100644 --- a/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs +++ b/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Collections.Generic; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class ForEachChangeFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs index a4ddfa5f6..bc8b9a8a4 100644 --- a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs @@ -1,14 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class FromAsyncFixture diff --git a/src/DynamicData.Tests/Cache/FullJoinFixture.cs b/src/DynamicData.Tests/Cache/FullJoinFixture.cs index e290edcf1..5f60d6633 100644 --- a/src/DynamicData.Tests/Cache/FullJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/FullJoinFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Kernel; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class FullJoinFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs b/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs index 0a0c99c29..a2c2004e8 100644 --- a/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class FullJoinManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs index 0a3ce8d78..c28b20845 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class GroupControllerFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs index 702b81b99..cdec445ef 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class GroupControllerForFilteredItemsFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupFixture.cs b/src/DynamicData.Tests/Cache/GroupFixture.cs index 549b4476c..8a1de9adf 100644 --- a/src/DynamicData.Tests/Cache/GroupFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupFixture.cs @@ -1,14 +1,9 @@ -using System; -using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Linq; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class GroupFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs b/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs index b5f3292dc..a31488da8 100644 --- a/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class GroupFromDistinctFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs b/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs index 8640bccb7..f9395cfe7 100644 --- a/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; +using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class GroupImmutableFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs index b1b6357ef..86dcd4589 100644 --- a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; using Person = DynamicData.Tests.Domain.Person; diff --git a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs index 081515e58..f6332f08b 100644 --- a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using Bogus; using DynamicData.Binding; using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; using Person = DynamicData.Tests.Domain.Person; diff --git a/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs b/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs index 7af362118..de6107e80 100644 --- a/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; +using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class GroupOnPropertyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs b/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs index 2321b6e3c..523b4832d 100644 --- a/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; +using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class GroupOnPropertyWithImmutableStateFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs b/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs index 7223a17af..f43a2e60f 100644 --- a/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs @@ -1,11 +1,7 @@ -using System; - -using DynamicData.Tests.Domain; +using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class IgnoreUpdateFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs b/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs index 5895a7e71..b48f291e4 100644 --- a/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs @@ -1,11 +1,7 @@ -using System; - -using DynamicData.Tests.Domain; +using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class IncludeUpdateFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs index 487671be1..6bfc292e6 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs @@ -1,11 +1,5 @@ -using System; - -using DynamicData.Tests.Utilities; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class InnerJoinFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs index 28b264a7a..e95be5596 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs @@ -1,7 +1,3 @@ -using System; - -using Xunit; - namespace DynamicData.Tests.Cache; public class InnerJoinFixtureRaceCondition diff --git a/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs b/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs index 48196ae8c..25decc1cb 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class InnerJoinManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/KeyValueCollectionEx.cs b/src/DynamicData.Tests/Cache/KeyValueCollectionEx.cs index d8f46418e..f7f437f1c 100644 --- a/src/DynamicData.Tests/Cache/KeyValueCollectionEx.cs +++ b/src/DynamicData.Tests/Cache/KeyValueCollectionEx.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Linq; - namespace DynamicData.Tests.Cache; public static class KeyValueCollectionEx diff --git a/src/DynamicData.Tests/Cache/LeftJoinFixture.cs b/src/DynamicData.Tests/Cache/LeftJoinFixture.cs index eef5e30c2..8f0dd2242 100644 --- a/src/DynamicData.Tests/Cache/LeftJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/LeftJoinFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Kernel; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class LeftJoinFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs b/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs index 875c3249a..5ab8cf8c2 100644 --- a/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class LeftJoinManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs b/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs index 12d4e90b6..6f8de9e96 100644 --- a/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public sealed partial class MergeChangeSetsFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs index 18dad24f8..148af77d9 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs @@ -1,15 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public sealed class MergeManyChangeSetsCacheFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs index 095f8c954..b5ece67cd 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs @@ -1,15 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public sealed class MergeManyChangeSetsCacheSourceCompareFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs index 505540455..3e7b34018 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/MergeManyFixture.cs b/src/DynamicData.Tests/Cache/MergeManyFixture.cs index 8f449080a..568aad5e7 100644 --- a/src/DynamicData.Tests/Cache/MergeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyFixture.cs @@ -1,9 +1,5 @@ -using System; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class MergeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs index 7bf6bdc5f..7d2fba117 100644 --- a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs @@ -1,9 +1,5 @@ -using System; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class MergeManyItemsFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs index 6d98c9dc7..a39a947ef 100644 --- a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs @@ -1,9 +1,5 @@ -using System; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class MergeManyWithKeyOverloadFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs index 6f739aa69..cbd4848a7 100644 --- a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs +++ b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs @@ -1,11 +1,7 @@ -using System; - using DynamicData.Kernel; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class MonitorStatusFixture diff --git a/src/DynamicData.Tests/Cache/ObservableCachePreviewFixture.cs b/src/DynamicData.Tests/Cache/ObservableCachePreviewFixture.cs index 801b03040..781cd1c78 100644 --- a/src/DynamicData.Tests/Cache/ObservableCachePreviewFixture.cs +++ b/src/DynamicData.Tests/Cache/ObservableCachePreviewFixture.cs @@ -1,9 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using Xunit; +using DynamicData.Tests.Domain; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs index 45cfebd7e..29e10c887 100644 --- a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Threading.Tasks; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class ObservableChangeSetFixture diff --git a/src/DynamicData.Tests/Cache/OfTypeFixture.cs b/src/DynamicData.Tests/Cache/OfTypeFixture.cs index ec38a0629..2353f2c0f 100644 --- a/src/DynamicData.Tests/Cache/OfTypeFixture.cs +++ b/src/DynamicData.Tests/Cache/OfTypeFixture.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Bogus; +using Bogus; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; using Xunit.Abstractions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/OnItemFixture.cs b/src/DynamicData.Tests/Cache/OnItemFixture.cs index 76a4f1045..d3b5efea2 100644 --- a/src/DynamicData.Tests/Cache/OnItemFixture.cs +++ b/src/DynamicData.Tests/Cache/OnItemFixture.cs @@ -1,11 +1,8 @@ -using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/OrFixture.cs b/src/DynamicData.Tests/Cache/OrFixture.cs index 720d3f0b4..4b5f1bc63 100644 --- a/src/DynamicData.Tests/Cache/OrFixture.cs +++ b/src/DynamicData.Tests/Cache/OrFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class OrFixture : OrFixtureBase diff --git a/src/DynamicData.Tests/Cache/PageFixture.cs b/src/DynamicData.Tests/Cache/PageFixture.cs index 7d3762f40..af38365e6 100644 --- a/src/DynamicData.Tests/Cache/PageFixture.cs +++ b/src/DynamicData.Tests/Cache/PageFixture.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class PageFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs b/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs index 67f626b86..4c1736af0 100644 --- a/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs +++ b/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs @@ -1,11 +1,7 @@ -using System; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class QueryWhenChangedFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/RefCountFixture.cs b/src/DynamicData.Tests/Cache/RefCountFixture.cs index 2b2c040e6..82117f2eb 100644 --- a/src/DynamicData.Tests/Cache/RefCountFixture.cs +++ b/src/DynamicData.Tests/Cache/RefCountFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class RefCountFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/RightJoinFixture.cs b/src/DynamicData.Tests/Cache/RightJoinFixture.cs index b415002bd..7c34624a1 100644 --- a/src/DynamicData.Tests/Cache/RightJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Kernel; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class RightJoinFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs b/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs index 08a42da17..2cbf2c1f1 100644 --- a/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class RightJoinManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SizeLimitFixture.cs b/src/DynamicData.Tests/Cache/SizeLimitFixture.cs index 1960aa98e..89ea1c9b9 100644 --- a/src/DynamicData.Tests/Cache/SizeLimitFixture.cs +++ b/src/DynamicData.Tests/Cache/SizeLimitFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class SizeLimitFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs index 851de7a08..2fc9e8851 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs @@ -1,13 +1,9 @@ -using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs index b0afb853f..a38019635 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs index 2ea3dbd8b..d658579b9 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs @@ -1,11 +1,6 @@ - -using System; -using System.Collections.Generic; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs index a15a000d8..b76fec1a0 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs index 9b841218f..5e0236cd5 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs index e9ba5da10..3f8a0ef20 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs @@ -1,11 +1,6 @@ - -using System; -using System.Collections.Generic; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortFixture.cs b/src/DynamicData.Tests/Cache/SortFixture.cs index 5ee4ff10a..7225b38c0 100644 --- a/src/DynamicData.Tests/Cache/SortFixture.cs +++ b/src/DynamicData.Tests/Cache/SortFixture.cs @@ -1,17 +1,11 @@ #region -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Binding; using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - #endregion namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs index 621b1fbc2..6b84eaf0a 100644 --- a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs +++ b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class SortObservableFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SourceCacheFixture.cs b/src/DynamicData.Tests/Cache/SourceCacheFixture.cs index 3dda8598d..2c6a994ff 100644 --- a/src/DynamicData.Tests/Cache/SourceCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/SourceCacheFixture.cs @@ -1,15 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class SourceCacheFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs b/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs index 323c1e7ca..3f9ab50fc 100644 --- a/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class SubscribeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs index f8d4a74a5..db4caf6d4 100644 --- a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs +++ b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using DynamicData.Kernel; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public sealed class SuspendNotificationsFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SwitchFixture.cs b/src/DynamicData.Tests/Cache/SwitchFixture.cs index d8cb7fcff..f47c848c5 100644 --- a/src/DynamicData.Tests/Cache/SwitchFixture.cs +++ b/src/DynamicData.Tests/Cache/SwitchFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class SwitchFixture diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs index edf278399..21af540f6 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs index 40c3af69c..5194c123c 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 595c4119d..ca189eef1 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs index b5bea808a..54ddc575b 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.cs index c1239a1d8..6de05c9c4 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture { diff --git a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs index 8a6f29e29..557f35105 100644 --- a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Threading.Tasks; using DynamicData.Kernel; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class ToObservableOptionalFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs b/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs index 601c97598..6bf6cfd4d 100644 --- a/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs +++ b/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class ToSortedCollectionFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs index e281af462..1bf3addaf 100644 --- a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs @@ -1,11 +1,7 @@ -using System; using System.Collections.ObjectModel; -using System.Linq; -using System.Threading.Tasks; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/TransformFixture.cs b/src/DynamicData.Tests/Cache/TransformFixture.cs index 740f98e28..90ea20898 100644 --- a/src/DynamicData.Tests/Cache/TransformFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformFixture diff --git a/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs b/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs index 5ff66a0d0..ddfa21db9 100644 --- a/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs +++ b/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - using DynamicData.PLinq; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformFixtureParallel : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs index 4116d0af0..d56767612 100644 --- a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs @@ -1,8 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs index 9c95f66e9..5895fa910 100644 --- a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Linq; -using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/TransformManyFixture.cs b/src/DynamicData.Tests/Cache/TransformManyFixture.cs index fdfe3a1dd..01f2aea91 100644 --- a/src/DynamicData.Tests/Cache/TransformManyFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyFixture.cs @@ -1,12 +1,7 @@ -using System; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; +using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs b/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs index f0dd5de25..ae3c2a760 100644 --- a/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs @@ -1,13 +1,9 @@ -using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformManyObservableCollectionFixture diff --git a/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs b/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs index 6d14af74c..15aa2bfe7 100644 --- a/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Tests.Domain; +using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformManyRefreshFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs b/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs index 409436e1b..1e6bdaf05 100644 --- a/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs @@ -1,11 +1,7 @@ -using System; - -using DynamicData.Tests.Domain; +using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformManySimpleFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs index 5253e0638..9861b5443 100644 --- a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs @@ -1,15 +1,9 @@ -using System; -using System.Linq; -using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformOnObservableFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs index 64fc6463b..eb1d76daf 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using DynamicData.Cache; using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/TransformSafeFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeFixture.cs index cd9aabc7d..ca0a77c00 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeFixture.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformSafeFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs index dace5e75d..c1778fea9 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformSafeParallelFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs index fab7da98b..90e4174e8 100644 --- a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformTreeFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs b/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs index 68748a69b..2233d1b64 100644 --- a/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Binding; +using DynamicData.Binding; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformTreeWithRefreshFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs b/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs index ff39c18f3..d9137c699 100644 --- a/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs @@ -1,11 +1,7 @@ -using System; -using System.Linq; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TransformWithInlineUpdateFixture diff --git a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs index e3cec45ea..e4b3fd66e 100644 --- a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs @@ -1,9 +1,5 @@ -using System; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TrueForAllFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs index cdf3b352c..b28997552 100644 --- a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs @@ -1,11 +1,5 @@ -using System; - -using DynamicData.Tests.Utilities; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class TrueForAnyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/WatchFixture.cs b/src/DynamicData.Tests/Cache/WatchFixture.cs index 6cc1116b3..d2f6cc202 100644 --- a/src/DynamicData.Tests/Cache/WatchFixture.cs +++ b/src/DynamicData.Tests/Cache/WatchFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class WatchFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/WatcherFixture.cs b/src/DynamicData.Tests/Cache/WatcherFixture.cs index 1173dcef4..419029f87 100644 --- a/src/DynamicData.Tests/Cache/WatcherFixture.cs +++ b/src/DynamicData.Tests/Cache/WatcherFixture.cs @@ -1,16 +1,10 @@ #region -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Experimental; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - #endregion namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/XorFixture.cs b/src/DynamicData.Tests/Cache/XorFixture.cs index 8a320430a..1159996e2 100644 --- a/src/DynamicData.Tests/Cache/XorFixture.cs +++ b/src/DynamicData.Tests/Cache/XorFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Collections.Generic; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public class XOrFixture : XOrFixtureBase diff --git a/src/DynamicData.Tests/Domain/Animal.cs b/src/DynamicData.Tests/Domain/Animal.cs index 744b058ee..141356077 100644 --- a/src/DynamicData.Tests/Domain/Animal.cs +++ b/src/DynamicData.Tests/Domain/Animal.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading; +using System.Diagnostics.CodeAnalysis; using DynamicData.Binding; namespace DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Domain/AnimalOwner.cs b/src/DynamicData.Tests/Domain/AnimalOwner.cs index ad3a49556..cde56097c 100644 --- a/src/DynamicData.Tests/Domain/AnimalOwner.cs +++ b/src/DynamicData.Tests/Domain/AnimalOwner.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections; using System.Collections.ObjectModel; using DynamicData.Binding; diff --git a/src/DynamicData.Tests/Domain/Fakers.cs b/src/DynamicData.Tests/Domain/Fakers.cs index 720b74565..fc828e702 100644 --- a/src/DynamicData.Tests/Domain/Fakers.cs +++ b/src/DynamicData.Tests/Domain/Fakers.cs @@ -1,7 +1,4 @@ -using System; -using System.Linq; -using Bogus; -using DynamicData.Tests.Utilities; +using Bogus; namespace DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Domain/Market.cs b/src/DynamicData.Tests/Domain/Market.cs index 78bc1b762..5306022e9 100644 --- a/src/DynamicData.Tests/Domain/Market.cs +++ b/src/DynamicData.Tests/Domain/Market.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Threading; using DynamicData.Kernel; -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Domain/MarketPrice.cs b/src/DynamicData.Tests/Domain/MarketPrice.cs index f8fb2c6ad..c2ef85ab5 100644 --- a/src/DynamicData.Tests/Domain/MarketPrice.cs +++ b/src/DynamicData.Tests/Domain/MarketPrice.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using Bogus; diff --git a/src/DynamicData.Tests/Domain/ParentAndChildren.cs b/src/DynamicData.Tests/Domain/ParentAndChildren.cs index 746d45fa9..ef371598a 100644 --- a/src/DynamicData.Tests/Domain/ParentAndChildren.cs +++ b/src/DynamicData.Tests/Domain/ParentAndChildren.cs @@ -1,6 +1,4 @@ -using System; - -using DynamicData.Kernel; +using DynamicData.Kernel; namespace DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Domain/Person.cs b/src/DynamicData.Tests/Domain/Person.cs index bca018cb6..fca3a2220 100644 --- a/src/DynamicData.Tests/Domain/Person.cs +++ b/src/DynamicData.Tests/Domain/Person.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Binding; +using DynamicData.Binding; namespace DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Domain/PersonObs.cs b/src/DynamicData.Tests/Domain/PersonObs.cs index adc86d977..2756134f2 100644 --- a/src/DynamicData.Tests/Domain/PersonObs.cs +++ b/src/DynamicData.Tests/Domain/PersonObs.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - namespace DynamicData.Tests.Domain; [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1001:Types that own disposable fields should be disposable", Justification = "Acceptable in test.")] diff --git a/src/DynamicData.Tests/Domain/PersonWithChildren.cs b/src/DynamicData.Tests/Domain/PersonWithChildren.cs index 9930cf7cb..d9eca2f3c 100644 --- a/src/DynamicData.Tests/Domain/PersonWithChildren.cs +++ b/src/DynamicData.Tests/Domain/PersonWithChildren.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Linq; - namespace DynamicData.Tests.Domain; public class PersonWithChildren : IKey diff --git a/src/DynamicData.Tests/Domain/PersonWithEmployment.cs b/src/DynamicData.Tests/Domain/PersonWithEmployment.cs index c95e9ce75..18c2e3a44 100644 --- a/src/DynamicData.Tests/Domain/PersonWithEmployment.cs +++ b/src/DynamicData.Tests/Domain/PersonWithEmployment.cs @@ -1,5 +1,3 @@ -using System; - namespace DynamicData.Tests.Domain; public class PersonWithEmployment(IGroup source) : IDisposable diff --git a/src/DynamicData.Tests/Domain/PersonWithFriends.cs b/src/DynamicData.Tests/Domain/PersonWithFriends.cs index 43db20717..ab78e321b 100644 --- a/src/DynamicData.Tests/Domain/PersonWithFriends.cs +++ b/src/DynamicData.Tests/Domain/PersonWithFriends.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Linq; - using DynamicData.Binding; namespace DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/Domain/PersonWithGender.cs b/src/DynamicData.Tests/Domain/PersonWithGender.cs index dc4ac6c09..1276dadd2 100644 --- a/src/DynamicData.Tests/Domain/PersonWithGender.cs +++ b/src/DynamicData.Tests/Domain/PersonWithGender.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public record PersonWithAgeGroup(Person Person, string AgeGroup); public class PersonWithGender : IEquatable diff --git a/src/DynamicData.Tests/Domain/PersonWithRelations.cs b/src/DynamicData.Tests/Domain/PersonWithRelations.cs index f488865f5..6e9103f9c 100644 --- a/src/DynamicData.Tests/Domain/PersonWithRelations.cs +++ b/src/DynamicData.Tests/Domain/PersonWithRelations.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Linq; - namespace DynamicData.Tests.Domain; public class PersonWithRelations : IKey diff --git a/src/DynamicData.Tests/Domain/RandomPersonGenerator.cs b/src/DynamicData.Tests/Domain/RandomPersonGenerator.cs index 77a799667..9094f2c76 100644 --- a/src/DynamicData.Tests/Domain/RandomPersonGenerator.cs +++ b/src/DynamicData.Tests/Domain/RandomPersonGenerator.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public class RandomPersonGenerator { diff --git a/src/DynamicData.Tests/Domain/SelfObservingPerson.cs b/src/DynamicData.Tests/Domain/SelfObservingPerson.cs index e59c64130..65da4e13a 100644 --- a/src/DynamicData.Tests/Domain/SelfObservingPerson.cs +++ b/src/DynamicData.Tests/Domain/SelfObservingPerson.cs @@ -1,5 +1,3 @@ -using System; - namespace DynamicData.Tests.Domain; public class SelfObservingPerson : IDisposable diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index c0014e5e3..8b8aff702 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -1,6 +1,6 @@  - net9.0 + net10.0 $(NoWarn);CS0618;CA1801;CA1812;CA1816;CA1062;CA1063;CS8767;CS8602;CS8618;IDE1006 2.* diff --git a/src/DynamicData.Tests/EnumerableExFixtures.cs b/src/DynamicData.Tests/EnumerableExFixtures.cs index d25cc8325..d0d271dce 100644 --- a/src/DynamicData.Tests/EnumerableExFixtures.cs +++ b/src/DynamicData.Tests/EnumerableExFixtures.cs @@ -1,11 +1,7 @@ -using System; - -using DynamicData.Tests.Domain; +using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests; public class EnumerableExFixtures diff --git a/src/DynamicData.Tests/EnumerableIListFixture.cs b/src/DynamicData.Tests/EnumerableIListFixture.cs index 2a0febc62..025f5678c 100644 --- a/src/DynamicData.Tests/EnumerableIListFixture.cs +++ b/src/DynamicData.Tests/EnumerableIListFixture.cs @@ -1,8 +1,5 @@ -using System; using DynamicData.Cache.Internal; -using System.Collections.Generic; using DynamicData.Kernel; -using Xunit; namespace DynamicData.Tests { diff --git a/src/DynamicData.Tests/IntegrationTestFixtureBase.cs b/src/DynamicData.Tests/IntegrationTestFixtureBase.cs index d28b8cf87..e7f7c91af 100644 --- a/src/DynamicData.Tests/IntegrationTestFixtureBase.cs +++ b/src/DynamicData.Tests/IntegrationTestFixtureBase.cs @@ -1,6 +1,4 @@ -using Xunit; - -namespace DynamicData.Tests; +namespace DynamicData.Tests; [Collection(CollectionName)] [CollectionDefinition(CollectionName, DisableParallelization = true)] diff --git a/src/DynamicData.Tests/Internal/BitsetFixture.cs b/src/DynamicData.Tests/Internal/BitsetFixture.cs index fd33ce09e..277f82e7c 100644 --- a/src/DynamicData.Tests/Internal/BitsetFixture.cs +++ b/src/DynamicData.Tests/Internal/BitsetFixture.cs @@ -2,9 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Internal; diff --git a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs index 75da93135..94df93b11 100644 --- a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs +++ b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs @@ -2,21 +2,10 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - using Bogus; -using DynamicData.Internal; -using DynamicData.Tests.Utilities; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Internal; /// diff --git a/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs b/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs index 3062e331f..0af364964 100644 --- a/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs +++ b/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs @@ -1,13 +1,5 @@ -using System; using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using DynamicData.Internal; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Internal; diff --git a/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs b/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs index 2296564ef..18a231a7e 100644 --- a/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs +++ b/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs @@ -2,12 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Collections.Generic; - -using DynamicData.Internal; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Internal; diff --git a/src/DynamicData.Tests/Internal/NotificationFixture.cs b/src/DynamicData.Tests/Internal/NotificationFixture.cs index 7df92b5bc..7b3da7b1b 100644 --- a/src/DynamicData.Tests/Internal/NotificationFixture.cs +++ b/src/DynamicData.Tests/Internal/NotificationFixture.cs @@ -2,11 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; - -using DynamicData.Internal; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Internal; diff --git a/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs b/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs index e67444cb6..4601f4136 100644 --- a/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs +++ b/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs @@ -2,16 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using DynamicData.Internal; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Internal; diff --git a/src/DynamicData.Tests/Internal/SwappableLockFixture.cs b/src/DynamicData.Tests/Internal/SwappableLockFixture.cs index 4b3bd980e..47f34133d 100644 --- a/src/DynamicData.Tests/Internal/SwappableLockFixture.cs +++ b/src/DynamicData.Tests/Internal/SwappableLockFixture.cs @@ -2,10 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System; -using System.Threading; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Internal; diff --git a/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs b/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs index ed68a55ed..5ce83dc8f 100644 --- a/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs +++ b/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs @@ -1,7 +1,6 @@ using System.Collections.ObjectModel; using DynamicData.Binding; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.Issues { diff --git a/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs b/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs index d2e62b888..dc8c801bb 100644 --- a/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs +++ b/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using DynamicData.Binding; -using Xunit; namespace DynamicData.Tests.Issues { diff --git a/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs b/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs index 438e1bd5f..109031dd5 100644 --- a/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs +++ b/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs @@ -1,12 +1,8 @@ -using System.Linq; - -using DynamicData.Cache.Internal; +using DynamicData.Cache.Internal; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Kernal; public class CacheUpdaterFixture diff --git a/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs b/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs index e7850ce8b..5321cfd1b 100644 --- a/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs +++ b/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs @@ -1,12 +1,8 @@ -using System; - -using DynamicData.Kernel; +using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Kernal; public class DistinctUpdateFixture diff --git a/src/DynamicData.Tests/Kernal/EnumerableEx.cs b/src/DynamicData.Tests/Kernal/EnumerableEx.cs index 315c392bb..8bc6d7f9e 100644 --- a/src/DynamicData.Tests/Kernal/EnumerableEx.cs +++ b/src/DynamicData.Tests/Kernal/EnumerableEx.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - namespace DynamicData.Tests.Cache; public static class EnumerableEx diff --git a/src/DynamicData.Tests/Kernal/KeyValueFixture.cs b/src/DynamicData.Tests/Kernal/KeyValueFixture.cs index ead9fb9da..4c11f17b2 100644 --- a/src/DynamicData.Tests/Kernal/KeyValueFixture.cs +++ b/src/DynamicData.Tests/Kernal/KeyValueFixture.cs @@ -1,11 +1,7 @@ -using System.Collections.Generic; - -using DynamicData.Tests.Domain; +using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Kernal; public class KeyValueFixture diff --git a/src/DynamicData.Tests/Kernal/OptionFixture.cs b/src/DynamicData.Tests/Kernal/OptionFixture.cs index e93c17e0b..6ee3f8c26 100644 --- a/src/DynamicData.Tests/Kernal/OptionFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionFixture.cs @@ -1,12 +1,9 @@ -using System; -using System.Globalization; +using System.Globalization; using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Kernal; public class OptionFixture diff --git a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs index 302ed7731..180ddecf6 100644 --- a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; using DynamicData.Kernel; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Kernal; public class OptionObservableFixture diff --git a/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs b/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs index 45c6f965e..cb6ff2452 100644 --- a/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs +++ b/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs @@ -1,12 +1,8 @@ -using System.Linq; - using DynamicData.Cache.Internal; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Kernal; public class SourceUpdaterFixture diff --git a/src/DynamicData.Tests/Kernal/UpdateFixture.cs b/src/DynamicData.Tests/Kernal/UpdateFixture.cs index 3431a2b9a..698f5c245 100644 --- a/src/DynamicData.Tests/Kernal/UpdateFixture.cs +++ b/src/DynamicData.Tests/Kernal/UpdateFixture.cs @@ -1,12 +1,8 @@ -using System; - -using DynamicData.Kernel; +using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Kernal; public class UpdateFixture diff --git a/src/DynamicData.Tests/List/AndFixture.cs b/src/DynamicData.Tests/List/AndFixture.cs index 1d18596ad..e50a2738a 100644 --- a/src/DynamicData.Tests/List/AndFixture.cs +++ b/src/DynamicData.Tests/List/AndFixture.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class AndFixture : AndFixtureBase diff --git a/src/DynamicData.Tests/List/AutoRefreshFixture.cs b/src/DynamicData.Tests/List/AutoRefreshFixture.cs index 1d5dd5cd5..6f739ee7b 100644 --- a/src/DynamicData.Tests/List/AutoRefreshFixture.cs +++ b/src/DynamicData.Tests/List/AutoRefreshFixture.cs @@ -1,14 +1,9 @@ -using System; -using System.Linq; - using DynamicData.Binding; using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class AutoRefreshFixture diff --git a/src/DynamicData.Tests/List/BatchFixture.cs b/src/DynamicData.Tests/List/BatchFixture.cs index 95f200a0c..02112b680 100644 --- a/src/DynamicData.Tests/List/BatchFixture.cs +++ b/src/DynamicData.Tests/List/BatchFixture.cs @@ -1,11 +1,7 @@ -using System; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class BatchFixture : IDisposable diff --git a/src/DynamicData.Tests/List/BatchIfFixture.cs b/src/DynamicData.Tests/List/BatchIfFixture.cs index 838f099aa..d879aa429 100644 --- a/src/DynamicData.Tests/List/BatchIfFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfFixture.cs @@ -1,11 +1,7 @@ -using System; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class BatchIfFixture : IDisposable diff --git a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs index c0b8e256f..8acfa45b4 100644 --- a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs @@ -1,11 +1,7 @@ -using System; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class BatchIfWithTimeOutFixture : IDisposable diff --git a/src/DynamicData.Tests/List/BufferFixture.cs b/src/DynamicData.Tests/List/BufferFixture.cs index e80a77583..cdeadca71 100644 --- a/src/DynamicData.Tests/List/BufferFixture.cs +++ b/src/DynamicData.Tests/List/BufferFixture.cs @@ -1,11 +1,7 @@ -using System; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class BufferFixture : IDisposable diff --git a/src/DynamicData.Tests/List/BufferInitialFixture.cs b/src/DynamicData.Tests/List/BufferInitialFixture.cs index 49fc76ff6..71a49efb6 100644 --- a/src/DynamicData.Tests/List/BufferInitialFixture.cs +++ b/src/DynamicData.Tests/List/BufferInitialFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class BufferInitialFixture diff --git a/src/DynamicData.Tests/List/CastFixture.cs b/src/DynamicData.Tests/List/CastFixture.cs index f6a5ac9f9..f64f0c6ae 100644 --- a/src/DynamicData.Tests/List/CastFixture.cs +++ b/src/DynamicData.Tests/List/CastFixture.cs @@ -1,9 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; +using FluentAssertions; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/ChangeAwareListFixture.cs b/src/DynamicData.Tests/List/ChangeAwareListFixture.cs index c8b65086c..6738ce704 100644 --- a/src/DynamicData.Tests/List/ChangeAwareListFixture.cs +++ b/src/DynamicData.Tests/List/ChangeAwareListFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; +using DynamicData.Kernel; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class ChangeAwareListFixture diff --git a/src/DynamicData.Tests/List/ChangeSetFixture.cs b/src/DynamicData.Tests/List/ChangeSetFixture.cs index 28027926d..65871c778 100644 --- a/src/DynamicData.Tests/List/ChangeSetFixture.cs +++ b/src/DynamicData.Tests/List/ChangeSetFixture.cs @@ -1,19 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Management; -using System.Reflection; -using System.Threading.Channels; - -using Argon; - -using Bogus; +using Bogus; using FluentAssertions; - -using Xunit; using Xunit.Abstractions; -using Xunit.Sdk; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/CloneChangesFixture.cs b/src/DynamicData.Tests/List/CloneChangesFixture.cs index b043cf78f..0df1a8ab1 100644 --- a/src/DynamicData.Tests/List/CloneChangesFixture.cs +++ b/src/DynamicData.Tests/List/CloneChangesFixture.cs @@ -1,13 +1,9 @@ -using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Linq; using DynamicData.Kernel; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class CloneChangesFixture diff --git a/src/DynamicData.Tests/List/CloneFixture.cs b/src/DynamicData.Tests/List/CloneFixture.cs index 4e050e305..2ff993d73 100644 --- a/src/DynamicData.Tests/List/CloneFixture.cs +++ b/src/DynamicData.Tests/List/CloneFixture.cs @@ -1,14 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; +using System.Collections.ObjectModel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class CloneFixture : IDisposable diff --git a/src/DynamicData.Tests/List/CreationFixtures.cs b/src/DynamicData.Tests/List/CreationFixtures.cs index e2abea91c..59a50ed02 100644 --- a/src/DynamicData.Tests/List/CreationFixtures.cs +++ b/src/DynamicData.Tests/List/CreationFixtures.cs @@ -1,10 +1,5 @@ -using System; -using System.Threading.Tasks; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class ListCreationFixtures diff --git a/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs b/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs index 1f8f725b3..511c6b2e8 100644 --- a/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs +++ b/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class DeferAnsdSkipFixture diff --git a/src/DynamicData.Tests/List/DisposeManyFixture.cs b/src/DynamicData.Tests/List/DisposeManyFixture.cs index eaeeb7719..d846e62b2 100644 --- a/src/DynamicData.Tests/List/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/List/DisposeManyFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public sealed class DisposeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/DistinctValuesFixture.cs b/src/DynamicData.Tests/List/DistinctValuesFixture.cs index 1a7bcf214..8e4cb69b5 100644 --- a/src/DynamicData.Tests/List/DistinctValuesFixture.cs +++ b/src/DynamicData.Tests/List/DistinctValuesFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class DistinctValuesFixture : IDisposable diff --git a/src/DynamicData.Tests/List/DynamicAndFixture.cs b/src/DynamicData.Tests/List/DynamicAndFixture.cs index 7ae39e813..4dd537e36 100644 --- a/src/DynamicData.Tests/List/DynamicAndFixture.cs +++ b/src/DynamicData.Tests/List/DynamicAndFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class DynamicAndFixture : IDisposable diff --git a/src/DynamicData.Tests/List/DynamicExceptFixture.cs b/src/DynamicData.Tests/List/DynamicExceptFixture.cs index 3fbf868ef..a21f6ef56 100644 --- a/src/DynamicData.Tests/List/DynamicExceptFixture.cs +++ b/src/DynamicData.Tests/List/DynamicExceptFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class DynamicExceptFixture : IDisposable diff --git a/src/DynamicData.Tests/List/DynamicOrFixture.cs b/src/DynamicData.Tests/List/DynamicOrFixture.cs index 415c37330..6c0c3573f 100644 --- a/src/DynamicData.Tests/List/DynamicOrFixture.cs +++ b/src/DynamicData.Tests/List/DynamicOrFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class DynamicOrRefreshFixture diff --git a/src/DynamicData.Tests/List/DynamicXOrFixture.cs b/src/DynamicData.Tests/List/DynamicXOrFixture.cs index ef6326976..8ba52d4df 100644 --- a/src/DynamicData.Tests/List/DynamicXOrFixture.cs +++ b/src/DynamicData.Tests/List/DynamicXOrFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class DynamicXOrFixture : IDisposable diff --git a/src/DynamicData.Tests/List/EditDiffFixture.cs b/src/DynamicData.Tests/List/EditDiffFixture.cs index 3a96e6195..e111d479f 100644 --- a/src/DynamicData.Tests/List/EditDiffFixture.cs +++ b/src/DynamicData.Tests/List/EditDiffFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; +using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class EditDiffFixture : IDisposable diff --git a/src/DynamicData.Tests/List/ExceptFixture.cs b/src/DynamicData.Tests/List/ExceptFixture.cs index d74eff07b..5f449f19a 100644 --- a/src/DynamicData.Tests/List/ExceptFixture.cs +++ b/src/DynamicData.Tests/List/ExceptFixture.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class ExceptFixture : ExceptFixtureBase diff --git a/src/DynamicData.Tests/List/ExpireAfterFixture.cs b/src/DynamicData.Tests/List/ExpireAfterFixture.cs index cafe64a5a..628fb9977 100644 --- a/src/DynamicData.Tests/List/ExpireAfterFixture.cs +++ b/src/DynamicData.Tests/List/ExpireAfterFixture.cs @@ -1,16 +1,9 @@ -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; using Bogus; using FluentAssertions; -using Xunit; using Xunit.Abstractions; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.List; public sealed class ExpireAfterFixture diff --git a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs index 3d84a2d1a..956dea5ae 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class FilterControllerFixtureWithClearAndReplace : IDisposable diff --git a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs index 8ee3ae5b6..05cac99df 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class FilterControllerFixtureWithDiffSet : IDisposable diff --git a/src/DynamicData.Tests/List/FilterFixture.Base.cs b/src/DynamicData.Tests/List/FilterFixture.Base.cs index c30d9978d..6b5e3e3e9 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Base.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/FilterFixture.Static.cs b/src/DynamicData.Tests/List/FilterFixture.Static.cs index ba1d65def..25093c311 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Static.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs index 60b66f1d3..d0373923d 100644 --- a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs +++ b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs @@ -1,14 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - using Bogus; using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; using Xunit.Abstractions; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/FilterOnObservableFixture.cs b/src/DynamicData.Tests/List/FilterOnObservableFixture.cs index 017613a52..af6027c45 100644 --- a/src/DynamicData.Tests/List/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/List/FilterOnObservableFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; //TODO: To optimise this, we need to introduce replace range, or specify a buffer diff --git a/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs b/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs index 9d9dbfe03..1eb73e62e 100644 --- a/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs +++ b/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class FilterOnPropertyFixture diff --git a/src/DynamicData.Tests/List/FilterWithObservable.cs b/src/DynamicData.Tests/List/FilterWithObservable.cs index adab80d75..975de33a0 100644 --- a/src/DynamicData.Tests/List/FilterWithObservable.cs +++ b/src/DynamicData.Tests/List/FilterWithObservable.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Aggregation; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class FilterWithObservable : IDisposable diff --git a/src/DynamicData.Tests/List/ForEachChangeFixture.cs b/src/DynamicData.Tests/List/ForEachChangeFixture.cs index 589397d31..1923aca5f 100644 --- a/src/DynamicData.Tests/List/ForEachChangeFixture.cs +++ b/src/DynamicData.Tests/List/ForEachChangeFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Collections.Generic; - using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class ForEachChangeFixture : IDisposable diff --git a/src/DynamicData.Tests/List/FromAsyncFixture.cs b/src/DynamicData.Tests/List/FromAsyncFixture.cs index 44cf625c7..f493fc7b0 100644 --- a/src/DynamicData.Tests/List/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/List/FromAsyncFixture.cs @@ -1,14 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class FromAsyncFixture diff --git a/src/DynamicData.Tests/List/GroupImmutableFixture.cs b/src/DynamicData.Tests/List/GroupImmutableFixture.cs index 9b59595b1..86830f535 100644 --- a/src/DynamicData.Tests/List/GroupImmutableFixture.cs +++ b/src/DynamicData.Tests/List/GroupImmutableFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class GroupImmutableFixture : IDisposable diff --git a/src/DynamicData.Tests/List/GroupOnFixture.cs b/src/DynamicData.Tests/List/GroupOnFixture.cs index 61164d3c3..317d290a3 100644 --- a/src/DynamicData.Tests/List/GroupOnFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class GroupOnFixture : IDisposable diff --git a/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs b/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs index aa9442888..12bbbfbea 100644 --- a/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; +using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class GroupOnPropertyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs b/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs index 0f55473d4..d155d1a38 100644 --- a/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; +using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class GroupOnPropertyWithImmutableStateFixture : IDisposable diff --git a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs index feae87d1a..f58d02ed6 100644 --- a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; using System.Collections.Concurrent; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs index b0a4aed14..47b18ffc0 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs @@ -1,15 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public sealed class MergeManyChangeSetsCacheFixture : IDisposable diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs index cb3ccdec1..0a3c4fb22 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs @@ -1,8 +1,5 @@ -using System.Linq; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class MergeManyChangeSetsFixture diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs index 1bb32d47b..1db956692 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/MergeManyFixture.cs b/src/DynamicData.Tests/List/MergeManyFixture.cs index 33185e9f3..1ea3079c6 100644 --- a/src/DynamicData.Tests/List/MergeManyFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyFixture.cs @@ -1,9 +1,5 @@ -using System; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class MergeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/OnItemAddedFixture.cs b/src/DynamicData.Tests/List/OnItemAddedFixture.cs index 81bfdebbb..553ee8e25 100644 --- a/src/DynamicData.Tests/List/OnItemAddedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemAddedFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs index df1e2a2da..5d0b88dac 100644 --- a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs index db904b030..596fd38a8 100644 --- a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/OrFixture.cs b/src/DynamicData.Tests/List/OrFixture.cs index c4c973aa2..8ea279a90 100644 --- a/src/DynamicData.Tests/List/OrFixture.cs +++ b/src/DynamicData.Tests/List/OrFixture.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using Xunit; +using FluentAssertions; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/PageFixture.cs b/src/DynamicData.Tests/List/PageFixture.cs index e9fb2942f..6918cd390 100644 --- a/src/DynamicData.Tests/List/PageFixture.cs +++ b/src/DynamicData.Tests/List/PageFixture.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class PageFixture : IDisposable diff --git a/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs b/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs index 49c5cd27e..6a4222ea6 100644 --- a/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs +++ b/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs @@ -1,11 +1,7 @@ -using System; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class QueryWhenChangedFixture : IDisposable diff --git a/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs b/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs index 1d79be23e..b5d725861 100644 --- a/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs +++ b/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs @@ -1,12 +1,7 @@ -using System; - using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class RecursiveTransformManyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/RefCountFixture.cs b/src/DynamicData.Tests/List/RefCountFixture.cs index 5d8eb9880..a72d0d81b 100644 --- a/src/DynamicData.Tests/List/RefCountFixture.cs +++ b/src/DynamicData.Tests/List/RefCountFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class RefCountFixture : IDisposable diff --git a/src/DynamicData.Tests/List/RemoveManyFixture.cs b/src/DynamicData.Tests/List/RemoveManyFixture.cs index b0809011e..f359a0b22 100644 --- a/src/DynamicData.Tests/List/RemoveManyFixture.cs +++ b/src/DynamicData.Tests/List/RemoveManyFixture.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class RemoveManyFixture diff --git a/src/DynamicData.Tests/List/ReverseFixture.cs b/src/DynamicData.Tests/List/ReverseFixture.cs index 68cb3685d..ed6f9ddf0 100644 --- a/src/DynamicData.Tests/List/ReverseFixture.cs +++ b/src/DynamicData.Tests/List/ReverseFixture.cs @@ -1,9 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; +using FluentAssertions; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/SelectFixture.cs b/src/DynamicData.Tests/List/SelectFixture.cs index 6fd4fe0f7..781dc9aa7 100644 --- a/src/DynamicData.Tests/List/SelectFixture.cs +++ b/src/DynamicData.Tests/List/SelectFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Linq; - -using DynamicData.Alias; +using DynamicData.Alias; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class SelectFixture : IDisposable diff --git a/src/DynamicData.Tests/List/SizeLimitFixture.cs b/src/DynamicData.Tests/List/SizeLimitFixture.cs index 265fe125e..db8376984 100644 --- a/src/DynamicData.Tests/List/SizeLimitFixture.cs +++ b/src/DynamicData.Tests/List/SizeLimitFixture.cs @@ -1,12 +1,7 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class SizeLimitFixture : IDisposable diff --git a/src/DynamicData.Tests/List/SortFixture.cs b/src/DynamicData.Tests/List/SortFixture.cs index fcf3a2aeb..038d47946 100644 --- a/src/DynamicData.Tests/List/SortFixture.cs +++ b/src/DynamicData.Tests/List/SortFixture.cs @@ -1,13 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; using DynamicData.Binding; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class SortChangedFixture diff --git a/src/DynamicData.Tests/List/SortMutableFixture.cs b/src/DynamicData.Tests/List/SortMutableFixture.cs index 73be51e2c..2bb9683e8 100644 --- a/src/DynamicData.Tests/List/SortMutableFixture.cs +++ b/src/DynamicData.Tests/List/SortMutableFixture.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Binding; using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class SortMutableFixture : IDisposable diff --git a/src/DynamicData.Tests/List/SortPrimitiveFixture.cs b/src/DynamicData.Tests/List/SortPrimitiveFixture.cs index d5e03c2a5..7fce7b389 100644 --- a/src/DynamicData.Tests/List/SortPrimitiveFixture.cs +++ b/src/DynamicData.Tests/List/SortPrimitiveFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Binding; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class SortPrimitiveFixture : IDisposable diff --git a/src/DynamicData.Tests/List/SourceListFixture.cs b/src/DynamicData.Tests/List/SourceListFixture.cs index 966cfb748..b4d2138a3 100644 --- a/src/DynamicData.Tests/List/SourceListFixture.cs +++ b/src/DynamicData.Tests/List/SourceListFixture.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/SourceListPreviewFixture.cs b/src/DynamicData.Tests/List/SourceListPreviewFixture.cs index cb61bbfb5..075711eae 100644 --- a/src/DynamicData.Tests/List/SourceListPreviewFixture.cs +++ b/src/DynamicData.Tests/List/SourceListPreviewFixture.cs @@ -1,9 +1,4 @@ -using System; -using System.Linq; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SourceListPreviewFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/SubscribeManyFixture.cs b/src/DynamicData.Tests/List/SubscribeManyFixture.cs index 744319e81..81936c649 100644 --- a/src/DynamicData.Tests/List/SubscribeManyFixture.cs +++ b/src/DynamicData.Tests/List/SubscribeManyFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class SubscribeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/SwitchFixture.cs b/src/DynamicData.Tests/List/SwitchFixture.cs index 5656e046a..4a4bdc502 100644 --- a/src/DynamicData.Tests/List/SwitchFixture.cs +++ b/src/DynamicData.Tests/List/SwitchFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class SwitchFixture : IDisposable diff --git a/src/DynamicData.Tests/List/ToCollectionFixture.cs b/src/DynamicData.Tests/List/ToCollectionFixture.cs index a2be60af8..6f1d283d1 100644 --- a/src/DynamicData.Tests/List/ToCollectionFixture.cs +++ b/src/DynamicData.Tests/List/ToCollectionFixture.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 57a3d3ddf..991c50961 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs index bb2baeddb..3dc4585a0 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 314d02584..08ee5bf74 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs index 4c5a06081..7dbf8bb0a 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.cs index e42998264..351fb6450 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture { diff --git a/src/DynamicData.Tests/List/TransformAsyncFixture.cs b/src/DynamicData.Tests/List/TransformAsyncFixture.cs index 9d0bdb447..6c5212584 100755 --- a/src/DynamicData.Tests/List/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/List/TransformAsyncFixture.cs @@ -1,10 +1,5 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/TransformFixture.cs b/src/DynamicData.Tests/List/TransformFixture.cs index c605bcd46..a5e7e3a7e 100644 --- a/src/DynamicData.Tests/List/TransformFixture.cs +++ b/src/DynamicData.Tests/List/TransformFixture.cs @@ -1,10 +1,6 @@ -using System; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/TransformManyFixture.cs b/src/DynamicData.Tests/List/TransformManyFixture.cs index caf8bc6c7..85429c207 100644 --- a/src/DynamicData.Tests/List/TransformManyFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyFixture.cs @@ -1,14 +1,9 @@ -using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class TransformManyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs b/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs index f713c1ee9..1a5b0a765 100644 --- a/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs @@ -1,13 +1,9 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; +using System.Collections.ObjectModel; using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class TransformManyObservableCollectionFixture diff --git a/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs b/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs index 49c34de51..eebef154f 100644 --- a/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs @@ -1,14 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; +using System.Collections.ObjectModel; using DynamicData.Binding; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class TransformManyProjectionFixture : IDisposable diff --git a/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs b/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs index f77aa95eb..e2dee4873 100644 --- a/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; - using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class TransformManyRefreshFixture : IDisposable diff --git a/src/DynamicData.Tests/List/VirtualisationFixture.cs b/src/DynamicData.Tests/List/VirtualisationFixture.cs index 9395ed1df..626502596 100644 --- a/src/DynamicData.Tests/List/VirtualisationFixture.cs +++ b/src/DynamicData.Tests/List/VirtualisationFixture.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using DynamicData.Tests.Domain; using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class VirtualisationFixture : IDisposable diff --git a/src/DynamicData.Tests/List/XOrFixture.cs b/src/DynamicData.Tests/List/XOrFixture.cs index 8f66b0d20..03a475f77 100644 --- a/src/DynamicData.Tests/List/XOrFixture.cs +++ b/src/DynamicData.Tests/List/XOrFixture.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.List; public class XOrFixture : XOrFixtureBase diff --git a/src/DynamicData.Tests/ObservableCollectionExFixture.cs b/src/DynamicData.Tests/ObservableCollectionExFixture.cs index d72b6cef9..bd46f394b 100644 --- a/src/DynamicData.Tests/ObservableCollectionExFixture.cs +++ b/src/DynamicData.Tests/ObservableCollectionExFixture.cs @@ -5,8 +5,6 @@ using FluentAssertions; -using Xunit; - namespace DynamicData.Tests; public class ObservableCollectionExFixture diff --git a/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs b/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs index bb4e7cb3f..58a5f5760 100644 --- a/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs +++ b/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; +using FluentAssertions; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs index b83efea61..4ad7df3e2 100644 --- a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace DynamicData.Tests.Utilities; public sealed class CacheItemRecordingObserver diff --git a/src/DynamicData.Tests/Utilities/ComparerExtensions.cs b/src/DynamicData.Tests/Utilities/ComparerExtensions.cs index a88101be6..efdc80bab 100644 --- a/src/DynamicData.Tests/Utilities/ComparerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ComparerExtensions.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/FakeScheduler.cs b/src/DynamicData.Tests/Utilities/FakeScheduler.cs index 27fcc9d35..99fb5e5dd 100644 --- a/src/DynamicData.Tests/Utilities/FakeScheduler.cs +++ b/src/DynamicData.Tests/Utilities/FakeScheduler.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.Diagnostics; -using ReactiveUI.Primitives.Concurrency; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/FakerExtensions.cs b/src/DynamicData.Tests/Utilities/FakerExtensions.cs index 69b182381..762781528 100644 --- a/src/DynamicData.Tests/Utilities/FakerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/FakerExtensions.cs @@ -1,5 +1,3 @@ -using System; -using System.Linq; using Bogus; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/FunctionalExtensions.cs b/src/DynamicData.Tests/Utilities/FunctionalExtensions.cs index cb3c819cf..bce089232 100644 --- a/src/DynamicData.Tests/Utilities/FunctionalExtensions.cs +++ b/src/DynamicData.Tests/Utilities/FunctionalExtensions.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class FunctionalExtensions { diff --git a/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs b/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs index d0b336e16..608fbced0 100644 --- a/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs +++ b/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; +using FluentAssertions; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs b/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs index 1574dab88..b9ccb2a5b 100644 --- a/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace DynamicData.Tests.Utilities; public sealed class ListItemRecordingObserver diff --git a/src/DynamicData.Tests/Utilities/ObservableEx.cs b/src/DynamicData.Tests/Utilities/ObservableEx.cs index e4757bf34..d6b33927e 100644 --- a/src/DynamicData.Tests/Utilities/ObservableEx.cs +++ b/src/DynamicData.Tests/Utilities/ObservableEx.cs @@ -1,5 +1,3 @@ -using System; - namespace DynamicData.Tests.Utilities; /// diff --git a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs index d30838837..a38dc868d 100644 --- a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Threading; - using FluentAssertions; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/ObservableSpy.cs b/src/DynamicData.Tests/Utilities/ObservableSpy.cs index 85fa90cf7..3108eeef1 100644 --- a/src/DynamicData.Tests/Utilities/ObservableSpy.cs +++ b/src/DynamicData.Tests/Utilities/ObservableSpy.cs @@ -1,7 +1,4 @@ -using System; -using System.Linq; using System.Runtime.InteropServices; -using System.Threading; using Xunit.Abstractions; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs b/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs index 5108d9116..ad27a89a7 100644 --- a/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs @@ -1,4 +1,3 @@ -using System; using System.Diagnostics; using Bogus; diff --git a/src/DynamicData.Tests/Utilities/RawAnonymousObservable.cs b/src/DynamicData.Tests/Utilities/RawAnonymousObservable.cs index 06168b009..618ec6922 100644 --- a/src/DynamicData.Tests/Utilities/RawAnonymousObservable.cs +++ b/src/DynamicData.Tests/Utilities/RawAnonymousObservable.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class RawAnonymousObservable { diff --git a/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs b/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs index 0567e5676..b5ad8a843 100644 --- a/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs +++ b/src/DynamicData.Tests/Utilities/RawAnonymousObserver.cs @@ -1,6 +1,4 @@ -using System; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class RawAnonymousObserver { diff --git a/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs b/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs index a233ceb0f..cd8a51886 100644 --- a/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs +++ b/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.Diagnostics; -using ReactiveUI.Primitives.Concurrency; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs b/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs index 167ce5fce..4e62e06eb 100644 --- a/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs +++ b/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - namespace DynamicData.Tests.Utilities; // Using a custom implementing of IObserver<> to bypass normal RX safeguards, allowing invalid behaviors to be potentially tested for. diff --git a/src/DynamicData.Tests/Utilities/SelectManyExtensions.cs b/src/DynamicData.Tests/Utilities/SelectManyExtensions.cs index 61c5b3445..ebeb037fe 100644 --- a/src/DynamicData.Tests/Utilities/SelectManyExtensions.cs +++ b/src/DynamicData.Tests/Utilities/SelectManyExtensions.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; /// /// see http://www.superstarcoders.com/blogs/posts/recursive-select-in-c-sharp-and-linq.aspx diff --git a/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs b/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs index 918f1eceb..e433c4826 100644 --- a/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs +++ b/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs @@ -1,6 +1,3 @@ -using System; -using System.Linq; - namespace DynamicData.Tests.Utilities; internal static class StressAddRemoveExtensions diff --git a/src/DynamicData.Tests/Utilities/TestSourceCache.cs b/src/DynamicData.Tests/Utilities/TestSourceCache.cs index daa6c12f8..c3171bd8d 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceCache.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceCache.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - using DynamicData.Kernel; namespace DynamicData.Tests.Utilities; diff --git a/src/DynamicData.Tests/Utilities/TestSourceList.cs b/src/DynamicData.Tests/Utilities/TestSourceList.cs index 4abf8f481..d364fe0cf 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceList.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceList.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - namespace DynamicData.Tests.Utilities; public sealed class TestSourceList diff --git a/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs b/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs index f42f0a427..3af2c35a7 100644 --- a/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs +++ b/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs @@ -1,5 +1,3 @@ -using System; - namespace DynamicData.Tests.Utilities; public class UnsynchronizedNotificationException diff --git a/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs b/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs index 37bda848b..ffdbd3d75 100644 --- a/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace DynamicData.Tests.Utilities; public sealed class ValueRecordingObserver diff --git a/src/DynamicData.sln b/src/DynamicData.sln index e5ce72ac8..fca444658 100644 --- a/src/DynamicData.sln +++ b/src/DynamicData.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 -VisualStudioVersion = 18.1.11312.151 d18.0 +VisualStudioVersion = 18.1.11312.151 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamicData", "DynamicData\DynamicData.csproj", "{FE903921-6C55-40E3-9A16-4127ECACC12C}" EndProject @@ -24,6 +24,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamicData.Tests", "Dynami EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamicData.Benchmarks", "DynamicData.Benchmarks\DynamicData.Benchmarks.csproj", "{42566F48-05FC-483E-8B2F-D0EA4F28E870}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicData.Reactive", "DynamicData.Reactive\DynamicData.Reactive.csproj", "{B95120A9-0815-41A0-93B0-D6D8FCE02487}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -80,6 +82,22 @@ Global {42566F48-05FC-483E-8B2F-D0EA4F28E870}.Release|x64.Build.0 = Release|Any CPU {42566F48-05FC-483E-8B2F-D0EA4F28E870}.Release|x86.ActiveCfg = Release|Any CPU {42566F48-05FC-483E-8B2F-D0EA4F28E870}.Release|x86.Build.0 = Release|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Debug|x64.ActiveCfg = Debug|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Debug|x64.Build.0 = Debug|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Debug|x86.ActiveCfg = Debug|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Debug|x86.Build.0 = Debug|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Release|Any CPU.Build.0 = Release|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Release|x64.ActiveCfg = Release|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Release|x64.Build.0 = Release|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Release|x86.ActiveCfg = Release|Any CPU + {B95120A9-0815-41A0-93B0-D6D8FCE02487}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/DynamicData/Aggregation/AggregateEnumerator.cs b/src/DynamicData/Aggregation/AggregateEnumerator.cs index be9f93264..a394e0fb8 100644 --- a/src/DynamicData/Aggregation/AggregateEnumerator.cs +++ b/src/DynamicData/Aggregation/AggregateEnumerator.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; -using System.Diagnostics.CodeAnalysis; -using DynamicData.Cache; - namespace DynamicData.Aggregation; internal sealed class AggregateEnumerator(IChangeSet source) : IAggregateChangeSet diff --git a/src/DynamicData/Attributes.cs b/src/DynamicData/Attributes.cs index 76f194b3c..0cbef76bc 100644 --- a/src/DynamicData/Attributes.cs +++ b/src/DynamicData/Attributes.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Runtime.CompilerServices; - [assembly: InternalsVisibleTo("DynamicData.Tests")] [assembly: InternalsVisibleTo("DynamicData.Benchmarks")] [assembly: InternalsVisibleTo("DynamicData.ReactiveUI")] diff --git a/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs b/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs index 6bafd4ed5..3f6fa6f0f 100644 --- a/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs +++ b/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.CompilerServices; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/BindPaged.cs b/src/DynamicData/Binding/BindPaged.cs index 24e6f8587..6b8707e21 100644 --- a/src/DynamicData/Binding/BindPaged.cs +++ b/src/DynamicData/Binding/BindPaged.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Binding; /* diff --git a/src/DynamicData/Binding/BindVirtualized.cs b/src/DynamicData/Binding/BindVirtualized.cs index 554e7aabb..1cc951712 100644 --- a/src/DynamicData/Binding/BindVirtualized.cs +++ b/src/DynamicData/Binding/BindVirtualized.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Binding; /* diff --git a/src/DynamicData/Binding/BindingListAdaptor.cs b/src/DynamicData/Binding/BindingListAdaptor.cs index 06cc41aff..86a1a20f0 100644 --- a/src/DynamicData/Binding/BindingListAdaptor.cs +++ b/src/DynamicData/Binding/BindingListAdaptor.cs @@ -3,9 +3,6 @@ // See the LICENSE file in the project root for full license information. #if SUPPORTS_BINDINGLIST -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using DynamicData.Cache; using DynamicData.Cache.Internal; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/BindingListEventsSuspender.cs b/src/DynamicData/Binding/BindingListEventsSuspender.cs index a4b52b97e..d49608c0b 100644 --- a/src/DynamicData/Binding/BindingListEventsSuspender.cs +++ b/src/DynamicData/Binding/BindingListEventsSuspender.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Binding; internal sealed class BindingListEventsSuspender<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T> : IDisposable diff --git a/src/DynamicData/Binding/BindingListEx.cs b/src/DynamicData/Binding/BindingListEx.cs index 6bf5c03ff..7720bba7d 100644 --- a/src/DynamicData/Binding/BindingListEx.cs +++ b/src/DynamicData/Binding/BindingListEx.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/ExpressionBuilder.cs b/src/DynamicData/Binding/ExpressionBuilder.cs index 552c56d8e..541c02578 100644 --- a/src/DynamicData/Binding/ExpressionBuilder.cs +++ b/src/DynamicData/Binding/ExpressionBuilder.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; using System.Linq.Expressions; using System.Reflection; diff --git a/src/DynamicData/Binding/IObservableCollection.cs b/src/DynamicData/Binding/IObservableCollection.cs index 4358877b5..a4adc6fd5 100644 --- a/src/DynamicData/Binding/IObservableCollection.cs +++ b/src/DynamicData/Binding/IObservableCollection.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Specialized; -using System.ComponentModel; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs index 39d693ad5..0836bf2de 100644 --- a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs +++ b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; using System.Linq.Expressions; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs index 4715aba25..0393a4e2f 100644 --- a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; -using DynamicData.Cache; using DynamicData.Cache.Internal; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/ObservableCollectionExtended.cs b/src/DynamicData/Binding/ObservableCollectionExtended.cs index c188d4298..a31f1e8d7 100644 --- a/src/DynamicData/Binding/ObservableCollectionExtended.cs +++ b/src/DynamicData/Binding/ObservableCollectionExtended.cs @@ -4,7 +4,6 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.ComponentModel; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/ObservablePropertyFactory.cs b/src/DynamicData/Binding/ObservablePropertyFactory.cs index bbb5a2daf..1703e761d 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactory.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactory.cs @@ -2,12 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.Generic; -using System.ComponentModel; using System.Linq.Expressions; -using DynamicData.Internal; - namespace DynamicData.Binding; internal sealed class ObservablePropertyFactory diff --git a/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs b/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs index c0e67dd3d..45d1ec749 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Concurrent; -using System.ComponentModel; using System.Linq.Expressions; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/SortAndBind.cs b/src/DynamicData/Binding/SortAndBind.cs index c5fdedbb6..b76402e04 100644 --- a/src/DynamicData/Binding/SortAndBind.cs +++ b/src/DynamicData/Binding/SortAndBind.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using DynamicData.Cache; using DynamicData.Cache.Internal; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/SortedBindingListAdaptor.cs b/src/DynamicData/Binding/SortedBindingListAdaptor.cs index 81956791a..0733fc9a8 100644 --- a/src/DynamicData/Binding/SortedBindingListAdaptor.cs +++ b/src/DynamicData/Binding/SortedBindingListAdaptor.cs @@ -3,9 +3,6 @@ // See the LICENSE file in the project root for full license information. #if SUPPORTS_BINDINGLIST -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Cache/ChangeAwareCache.cs b/src/DynamicData/Cache/ChangeAwareCache.cs index 3230a9946..ecf3df403 100644 --- a/src/DynamicData/Cache/ChangeAwareCache.cs +++ b/src/DynamicData/Cache/ChangeAwareCache.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Cache; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index a413b008b..878f7f8e9 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs @@ -19,15 +19,13 @@ public static IObservable> Create( return Observable .Create>(downstreamObserver => { + var gate = new object(); var itemsByKey = new Dictionary(); - - var disposals = new Subject>(); - var disposalsCompleted = disposals - .Merge() - .IgnoreElements() - .Concat(Observable.Return(Unit.Default)) - .Publish() - .AutoConnect(0); + var disposalsCompleted = new ReplaySubject(1); + var pendingAsyncDisposals = 0; + var teardownStarted = false; + var teardownCompleted = false; + var disposalsFinalized = false; disposalsCompletedAccessor.Invoke(disposalsCompleted); @@ -74,20 +72,37 @@ public static IObservable> Create( void TearDown() { - if (disposals.HasObservers) + TObject[] items; + + lock (gate) { - try - { - foreach (var item in itemsByKey.Values) - TryDisposeItem(item); - disposals.OnCompleted(); - itemsByKey.Clear(); - } - catch (Exception error) - { - disposals.OnError(error); - } + if (teardownStarted) + return; + + teardownStarted = true; + items = [.. itemsByKey.Values]; + itemsByKey.Clear(); + } + + try + { + foreach (var item in items) + TryDisposeItem(item); + } + catch (Exception error) + { + TryFailDisposals(error); + } + + var publishCompleted = false; + lock (gate) + { + teardownCompleted = true; + publishCompleted = TryMarkDisposalsCompleted(); } + + if (publishCompleted) + PublishDisposalsCompleted(); } void TryDisposeItem(TObject item) @@ -95,7 +110,83 @@ void TryDisposeItem(TObject item) if (item is IDisposable disposable) disposable.Dispose(); else if (item is IAsyncDisposable asyncDisposable) - disposals.OnNext(Observable.FromAsync(() => asyncDisposable.DisposeAsync().AsTask())); + TrackAsyncDisposal(asyncDisposable.DisposeAsync().AsTask()); + } + + void TrackAsyncDisposal(Task disposalTask) + { + lock (gate) + { + ++pendingAsyncDisposals; + } + + if (disposalTask.IsCompleted) + { + CompleteAsyncDisposal(disposalTask); + return; + } + + _ = disposalTask.ContinueWith( + static (completedTask, state) => ((Action)state!).Invoke(completedTask), + (Action)CompleteAsyncDisposal, + CancellationToken.None, + TaskContinuationOptions.ExecuteSynchronously, + TaskScheduler.Default); + } + + void CompleteAsyncDisposal(Task disposalTask) + { + if (disposalTask.IsFaulted) + { + TryFailDisposals(disposalTask.Exception.InnerExceptions.Count == 1 + ? disposalTask.Exception.InnerException! + : disposalTask.Exception); + } + else if (disposalTask.IsCanceled) + { + TryFailDisposals(new TaskCanceledException(disposalTask)); + } + + var publishCompleted = false; + lock (gate) + { + --pendingAsyncDisposals; + publishCompleted = TryMarkDisposalsCompleted(); + } + + if (publishCompleted) + PublishDisposalsCompleted(); + } + + bool TryMarkDisposalsCompleted() + { + if (!teardownCompleted || pendingAsyncDisposals != 0 || disposalsFinalized) + return false; + + disposalsFinalized = true; + return true; + } + + void PublishDisposalsCompleted() + { + disposalsCompleted.OnNext(Unit.Default); + disposalsCompleted.OnCompleted(); + } + + void TryFailDisposals(Exception error) + { + var publishError = false; + lock (gate) + { + if (!disposalsFinalized) + { + disposalsFinalized = true; + publishError = true; + } + } + + if (publishError) + disposalsCompleted.OnError(error); } }); } diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs index bbd0c3393..355b15ea9 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal static partial class ExpireAfter diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs index 9cdb0212b..b65e7c1fd 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal static partial class ExpireAfter diff --git a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs index d9627347e..4c1b014b8 100644 --- a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal static partial class Filter diff --git a/src/DynamicData/Cache/Internal/GroupOnObservable.cs b/src/DynamicData/Cache/Internal/GroupOnObservable.cs index c0c604052..4ec36814f 100644 --- a/src/DynamicData/Cache/Internal/GroupOnObservable.cs +++ b/src/DynamicData/Cache/Internal/GroupOnObservable.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class GroupOnObservable(IObservable> source, Func> selectGroup) diff --git a/src/DynamicData/Cache/Internal/GroupOnProperty.cs b/src/DynamicData/Cache/Internal/GroupOnProperty.cs index b27970f8d..36f87ac22 100644 --- a/src/DynamicData/Cache/Internal/GroupOnProperty.cs +++ b/src/DynamicData/Cache/Internal/GroupOnProperty.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; using System.Linq.Expressions; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs index f54752dd3..95abc0298 100644 --- a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; using System.Linq.Expressions; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/IndexAndNode.cs b/src/DynamicData/Cache/Internal/IndexAndNode.cs index d80b66fd9..0f2237a21 100644 --- a/src/DynamicData/Cache/Internal/IndexAndNode.cs +++ b/src/DynamicData/Cache/Internal/IndexAndNode.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Cache.Internal; internal static class IndexAndNode diff --git a/src/DynamicData/Cache/Internal/KeySelector.cs b/src/DynamicData/Cache/Internal/KeySelector.cs index 87127dfcb..164d84caa 100644 --- a/src/DynamicData/Cache/Internal/KeySelector.cs +++ b/src/DynamicData/Cache/Internal/KeySelector.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Cache.Internal; internal sealed class KeySelector(Func keySelector) : IKeySelector diff --git a/src/DynamicData/Cache/Internal/KeyValueCollection.cs b/src/DynamicData/Cache/Internal/KeyValueCollection.cs index d743073f5..614f7b49f 100644 --- a/src/DynamicData/Cache/Internal/KeyValueCollection.cs +++ b/src/DynamicData/Cache/Internal/KeyValueCollection.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.Cache.Internal; internal sealed class KeyValueCollection : IKeyValueCollection diff --git a/src/DynamicData/Cache/Internal/MergeMany.cs b/src/DynamicData/Cache/Internal/MergeMany.cs index 1dee93a3c..192b799aa 100644 --- a/src/DynamicData/Cache/Internal/MergeMany.cs +++ b/src/DynamicData/Cache/Internal/MergeMany.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Runtime.CompilerServices; - namespace DynamicData.Cache.Internal; internal sealed class MergeMany diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs index 7a9971c68..ad8794392 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs index 1480851a8..a8875e776 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs index 09fae60c8..801e96c3c 100644 --- a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; using DynamicData.List.Internal; namespace DynamicData.Cache.Internal; diff --git a/src/DynamicData/Cache/Internal/OfType.cs b/src/DynamicData/Cache/Internal/OfType.cs index 7eb41363b..d5fbdb828 100644 --- a/src/DynamicData/Cache/Internal/OfType.cs +++ b/src/DynamicData/Cache/Internal/OfType.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class OfType(IObservable> source, bool suppressEmptyChangeSets) diff --git a/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs b/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs index 716d847d5..1194f5ef2 100644 --- a/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs +++ b/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.Cache.Internal; /// Initializes a new instance of the class.Converts a to . diff --git a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs index 73b04a528..5f2ad040d 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal static class ToObservableChangeSet diff --git a/src/DynamicData/Cache/Internal/TransformMany.cs b/src/DynamicData/Cache/Internal/TransformMany.cs index 07ec989f7..912835bf0 100644 --- a/src/DynamicData/Cache/Internal/TransformMany.cs +++ b/src/DynamicData/Cache/Internal/TransformMany.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; using System.Collections.ObjectModel; using DynamicData.Binding; diff --git a/src/DynamicData/Cache/Internal/TransformManyAsync.cs b/src/DynamicData/Cache/Internal/TransformManyAsync.cs index 15f358923..924bda571 100644 --- a/src/DynamicData/Cache/Internal/TransformManyAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformManyAsync.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class TransformManyAsync(IObservable> source, Func>>> transformer, IEqualityComparer? equalityComparer, IComparer? comparer, Action>? errorHandler = null) diff --git a/src/DynamicData/Cache/Internal/TransformOnObservable.cs b/src/DynamicData/Cache/Internal/TransformOnObservable.cs index 50e8023ad..e446c24a2 100644 --- a/src/DynamicData/Cache/Internal/TransformOnObservable.cs +++ b/src/DynamicData/Cache/Internal/TransformOnObservable.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class TransformOnObservable(IObservable> source, Func> transform, bool transformOnRefresh = false) diff --git a/src/DynamicData/Cache/ObservableCache.cs b/src/DynamicData/Cache/ObservableCache.cs index 38bdbfa41..80447ca15 100644 --- a/src/DynamicData/Cache/ObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCache.cs @@ -3,9 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; -using System.Threading; using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs index 28ba162c6..d1363d578 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs @@ -2,15 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs index 756e02364..a04d82fa9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs index ec494006e..e4413ca0a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.And.cs b/src/DynamicData/Cache/ObservableCacheEx.And.cs index 00fd9a282..49b068051 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.And.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.And.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs index 227b3639c..f2ab9b21c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs index 801c86ab9..c43a1da2f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs index 47625108d..f903170c5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs @@ -2,15 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs index dd007e108..d04918456 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs index 4e58c5923..7d6eec294 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs index 6c70d768d..e95ca23af 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs index d5ef4e870..5be9b0125 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs @@ -3,14 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs index ca5bfc34d..95649e472 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs index b3955886a..a79020179 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs index ae4a41df8..0d656b1f7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs index 025bdf6ff..3dce3dc01 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs index 8eae3ed84..fe115da5c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs index d1a2fff42..5b27f919e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs index becaefa46..55c93f9d5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs index 9c50278bf..994fa8e38 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs @@ -2,15 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs index e3b448589..b170a4a87 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs index 10a78e2ea..1becb08d6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs index 1791a5170..d65ae0a5e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs index 482a9c564..abf5a0cff 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs index 195f21998..4a8ee9d7c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Except.cs b/src/DynamicData/Cache/ObservableCacheEx.Except.cs index ca7b83c03..8c71d717e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Except.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Except.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs index c90c1e6e1..2495d6917 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs index 3ce393615..a2b616930 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs index 6264e1c7c..58be8eb75 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs index f37cbee03..e8673b43b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs index 0e7b5e465..c7e7eff67 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs index 584d6cd01..addb9a623 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs index e7f779d4e..ad209b312 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs index 9172493e1..38bc5f416 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs index 2b761800b..6fca43439 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs index cfd209572..9a8a83cde 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs index 725350a32..f5da307fb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Group.cs b/src/DynamicData/Cache/ObservableCacheEx.Group.cs index 4f362cb03..11e37c307 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Group.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Group.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs index aa650fe61..bdb7e1364 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs index a23b4604a..5dd0219b8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs index facb68085..f52a53ab3 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs index 4b4f7d518..f0252a108 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs index 1a7c9355f..db11fc2ee 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs index 57dda1f38..1576a31b2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs index 3c2783c51..4542bcb04 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs index 88b6e140b..f81234179 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs index 2d00eb6a7..8b2e81479 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs index 68b6ae513..37848290e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs @@ -2,15 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs index 8eafeb097..60cb091ae 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs index fa358a6df..e8c8e5ec8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs index de334f316..f68f19f6b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs index e9491eb06..abad73be3 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs index a22262d6c..827094ec4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs index c4ffc12a9..e3f821dd8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs index 524e4ec58..8b9ac0929 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs index 7190fd04d..aa39897fb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs index 5dceb0b81..7acee487b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs index f749d1074..f1d3a6d0b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs index f7f776855..15c7448cb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs index cbe1993c2..eeedbfbef 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs index b3fcc3ab7..7079cf8dc 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs index ae467860e..8bc5ddae9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs index 1b7f6cbf5..6565a6d9b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Or.cs b/src/DynamicData/Cache/ObservableCacheEx.Or.cs index 29e988388..2e83d3c13 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Or.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Or.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs index e91ca48fe..beb7716f1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs index 5eead45c8..6d07f648f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs index 801217da2..5450a338f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs index 3eb01a977..475238b9f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs index b1bc69f13..60eb3ac74 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs index 5d559e0f5..415acdb0d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs index 43f19fb4c..2ddf59a2d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs index 5927fcaf5..50f40f5cf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs index 08566dfc3..2e7c00975 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs index 156893656..b01283931 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs index d8a8880f8..35af96fad 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs index 5c6c0c56d..c197750ee 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs index 9f5e1444c..1f70a4b54 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Collections.ObjectModel; -using System.Diagnostics.CodeAnalysis; using DynamicData.Binding; namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs b/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs index 9081a78c7..20f83edf4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs @@ -2,15 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs index 12027748e..c7005e3df 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs index 40f61f118..8e68f506d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs index 15a1423df..c83429720 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs index 999c3fd92..a6a4faafe 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs index 2b94b4798..6a506f1d2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs index 1d407170a..0b22bfe01 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs index 5185c2f66..df797f21d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs index 17548ae4f..a4ef74553 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs index cd609eb03..863f8642f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs @@ -2,15 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs index eacabe14f..1770d0d5d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs index a855dac35..60a9be37d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs index 43c48a9d8..386fc07f1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs index e54e1038b..85a0a8e3e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs @@ -3,13 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs index 51c2ff1c0..aab6ab513 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs index 9f076e17f..2789899e9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs index 952b5b2d2..7a7b769be 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs index 1b8b2cb36..79fa372d2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs index 0ca8b9ca3..386cf7a1a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs index 50f8f268a..9b94be268 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs index e89379b79..cf2c48b58 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs index 18e3cd329..3feeed90c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs index 20c9fcfbf..0a859dd21 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs index fad74bb19..94f49cfc8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs index abc89d292..2b3cefbf9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs index 90180f3e5..eeb89d22b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs @@ -2,15 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs index c979aea02..71136ca2b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs index 0b2be335a..f399ff44c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs index 1959841d6..2f27a25b4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs @@ -2,15 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs index e41709dc3..1ae40457d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs @@ -2,15 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs index 2b25b7966..0318f1145 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs @@ -2,15 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using System.Runtime.CompilerServices; using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs index 94b4c00cb..f5de0d3d3 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs index b0f70c80c..41ec68c0e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Xor.cs b/src/DynamicData/Cache/ObservableCacheEx.Xor.cs index 9d393397f..157ce2ecb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Xor.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Xor.cs @@ -2,14 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.cs b/src/DynamicData/Cache/ObservableCacheEx.cs index a2290ba0e..f201d769f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.cs @@ -2,16 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index d12d46147..5cb986922 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -1,18 +1,29 @@  - netstandard2.0;net462;net6.0;net7.0;net8.0;net9.0;net10.0 - true + Dynamic Data + +Bring the power of Rx to collections using Dynamic Data. +Dynamic Data is a comprehensive caching and data manipulation solution which introduces domain centric observable collections. + Linq extensions enable dynamic filtering, sorting, grouping, transforms, binding, pagination, data virtualisation, expiration, disposal management plus more. + + net462;net472;net48;net481;net8.0;net9.0;net10.0;net11.0 true true - enable - + + + + + + + + @@ -24,12 +35,6 @@ - Dynamic Data - -Bring the power of Rx to collections using Dynamic Data. -Dynamic Data is a comprehensive caching and data manipulation solution which introduces domain centric observable collections. - Linq extensions enable dynamic filtering, sorting, grouping, transforms, binding, pagination, data virtualisation, expiration, disposal management plus more. - diff --git a/src/DynamicData/Experimental/SubjectWithRefCount.cs b/src/DynamicData/Experimental/SubjectWithRefCount.cs index 213acd459..e5a5a94e0 100644 --- a/src/DynamicData/Experimental/SubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/SubjectWithRefCount.cs @@ -16,6 +16,8 @@ internal sealed class SubjectWithRefCount(ISubject? subject = null) : ISub { private readonly ISubject _subject = subject ?? new Subject(); + private bool _isDisposed; + private int _refCount; /// Gets number of subscribers. @@ -25,13 +27,17 @@ internal sealed class SubjectWithRefCount(ISubject? subject = null) : ISub public int RefCount => _refCount; /// - public bool HasObservers => _subject.HasObservers; + public bool HasObservers => Volatile.Read(ref _refCount) > 0; /// - public bool IsDisposed => _subject.IsDisposed; + public bool IsDisposed => _isDisposed; /// - public void Dispose() => (_subject as IDisposable)?.Dispose(); + public void Dispose() + { + _isDisposed = true; + (_subject as IDisposable)?.Dispose(); + } /// /// Notifies the observer that the provider has finished sending push-based notifications. diff --git a/src/DynamicData/Experimental/Watcher.cs b/src/DynamicData/Experimental/Watcher.cs index b7cc90fac..938293a92 100644 --- a/src/DynamicData/Experimental/Watcher.cs +++ b/src/DynamicData/Experimental/Watcher.cs @@ -35,7 +35,13 @@ public Watcher(IObservable> source, IScheduler schedul var subscriber = _subscribers.Lookup(update.Key); if (subscriber.HasValue) { - scheduler.Schedule(() => subscriber.Value.OnNext(update)); + scheduler.Schedule( + state: (subject: subscriber.Value, update), + action: static (_, state) => + { + state.subject.OnNext(state.update); + return Disposable.Empty; + }); } })); diff --git a/src/DynamicData/Internal/Bitset.cs b/src/DynamicData/Internal/Bitset.cs index d28e4a669..963468a09 100644 --- a/src/DynamicData/Internal/Bitset.cs +++ b/src/DynamicData/Internal/Bitset.cs @@ -5,7 +5,6 @@ #if NETCOREAPP3_0_OR_GREATER using System.Numerics; #endif -using System.Runtime.CompilerServices; namespace DynamicData.Internal; diff --git a/src/DynamicData/Internal/Notification.cs b/src/DynamicData/Internal/Notification.cs index 9e3eaf4a0..e8a5ef413 100644 --- a/src/DynamicData/Internal/Notification.cs +++ b/src/DynamicData/Internal/Notification.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Kernel; - namespace DynamicData.Internal; /// diff --git a/src/DynamicData/Internal/ReactiveCompatibility.cs b/src/DynamicData/Internal/ReactiveCompatibility.cs index 02d40f593..31ca7c3bb 100644 --- a/src/DynamicData/Internal/ReactiveCompatibility.cs +++ b/src/DynamicData/Internal/ReactiveCompatibility.cs @@ -2,10 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; -using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Internal; diff --git a/src/DynamicData/Internal/SharedDeliveryQueue.cs b/src/DynamicData/Internal/SharedDeliveryQueue.cs index 6eab28894..83cc1097d 100644 --- a/src/DynamicData/Internal/SharedDeliveryQueue.cs +++ b/src/DynamicData/Internal/SharedDeliveryQueue.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Runtime.CompilerServices; - namespace DynamicData.Internal; /// diff --git a/src/DynamicData/Kernel/EnumerableIList.cs b/src/DynamicData/Kernel/EnumerableIList.cs index 242f83b67..807914f1c 100644 --- a/src/DynamicData/Kernel/EnumerableIList.cs +++ b/src/DynamicData/Kernel/EnumerableIList.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; -using System.Diagnostics.CodeAnalysis; - // Lifted from here https://github.com/benaadams/Ben.Enumerable. Many thanks to the genius of the man. namespace DynamicData.Kernel; diff --git a/src/DynamicData/Kernel/EnumeratorIList.cs b/src/DynamicData/Kernel/EnumeratorIList.cs index 237ad591e..6adabc312 100644 --- a/src/DynamicData/Kernel/EnumeratorIList.cs +++ b/src/DynamicData/Kernel/EnumeratorIList.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - // Lifted from here https://github.com/benaadams/Ben.Enumerable. Many thanks to the genius of the man. namespace DynamicData.Kernel; diff --git a/src/DynamicData/Kernel/Optional.cs b/src/DynamicData/Kernel/Optional.cs index 0dbbd567f..a7dc27af0 100644 --- a/src/DynamicData/Kernel/Optional.cs +++ b/src/DynamicData/Kernel/Optional.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Diagnostics.CodeAnalysis; - namespace DynamicData.Kernel; /// diff --git a/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs b/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs index 3f621f60b..35a70c6a7 100644 --- a/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs +++ b/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.Kernel; internal sealed class ReadOnlyCollectionLight : IReadOnlyCollection diff --git a/src/DynamicData/List/ChangeAwareList.cs b/src/DynamicData/List/ChangeAwareList.cs index 90d8e3abc..3d8c22ff8 100644 --- a/src/DynamicData/List/ChangeAwareList.cs +++ b/src/DynamicData/List/ChangeAwareList.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData; /// diff --git a/src/DynamicData/List/Internal/ExpireAfter.cs b/src/DynamicData/List/Internal/ExpireAfter.cs index 43469a996..4d69f0e8b 100644 --- a/src/DynamicData/List/Internal/ExpireAfter.cs +++ b/src/DynamicData/List/Internal/ExpireAfter.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.List.Internal; internal sealed class ExpireAfter diff --git a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs index 037642deb..5d52a9602 100644 --- a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs +++ b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.List.Internal; internal static partial class Filter diff --git a/src/DynamicData/List/Internal/FilterOnProperty.cs b/src/DynamicData/List/Internal/FilterOnProperty.cs index 2ecc2bcd3..1ff832f93 100644 --- a/src/DynamicData/List/Internal/FilterOnProperty.cs +++ b/src/DynamicData/List/Internal/FilterOnProperty.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; using System.Linq.Expressions; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/GroupOnProperty.cs b/src/DynamicData/List/Internal/GroupOnProperty.cs index 2debc3d6c..a80b0e0db 100644 --- a/src/DynamicData/List/Internal/GroupOnProperty.cs +++ b/src/DynamicData/List/Internal/GroupOnProperty.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; using System.Linq.Expressions; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs index ef2e8947b..dd48eb230 100644 --- a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; using System.Linq.Expressions; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs index ca22c3ccd..afff3572c 100644 --- a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using DynamicData.Cache.Internal; -using DynamicData.Internal; namespace DynamicData.List.Internal; diff --git a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs index 68f1314f5..9f0363d2f 100644 --- a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.List.Internal; /// diff --git a/src/DynamicData/List/Internal/Pager.cs b/src/DynamicData/List/Internal/Pager.cs index b9ac0fcbd..a98caa2e4 100644 --- a/src/DynamicData/List/Internal/Pager.cs +++ b/src/DynamicData/List/Internal/Pager.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.List.Internal; internal sealed class Pager(IObservable> source, IObservable requests) diff --git a/src/DynamicData/List/Internal/ToObservableChangeSet.cs b/src/DynamicData/List/Internal/ToObservableChangeSet.cs index 49632249c..93d6d0596 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using DynamicData.Internal; - namespace DynamicData.List.Internal; internal static class ToObservableChangeSet diff --git a/src/DynamicData/List/Internal/TransformMany.cs b/src/DynamicData/List/Internal/TransformMany.cs index 2c7da46e6..4f2f86138 100644 --- a/src/DynamicData/List/Internal/TransformMany.cs +++ b/src/DynamicData/List/Internal/TransformMany.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; using System.Collections.ObjectModel; using DynamicData.Binding; diff --git a/src/DynamicData/List/Linq/AddKeyEnumerator.cs b/src/DynamicData/List/Linq/AddKeyEnumerator.cs index 150c7c4a6..460b158c3 100644 --- a/src/DynamicData/List/Linq/AddKeyEnumerator.cs +++ b/src/DynamicData/List/Linq/AddKeyEnumerator.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.List.Linq; internal sealed class AddKeyEnumerator(IChangeSet source, Func keySelector) : IEnumerable> diff --git a/src/DynamicData/List/Linq/ItemChangeEnumerator.cs b/src/DynamicData/List/Linq/ItemChangeEnumerator.cs index 53c975d0a..56eca3b7c 100644 --- a/src/DynamicData/List/Linq/ItemChangeEnumerator.cs +++ b/src/DynamicData/List/Linq/ItemChangeEnumerator.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.List.Linq; internal sealed class ItemChangeEnumerator(IChangeSet changeSet) : IEnumerable> diff --git a/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs b/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs index 4a8d0c352..e9f6b7590 100644 --- a/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs +++ b/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - using DynamicData.List.Internal; namespace DynamicData.List.Linq; diff --git a/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs b/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs index 269bf2c2e..a1a02a2c8 100644 --- a/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs +++ b/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - namespace DynamicData.List.Linq; /// diff --git a/src/DynamicData/List/ObservableListEx.Adapt.cs b/src/DynamicData/List/ObservableListEx.Adapt.cs index 5881b1da6..0980d532f 100644 --- a/src/DynamicData/List/ObservableListEx.Adapt.cs +++ b/src/DynamicData/List/ObservableListEx.Adapt.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.AddKey.cs b/src/DynamicData/List/ObservableListEx.AddKey.cs index 5666a0512..eb1f2c34e 100644 --- a/src/DynamicData/List/ObservableListEx.AddKey.cs +++ b/src/DynamicData/List/ObservableListEx.AddKey.cs @@ -2,13 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; using DynamicData.List.Linq; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/List/ObservableListEx.And.cs b/src/DynamicData/List/ObservableListEx.And.cs index 1bc72f159..6ecb98a37 100644 --- a/src/DynamicData/List/ObservableListEx.And.cs +++ b/src/DynamicData/List/ObservableListEx.And.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.AsObservableList.cs b/src/DynamicData/List/ObservableListEx.AsObservableList.cs index 65aeab586..eb34f4945 100644 --- a/src/DynamicData/List/ObservableListEx.AsObservableList.cs +++ b/src/DynamicData/List/ObservableListEx.AsObservableList.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs index 495a29b8b..f698f12d7 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs index 6a10facb5..60e17e805 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Bind.cs b/src/DynamicData/List/ObservableListEx.Bind.cs index 05e6977e5..a876bed88 100644 --- a/src/DynamicData/List/ObservableListEx.Bind.cs +++ b/src/DynamicData/List/ObservableListEx.Bind.cs @@ -3,13 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.BufferIf.cs b/src/DynamicData/List/ObservableListEx.BufferIf.cs index befea2a75..0a0da052c 100644 --- a/src/DynamicData/List/ObservableListEx.BufferIf.cs +++ b/src/DynamicData/List/ObservableListEx.BufferIf.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.BufferInitial.cs b/src/DynamicData/List/ObservableListEx.BufferInitial.cs index 222b74b77..f166a308b 100644 --- a/src/DynamicData/List/ObservableListEx.BufferInitial.cs +++ b/src/DynamicData/List/ObservableListEx.BufferInitial.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Cast.cs b/src/DynamicData/List/ObservableListEx.Cast.cs index 1a258601e..a9ec135db 100644 --- a/src/DynamicData/List/ObservableListEx.Cast.cs +++ b/src/DynamicData/List/ObservableListEx.Cast.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.CastToObject.cs b/src/DynamicData/List/ObservableListEx.CastToObject.cs index c7ebe885e..c24fffaaf 100644 --- a/src/DynamicData/List/ObservableListEx.CastToObject.cs +++ b/src/DynamicData/List/ObservableListEx.CastToObject.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Clone.cs b/src/DynamicData/List/ObservableListEx.Clone.cs index 51264a1e5..2c00a2379 100644 --- a/src/DynamicData/List/ObservableListEx.Clone.cs +++ b/src/DynamicData/List/ObservableListEx.Clone.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Combine.cs b/src/DynamicData/List/ObservableListEx.Combine.cs index 3e2911456..dfc97525f 100644 --- a/src/DynamicData/List/ObservableListEx.Combine.cs +++ b/src/DynamicData/List/ObservableListEx.Combine.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Convert.cs b/src/DynamicData/List/ObservableListEx.Convert.cs index 473c8768a..87d52d047 100644 --- a/src/DynamicData/List/ObservableListEx.Convert.cs +++ b/src/DynamicData/List/ObservableListEx.Convert.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs index e30fdee68..6c61d0726 100644 --- a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs +++ b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.DisposeMany.cs b/src/DynamicData/List/ObservableListEx.DisposeMany.cs index 28539195b..fcf3ac185 100644 --- a/src/DynamicData/List/ObservableListEx.DisposeMany.cs +++ b/src/DynamicData/List/ObservableListEx.DisposeMany.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.DistinctValues.cs b/src/DynamicData/List/ObservableListEx.DistinctValues.cs index 08b03f670..7eb8f8309 100644 --- a/src/DynamicData/List/ObservableListEx.DistinctValues.cs +++ b/src/DynamicData/List/ObservableListEx.DistinctValues.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Except.cs b/src/DynamicData/List/ObservableListEx.Except.cs index 04d954b43..d3fededaf 100644 --- a/src/DynamicData/List/ObservableListEx.Except.cs +++ b/src/DynamicData/List/ObservableListEx.Except.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs index e6f997e74..4b4090a45 100644 --- a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs +++ b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Filter.cs b/src/DynamicData/List/ObservableListEx.Filter.cs index 8cd9cd72e..f0686c9bb 100644 --- a/src/DynamicData/List/ObservableListEx.Filter.cs +++ b/src/DynamicData/List/ObservableListEx.Filter.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs index a4976b6f7..7a8d87d6d 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs index 1cb19a849..c5d6107d8 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs index 6d71f667c..062a31297 100644 --- a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs +++ b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ForEachChange.cs b/src/DynamicData/List/ObservableListEx.ForEachChange.cs index 1a8a789bd..758486fa8 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachChange.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs index 74feafd1d..8b521df3a 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.GroupOn.cs b/src/DynamicData/List/ObservableListEx.GroupOn.cs index 59b851f28..cf852edc0 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOn.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOn.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs index 97ebc337f..70adaf90d 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs index 9cce8d9ea..58959aed5 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs index d01b9d3c2..5f617ca98 100644 --- a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs index 4c5aa3852..9d1b3a71d 100644 --- a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs +++ b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs index 9a33edf9f..0786c39cc 100644 --- a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.MergeMany.cs b/src/DynamicData/List/ObservableListEx.MergeMany.cs index 103a54efe..00e6bdeae 100644 --- a/src/DynamicData/List/ObservableListEx.MergeMany.cs +++ b/src/DynamicData/List/ObservableListEx.MergeMany.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs index f599b1bb1..b7706bc5e 100644 --- a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.NotEmpty.cs b/src/DynamicData/List/ObservableListEx.NotEmpty.cs index 42bb32c7f..98fc762ec 100644 --- a/src/DynamicData/List/ObservableListEx.NotEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.NotEmpty.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs index 26fdc02c0..d66024318 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs index 1974843b4..23fc3eb5f 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs index 9c17b1493..c8f03fc77 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Or.cs b/src/DynamicData/List/ObservableListEx.Or.cs index ff6878549..5e9492a52 100644 --- a/src/DynamicData/List/ObservableListEx.Or.cs +++ b/src/DynamicData/List/ObservableListEx.Or.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Page.cs b/src/DynamicData/List/ObservableListEx.Page.cs index 40bee2a52..52d18ab0d 100644 --- a/src/DynamicData/List/ObservableListEx.Page.cs +++ b/src/DynamicData/List/ObservableListEx.Page.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.PopulateInto.cs b/src/DynamicData/List/ObservableListEx.PopulateInto.cs index b07b8ba14..1334a6e5f 100644 --- a/src/DynamicData/List/ObservableListEx.PopulateInto.cs +++ b/src/DynamicData/List/ObservableListEx.PopulateInto.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs index ec45132fd..45c70cdd1 100644 --- a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs +++ b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.RefCount.cs b/src/DynamicData/List/ObservableListEx.RefCount.cs index 7dd16dbf4..c95d83d88 100644 --- a/src/DynamicData/List/ObservableListEx.RefCount.cs +++ b/src/DynamicData/List/ObservableListEx.RefCount.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs index ac9338511..3dac36f61 100644 --- a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs +++ b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Reverse.cs b/src/DynamicData/List/ObservableListEx.Reverse.cs index 6347982cf..bde4734ee 100644 --- a/src/DynamicData/List/ObservableListEx.Reverse.cs +++ b/src/DynamicData/List/ObservableListEx.Reverse.cs @@ -2,13 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; using DynamicData.List.Linq; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/List/ObservableListEx.SkipInitial.cs b/src/DynamicData/List/ObservableListEx.SkipInitial.cs index 41803eb3c..116af0c47 100644 --- a/src/DynamicData/List/ObservableListEx.SkipInitial.cs +++ b/src/DynamicData/List/ObservableListEx.SkipInitial.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Sort.cs b/src/DynamicData/List/ObservableListEx.Sort.cs index b2e559197..aa0969339 100644 --- a/src/DynamicData/List/ObservableListEx.Sort.cs +++ b/src/DynamicData/List/ObservableListEx.Sort.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs index 646d8d026..5e1fdd320 100644 --- a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs index cbfbdcecb..441b543a8 100644 --- a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs +++ b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs index 77eada53a..d728e50ed 100644 --- a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Switch.cs b/src/DynamicData/List/ObservableListEx.Switch.cs index 9fdd2c2f8..625a006d4 100644 --- a/src/DynamicData/List/ObservableListEx.Switch.cs +++ b/src/DynamicData/List/ObservableListEx.Switch.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ToCollection.cs b/src/DynamicData/List/ObservableListEx.ToCollection.cs index 652e333e3..48da34c8e 100644 --- a/src/DynamicData/List/ObservableListEx.ToCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToCollection.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs index 5390ec9d3..e1bc62fb0 100644 --- a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs +++ b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs index bff9727a7..67322d70e 100644 --- a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Top.cs b/src/DynamicData/List/ObservableListEx.Top.cs index 4efe40a6c..6b97feaf1 100644 --- a/src/DynamicData/List/ObservableListEx.Top.cs +++ b/src/DynamicData/List/ObservableListEx.Top.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Transform.cs b/src/DynamicData/List/ObservableListEx.Transform.cs index b8b4fcace..cbdf471c3 100644 --- a/src/DynamicData/List/ObservableListEx.Transform.cs +++ b/src/DynamicData/List/ObservableListEx.Transform.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.TransformAsync.cs b/src/DynamicData/List/ObservableListEx.TransformAsync.cs index 37fdec36c..196c1f851 100644 --- a/src/DynamicData/List/ObservableListEx.TransformAsync.cs +++ b/src/DynamicData/List/ObservableListEx.TransformAsync.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.TransformMany.cs b/src/DynamicData/List/ObservableListEx.TransformMany.cs index e5f04b46a..8c211f6c9 100644 --- a/src/DynamicData/List/ObservableListEx.TransformMany.cs +++ b/src/DynamicData/List/ObservableListEx.TransformMany.cs @@ -3,13 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Virtualise.cs b/src/DynamicData/List/ObservableListEx.Virtualise.cs index 515b5a9b7..26797970d 100644 --- a/src/DynamicData/List/ObservableListEx.Virtualise.cs +++ b/src/DynamicData/List/ObservableListEx.Virtualise.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs index 52f88c75e..3d7b201a4 100644 --- a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs index 5d7dfccaf..86cf11aa5 100644 --- a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs index 3ec0b886c..4e2a0cdac 100644 --- a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs @@ -2,14 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs index 714bbd536..ae9a6b072 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs index 9562aa145..039ec00c1 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.Xor.cs b/src/DynamicData/List/ObservableListEx.Xor.cs index bb55c0215..d875e594f 100644 --- a/src/DynamicData/List/ObservableListEx.Xor.cs +++ b/src/DynamicData/List/ObservableListEx.Xor.cs @@ -2,14 +2,7 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.cs b/src/DynamicData/List/ObservableListEx.cs index c215f03e5..57167e3dd 100644 --- a/src/DynamicData/List/ObservableListEx.cs +++ b/src/DynamicData/List/ObservableListEx.cs @@ -2,15 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq.Expressions; -using DynamicData.Binding; -using DynamicData.Cache.Internal; -using DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/PageChangeSet.cs b/src/DynamicData/List/PageChangeSet.cs index c746ca0e3..34124f2e1 100644 --- a/src/DynamicData/List/PageChangeSet.cs +++ b/src/DynamicData/List/PageChangeSet.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - using DynamicData.Operators; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/List/RangeChange.cs b/src/DynamicData/List/RangeChange.cs index 4abef195e..c3635d4db 100644 --- a/src/DynamicData/List/RangeChange.cs +++ b/src/DynamicData/List/RangeChange.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/SourceList.cs b/src/DynamicData/List/SourceList.cs index e0d347af8..67339be44 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.cs @@ -17,13 +17,13 @@ namespace DynamicData; public sealed class SourceList : ISourceList where T : notnull { - private readonly ISubject> _changes = new Subject>(); + private readonly Subject> _changes = new(); - private readonly ISubject> _changesPreview = new Subject>(); + private readonly Subject> _changesPreview = new(); private readonly IDisposable _cleanUp; - private readonly Lazy> _countChanged = new(() => new Subject()); + private readonly Lazy> _countChanged = new(() => new Subject()); #if NET9_0_OR_GREATER private readonly Lock _locker = new(); @@ -108,6 +108,12 @@ public IObservable> Connect(Func? predicate = null) public void Dispose() { _cleanUp.Dispose(); + _changesPreview.Dispose(); + _changes.Dispose(); + if (_countChanged.IsValueCreated) + { + _countChanged.Value.Dispose(); + } } /// diff --git a/src/DynamicData/List/VirtualChangeSet.cs b/src/DynamicData/List/VirtualChangeSet.cs index 086490a36..61cee6b98 100644 --- a/src/DynamicData/List/VirtualChangeSet.cs +++ b/src/DynamicData/List/VirtualChangeSet.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections; - // ReSharper disable once CheckNamespace namespace DynamicData; From e4f71353cda2c11692a960179f5d25b33a1dab88 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Fri, 19 Jun 2026 00:37:31 +0100 Subject: [PATCH 03/36] Add MSBuild task to generate Reactive sources Introduce a new DynamicDataReactiveSource item and a RoslynCodeTaskFactory task (RewriteDynamicDataReactiveNamespaces) to rewrite namespaces/usings from DynamicData to DynamicData.Reactive and emit generated sources into the intermediate output during build. Update the DynamicData.Reactive.csproj to use DynamicData.Reactive.* Using entries, replace direct Compile includes with DynamicDataReactiveSource (and adjust removal of AsyncDisposeMany), and add a GenerateDynamicDataReactiveSources target that wires generated files into Compile. Also add an API approval verified file for DynamicData.Reactive (.NET 10) and update the tests project (ApiApprovalTests and DynamicData.Tests.csproj) accordingly. --- .../DynamicData.Reactive.csproj | 77 +- ...cDataReactiveTests.DotNet10_0.verified.txt | 3104 +++++++++++++++++ src/DynamicData.Tests/API/ApiApprovalTests.cs | 12 + .../DynamicData.Tests.csproj | 8 + 4 files changed, 3193 insertions(+), 8 deletions(-) create mode 100644 src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataReactiveTests.DotNet10_0.verified.txt diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index 742885c5e..3309f2fef 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -23,9 +23,9 @@ - - - + + + @@ -39,16 +39,77 @@ - + Exclude="..\DynamicData\bin\**;..\DynamicData\obj\**;..\DynamicData\Internal\ReactiveCompatibility.cs" /> - - + + + + + + + + + + + + + + + + + (Sources.Length); + +foreach (var source in Sources) +{ + var sourcePath = Path.GetFullPath(source.ItemSpec); + if (!sourcePath.StartsWith(sourceRoot, StringComparison.OrdinalIgnoreCase)) + { + Log.LogError("Reactive source '{0}' is outside source root '{1}'.", sourcePath, sourceRoot); + return false; + } + + var relativePath = sourcePath.Substring(sourceRoot.Length) + .TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); + var outputPath = Path.Combine(outputRoot, relativePath); + + Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); + + var text = File.ReadAllText(sourcePath); + text = Regex.Replace(text, @"(?m)^(\s*namespace\s+)DynamicData(?=([.;\s{]|$))", "$1DynamicData.Reactive"); + text = Regex.Replace(text, @"(?m)^(\s*using\s+(?:static\s+)?)DynamicData(?=([.;\s]|$))", "$1DynamicData.Reactive"); + text = Regex.Replace(text, @"(?m)^(\s*using\s+[A-Za-z_][A-Za-z0-9_]*\s*=\s*)DynamicData(?=([.;\s]|$))", "$1DynamicData.Reactive"); + text = text.Replace("global::DynamicData.", "global::DynamicData.Reactive."); + + File.WriteAllText(outputPath, text); + generated.Add(new TaskItem(outputPath)); +} + +GeneratedSources = generated.ToArray(); + ]]> + + + + + + + + + + diff --git a/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataReactiveTests.DotNet10_0.verified.txt b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataReactiveTests.DotNet10_0.verified.txt new file mode 100644 index 000000000..c8331afb6 --- /dev/null +++ b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataReactiveTests.DotNet10_0.verified.txt @@ -0,0 +1,3104 @@ +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.Benchmarks")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.Profile")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.ReactiveUI")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicData.Tests")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v10.0", FrameworkDisplayName=".NET 10.0")] +namespace DynamicData.Reactive.Aggregation +{ + public readonly struct AggregateItem : System.IEquatable> + { + public AggregateItem(DynamicData.Reactive.Aggregation.AggregateType type, TObject item) { } + public TObject Item { get; } + public DynamicData.Reactive.Aggregation.AggregateType Type { get; } + public bool Equals(DynamicData.Reactive.Aggregation.AggregateItem other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public static bool operator !=(in DynamicData.Reactive.Aggregation.AggregateItem left, in DynamicData.Reactive.Aggregation.AggregateItem right) { } + public static bool operator ==(in DynamicData.Reactive.Aggregation.AggregateItem left, in DynamicData.Reactive.Aggregation.AggregateItem right) { } + } + public enum AggregateType + { + Add = 0, + Remove = 1, + } + public static class AggregationEx + { + public static System.IObservable> ForAggregation(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable> ForAggregation(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable InvalidateWhen(this System.IObservable source, System.IObservable invalidate) { } + public static System.IObservable InvalidateWhen(this System.IObservable source, System.IObservable invalidate) { } + } + public static class AvgEx + { + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) + where T : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal emptyValue) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, double emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, float emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, int emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Avg(this System.IObservable> source, System.Func valueSelector, long emptyValue = 0) + where TObject : notnull + where TKey : notnull { } + } + public static class CountEx + { + public static System.IObservable Count(this System.IObservable> source) { } + public static System.IObservable Count(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable Count(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable Count(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable IsEmpty(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable IsEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable IsNotEmpty(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable IsNotEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + } + public interface IAggregateChangeSet : System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable { } + public static class MaxEx + { + public static System.IObservable Maximum(this System.IObservable> source, System.Func valueSelector, TResult emptyValue = default) + where TObject : notnull + where TResult : struct, System.IComparable { } + public static System.IObservable Maximum(this System.IObservable> source, System.Func valueSelector, TResult emptyValue = default) + where TObject : notnull + where TKey : notnull + where TResult : struct, System.IComparable { } + public static System.IObservable Minimum(this System.IObservable> source, System.Func valueSelector, TResult emptyValue = default) + where TObject : notnull + where TResult : struct, System.IComparable { } + public static System.IObservable Minimum(this System.IObservable> source, System.Func valueSelector, TResult emptyValue = default) + where TObject : notnull + where TKey : notnull + where TResult : struct, System.IComparable { } + } + public static class StdDevEx + { + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, [System.Runtime.CompilerServices.DecimalConstant(0, 0, 0u, 0u, 0u)] decimal fallbackValue) { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, double fallbackValue = 0) { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, float fallbackValue = 0) { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, int fallbackValue = 0) { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, long fallbackValue = 0) { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, decimal fallbackValue) + where T : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, double fallbackValue) + where T : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, float fallbackValue = 0) + where T : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, int fallbackValue) + where T : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, long fallbackValue) + where T : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, decimal fallbackValue) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, double fallbackValue) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, float fallbackValue = 0) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, int fallbackValue) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable StdDev(this System.IObservable> source, System.Func valueSelector, long fallbackValue) + where TObject : notnull + where TKey : notnull { } + } + public static class SumEx + { + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable Sum(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull { } + } +} +namespace DynamicData.Reactive.Alias +{ + public static class ObservableCacheAlias + { + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> SelectMany(this System.IObservable> source, System.Func> manySelector, System.Func keySelector) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> SelectSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable, TKey>> SelectTree(this System.IObservable> source, System.Func pivotOn) + where TObject : class + where TKey : notnull { } + public static System.IObservable> Where(this System.IObservable> source, System.Func filter) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicateChanged) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicateChanged, System.IObservable reapplyFilter) + where TObject : notnull + where TKey : notnull { } + } + public static class ObservableListAlias + { + public static System.IObservable> Select(this System.IObservable> source, System.Func transformFactory) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> SelectMany(this System.IObservable> source, System.Func> manySelector) + where TDestination : notnull + where TSource : notnull { } + public static System.IObservable> Where(this System.IObservable> source, System.Func predicate) + where T : notnull { } + public static System.IObservable> Where(this System.IObservable> source, System.IObservable> predicate) + where T : notnull { } + } +} +namespace DynamicData.Reactive.Binding +{ + public abstract class AbstractNotifyPropertyChanged : System.ComponentModel.INotifyPropertyChanged + { + protected AbstractNotifyPropertyChanged() { } + public event System.ComponentModel.PropertyChangedEventHandler? PropertyChanged; + protected virtual void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string? propertyName = null) { } + protected virtual void SetAndRaise(ref T backingField, T newValue, [System.Runtime.CompilerServices.CallerMemberName] string? propertyName = null) { } + protected virtual void SetAndRaise(ref T backingField, T newValue, System.Collections.Generic.IEqualityComparer? comparer, [System.Runtime.CompilerServices.CallerMemberName] string? propertyName = null) { } + } + public class BindingListAdaptor<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T> : DynamicData.Reactive.IChangeSetAdaptor + where T : notnull + { + public BindingListAdaptor(System.ComponentModel.BindingList list, int refreshThreshold = 25) { } + public void Adapt(DynamicData.Reactive.IChangeSet changes) { } + } + public class BindingListAdaptor<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey> : DynamicData.Reactive.IChangeSetAdaptor + where TObject : notnull + where TKey : notnull + { + public BindingListAdaptor(System.ComponentModel.BindingList list, int refreshThreshold = 25) { } + public void Adapt(DynamicData.Reactive.IChangeSet changes) { } + } + public static class BindingListEx + { + public static System.IObservable> ObserveCollectionChanges(this System.ComponentModel.IBindingList source) { } + public static System.IObservable> ToObservableChangeSet<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this System.ComponentModel.BindingList source) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this TCollection source) + where TCollection : System.ComponentModel.IBindingList, System.Collections.Generic.IEnumerable + where T : notnull { } + public static System.IObservable> ToObservableChangeSet<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.ComponentModel.BindingList source, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + } + public struct BindingOptions : System.IEquatable + { + public const bool DefaultResetOnFirstTimeLoad = true; + public const int DefaultResetThreshold = 25; + public const bool DefaultUseReplaceForUpdates = true; + public BindingOptions(int ResetThreshold, bool UseReplaceForUpdates = true, bool ResetOnFirstTimeLoad = true) { } + public bool ResetOnFirstTimeLoad { get; set; } + public int ResetThreshold { get; set; } + public bool UseReplaceForUpdates { get; set; } + public static DynamicData.Reactive.Binding.BindingOptions NeverFireReset(bool useReplaceForUpdates = true) { } + } + public interface IEvaluateAware + { + void Evaluate(); + } + public interface IIndexAware + { + int Index { get; set; } + } + public interface INotifyCollectionChangedSuspender + { + System.IDisposable SuspendCount(); + System.IDisposable SuspendNotifications(); + } + public interface IObservableCollectionAdaptor + where TObject : notnull + where TKey : notnull + { + void Adapt(DynamicData.Reactive.IChangeSet changes, DynamicData.Reactive.Binding.IObservableCollection collection); + } + public interface IObservableCollection : DynamicData.Reactive.Binding.INotifyCollectionChangedSuspender, System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.IEnumerable, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.INotifyPropertyChanged + { + void Load(System.Collections.Generic.IEnumerable items); + void Move(int oldIndex, int newIndex); + } + public static class IObservableListEx + { + public static System.IObservable> BindToObservableList(this System.IObservable> source, out DynamicData.Reactive.IObservableList observableList) + where TObject : notnull { } + public static System.IObservable> BindToObservableList(this System.IObservable> source, out DynamicData.Reactive.IObservableList observableList) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BindToObservableList(this System.IObservable> source, out DynamicData.Reactive.IObservableList observableList) + where TObject : notnull + where TKey : notnull { } + } + public interface ISortedObservableCollectionAdaptor + where TObject : notnull + where TKey : notnull + { + void Adapt(DynamicData.Reactive.ISortedChangeSet changes, DynamicData.Reactive.Binding.IObservableCollection collection); + } + public static class NotifyPropertyChangedEx + { + public static System.IObservable WhenAnyPropertyChanged(this TObject source, params string[] propertiesToMonitor) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Func resultSelector, System.Func? p1Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Linq.Expressions.Expression> p2, System.Func resultSelector, System.Func? p1Fallback = null, System.Func? p2Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Linq.Expressions.Expression> p2, System.Linq.Expressions.Expression> p3, System.Func resultSelector, System.Func? p1Fallback = null, System.Func? p2Fallback = null, System.Func? p3Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Linq.Expressions.Expression> p2, System.Linq.Expressions.Expression> p3, System.Linq.Expressions.Expression> p4, System.Func resultSelector, System.Func? p1Fallback = null, System.Func? p2Fallback = null, System.Func? p3Fallback = null, System.Func? p4Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Linq.Expressions.Expression> p2, System.Linq.Expressions.Expression> p3, System.Linq.Expressions.Expression> p4, System.Linq.Expressions.Expression> p5, System.Func resultSelector, System.Func? p1Fallback = null, System.Func? p2Fallback = null, System.Func? p3Fallback = null, System.Func? p4Fallback = null, System.Func? p5Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenChanged(this TObject source, System.Linq.Expressions.Expression> p1, System.Linq.Expressions.Expression> p2, System.Linq.Expressions.Expression> p3, System.Linq.Expressions.Expression> p4, System.Linq.Expressions.Expression> p5, System.Linq.Expressions.Expression> p6, System.Func resultSelector, System.Func? p1Fallback = null, System.Func? p2Fallback = null, System.Func? p3Fallback = null, System.Func? p4Fallback = null, System.Func? p5Fallback = null, System.Func? p6Fallback = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> WhenPropertyChanged(this TObject source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true, System.Func? fallbackValue = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenValueChanged(this TObject source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true, System.Func? fallbackValue = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + } + public class ObservableCollectionAdaptor : DynamicData.Reactive.IChangeSetAdaptor + where T : notnull + { + public ObservableCollectionAdaptor(DynamicData.Reactive.Binding.IObservableCollection collection) { } + public ObservableCollectionAdaptor(DynamicData.Reactive.Binding.IObservableCollection collection, DynamicData.Reactive.Binding.BindingOptions options) { } + public ObservableCollectionAdaptor(DynamicData.Reactive.Binding.IObservableCollection collection, int refreshThreshold, bool allowReplace = true, bool resetOnFirstTimeLoad = true) { } + public void Adapt(DynamicData.Reactive.IChangeSet changes) { } + } + public class ObservableCollectionAdaptor : DynamicData.Reactive.Binding.IObservableCollectionAdaptor + where TObject : notnull + where TKey : notnull + { + public ObservableCollectionAdaptor(DynamicData.Reactive.Binding.BindingOptions options) { } + public ObservableCollectionAdaptor(int refreshThreshold = 25, bool useReplaceForUpdates = true, bool resetOnFirstTimeLoad = true) { } + public void Adapt(DynamicData.Reactive.IChangeSet changes, DynamicData.Reactive.Binding.IObservableCollection collection) { } + } + public static class ObservableCollectionEx + { + public static System.IObservable> ObserveCollectionChanges(this System.Collections.Specialized.INotifyCollectionChanged source) { } + public static System.IObservable> ToObservableChangeSet(this System.Collections.ObjectModel.ObservableCollection source) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.Collections.ObjectModel.ReadOnlyObservableCollection source) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this TCollection source) + where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.Collections.ObjectModel.ObservableCollection source, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.Collections.ObjectModel.ReadOnlyObservableCollection source, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + } + public class ObservableCollectionExtended : System.Collections.ObjectModel.ObservableCollection, DynamicData.Reactive.Binding.INotifyCollectionChangedSuspender, DynamicData.Reactive.Binding.IObservableCollection, DynamicData.Reactive.IExtendedList, System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.IEnumerable, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.INotifyPropertyChanged + { + public ObservableCollectionExtended() { } + public ObservableCollectionExtended(System.Collections.Generic.IEnumerable collection) { } + public ObservableCollectionExtended(System.Collections.Generic.List list) { } + public void AddRange(System.Collections.Generic.IEnumerable collection) { } + public void InsertRange(System.Collections.Generic.IEnumerable collection, int index) { } + public void Load(System.Collections.Generic.IEnumerable items) { } + protected override void OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { } + protected override void OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs e) { } + public void RemoveRange(int index, int count) { } + public System.IDisposable SuspendCount() { } + public System.IDisposable SuspendNotifications() { } + } + public sealed class PropertyValue : System.IEquatable> + { + public PropertyValue(TObject sender, TValue value) { } + public TObject Sender { get; } + public TValue Value { get; } + public bool Equals(DynamicData.Reactive.Binding.PropertyValue? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(DynamicData.Reactive.Binding.PropertyValue? left, DynamicData.Reactive.Binding.PropertyValue? right) { } + public static bool operator ==(DynamicData.Reactive.Binding.PropertyValue? left, DynamicData.Reactive.Binding.PropertyValue? right) { } + } + public readonly struct SortAndBindOptions : System.IEquatable + { + public SortAndBindOptions() { } + public int InitialCapacity { get; init; } + public bool ResetOnFirstTimeLoad { get; init; } + public int ResetThreshold { get; init; } + public System.Reactive.Concurrency.IScheduler? Scheduler { get; init; } + public bool UseBinarySearch { get; init; } + public bool UseReplaceForUpdates { get; init; } + } + public enum SortDirection + { + Ascending = 0, + Descending = 1, + } + public class SortExpressionComparer : System.Collections.Generic.List>, System.Collections.Generic.IComparer + { + public SortExpressionComparer() { } + public int Compare(T? x, T? y) { } + public DynamicData.Reactive.Binding.SortExpressionComparer ThenByAscending(System.Func expression) { } + public DynamicData.Reactive.Binding.SortExpressionComparer ThenByDescending(System.Func expression) { } + public static DynamicData.Reactive.Binding.SortExpressionComparer Ascending(System.Func expression) { } + public static DynamicData.Reactive.Binding.SortExpressionComparer Descending(System.Func expression) { } + } + public class SortExpression + { + public SortExpression(System.Func expression, DynamicData.Reactive.Binding.SortDirection direction = 0) { } + public DynamicData.Reactive.Binding.SortDirection Direction { get; } + public System.Func Expression { get; } + } + public class SortedBindingListAdaptor<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey> : DynamicData.Reactive.ISortedChangeSetAdaptor + where TObject : notnull + where TKey : notnull + { + public SortedBindingListAdaptor(System.ComponentModel.BindingList list, int refreshThreshold = 25) { } + public void Adapt(DynamicData.Reactive.ISortedChangeSet changes) { } + } + public class SortedObservableCollectionAdaptor : DynamicData.Reactive.Binding.ISortedObservableCollectionAdaptor + where TObject : notnull + where TKey : notnull + { + public SortedObservableCollectionAdaptor() { } + public SortedObservableCollectionAdaptor(DynamicData.Reactive.Binding.BindingOptions options) { } + public SortedObservableCollectionAdaptor(int refreshThreshold, bool useReplaceForUpdates = true, bool resetOnFirstTimeLoad = true) { } + public void Adapt(DynamicData.Reactive.ISortedChangeSet changes, DynamicData.Reactive.Binding.IObservableCollection collection) { } + } +} +namespace DynamicData.Reactive.Cache.Internal +{ + public enum CombineOperator + { + And = 0, + Or = 1, + Xor = 2, + Except = 3, + } + [System.Serializable] + public class KeySelectorException : System.Exception + { + public KeySelectorException() { } + public KeySelectorException(string message) { } + public KeySelectorException(string message, System.Exception innerException) { } + } + [System.Diagnostics.DebuggerDisplay("LockFreeObservableCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Ite" + + "ms)")] + public sealed class LockFreeObservableCache : DynamicData.Reactive.IConnectableCache, DynamicData.Reactive.IObservableCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + public LockFreeObservableCache() { } + public LockFreeObservableCache(System.IObservable> source) { } + public int Count { get; } + public System.IObservable CountChanged { get; } + public System.Collections.Generic.IReadOnlyList Items { get; } + public System.Collections.Generic.IReadOnlyDictionary KeyValues { get; } + public System.Collections.Generic.IReadOnlyList Keys { get; } + public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } + public void Dispose() { } + public void Edit(System.Action> editAction) { } + public DynamicData.Reactive.Kernel.Optional Lookup(TKey key) { } + public System.IObservable> Preview(System.Func? predicate = null) { } + public System.IObservable> Watch(TKey key) { } + } +} +namespace DynamicData.Reactive +{ + public sealed class ChangeAwareCache : DynamicData.Reactive.ICache, DynamicData.Reactive.IQuery + where TObject : notnull + where TKey : notnull + { + public ChangeAwareCache() { } + public ChangeAwareCache(System.Collections.Generic.Dictionary data) { } + public ChangeAwareCache(int capacity) { } + public int Count { get; } + public System.Collections.Generic.IEnumerable Items { get; } + public System.Collections.Generic.IEnumerable> KeyValues { get; } + public System.Collections.Generic.IEnumerable Keys { get; } + public void Add(TObject item, TKey key) { } + public void AddOrUpdate(TObject item, TKey key) { } + public DynamicData.Reactive.ChangeSet CaptureChanges() { } + public void Clear() { } + public void Clone(DynamicData.Reactive.IChangeSet changes) { } + public DynamicData.Reactive.Kernel.Optional Lookup(TKey key) { } + public void Refresh() { } + public void Refresh(System.Collections.Generic.IEnumerable keys) { } + public void Refresh(TKey key) { } + public void Remove(System.Collections.Generic.IEnumerable keys) { } + public void Remove(TKey key) { } + } + public class ChangeAwareList : DynamicData.Reactive.IExtendedList, System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.IEnumerable + where T : notnull + { + public ChangeAwareList(System.Collections.Generic.IEnumerable items) { } + public ChangeAwareList(int capacity = -1) { } + public ChangeAwareList(DynamicData.Reactive.ChangeAwareList list, bool copyChanges) { } + public int Capacity { get; set; } + public int Count { get; } + public bool IsReadOnly { get; } + public T this[int index] { get; set; } + public void Add(T item) { } + public void AddRange(System.Collections.Generic.IEnumerable collection) { } + public DynamicData.Reactive.IChangeSet CaptureChanges() { } + public virtual void Clear() { } + public virtual bool Contains(T item) { } + public void CopyTo(T[] array, int arrayIndex) { } + public System.Collections.Generic.IEnumerator GetEnumerator() { } + public int IndexOf(T item) { } + public int IndexOf(T item, System.Collections.Generic.IEqualityComparer equalityComparer) { } + public void Insert(int index, T item) { } + protected virtual void InsertItem(int index, T item) { } + public void InsertRange(System.Collections.Generic.IEnumerable collection, int index) { } + public virtual void Move(T item, int destination) { } + public virtual void Move(int original, int destination) { } + protected virtual void OnInsertItems(int startIndex, System.Collections.Generic.IEnumerable items) { } + protected virtual void OnRemoveItems(int startIndex, System.Collections.Generic.IEnumerable items) { } + protected virtual void OnSetItem(int index, T newItem, T oldItem) { } + public bool Refresh(T item) { } + public void Refresh(T item, int index) { } + public void RefreshAt(int index) { } + public bool Remove(T item) { } + public void RemoveAt(int index) { } + protected void RemoveItem(int index) { } + protected virtual void RemoveItem(int index, T item) { } + public void RemoveRange(int index, int count) { } + protected virtual void SetItem(int index, T item) { } + } + public enum ChangeReason + { + Add = 0, + Update = 1, + Remove = 2, + Refresh = 3, + Moved = 4, + } + public static class ChangeSetEx + { + public static System.Collections.Generic.IEnumerable> Flatten(this DynamicData.Reactive.IChangeSet source) + where T : notnull { } + public static DynamicData.Reactive.ChangeType GetChangeType(this DynamicData.Reactive.ListChangeReason source) { } + public static DynamicData.Reactive.IChangeSet Transform(this DynamicData.Reactive.IChangeSet source, System.Func transformer) + where TSource : notnull + where TDestination : notnull { } + public static System.Collections.Generic.IEnumerable> YieldWithoutIndex(this System.Collections.Generic.IEnumerable> source) + where T : notnull { } + } + public class ChangeSet : System.Collections.Generic.List>, DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where T : notnull + { + public static readonly DynamicData.Reactive.IChangeSet Empty; + public ChangeSet() { } + public ChangeSet(System.Collections.Generic.IEnumerable> items) { } + public ChangeSet(int capacity) { } + public int Adds { get; } + public int Moves { get; } + public int Refreshes { get; } + public int Removes { get; } + public int Replaced { get; } + public int TotalChanges { get; } + public override string ToString() { } + } + public class ChangeSet : System.Collections.Generic.List>, DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + public static readonly DynamicData.Reactive.ChangeSet Empty; + public ChangeSet() { } + public ChangeSet(System.Collections.Generic.IEnumerable> collection) { } + public ChangeSet(int capacity) { } + public int Adds { get; } + public int Moves { get; } + public int Refreshes { get; } + public int Removes { get; } + public int Updates { get; } + public override string ToString() { } + } + public sealed class ChangeSet : DynamicData.Reactive.ChangeSet, DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + public ChangeSet(TContext context) { } + public ChangeSet(System.Collections.Generic.IEnumerable> collection, TContext context) { } + public ChangeSet(int capacity, TContext context) { } + public TContext Context { get; } + } + public enum ChangeType + { + Item = 0, + Range = 1, + } + public sealed class Change : System.IEquatable> + where T : notnull + { + public Change(DynamicData.Reactive.ListChangeReason reason, System.Collections.Generic.IEnumerable items, int index = -1) { } + public Change(DynamicData.Reactive.ListChangeReason reason, T current, int index = -1) { } + public Change(T current, int currentIndex, int previousIndex) { } + public Change(DynamicData.Reactive.ListChangeReason reason, T current, in DynamicData.Reactive.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public DynamicData.Reactive.ItemChange Item { get; } + public DynamicData.Reactive.RangeChange Range { get; } + public DynamicData.Reactive.ListChangeReason Reason { get; } + public DynamicData.Reactive.ChangeType Type { get; } + public bool Equals(DynamicData.Reactive.Change? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(DynamicData.Reactive.Change left, DynamicData.Reactive.Change right) { } + public static bool operator ==(DynamicData.Reactive.Change left, DynamicData.Reactive.Change right) { } + } + public readonly struct Change : System.IEquatable> + where TObject : notnull + where TKey : notnull + { + public Change(DynamicData.Reactive.ChangeReason reason, TKey key, TObject current, int index = -1) { } + public Change(TKey key, TObject current, int currentIndex, int previousIndex) { } + public Change(DynamicData.Reactive.ChangeReason reason, TKey key, TObject current, in DynamicData.Reactive.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public TObject Current { get; } + public int CurrentIndex { get; } + public TKey Key { get; } + public DynamicData.Reactive.Kernel.Optional Previous { get; } + public int PreviousIndex { get; } + public DynamicData.Reactive.ChangeReason Reason { get; } + public bool Equals(DynamicData.Reactive.Change other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(in DynamicData.Reactive.Change left, in DynamicData.Reactive.Change right) { } + public static bool operator ==(in DynamicData.Reactive.Change left, in DynamicData.Reactive.Change right) { } + } + public static class DynamicDataOptions + { + public static DynamicData.Reactive.Binding.BindingOptions Binding { get; set; } + public static DynamicData.Reactive.Binding.SortAndBindOptions SortAndBind { get; set; } + } + public static class EnumerableEx + { + public static System.IObservable> AsObservableChangeSet(this System.Collections.Generic.IEnumerable source, bool completable = false) + where TObject : notnull { } + public static System.IObservable> AsObservableChangeSet(this System.Collections.Generic.IEnumerable source, System.Func keySelector, bool completable = false) + where TObject : notnull + where TKey : notnull { } + } + public interface ICacheUpdater : DynamicData.Reactive.IQuery + where TObject : notnull + where TKey : notnull + { + void AddOrUpdate(System.Collections.Generic.IEnumerable> keyValuePairs); + void AddOrUpdate(System.Collections.Generic.KeyValuePair item); + void AddOrUpdate(TObject item, TKey key); + void Clear(); + void Clone(DynamicData.Reactive.IChangeSet changes); + TKey GetKey(TObject item); + System.Collections.Generic.IEnumerable> GetKeyValues(System.Collections.Generic.IEnumerable items); + void Refresh(); + void Refresh(System.Collections.Generic.IEnumerable keys); + void Refresh(TKey key); + void Remove(System.Collections.Generic.IEnumerable> items); + void Remove(System.Collections.Generic.IEnumerable keys); + void Remove(System.Collections.Generic.KeyValuePair item); + void Remove(TKey key); + void RemoveKey(TKey key); + void RemoveKeys(System.Collections.Generic.IEnumerable key); + [System.Obsolete("Use Clone()")] + void Update(DynamicData.Reactive.IChangeSet changes); + } + public interface ICache : DynamicData.Reactive.IQuery + where TObject : notnull + where TKey : notnull + { + void AddOrUpdate(TObject item, TKey key); + void Clear(); + void Clone(DynamicData.Reactive.IChangeSet changes); + void Refresh(); + void Refresh(System.Collections.Generic.IEnumerable keys); + void Refresh(TKey key); + void Remove(System.Collections.Generic.IEnumerable keys); + void Remove(TKey key); + } + public interface IChangeSet + { + int Adds { get; } + int Capacity { get; set; } + int Count { get; } + int Moves { get; } + int Refreshes { get; } + int Removes { get; } + } + public interface IChangeSetAdaptor + where T : notnull + { + void Adapt(DynamicData.Reactive.IChangeSet changes); + } + public interface IChangeSetAdaptor + where TObject : notnull + where TKey : notnull + { + void Adapt(DynamicData.Reactive.IChangeSet changes); + } + public interface IChangeSet : DynamicData.Reactive.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + { + int Replaced { get; } + int TotalChanges { get; } + } + public interface IChangeSet : DynamicData.Reactive.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + int Updates { get; } + } + public interface IChangeSet : DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + TContext Context { get; } + } + public interface IConnectableCache + where TObject : notnull + where TKey : notnull + { + System.IObservable CountChanged { get; } + System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true); + System.IObservable> Preview(System.Func? predicate = null); + System.IObservable> Watch(TKey key); + } + public interface IDistinctChangeSet : DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where T : notnull { } + public interface IExtendedList : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IList, System.Collections.IEnumerable + { + void AddRange(System.Collections.Generic.IEnumerable collection); + void InsertRange(System.Collections.Generic.IEnumerable collection, int index); + void Move(int original, int destination); + void RemoveRange(int index, int count); + } + public interface IGroupChangeSet : DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, TGroupKey>, System.Collections.Generic.IEnumerable, TGroupKey>>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public interface IGroup + where TObject : notnull + { + TGroup GroupKey { get; } + DynamicData.Reactive.IObservableList List { get; } + } + public interface IGroup : DynamicData.Reactive.IKey + where TObject : notnull + where TKey : notnull + { + DynamicData.Reactive.IObservableCache Cache { get; } + } + public interface IGrouping + where TObject : notnull + { + int Count { get; } + System.Collections.Generic.IEnumerable Items { get; } + TGroupKey Key { get; } + System.Collections.Generic.IEnumerable> KeyValues { get; } + System.Collections.Generic.IEnumerable Keys { get; } + DynamicData.Reactive.Kernel.Optional Lookup(TKey key); + } + public interface IImmutableGroupChangeSet : DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, TGroupKey>, System.Collections.Generic.IEnumerable, TGroupKey>>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public interface IIntermediateCache : DynamicData.Reactive.IConnectableCache, DynamicData.Reactive.IObservableCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + void Edit(System.Action> updateAction); + } + public interface IKeyValueCollection : System.Collections.Generic.IEnumerable>, System.Collections.Generic.IReadOnlyCollection>, System.Collections.Generic.IReadOnlyList>, System.Collections.IEnumerable + { + System.Collections.Generic.IComparer> Comparer { get; } + DynamicData.Reactive.SortOptimisations Optimisations { get; } + DynamicData.Reactive.SortReason SortReason { get; } + } + public interface IKeyValue : DynamicData.Reactive.IKey + { + TObject Value { get; } + } + public interface IKey + { + T Key { get; } + } + public interface IObservableCache : DynamicData.Reactive.IConnectableCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + int Count { get; } + System.Collections.Generic.IReadOnlyList Items { get; } + System.Collections.Generic.IReadOnlyDictionary KeyValues { get; } + System.Collections.Generic.IReadOnlyList Keys { get; } + DynamicData.Reactive.Kernel.Optional Lookup(TKey key); + } + public interface IObservableList : System.IDisposable + where T : notnull + { + int Count { get; } + System.IObservable CountChanged { get; } + System.Collections.Generic.IReadOnlyList Items { get; } + System.IObservable> Connect(System.Func? predicate = null); + System.IObservable> Preview(System.Func? predicate = null); + } + public interface IPageChangeSet : DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where T : notnull + { + DynamicData.Reactive.Operators.IPageResponse Response { get; } + } + public interface IPageRequest + { + int Page { get; } + int Size { get; } + } + public interface IPagedChangeSet : DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, DynamicData.Reactive.ISortedChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + DynamicData.Reactive.Operators.IPageResponse Response { get; } + } + public interface IQuery + where TObject : notnull + { + int Count { get; } + System.Collections.Generic.IEnumerable Items { get; } + System.Collections.Generic.IEnumerable> KeyValues { get; } + System.Collections.Generic.IEnumerable Keys { get; } + DynamicData.Reactive.Kernel.Optional Lookup(TKey key); + } + public interface ISortedChangeSetAdaptor + where TObject : notnull + where TKey : notnull + { + void Adapt(DynamicData.Reactive.ISortedChangeSet changes); + } + public interface ISortedChangeSet : DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + DynamicData.Reactive.IKeyValueCollection SortedItems { get; } + } + public interface ISourceCache : DynamicData.Reactive.IConnectableCache, DynamicData.Reactive.IObservableCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + System.Func KeySelector { get; } + void Edit(System.Action> updateAction); + } + public interface ISourceList : DynamicData.Reactive.IObservableList, System.IDisposable + where T : notnull + { + void Edit(System.Action> updateAction); + } + public interface ISourceUpdater : DynamicData.Reactive.ICacheUpdater, DynamicData.Reactive.IQuery + where TObject : notnull + where TKey : notnull + { + void AddOrUpdate(System.Collections.Generic.IEnumerable items); + void AddOrUpdate(TObject item); + void AddOrUpdate(System.Collections.Generic.IEnumerable items, System.Collections.Generic.IEqualityComparer comparer); + void AddOrUpdate(TObject item, System.Collections.Generic.IEqualityComparer comparer); + void Load(System.Collections.Generic.IEnumerable items); + void Refresh(System.Collections.Generic.IEnumerable items); + void Refresh(TObject item); + void Remove(System.Collections.Generic.IEnumerable items); + void Remove(TObject item); + } + public interface IVirtualChangeSet : DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where T : notnull + { + DynamicData.Reactive.IVirtualResponse Response { get; } + } + public interface IVirtualChangeSet : DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, DynamicData.Reactive.ISortedChangeSet, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + where TObject : notnull + where TKey : notnull + { + DynamicData.Reactive.IVirtualResponse Response { get; } + } + public interface IVirtualRequest + { + int Size { get; } + int StartIndex { get; } + } + public interface IVirtualResponse + { + int Size { get; } + int StartIndex { get; } + int TotalSize { get; } + } + public sealed class IndexedItem : System.IEquatable> + { + public IndexedItem(TObject value, TKey key, int index) { } + public int Index { get; } + public TKey Key { get; } + public TObject Value { get; } + public bool Equals(DynamicData.Reactive.IndexedItem? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + } + [System.Diagnostics.DebuggerDisplay("IntermediateCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] + public sealed class IntermediateCache : DynamicData.Reactive.Binding.INotifyCollectionChangedSuspender, DynamicData.Reactive.IConnectableCache, DynamicData.Reactive.IIntermediateCache, DynamicData.Reactive.IObservableCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + public IntermediateCache() { } + public IntermediateCache(System.IObservable> source) { } + public int Count { get; } + public System.IObservable CountChanged { get; } + public System.Collections.Generic.IReadOnlyList Items { get; } + public System.Collections.Generic.IReadOnlyDictionary KeyValues { get; } + public System.Collections.Generic.IReadOnlyList Keys { get; } + public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } + public void Dispose() { } + public void Edit(System.Action> updateAction) { } + public DynamicData.Reactive.Kernel.Optional Lookup(TKey key) { } + public System.IObservable> Preview(System.Func? predicate = null) { } + public System.IDisposable SuspendCount() { } + public System.IDisposable SuspendNotifications() { } + public System.IObservable> Watch(TKey key) { } + } + public readonly struct ItemChange : System.IEquatable> + where T : notnull + { + public static readonly DynamicData.Reactive.ItemChange Empty; + public ItemChange(DynamicData.Reactive.ListChangeReason reason, T current, int currentIndex) { } + public ItemChange(DynamicData.Reactive.ListChangeReason reason, T current, in DynamicData.Reactive.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public T Current { get; } + public int CurrentIndex { get; } + public DynamicData.Reactive.Kernel.Optional Previous { get; } + public int PreviousIndex { get; } + public DynamicData.Reactive.ListChangeReason Reason { get; } + public bool Equals(DynamicData.Reactive.ItemChange other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(in DynamicData.Reactive.ItemChange left, in DynamicData.Reactive.ItemChange right) { } + public static bool operator ==(in DynamicData.Reactive.ItemChange left, in DynamicData.Reactive.ItemChange right) { } + } + public enum ListChangeReason + { + Add = 0, + AddRange = 1, + Replace = 2, + Remove = 3, + RemoveRange = 4, + Refresh = 5, + Moved = 6, + Clear = 7, + } + public static class ListEx + { + public static void Add(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items) { } + public static void AddOrInsertRange(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items, int index) { } + public static void AddRange(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items) { } + public static void AddRange(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items, int index) { } + public static int BinarySearch(this System.Collections.Generic.IList list, TItem value) { } + public static int BinarySearch(this System.Collections.Generic.IList list, TItem value, System.Collections.Generic.IComparer comparer) { } + public static int BinarySearch(this System.Collections.Generic.IList list, TSearch value, System.Func comparer) { } + public static void Clone(this System.Collections.Generic.IList source, DynamicData.Reactive.IChangeSet changes) + where T : notnull { } + public static void Clone(this System.Collections.Generic.IList source, DynamicData.Reactive.IChangeSet changes, System.Collections.Generic.IEqualityComparer? equalityComparer) + where T : notnull { } + public static void Clone(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable> changes, System.Collections.Generic.IEqualityComparer? equalityComparer) + where T : notnull { } + public static int IndexOf(this System.Collections.Generic.IEnumerable source, T item) { } + public static int IndexOf(this System.Collections.Generic.IEnumerable source, T item, System.Collections.Generic.IEqualityComparer equalityComparer) { } + public static DynamicData.Reactive.Kernel.Optional> IndexOfOptional(this System.Collections.Generic.IEnumerable source, T item, System.Collections.Generic.IEqualityComparer? equalityComparer = null) { } + public static void Remove(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items) { } + public static void RemoveMany(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable itemsToRemove) { } + public static void Replace(this System.Collections.Generic.IList source, T original, T replaceWith) { } + public static void Replace(this System.Collections.Generic.IList source, T original, T replaceWith, System.Collections.Generic.IEqualityComparer comparer) { } + public static void ReplaceOrAdd(this System.Collections.Generic.IList source, T original, T replaceWith) { } + } + public enum ListFilterPolicy + { + ClearAndReplace = 0, + CalculateDiff = 1, + } + [System.Serializable] + public class MissingKeyException : System.Exception + { + public MissingKeyException() { } + public MissingKeyException(string message) { } + public MissingKeyException(string message, System.Exception innerException) { } + } + public class Node : System.IDisposable, System.IEquatable> + where TObject : class + where TKey : notnull + { + public Node(TObject item, TKey key) { } + public Node(TObject item, TKey key, in DynamicData.Reactive.Kernel.Optional> parent) { } + public DynamicData.Reactive.IObservableCache, TKey> Children { get; } + public int Depth { get; } + public bool IsRoot { get; } + public TObject Item { get; } + public TKey Key { get; } + public DynamicData.Reactive.Kernel.Optional> Parent { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + public bool Equals(DynamicData.Reactive.Node? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(DynamicData.Reactive.Node left, DynamicData.Reactive.Node right) { } + public static bool operator ==(DynamicData.Reactive.Node? left, DynamicData.Reactive.Node? right) { } + } + public static class ObservableCacheEx + { + public static System.IObservable> Adapt(this System.IObservable> source, DynamicData.Reactive.IChangeSetAdaptor adaptor) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Adapt(this System.IObservable> source, DynamicData.Reactive.ISortedChangeSetAdaptor adaptor) + where TObject : notnull + where TKey : notnull { } + public static void AddOrUpdate(this DynamicData.Reactive.ISourceCache source, System.Collections.Generic.IEnumerable items) + where TObject : notnull + where TKey : notnull { } + public static void AddOrUpdate(this DynamicData.Reactive.ISourceCache source, TObject item) + where TObject : notnull + where TKey : notnull { } + public static void AddOrUpdate(this DynamicData.Reactive.IIntermediateCache source, TObject item, TKey key) + where TObject : notnull + where TKey : notnull { } + public static void AddOrUpdate(this DynamicData.Reactive.ISourceCache source, System.Collections.Generic.IEnumerable items, System.Collections.Generic.IEqualityComparer equalityComparer) + where TObject : notnull + where TKey : notnull { } + public static void AddOrUpdate(this DynamicData.Reactive.ISourceCache source, TObject item, System.Collections.Generic.IEqualityComparer equalityComparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this DynamicData.Reactive.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this DynamicData.Reactive.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this DynamicData.Reactive.IObservableList>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this System.Collections.Generic.ICollection>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this System.IObservable> source, params System.IObservable>[] others) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Reactive.IObservableCache AsObservableCache(this DynamicData.Reactive.IObservableCache source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Reactive.IObservableCache AsObservableCache(this System.IObservable> source, bool applyLocking = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> AsyncDisposeMany(this System.IObservable> source, System.Action> disposalsCompletedAccessor) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull { } + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull { } + public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Batch(this System.IObservable> source, System.TimeSpan timeSpan, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.TimeSpan? timeOut = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, System.IObservable? timer = null, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BatchIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState = false, System.TimeSpan? timeOut = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, System.Collections.Generic.IList targetList) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, System.Collections.Generic.IList targetList) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Reactive.Binding.IObservableCollection destination) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Reactive.Binding.IObservableCollection destination, DynamicData.Reactive.Binding.BindingOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Reactive.Binding.IObservableCollection destination, DynamicData.Reactive.Binding.IObservableCollectionAdaptor updater) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Reactive.Binding.IObservableCollection destination, int refreshThreshold = 25) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Reactive.Binding.BindingOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.ComponentModel.BindingList bindingList, int resetThreshold = 25) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, System.Collections.Generic.IList targetList, DynamicData.Reactive.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Reactive.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, System.Collections.Generic.IList targetList, DynamicData.Reactive.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable>> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Reactive.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Reactive.Binding.IObservableCollection destination, DynamicData.Reactive.Binding.BindingOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Reactive.Binding.IObservableCollection destination, DynamicData.Reactive.Binding.ISortedObservableCollectionAdaptor updater) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Reactive.Binding.BindingOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.ComponentModel.BindingList bindingList, int resetThreshold = 25) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = 25, bool useReplaceForUpdates = true, DynamicData.Reactive.Binding.IObservableCollectionAdaptor? adaptor = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = 25, bool useReplaceForUpdates = true, DynamicData.Reactive.Binding.ISortedObservableCollectionAdaptor? adaptor = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> BufferInitial(this System.IObservable> source, System.TimeSpan initialBuffer, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Cast(this System.IObservable> source, System.Func converter) + where TSource : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> ChangeKey(this System.IObservable> source, System.Func keySelector) + where TObject : notnull + where TSourceKey : notnull + where TDestinationKey : notnull { } + public static System.IObservable> ChangeKey(this System.IObservable> source, System.Func keySelector) + where TObject : notnull + where TSourceKey : notnull + where TDestinationKey : notnull { } + public static void Clear(this DynamicData.Reactive.Cache.Internal.LockFreeObservableCache source) + where TObject : notnull + where TKey : notnull { } + public static void Clear(this DynamicData.Reactive.IIntermediateCache source) + where TObject : notnull + where TKey : notnull { } + public static void Clear(this DynamicData.Reactive.ISourceCache source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Clone(this System.IObservable> source, System.Collections.Generic.ICollection target) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("This was an experiment that did not work. Use Transform instead")] + public static System.IObservable> Convert(this System.IObservable> source, System.Func conversionFactory) + where TObject : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> DeferUntilLoaded(this DynamicData.Reactive.IObservableCache source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> DeferUntilLoaded(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> DisposeMany(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> DistinctValues(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TKey : notnull + where TValue : notnull { } + public static void EditDiff(this DynamicData.Reactive.ISourceCache source, System.Collections.Generic.IEnumerable allItems, System.Collections.Generic.IEqualityComparer equalityComparer) + where TObject : notnull + where TKey : notnull { } + public static void EditDiff(this DynamicData.Reactive.ISourceCache source, System.Collections.Generic.IEnumerable allItems, System.Func areItemsEqual) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> EditDiff(this System.IObservable> source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> EditDiff(this System.IObservable> source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> EnsureUniqueKeys(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Except(this DynamicData.Reactive.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Except(this DynamicData.Reactive.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Except(this DynamicData.Reactive.IObservableList>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Except(this System.Collections.Generic.ICollection>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Except(this System.IObservable> source, params System.IObservable>[] others) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, System.Reactive.Concurrency.IScheduler scheduler) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, System.TimeSpan? pollingInterval) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> ExpireAfter(this DynamicData.Reactive.ISourceCache source, System.Func timeSelector, System.TimeSpan? pollingInterval = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ExpireAfter(this System.IObservable> source, System.Func timeSelector, System.TimeSpan? pollingInterval, System.Reactive.Concurrency.IScheduler scheduler) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.Func filter, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicateChanged, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicateChanged, System.IObservable reapplyFilter, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable predicateState, System.Func predicate, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> FilterImmutable(this System.IObservable> source, System.Func predicate, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> filterFactory, System.TimeSpan? buffer = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> filterFactory, System.TimeSpan? buffer = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("This can cause unhandled exception issues so do not use")] + public static System.IObservable FinallySafe(this System.IObservable source, System.Action finallyAction) { } + public static System.IObservable> Flatten(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> FlattenBufferResult(this System.IObservable>> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ForEachChange(this System.IObservable> source, System.Action> action) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.Kernel.Optional, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.Kernel.Optional, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> Group(this System.IObservable> source, System.Func groupSelectorKey) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> Group(this System.IObservable> source, System.Func groupSelector, System.IObservable> resultGroupSource) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> Group(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable regrouper) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> Group(this System.IObservable> source, System.IObservable> groupSelectorKeyObservable, System.IObservable? regrouper = null) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> Group(this System.IObservable> source, System.IObservable> groupSelectorKeyObservable, System.IObservable? regrouper = null) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> GroupOnObservable(this System.IObservable> source, System.Func> groupObservableSelector) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> GroupOnObservable(this System.IObservable> source, System.Func> groupObservableSelector) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> GroupOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> GroupOnPropertyWithImmutableState(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> GroupWithImmutableState(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable? regrouper = null) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> IgnoreSameReferenceUpdate(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> IgnoreUpdateWhen(this System.IObservable> source, System.Func ignoreFunction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> IncludeUpdateWhen(this System.IObservable> source, System.Func includeFunction) + where TObject : notnull + where TKey : notnull { } + [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + "leftKey", + "rightKey"})] + public static System.IObservable>> InnerJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + [return: System.Runtime.CompilerServices.TupleElementNames(new string[] { + "leftKey", + "rightKey"})] + public static System.IObservable>> InnerJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, [System.Runtime.CompilerServices.TupleElementNames(new string[] { + "leftKey", + "rightKey"})] System.Func, TLeft, TRight, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> InnerJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> InnerJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> InvokeEvaluate(this System.IObservable> source) + where TObject : DynamicData.Reactive.Binding.IEvaluateAware + where TKey : notnull { } + public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> LeftJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> LeftJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> LimitSizeTo(this System.IObservable> source, int size) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> LimitSizeTo(this DynamicData.Reactive.ISourceCache source, int sizeLimit, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IEqualityComparer equalityComparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer equalityComparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer equalityComparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer equalityComparer, System.Collections.Generic.IComparer comparer, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable MergeMany(this System.IObservable> source, System.Func> observableSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable MergeMany(this System.IObservable> source, System.Func> observableSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, System.Collections.Generic.IComparer childComparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, System.Collections.Generic.IComparer childComparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? childComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, bool resortOnSourceRefresh, System.Collections.Generic.IComparer childComparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? childComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, bool resortOnSourceRefresh, System.Collections.Generic.IComparer childComparer) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, bool resortOnSourceRefresh, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? childComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer sourceComparer, bool resortOnSourceRefresh, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? childComparer = null) + where TObject : notnull + where TKey : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyItems(this System.IObservable> source, System.Func> observableSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeManyItems(this System.IObservable> source, System.Func> observableSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable MonitorStatus(this System.IObservable source) { } + public static System.IObservable> NotEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OfType(this System.IObservable> source, bool suppressEmptyChangeSets = true) + where TObject : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> OnItemAdded(this System.IObservable> source, System.Action addAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemAdded(this System.IObservable> source, System.Action addAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemRefreshed(this System.IObservable> source, System.Action refreshAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemRefreshed(this System.IObservable> source, System.Action refreshAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemRemoved(this System.IObservable> source, System.Action removeAction, bool invokeOnUnsubscribe = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemRemoved(this System.IObservable> source, System.Action removeAction, bool invokeOnUnsubscribe = true) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemUpdated(this System.IObservable> source, System.Action updateAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> OnItemUpdated(this System.IObservable> source, System.Action updateAction) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Or(this DynamicData.Reactive.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Or(this DynamicData.Reactive.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Or(this DynamicData.Reactive.IObservableList>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Or(this System.Collections.Generic.ICollection>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Or(this System.IObservable> source, params System.IObservable>[] others) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("Use SortAndPage as it\'s more efficient")] + public static System.IObservable> Page(this System.IObservable> source, System.IObservable pageRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IDisposable PopulateFrom(this DynamicData.Reactive.ISourceCache source, System.IObservable> observable) + where TObject : notnull + where TKey : notnull { } + public static System.IDisposable PopulateFrom(this DynamicData.Reactive.ISourceCache source, System.IObservable observable) + where TObject : notnull + where TKey : notnull { } + public static System.IDisposable PopulateInto(this System.IObservable> source, DynamicData.Reactive.Cache.Internal.LockFreeObservableCache destination) + where TObject : notnull + where TKey : notnull { } + public static System.IDisposable PopulateInto(this System.IObservable> source, DynamicData.Reactive.IIntermediateCache destination) + where TObject : notnull + where TKey : notnull { } + public static System.IDisposable PopulateInto(this System.IObservable> source, DynamicData.Reactive.ISourceCache destination) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> QueryWhenChanged(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable QueryWhenChanged(this System.IObservable> source, System.Func, TDestination> resultSelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> QueryWhenChanged(this System.IObservable> source, System.Func> itemChangedTrigger) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> RefCount(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static void Refresh(this DynamicData.Reactive.ISourceCache source) + where TObject : notnull + where TKey : notnull { } + public static void Refresh(this DynamicData.Reactive.ISourceCache source, System.Collections.Generic.IEnumerable items) + where TObject : notnull + where TKey : notnull { } + public static void Refresh(this DynamicData.Reactive.ISourceCache source, TObject item) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.Reactive.IIntermediateCache source, System.Collections.Generic.IEnumerable keys) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.Reactive.IIntermediateCache source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.Reactive.ISourceCache source, System.Collections.Generic.IEnumerable keys) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.Reactive.ISourceCache source, System.Collections.Generic.IEnumerable items) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.Reactive.ISourceCache source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static void Remove(this DynamicData.Reactive.ISourceCache source, TObject item) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> RemoveKey(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static void RemoveKey(this DynamicData.Reactive.ISourceCache source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static void RemoveKeys(this DynamicData.Reactive.ISourceCache source, System.Collections.Generic.IEnumerable keys) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) + where TLeft : notnull + where TLeftKey : notnull + where TRight : notnull + where TRightKey : notnull + where TDestination : notnull { } + public static System.IObservable> SkipInitial(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("Use SortAndBind as it\'s more efficient")] + public static System.IObservable> Sort(this System.IObservable> source, System.Collections.Generic.IComparer comparer, DynamicData.Reactive.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("Use SortAndBind as it\'s more efficient")] + public static System.IObservable> Sort(this System.IObservable> source, System.IObservable> comparerObservable, DynamicData.Reactive.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("Use SortAndBind as it\'s more efficient")] + public static System.IObservable> Sort(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable resorter, DynamicData.Reactive.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + where TObject : notnull + where TKey : notnull { } + [System.Obsolete("Use SortAndBind as it\'s more efficient")] + public static System.IObservable> Sort(this System.IObservable> source, System.IObservable> comparerObservable, System.IObservable resorter, DynamicData.Reactive.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList) + where TObject : notnull, System.IComparable + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection) + where TObject : notnull, System.IComparable + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList, DynamicData.Reactive.Binding.SortAndBindOptions options) + where TObject : notnull, System.IComparable + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList, System.IObservable> comparerChanged) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Reactive.Binding.SortAndBindOptions options) + where TObject : notnull, System.IComparable + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, System.IObservable> comparerChanged) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList, System.Collections.Generic.IComparer comparer, DynamicData.Reactive.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, System.Collections.Generic.IList targetList, System.IObservable> comparerChanged, DynamicData.Reactive.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, System.Collections.Generic.IComparer comparer, DynamicData.Reactive.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortAndBind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] TObject, TKey>(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, System.IObservable> comparerChanged, DynamicData.Reactive.Binding.SortAndBindOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndPage(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable pageRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndPage(this System.IObservable> source, System.IObservable> comparerChanged, System.IObservable pageRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndPage(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable pageRequests, DynamicData.Reactive.SortAndPageOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndPage(this System.IObservable> source, System.IObservable> comparerChanged, System.IObservable pageRequests, DynamicData.Reactive.SortAndPageOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndVirtualize(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable virtualRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndVirtualize(this System.IObservable> source, System.IObservable> comparerChanged, System.IObservable virtualRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndVirtualize(this System.IObservable> source, System.Collections.Generic.IComparer comparer, System.IObservable virtualRequests, DynamicData.Reactive.SortAndVirtualizeOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> SortAndVirtualize(this System.IObservable> source, System.IObservable> comparerChanged, System.IObservable virtualRequests, DynamicData.Reactive.SortAndVirtualizeOptions options) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SortBy(this System.IObservable> source, System.Func expression, DynamicData.Reactive.Binding.SortDirection sortOrder = 0, DynamicData.Reactive.SortOptimisations sortOptimisations = 0, int resetThreshold = 100) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull { } + public static System.IObservable> StartWithItem(this System.IObservable> source, TObject item) + where TObject : DynamicData.Reactive.IKey + where TKey : notnull { } + public static System.IObservable> StartWithItem(this System.IObservable> source, TObject item, TKey key) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SubscribeMany(this System.IObservable> source, System.Func subscriptionFactory) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SubscribeMany(this System.IObservable> source, System.Func subscriptionFactory) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SuppressRefresh(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Switch(this System.IObservable> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Switch(this System.IObservable>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToCollection(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func keySelector, System.Func? expireAfter = null, int limitSizeTo = -1, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func keySelector, System.Func? expireAfter = null, int limitSizeTo = -1, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, bool initialOptionalWhenMissing, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Func sort, DynamicData.Reactive.Binding.SortDirection sortOrder = 0) + where TObject : notnull + where TKey : notnull + where TSortKey : notnull { } + [System.Obsolete("Use Overload with comparer as it\'s more efficient")] + public static System.IObservable> Top(this System.IObservable> source, int size) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable>> Top(this System.IObservable> source, System.Collections.Generic.IComparer comparer, int size) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, bool transformOnRefresh) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, DynamicData.Reactive.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, DynamicData.Reactive.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, DynamicData.Reactive.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformImmutable(this System.IObservable> source, System.Func transformFactory) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Func keySelector) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Func keySelector) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Func keySelector) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Func keySelector) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func>> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func>> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func>> manySelector, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func>> manySelector, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func> manySelector, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull + where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable { } + public static System.IObservable> TransformManyAsync(this System.IObservable> source, System.Func> manySelector, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull + where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func>> manySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func>> manySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func>> manySelector, System.Func keySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func>> manySelector, System.Func keySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func> manySelector, System.Func keySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull + where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable { } + public static System.IObservable> TransformManySafeAsync(this System.IObservable> source, System.Func> manySelector, System.Func keySelector, System.Action> errorHandler, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull + where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable { } + public static System.IObservable> TransformOnObservable(this System.IObservable> source, System.Func> transformFactory) + where TSource : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> TransformOnObservable(this System.IObservable> source, System.Func> transformFactory) + where TSource : notnull + where TKey : notnull + where TDestination : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func> transformFactory, System.Action> errorHandler, DynamicData.Reactive.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func> transformFactory, System.Action> errorHandler, DynamicData.Reactive.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, DynamicData.Reactive.TransformAsyncOptions options) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable, TKey>> TransformToTree(this System.IObservable> source, System.Func pivotOn, System.IObservable, bool>>? predicateChanged = null) + where TObject : class + where TKey : notnull { } + public static System.IObservable> TransformWithInlineUpdate(this System.IObservable> source, System.Func transformFactory, System.Action updateAction) + where TDestination : class + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformWithInlineUpdate(this System.IObservable> source, System.Func transformFactory, System.Action updateAction, System.Action> errorHandler) + where TDestination : class + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformWithInlineUpdate(this System.IObservable> source, System.Func transformFactory, System.Action updateAction, bool transformOnRefresh) + where TDestination : class + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformWithInlineUpdate(this System.IObservable> source, System.Func transformFactory, System.Action updateAction, System.Action> errorHandler, bool transformOnRefresh) + where TDestination : class + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TreatMovesAsRemoveAdd(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable TrueForAll(this System.IObservable> source, System.Func> observableSelector, System.Func equalityCondition) + where TObject : notnull + where TKey : notnull + where TValue : notnull { } + public static System.IObservable TrueForAll(this System.IObservable> source, System.Func> observableSelector, System.Func equalityCondition) + where TObject : notnull + where TKey : notnull + where TValue : notnull { } + public static System.IObservable TrueForAny(this System.IObservable> source, System.Func> observableSelector, System.Func equalityCondition) + where TObject : notnull + where TKey : notnull + where TValue : notnull { } + public static System.IObservable TrueForAny(this System.IObservable> source, System.Func> observableSelector, System.Func equalityCondition) + where TObject : notnull + where TKey : notnull + where TValue : notnull { } + public static System.IObservable> UpdateIndex(this System.IObservable> source) + where TObject : DynamicData.Reactive.Binding.IIndexAware + where TKey : notnull { } + [System.Obsolete("Use SortAndVirtualize as it\'s more efficient")] + public static System.IObservable> Virtualise(this System.IObservable> source, System.IObservable virtualRequests) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Watch(this System.IObservable> source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable WatchValue(this DynamicData.Reactive.IObservableCache source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable WatchValue(this System.IObservable> source, TKey key) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable WhenAnyPropertyChanged(this System.IObservable> source, params string[] propertiesToMonitor) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull { } + public static System.IObservable> WhenPropertyChanged(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull { } + public static System.IObservable WhenValueChanged(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TKey : notnull { } + public static System.IObservable> WhereReasonsAre(this System.IObservable> source, params DynamicData.Reactive.ChangeReason[] reasons) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> WhereReasonsAreNot(this System.IObservable> source, params DynamicData.Reactive.ChangeReason[] reasons) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Xor(this DynamicData.Reactive.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Xor(this DynamicData.Reactive.IObservableList> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Xor(this DynamicData.Reactive.IObservableList>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Xor(this System.Collections.Generic.ICollection>> sources) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Xor(this System.IObservable> source, params System.IObservable>[] others) + where TObject : notnull + where TKey : notnull { } + } + public static class ObservableChangeSet + { + public static System.IObservable> Create(System.Func, System.Action> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.IDisposable> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe) + where T : notnull { } + public static System.IObservable> Create(System.Func, System.Action> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.IDisposable> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Create(System.Func, System.Threading.CancellationToken, System.Threading.Tasks.Task> subscribe, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + } + public static class ObservableListEx + { + public static System.IObservable> Adapt(this System.IObservable> source, DynamicData.Reactive.IChangeSetAdaptor adaptor) + where T : notnull { } + public static System.IObservable> AddKey(this System.IObservable> source, System.Func keySelector) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> And(this DynamicData.Reactive.IObservableList> sources) + where T : notnull { } + public static System.IObservable> And(this DynamicData.Reactive.IObservableList> sources) + where T : notnull { } + public static System.IObservable> And(this DynamicData.Reactive.IObservableList>> sources) + where T : notnull { } + public static System.IObservable> And(this System.Collections.Generic.ICollection>> sources) + where T : notnull { } + public static System.IObservable> And(this System.IObservable> source, params System.IObservable>[] others) + where T : notnull { } + public static DynamicData.Reactive.IObservableList AsObservableList(this DynamicData.Reactive.ISourceList source) + where T : notnull { } + public static DynamicData.Reactive.IObservableList AsObservableList(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> AutoRefresh(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, System.TimeSpan? changeSetBuffer = default, System.TimeSpan? propertyChangeThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> AutoRefreshOnObservable(this System.IObservable> source, System.Func> reevaluator, System.TimeSpan? changeSetBuffer = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Reactive.Binding.IObservableCollection targetCollection, DynamicData.Reactive.Binding.BindingOptions options) + where T : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, DynamicData.Reactive.Binding.IObservableCollection targetCollection, int resetThreshold = 25) + where T : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, DynamicData.Reactive.Binding.BindingOptions options) + where T : notnull { } + public static System.IObservable> Bind(this System.IObservable> source, out System.Collections.ObjectModel.ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = 25) + where T : notnull { } + public static System.IObservable> Bind<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this System.IObservable> source, System.ComponentModel.BindingList bindingList, int resetThreshold = 25) + where T : notnull { } + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, System.TimeSpan? timeOut, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> BufferIf(this System.IObservable> source, System.IObservable pauseIfTrueSelector, bool initialPauseState, System.TimeSpan? timeOut, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> BufferInitial(this System.IObservable> source, System.TimeSpan initialBuffer, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull { } + public static System.IObservable> Cast(this System.IObservable> source) + where TDestination : notnull { } + public static System.IObservable> Cast(this System.IObservable> source, System.Func conversionFactory) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> CastToObject(this System.IObservable> source) + where T : class { } + public static System.IObservable> Clone(this System.IObservable> source, System.Collections.Generic.IList target) + where T : notnull { } + [System.Obsolete("Prefer Cast as it is does the same thing but is semantically correct")] + public static System.IObservable> Convert(this System.IObservable> source, System.Func conversionFactory) + where TObject : notnull + where TDestination : notnull { } + public static System.IObservable> DeferUntilLoaded(this DynamicData.Reactive.IObservableList source) + where T : notnull { } + public static System.IObservable> DeferUntilLoaded(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> DisposeMany(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> DistinctValues(this System.IObservable> source, System.Func valueSelector) + where TObject : notnull + where TValue : notnull { } + public static System.IObservable> Except(this DynamicData.Reactive.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Except(this DynamicData.Reactive.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Except(this DynamicData.Reactive.IObservableList>> sources) + where T : notnull { } + public static System.IObservable> Except(this System.Collections.Generic.ICollection>> sources) + where T : notnull { } + public static System.IObservable> Except(this System.IObservable> source, params System.IObservable>[] others) + where T : notnull { } + public static System.IObservable> ExpireAfter(this DynamicData.Reactive.ISourceList source, System.Func timeSelector, System.TimeSpan? pollingInterval = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.Func predicate) + where T : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable> predicate, DynamicData.Reactive.ListFilterPolicy filterPolicy = 1) + where T : notnull { } + public static System.IObservable> Filter(this System.IObservable> source, System.IObservable predicateState, System.Func predicate, DynamicData.Reactive.ListFilterPolicy filterPolicy = 1, bool suppressEmptyChangeSets = true) + where T : notnull { } + public static System.IObservable> FilterOnObservable(this System.IObservable> source, System.Func> objectFilterObservable, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull { } + [System.Obsolete("Use AutoRefresh(), followed by Filter() instead")] + public static System.IObservable> FilterOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.Func predicate, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> FlattenBufferResult(this System.IObservable>> source) + where T : notnull { } + public static System.IObservable> ForEachChange(this System.IObservable> source, System.Action> action) + where TObject : notnull { } + public static System.IObservable> ForEachItemChange(this System.IObservable> source, System.Action> action) + where TObject : notnull { } + public static System.IObservable>> GroupOn(this System.IObservable> source, System.Func groupSelector, System.IObservable? regrouper = null) + where TObject : notnull + where TGroup : notnull { } + public static System.IObservable>> GroupOnProperty(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TGroup : notnull { } + public static System.IObservable>> GroupOnPropertyWithImmutableState(this System.IObservable> source, System.Linq.Expressions.Expression> propertySelector, System.TimeSpan? propertyChangedThrottle = default, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : System.ComponentModel.INotifyPropertyChanged + where TGroup : notnull { } + public static System.IObservable>> GroupWithImmutableState(this System.IObservable> source, System.Func groupSelectorKey, System.IObservable? regrouper = null) + where TObject : notnull + where TGroupKey : notnull { } + public static System.IObservable> LimitSizeTo(this DynamicData.Reactive.ISourceList source, int sizeLimit, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> MergeChangeSets(this DynamicData.Reactive.IObservableList>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this System.Collections.Generic.IEnumerable>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.Collections.Generic.IEnumerable>> others, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable> source, System.IObservable> other, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Reactive.Concurrency.IScheduler? scheduler = null, bool completable = true) + where TObject : notnull { } + public static System.IObservable> MergeChangeSets(this DynamicData.Reactive.IObservableList>> source, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>>> source, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this DynamicData.Reactive.IObservableList>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> MergeChangeSets(this System.IObservable>>> source, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable MergeMany(this System.IObservable> source, System.Func> observableSelector) + where T : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TObject : notnull + where TDestination : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IComparer comparer) + where TObject : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> MergeManyChangeSets(this System.IObservable> source, System.Func>> observableSelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null, System.Collections.Generic.IComparer? comparer = null) + where TObject : notnull + where TDestination : notnull + where TDestinationKey : notnull { } + public static System.IObservable> NotEmpty(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> OnItemAdded(this System.IObservable> source, System.Action addAction) + where T : notnull { } + public static System.IObservable> OnItemRefreshed(this System.IObservable> source, System.Action refreshAction) + where T : notnull { } + public static System.IObservable> OnItemRemoved(this System.IObservable> source, System.Action removeAction, bool invokeOnUnsubscribe = true) + where T : notnull { } + public static System.IObservable> Or(this DynamicData.Reactive.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Or(this DynamicData.Reactive.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Or(this DynamicData.Reactive.IObservableList>> sources) + where T : notnull { } + public static System.IObservable> Or(this System.Collections.Generic.ICollection>> sources) + where T : notnull { } + public static System.IObservable> Or(this System.IObservable> source, params System.IObservable>[] others) + where T : notnull { } + public static System.IObservable> Page(this System.IObservable> source, System.IObservable requests) + where T : notnull { } + public static System.IDisposable PopulateInto(this System.IObservable> source, DynamicData.Reactive.ISourceList destination) + where T : notnull { } + public static System.IObservable> QueryWhenChanged(this System.IObservable> source) + where T : notnull { } + public static System.IObservable QueryWhenChanged(this System.IObservable> source, System.Func, TDestination> resultSelector) + where TObject : notnull { } + public static System.IObservable> RefCount(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> RemoveIndex(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> Reverse(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> SkipInitial(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> Sort(this System.IObservable> source, System.IObservable> comparerChanged, DynamicData.Reactive.SortOptions options = 0, System.IObservable? resort = null, int resetThreshold = 50) + where T : notnull { } + public static System.IObservable> Sort(this System.IObservable> source, System.Collections.Generic.IComparer comparer, DynamicData.Reactive.SortOptions options = 0, System.IObservable? resort = null, System.IObservable>? comparerChanged = null, int resetThreshold = 50) + where T : notnull { } + public static System.IObservable> StartWithEmpty(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> SubscribeMany(this System.IObservable> source, System.Func subscriptionFactory) + where T : notnull { } + public static System.IObservable> SuppressRefresh(this System.IObservable> source) + where T : notnull { } + public static System.IObservable> Switch(this System.IObservable> sources) + where T : notnull { } + public static System.IObservable> Switch(this System.IObservable>> sources) + where T : notnull { } + public static System.IObservable> ToCollection(this System.IObservable> source) + where TObject : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func expireAfter, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, int limitSizeTo, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func expireAfter, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, int limitSizeTo, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable> source, System.Func? expireAfter, int limitSizeTo, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func? expireAfter, int limitSizeTo, System.Reactive.Concurrency.IScheduler? scheduler = null) + where T : notnull { } + public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Collections.Generic.IComparer comparer) + where TObject : notnull { } + public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Func sort, DynamicData.Reactive.Binding.SortDirection sortOrder = 0) + where TObject : notnull { } + public static System.IObservable> Top(this System.IObservable> source, int numberOfItems) + where T : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TDestination> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func, int, TDestination> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, int, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TDestination : notnull + where TSource : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TDestination : notnull + where TSource : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TDestination : notnull + where TSource : notnull { } + public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where TDestination : notnull + where TSource : notnull { } + public static System.IObservable> Virtualise(this System.IObservable> source, System.IObservable requests) + where T : notnull { } + public static System.IObservable WhenAnyPropertyChanged(this System.IObservable> source, params string[] propertiesToMonitor) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> WhenPropertyChanged(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable WhenValueChanged(this System.IObservable> source, System.Linq.Expressions.Expression> propertyAccessor, bool notifyOnInitialValue = true) + where TObject : System.ComponentModel.INotifyPropertyChanged { } + public static System.IObservable> WhereReasonsAre(this System.IObservable> source, params DynamicData.Reactive.ListChangeReason[] reasons) + where T : notnull { } + public static System.IObservable> WhereReasonsAreNot(this System.IObservable> source, params DynamicData.Reactive.ListChangeReason[] reasons) + where T : notnull { } + public static System.IObservable> Xor(this DynamicData.Reactive.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Xor(this DynamicData.Reactive.IObservableList> sources) + where T : notnull { } + public static System.IObservable> Xor(this DynamicData.Reactive.IObservableList>> sources) + where T : notnull { } + public static System.IObservable> Xor(this System.Collections.Generic.ICollection>> sources) + where T : notnull { } + public static System.IObservable> Xor(this System.IObservable> source, params System.IObservable>[] others) + where T : notnull { } + } + public class PageContext : System.IEquatable> + { + public PageContext(DynamicData.Reactive.Operators.IPageResponse Response, System.Collections.Generic.IComparer Comparer, DynamicData.Reactive.SortAndPageOptions Options) { } + public System.Collections.Generic.IComparer Comparer { get; init; } + public DynamicData.Reactive.SortAndPageOptions Options { get; init; } + public DynamicData.Reactive.Operators.IPageResponse Response { get; init; } + } + public sealed class PageRequest : DynamicData.Reactive.IPageRequest, System.IEquatable + { + public static readonly DynamicData.Reactive.IPageRequest Default; + public static readonly DynamicData.Reactive.IPageRequest Empty; + public PageRequest() { } + public PageRequest(int page, int size) { } + public int Page { get; } + public int Size { get; } + public static System.Collections.Generic.IEqualityComparer DefaultComparer { get; } + public bool Equals(DynamicData.Reactive.IPageRequest? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + } + public sealed class RangeChange : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + public RangeChange(System.Collections.Generic.IEnumerable items, int index = -1) { } + public int Count { get; } + public int Index { get; } + public static DynamicData.Reactive.RangeChange Empty { get; } + public void Add(T item) { } + public System.Collections.Generic.IEnumerator GetEnumerator() { } + public void Insert(int index, T item) { } + public void SetStartingIndex(int index) { } + public override string ToString() { } + } + public struct SortAndPageOptions : System.IEquatable + { + public SortAndPageOptions() { } + public int InitialCapacity { get; init; } + public int ResetThreshold { get; init; } + public bool UseBinarySearch { get; init; } + } + public struct SortAndVirtualizeOptions : System.IEquatable + { + public SortAndVirtualizeOptions() { } + public int InitialCapacity { get; init; } + public int ResetThreshold { get; init; } + public bool UseBinarySearch { get; init; } + } + [System.Serializable] + public class SortException : System.Exception + { + public SortException() { } + public SortException(string message) { } + public SortException(string message, System.Exception innerException) { } + } + [System.Flags] + public enum SortOptimisations + { + None = 0, + ComparesImmutableValuesOnly = 1, + IgnoreEvaluates = 2, + [System.Obsolete("This is no longer being used. Use one of the other options instead.")] + InsertAtEndThenSort = 3, + } + public enum SortOptions + { + None = 0, + UseBinarySearch = 1, + } + public enum SortReason + { + InitialLoad = 0, + ComparerChanged = 1, + DataChanged = 2, + Reorder = 3, + Reset = 4, + } + public static class SourceCacheEx + { + public static System.IObservable> Cast(this DynamicData.Reactive.IObservableCache source, System.Func converter) + where TSource : notnull + where TKey : notnull + where TDestination : notnull { } + } + [System.Diagnostics.DebuggerDisplay("SourceCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] + public sealed class SourceCache : DynamicData.Reactive.Binding.INotifyCollectionChangedSuspender, DynamicData.Reactive.IConnectableCache, DynamicData.Reactive.IObservableCache, DynamicData.Reactive.ISourceCache, System.IDisposable + where TObject : notnull + where TKey : notnull + { + public SourceCache(System.Func keySelector) { } + public int Count { get; } + public System.IObservable CountChanged { get; } + public System.Collections.Generic.IReadOnlyList Items { get; } + public System.Func KeySelector { get; } + public System.Collections.Generic.IReadOnlyDictionary KeyValues { get; } + public System.Collections.Generic.IReadOnlyList Keys { get; } + public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } + public void Dispose() { } + public void Edit(System.Action> updateAction) { } + public DynamicData.Reactive.Kernel.Optional Lookup(TKey key) { } + public System.IObservable> Preview(System.Func? predicate = null) { } + public System.IDisposable SuspendCount() { } + public System.IDisposable SuspendNotifications() { } + public System.IObservable> Watch(TKey key) { } + } + public static class SourceListEditConvenienceEx + { + public static void Add(this DynamicData.Reactive.ISourceList source, T item) + where T : notnull { } + public static void AddRange(this DynamicData.Reactive.ISourceList source, System.Collections.Generic.IEnumerable items) + where T : notnull { } + public static void Clear(this DynamicData.Reactive.ISourceList source) + where T : notnull { } + public static void EditDiff(this DynamicData.Reactive.ISourceList source, System.Collections.Generic.IEnumerable allItems, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + where T : notnull { } + public static void Insert(this DynamicData.Reactive.ISourceList source, int index, T item) + where T : notnull { } + public static void InsertRange(this DynamicData.Reactive.ISourceList source, System.Collections.Generic.IEnumerable items, int index) + where T : notnull { } + public static void Move(this DynamicData.Reactive.ISourceList source, int original, int destination) + where T : notnull { } + public static bool Remove(this DynamicData.Reactive.ISourceList source, T item) + where T : notnull { } + public static void RemoveAt(this DynamicData.Reactive.ISourceList source, int index) + where T : notnull { } + public static void RemoveMany(this DynamicData.Reactive.ISourceList source, System.Collections.Generic.IEnumerable itemsToRemove) + where T : notnull { } + public static void RemoveRange(this DynamicData.Reactive.ISourceList source, int index, int count) + where T : notnull { } + public static void Replace(this DynamicData.Reactive.ISourceList source, T original, T destination) + where T : notnull { } + public static void ReplaceAt(this DynamicData.Reactive.ISourceList source, int index, T item) + where T : notnull { } + } + public static class SourceListEx + { + public static System.IObservable> Cast(this DynamicData.Reactive.ISourceList source, System.Func conversionFactory) + where TSource : notnull + where TDestination : notnull { } + } + [System.Diagnostics.DebuggerDisplay("SourceList<{typeof(T).Name}> ({Count} Items)")] + public sealed class SourceList : DynamicData.Reactive.IObservableList, DynamicData.Reactive.ISourceList, System.IDisposable + where T : notnull + { + public SourceList(System.IObservable>? source = null) { } + public int Count { get; } + public System.IObservable CountChanged { get; } + public System.Collections.Generic.IReadOnlyList Items { get; } + public System.IObservable> Connect(System.Func? predicate = null) { } + public void Dispose() { } + public void Edit(System.Action> updateAction) { } + public System.IObservable> Preview(System.Func? predicate = null) { } + } + public struct TransformAsyncOptions : System.IEquatable + { + public static readonly DynamicData.Reactive.TransformAsyncOptions Default; + public TransformAsyncOptions(int? MaximumConcurrency, bool TransformOnRefresh) { } + public int? MaximumConcurrency { get; set; } + public bool TransformOnRefresh { get; set; } + } + [System.Serializable] + public class UnspecifiedIndexException : System.Exception + { + public UnspecifiedIndexException() { } + public UnspecifiedIndexException(string message) { } + public UnspecifiedIndexException(string message, System.Exception innerException) { } + } + public class VirtualContext : System.IEquatable> + { + public VirtualContext(DynamicData.Reactive.IVirtualResponse Response, System.Collections.Generic.IComparer Comparer, DynamicData.Reactive.SortAndVirtualizeOptions Options) { } + public System.Collections.Generic.IComparer Comparer { get; init; } + public DynamicData.Reactive.SortAndVirtualizeOptions Options { get; init; } + public DynamicData.Reactive.IVirtualResponse Response { get; init; } + } + public class VirtualRequest : DynamicData.Reactive.IVirtualRequest, System.IEquatable + { + public static readonly DynamicData.Reactive.VirtualRequest Default; + public VirtualRequest() { } + public VirtualRequest(int startIndex, int size) { } + public int Size { get; } + public int StartIndex { get; } + public static System.Collections.Generic.IEqualityComparer StartIndexSizeComparer { get; } + public bool Equals(DynamicData.Reactive.IVirtualRequest? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + } +} +namespace DynamicData.Reactive.Diagnostics +{ + public class ChangeStatistics : System.IEquatable + { + public ChangeStatistics() { } + public ChangeStatistics(int index, int adds, int updates, int removes, int refreshes, int moves, int count) { } + public int Adds { get; } + public int Count { get; } + public int Index { get; } + public System.DateTime LastUpdated { get; } + public int Moves { get; } + public int Refreshes { get; } + public int Removes { get; } + public int Updates { get; } + public bool Equals(DynamicData.Reactive.Diagnostics.ChangeStatistics? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(DynamicData.Reactive.Diagnostics.ChangeStatistics left, DynamicData.Reactive.Diagnostics.ChangeStatistics right) { } + public static bool operator ==(DynamicData.Reactive.Diagnostics.ChangeStatistics left, DynamicData.Reactive.Diagnostics.ChangeStatistics right) { } + } + public class ChangeSummary + { + public static readonly DynamicData.Reactive.Diagnostics.ChangeSummary Empty; + public ChangeSummary(int index, DynamicData.Reactive.Diagnostics.ChangeStatistics latest, DynamicData.Reactive.Diagnostics.ChangeStatistics overall) { } + public DynamicData.Reactive.Diagnostics.ChangeStatistics Latest { get; } + public DynamicData.Reactive.Diagnostics.ChangeStatistics Overall { get; } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + } + public static class DiagnosticOperators + { + public static System.IObservable CollectUpdateStats(this System.IObservable> source) + where TSource : notnull { } + public static System.IObservable CollectUpdateStats(this System.IObservable> source) + where TSource : notnull + where TKey : notnull { } + } +} +namespace DynamicData.Reactive.Experimental +{ + public static class ExperimentalEx + { + public static DynamicData.Reactive.Experimental.IWatcher AsWatcher(this System.IObservable> source, System.Reactive.Concurrency.IScheduler? scheduler = null) + where TObject : notnull + where TKey : notnull { } + } + public interface IWatcher : System.IDisposable + where TObject : notnull + where TKey : notnull + { + System.IObservable> Watch(TKey key); + } +} +namespace DynamicData.Reactive.Kernel +{ + public enum ConnectionStatus + { + Pending = 0, + Loaded = 1, + Errored = 2, + Completed = 3, + } + public static class EnumerableEx + { + public static T[] AsArray(this System.Collections.Generic.IEnumerable source) { } + public static System.Collections.Generic.List AsList(this System.Collections.Generic.IEnumerable source) { } + public static System.Collections.Generic.IEnumerable Duplicates(this System.Collections.Generic.IEnumerable source, System.Func valueSelector) { } + public static System.Collections.Generic.IEnumerable> IndexOfMany(this System.Collections.Generic.IEnumerable source, System.Collections.Generic.IEnumerable itemsToFind) { } + public static System.Collections.Generic.IEnumerable IndexOfMany(this System.Collections.Generic.IEnumerable source, System.Collections.Generic.IEnumerable itemsToFind, System.Func resultSelector) { } + } + public sealed class Error : DynamicData.Reactive.IKeyValue, DynamicData.Reactive.IKey, System.IEquatable> + where TKey : notnull + { + public Error(System.Exception? exception, TObject value, TKey key) { } + public System.Exception? Exception { get; } + public TKey Key { get; } + public TObject Value { get; } + public bool Equals(DynamicData.Reactive.Kernel.Error? other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(DynamicData.Reactive.Kernel.Error left, DynamicData.Reactive.Kernel.Error right) { } + public static bool operator ==(DynamicData.Reactive.Kernel.Error left, DynamicData.Reactive.Kernel.Error right) { } + } + public static class InternalEx + { + public static System.IObservable RetryWithBackOff(this System.IObservable source, System.Func backOffStrategy) + where TException : System.Exception { } + public static System.IDisposable ScheduleRecurringAction(this System.Reactive.Concurrency.IScheduler scheduler, System.Func interval, System.Action action) { } + public static System.IDisposable ScheduleRecurringAction(this System.Reactive.Concurrency.IScheduler scheduler, System.TimeSpan interval, System.Action action) { } + } + public readonly struct ItemWithIndex : System.IEquatable> + { + public ItemWithIndex(T item, int index) { } + public int Index { get; } + public T Item { get; } + public bool Equals(DynamicData.Reactive.Kernel.ItemWithIndex other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(in DynamicData.Reactive.Kernel.ItemWithIndex left, in DynamicData.Reactive.Kernel.ItemWithIndex right) { } + public static bool operator ==(in DynamicData.Reactive.Kernel.ItemWithIndex left, in DynamicData.Reactive.Kernel.ItemWithIndex right) { } + } + public readonly struct ItemWithValue : System.IEquatable> + { + public ItemWithValue(TObject item, TValue value) { } + public TObject Item { get; } + public TValue Value { get; } + public bool Equals(DynamicData.Reactive.Kernel.ItemWithValue other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string ToString() { } + public static bool operator !=(in DynamicData.Reactive.Kernel.ItemWithValue left, in DynamicData.Reactive.Kernel.ItemWithValue right) { } + public static bool operator ==(in DynamicData.Reactive.Kernel.ItemWithValue left, in DynamicData.Reactive.Kernel.ItemWithValue right) { } + } + public sealed class OptionElse + { + public void Else(System.Action action) { } + } + public static class OptionExtensions + { + public static DynamicData.Reactive.Kernel.Optional Convert(this in DynamicData.Reactive.Kernel.Optional source, System.Func> converter) + where TSource : notnull + where TDestination : notnull { } + public static DynamicData.Reactive.Kernel.Optional Convert(this in DynamicData.Reactive.Kernel.Optional source, System.Func converter) + where TSource : notnull + where TDestination : notnull { } + public static TDestination? ConvertOr(this in DynamicData.Reactive.Kernel.Optional source, System.Func converter, System.Func fallbackConverter) + where TSource : notnull { } + public static DynamicData.Reactive.Kernel.Optional FirstOrOptional(this System.Collections.Generic.IEnumerable source, System.Func selector) + where T : notnull { } + public static DynamicData.Reactive.Kernel.OptionElse IfHasValue(this DynamicData.Reactive.Kernel.Optional? source, System.Action action) + where T : notnull { } + public static DynamicData.Reactive.Kernel.OptionElse IfHasValue(this in DynamicData.Reactive.Kernel.Optional source, System.Action action) + where T : notnull { } + public static DynamicData.Reactive.Kernel.Optional Lookup(this System.Collections.Generic.IDictionary source, TKey key) + where TValue : notnull { } + public static DynamicData.Reactive.Kernel.Optional OrElse(this in DynamicData.Reactive.Kernel.Optional source, System.Func> fallbackOperation) + where T : notnull { } + public static bool RemoveIfContained(this System.Collections.Generic.IDictionary source, TKey key) { } + public static System.Collections.Generic.IEnumerable SelectValues(this System.Collections.Generic.IEnumerable> source) + where T : notnull { } + public static T ValueOr(this T? source, T defaultValue) + where T : struct { } + public static T ValueOr(this in DynamicData.Reactive.Kernel.Optional source, System.Func valueSelector) + where T : notnull { } + public static T? ValueOrDefault(this in DynamicData.Reactive.Kernel.Optional source) + where T : notnull { } + public static T ValueOrThrow(this in DynamicData.Reactive.Kernel.Optional source, System.Func exceptionGenerator) + where T : notnull { } + } + public static class OptionObservableExtensions + { + public static System.IObservable> Convert(this System.IObservable> source, System.Func> converter) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable> Convert(this System.IObservable> source, System.Func converter) + where TSource : notnull + where TDestination : notnull { } + public static System.IObservable ConvertOr(this System.IObservable> source, System.Func converter, System.Func fallbackConverter) + where TSource : notnull { } + public static System.IObservable> OnHasNoValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) + where T : notnull { } + public static System.IObservable> OnHasValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) + where T : notnull { } + public static System.IObservable> OrElse(this System.IObservable> source, System.Func> fallbackOperation) + where T : notnull { } + public static System.IObservable SelectValues(this System.IObservable> source) + where T : notnull { } + public static System.IObservable ValueOr(this System.IObservable> source, System.Func valueSelector) + where T : notnull { } + public static System.IObservable ValueOrDefault(this System.IObservable> source) + where T : notnull { } + public static System.IObservable ValueOrThrow(this System.IObservable> source, System.Func exceptionGenerator) + where T : notnull { } + } + public static class Optional + { + public static DynamicData.Reactive.Kernel.Optional None() + where T : notnull { } + public static DynamicData.Reactive.Kernel.Optional Some(T? value) + where T : notnull { } + } + public readonly struct Optional : System.IEquatable> + where T : notnull + { + public bool HasValue { get; } + public T Value { get; } + public static DynamicData.Reactive.Kernel.Optional None { get; } + public bool Equals(DynamicData.Reactive.Kernel.Optional other) { } + public override bool Equals(object? obj) { } + public override int GetHashCode() { } + public override string? ToString() { } + public static DynamicData.Reactive.Kernel.Optional Create(T? value) { } + public static T? FromOptional(in DynamicData.Reactive.Kernel.Optional value) { } + public static DynamicData.Reactive.Kernel.Optional ToOptional(T? value) { } + public static T? op_Explicit(in DynamicData.Reactive.Kernel.Optional value) { } + public static DynamicData.Reactive.Kernel.Optional op_Implicit(T? value) { } + public static bool operator !=(in DynamicData.Reactive.Kernel.Optional left, in DynamicData.Reactive.Kernel.Optional right) { } + public static bool operator ==(in DynamicData.Reactive.Kernel.Optional left, in DynamicData.Reactive.Kernel.Optional right) { } + } +} +namespace DynamicData.Reactive.List +{ + public interface IGrouping + { + int Count { get; } + System.Collections.Generic.IEnumerable Items { get; } + TGroupKey Key { get; } + } +} +namespace DynamicData.Reactive.Operators +{ + public interface IPageResponse + { + int Page { get; } + int PageSize { get; } + int Pages { get; } + int TotalSize { get; } + } +} +namespace DynamicData.Reactive.PLinq +{ + public static class ParallelOperators + { + public static System.IObservable> Filter(this System.IObservable> source, System.Func filter, DynamicData.Reactive.PLinq.ParallelisationOptions parallelisationOptions) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SubscribeMany(this System.IObservable> source, System.Func subscriptionFactory, DynamicData.Reactive.PLinq.ParallelisationOptions parallelisationOptions) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> SubscribeMany(this System.IObservable> source, System.Func subscriptionFactory, DynamicData.Reactive.PLinq.ParallelisationOptions parallelisationOptions) + where TObject : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, DynamicData.Reactive.PLinq.ParallelisationOptions parallelisationOptions) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, DynamicData.Reactive.PLinq.ParallelisationOptions parallelisationOptions) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, DynamicData.Reactive.PLinq.ParallelisationOptions parallelisationOptions) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func transformFactory, System.Action> errorHandler, DynamicData.Reactive.PLinq.ParallelisationOptions parallelisationOptions) + where TDestination : notnull + where TSource : notnull + where TKey : notnull { } + } + public enum ParallelType + { + None = 0, + Parallelise = 1, + Ordered = 2, + } + public class ParallelisationOptions + { + public static readonly DynamicData.Reactive.PLinq.ParallelisationOptions Default; + public static readonly DynamicData.Reactive.PLinq.ParallelisationOptions None; + public ParallelisationOptions(DynamicData.Reactive.PLinq.ParallelType type = 0, int threshold = 0, int maxDegreeOfParallelisation = 0) { } + public int MaxDegreeOfParallelisation { get; } + public int Threshold { get; } + public DynamicData.Reactive.PLinq.ParallelType Type { get; } + } +} +namespace DynamicData.Reactive.Tests +{ + public class ChangeSetAggregator : System.IDisposable + where TObject : notnull + { + public ChangeSetAggregator(System.IObservable> source) { } + public DynamicData.Reactive.IObservableList Data { get; } + public System.Exception? Exception { get; set; } + public bool IsCompleted { get; } + public System.Collections.Generic.IList> Messages { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + } + public sealed class ChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + { + public ChangeSetAggregator(System.IObservable> source) { } + public DynamicData.Reactive.IObservableCache Data { get; } + public System.Exception? Error { get; } + public bool IsCompleted { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Reactive.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + } + public sealed class ChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + { + public ChangeSetAggregator(System.IObservable> source) { } + public DynamicData.Reactive.IObservableCache Data { get; } + public System.Exception? Error { get; } + public bool IsCompleted { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Reactive.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + } + public class DistinctChangeSetAggregator : System.IDisposable + where TValue : notnull + { + public DistinctChangeSetAggregator(System.IObservable> source) { } + public DynamicData.Reactive.IObservableCache Data { get; } + public System.Exception? Error { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Reactive.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + } + public class GroupChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + where TGroupKey : notnull + { + public GroupChangeSetAggregator(System.IObservable> source) { } + public DynamicData.Reactive.IObservableCache, TGroupKey> Data { get; } + public System.Exception? Error { get; } + public DynamicData.Reactive.IObservableCache, TGroupKey> Groups { get; } + public bool IsCompleted { get; } + public System.Collections.Generic.IReadOnlyList> Messages { get; } + public DynamicData.Reactive.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + } + public static class ListTextEx + { + public static DynamicData.Reactive.Tests.ChangeSetAggregator AsAggregator(this System.IObservable> source) + where T : notnull { } + } + public class PagedChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + { + public PagedChangeSetAggregator(System.IObservable> source) { } + public DynamicData.Reactive.IObservableCache Data { get; } + public System.Exception? Error { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Reactive.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + } + public class SortedChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + { + public SortedChangeSetAggregator(System.IObservable> source) { } + public DynamicData.Reactive.IObservableCache Data { get; } + public System.Exception? Error { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Reactive.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + } + public static class TestEx + { + public static DynamicData.Reactive.Tests.DistinctChangeSetAggregator AsAggregator(this System.IObservable> source) + where TValue : notnull { } + public static DynamicData.Reactive.Tests.ChangeSetAggregator AsAggregator(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Reactive.Tests.PagedChangeSetAggregator AsAggregator(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Reactive.Tests.SortedChangeSetAggregator AsAggregator(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Reactive.Tests.VirtualChangeSetAggregator AsAggregator(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Reactive.Tests.ChangeSetAggregator AsAggregator(this System.IObservable> source) + where TObject : notnull + where TKey : notnull { } + public static DynamicData.Reactive.Tests.GroupChangeSetAggregator AsAggregator(this System.IObservable> source) + where TValue : notnull + where TKey : notnull + where TGroupKey : notnull { } + } + public class VirtualChangeSetAggregator : System.IDisposable + where TObject : notnull + where TKey : notnull + { + public VirtualChangeSetAggregator(System.IObservable> source) { } + public DynamicData.Reactive.IObservableCache Data { get; } + public System.Exception? Error { get; } + public System.Collections.Generic.IList> Messages { get; } + public DynamicData.Reactive.Diagnostics.ChangeSummary Summary { get; } + public void Dispose() { } + protected virtual void Dispose(bool isDisposing) { } + } +} \ No newline at end of file diff --git a/src/DynamicData.Tests/API/ApiApprovalTests.cs b/src/DynamicData.Tests/API/ApiApprovalTests.cs index 7711d218f..3c6adfdf8 100644 --- a/src/DynamicData.Tests/API/ApiApprovalTests.cs +++ b/src/DynamicData.Tests/API/ApiApprovalTests.cs @@ -13,5 +13,17 @@ public class ApiApprovalTests /// [Fact] public Task DynamicDataTests() => typeof(VirtualRequest).Assembly.CheckApproval(["DynamicData"]); + + /// + /// Tests to make sure the API of DynamicData.Reactive project is approved. + /// + [Fact] + public Task DynamicDataReactiveTests() + { + var reactiveAssemblyPath = Path.Combine(AppContext.BaseDirectory, "DynamicData.Reactive.dll"); + var reactiveAssembly = System.Reflection.Assembly.LoadFrom(reactiveAssemblyPath); + + return reactiveAssembly.CheckApproval(["DynamicData.Reactive"]); + } } } diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index 8b8aff702..7c3855931 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -7,6 +7,7 @@ + @@ -31,4 +32,11 @@ + + + + + + + From 4868422d8700aafa0f9f2946d15b50ab940bfdd6 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Fri, 19 Jun 2026 21:25:59 +0100 Subject: [PATCH 04/36] Migrate Subjects to ReactiveUI Signals Replace usages of System.Reactive subjects (Subject, BehaviorSubject, ISubject) with ReactiveUI.Primitives signals (Signal, StateSignal, ISignal) across benchmarks, tests and library code. Update DynamicData.Reactive.csproj to reference ReactiveUI.Primitives assemblies and switch from the previous Roslyn code-generation task to a direct Compile Include for DynamicData sources (with a conditional Compile Remove for AsyncDisposeMany). Add a Directory.Build.props Using alias that maps Lock to System.Threading.Lock on .NET 9+ and to System.Object for earlier targets. Also remove the obsolete Binding/Observable.cs file and adjust related files to the new Signal types. --- src/Directory.Build.props | 9 ++ .../Cache/ExpireAfter_Cache_ForStream.cs | 3 +- .../Cache/FilterImmutable.cs | 9 +- .../Cache/Filter_Cache_WithPredicateState.cs | 5 +- .../Cache/StatelessFiltering.cs | 5 +- .../Cache/StatelessTransforming.cs | 5 +- .../Cache/ToObservableChangeSet_Cache.cs | 3 +- .../Cache/TransformImmutable.cs | 9 +- ...lter_List_Static_RandomizedBoundedEdits.cs | 3 +- ...er_List_Static_RandomizedUnboundedEdits.cs | 3 +- .../List/Filter_List_WithPredicateState.cs | 5 +- .../List/ToObservableChangeSet_List.cs | 3 +- .../DynamicData.Reactive.csproj | 75 +---------- src/DynamicData.Tests/AutoRefreshFilter.cs | 4 +- .../IObservableListBindCacheSortedFixture.cs | 2 +- ...syncDisposeManyFixture.IntegrationTests.cs | 6 +- .../Cache/AutoRefreshFixture.Base.cs | 4 +- .../AutoRefreshOnObservableFixture.Base.cs | 4 +- .../Cache/AutoRefreshOnObservableFixture.cs | 34 ++--- src/DynamicData.Tests/Cache/BatchIfFixture.cs | 5 +- .../Cache/BatchIfWithTimeOutFixture.cs | 7 +- .../Cache/DeadlockTortureTest.cs | 18 +-- .../Cache/DisposeManyFixture.cs | 2 +- .../Cache/ExpireAfterFixture.ForStream.cs | 26 ++-- .../Cache/FilterFixture.Base.cs | 2 +- ...xture.DynamicPredicate.IntegrationTests.cs | 4 +- ...ilterFixture.DynamicPredicate.UnitTests.cs | 22 ++-- ...redicateAndReFiltering.IntegrationTests.cs | 6 +- ...ynamicPredicateAndReFiltering.UnitTests.cs | 38 +++--- ....DynamicPredicateState.IntegrationTests.cs | 4 +- ...Fixture.DynamicPredicateState.UnitTests.cs | 20 +-- .../Cache/FilterFixture.Static.cs | 2 +- .../Cache/FilterImmutableFixture.cs | 16 +-- .../Cache/FilterOnObservableFixture.cs | 6 +- .../Cache/FromAsyncFixture.cs | 8 +- .../Cache/GroupControllerFixture.cs | 5 +- .../GroupControllerForFilteredItemsFixture.cs | 3 +- .../Cache/GroupOnDynamicFixture.cs | 5 +- .../Cache/GroupOnObservableFixture.cs | 3 +- .../Cache/InnerJoinFixtureRaceCondition.cs | 2 +- .../Cache/MergeManyFixture.cs | 11 +- .../Cache/MergeManyItemsFixture.cs | 10 +- .../Cache/MergeManyWithKeyOverloadFixture.cs | 6 +- .../Cache/MonitorStatusFixture.cs | 8 +- src/DynamicData.Tests/Cache/PageFixture.cs | 10 +- .../Cache/SortAndBindObservableFixture.cs | 4 +- .../Cache/SortAndPageAndBindFixture.cs | 3 +- .../Cache/SortAndPageFixture.cs | 7 +- .../Cache/SortAndVirtualizeAndBindFixture.cs | 3 +- .../Cache/SortAndVirtualizeFixture.cs | 7 +- src/DynamicData.Tests/Cache/SortFixture.cs | 16 +-- .../Cache/SortObservableFixtureFixture.cs | 4 +- src/DynamicData.Tests/Cache/SwitchFixture.cs | 10 +- ...ervableChangeSetFixture.Items.UnitTests.cs | 24 ++-- ...bleChangeSetFixture.Sequences.UnitTests.cs | 24 ++-- .../Cache/TransformAsyncFixture.cs | 4 +- .../Cache/TransformFixture.cs | 4 +- .../Cache/TransformImmutableFixture.cs | 10 +- .../Cache/TransformOnObservableFixture.cs | 4 +- .../Cache/TransformSafeAsyncFixture.cs | 4 +- .../Cache/TransformTreeFixture.cs | 4 +- .../Cache/TrueForAllFixture.cs | 11 +- .../Cache/TrueForAnyFixture.cs | 11 +- src/DynamicData.Tests/Domain/PersonObs.cs | 2 +- .../DynamicData.Tests.csproj | 2 + .../EnumerableIListFixture.cs | 2 +- .../CacheParentSubscriptionFixture.cs | 16 +-- .../Internal/DeliveryQueueFixture.cs | 8 +- .../Internal/SharedDeliveryQueueFixture.cs | 6 +- src/DynamicData.Tests/List/BatchIfFixture.cs | 5 +- .../List/BatchIfWithTimeOutFixture.cs | 5 +- .../List/DisposeManyFixture.cs | 2 +- ...terControllerFixtureWithClearAndReplace.cs | 7 +- .../FilterControllerFixtureWithDiffSet.cs | 5 +- .../List/FilterFixture.Static.cs | 2 +- .../List/FilterFixture.WithPredicateState.cs | 48 +++---- .../List/FilterWithObservable.cs | 6 +- .../List/FromAsyncFixture.cs | 6 +- .../List/GroupImmutableFixture.cs | 5 +- .../List/MergeManyFixture.cs | 6 +- src/DynamicData.Tests/List/PageFixture.cs | 7 +- src/DynamicData.Tests/List/SortFixture.cs | 2 +- .../List/SortMutableFixture.cs | 10 +- src/DynamicData.Tests/List/SwitchFixture.cs | 5 +- ...ervableChangeSetFixture.Items.UnitTests.cs | 18 +-- ...bleChangeSetFixture.Sequences.UnitTests.cs | 18 +-- .../List/VirtualisationFixture.cs | 5 +- .../Utilities/TestSourceCache.cs | 4 +- .../Utilities/TestSourceList.cs | 8 +- src/DynamicData/Aggregation/AggregateItem.cs | 27 +--- src/DynamicData/Aggregation/Avg.cs | 7 +- src/DynamicData/Aggregation/AvgEx.cs | 30 ++++- src/DynamicData/Aggregation/CountEx.cs | 6 +- src/DynamicData/Aggregation/StdDev.cs | 9 +- src/DynamicData/Aggregation/StdDevEx.cs | 32 ++++- src/DynamicData/Aggregation/SumEx.cs | 6 +- src/DynamicData/Binding/IObservableListEx.cs | 2 - .../Binding/NotifyPropertyChangedEx.cs | 2 +- src/DynamicData/Binding/Observable.cs | 14 -- .../Binding/ObservableCollectionAdaptor.cs | 2 +- .../Binding/ObservableCollectionEx.cs | 3 +- .../Binding/ObservableCollectionExtended.cs | 1 - src/DynamicData/Binding/PropertyValue.cs | 76 +---------- src/DynamicData/Cache/Change.cs | 4 +- src/DynamicData/Cache/ChangeAwareCache.cs | 4 +- src/DynamicData/Cache/IGrouping.cs | 2 +- src/DynamicData/Cache/IObservableCache.cs | 2 +- src/DynamicData/Cache/IQuery.cs | 2 +- src/DynamicData/Cache/IntermediateCache.cs | 2 +- .../Cache/Internal/AbstractFilter.cs | 4 +- .../Internal/AnonymousObservableCache.cs | 4 +- .../Cache/Internal/AnonymousQuery.cs | 2 +- .../Cache/Internal/AsyncDisposeMany.cs | 2 +- src/DynamicData/Cache/Internal/Cache.cs | 2 +- .../Cache/Internal/CacheUpdater.cs | 4 +- .../Cache/Internal/ChangeSetMergeTracker.cs | 6 +- .../Internal/EditDiffChangeSetOptional.cs | 4 +- .../Cache/Internal/ExpirableItem.cs | 20 +-- .../Cache/Internal/Filter.Dynamic.cs | 10 -- .../Cache/Internal/FullJoinMany.cs | 4 +- .../Cache/Internal/ImmutableGroup.cs | 2 +- src/DynamicData/Cache/Internal/LeftJoin.cs | 12 +- .../Cache/Internal/LockFreeObservableCache.cs | 21 +-- .../Cache/Internal/ObservableWithValue.cs | 2 +- .../Cache/Internal/ReaderWriter.cs | 6 +- src/DynamicData/Cache/Internal/RefCount.cs | 4 - src/DynamicData/Cache/Internal/RightJoin.cs | 8 +- .../Cache/Internal/RightJoinMany.cs | 4 +- src/DynamicData/Cache/Internal/SizeLimiter.cs | 2 +- .../Cache/Internal/SortExtensions.cs | 2 - .../Cache/Internal/StatusMonitor.cs | 2 +- .../Cache/Internal/ToObservableChangeSet.cs | 6 +- .../Cache/Internal/ToObservableOptional.cs | 4 +- src/DynamicData/Cache/Internal/Transform.cs | 4 +- .../Internal/TransformWithInlineUpdate.cs | 2 +- src/DynamicData/Cache/ObservableCache.cs | 46 +++---- .../Cache/ObservableCacheEx.Bind.cs | 15 +-- .../Cache/ObservableCacheEx.EditDiff.cs | 2 +- .../Cache/ObservableCacheEx.FullJoin.cs | 4 +- .../Cache/ObservableCacheEx.FullJoinMany.cs | 4 +- .../ObservableCacheEx.IgnoreUpdateWhen.cs | 10 +- .../Cache/ObservableCacheEx.InvokeEvaluate.cs | 6 +- .../Cache/ObservableCacheEx.LeftJoin.cs | 4 +- .../Cache/ObservableCacheEx.RightJoin.cs | 4 +- .../Cache/ObservableCacheEx.RightJoinMany.cs | 4 +- .../Cache/ObservableCacheEx.SortAndBind.cs | 1 - .../ObservableCacheEx.ToObservableOptional.cs | 10 +- .../Cache/ObservableCacheEx.Transform.cs | 6 +- .../Cache/ObservableCacheEx.TransformAsync.cs | 20 +-- .../Cache/ObservableCacheEx.TransformMany.cs | 1 - .../Cache/ObservableCacheEx.TransformSafe.cs | 16 +-- .../ObservableCacheEx.TransformSafeAsync.cs | 4 +- .../Cache/ObservableCacheEx.UpdateIndex.cs | 10 +- .../ObservableCacheEx.WhereReasonsAreNot.cs | 1 + src/DynamicData/Cache/SortAndPageOptions.cs | 2 +- .../Cache/SortAndVirtualizeOptions.cs | 2 +- src/DynamicData/Cache/SourceCache.cs | 2 +- .../Diagnostics/ChangeStatistics.cs | 124 ++---------------- src/DynamicData/DynamicData.csproj | 1 + .../Experimental/ISubjectWithRefCount.cs | 2 +- .../Experimental/SubjectWithRefCount.cs | 4 +- src/DynamicData/Experimental/Watcher.cs | 12 +- .../Internal/CacheParentSubscription.cs | 4 +- src/DynamicData/Internal/DeliveryQueue.cs | 5 +- src/DynamicData/Internal/KeyedDisposable.cs | 4 - src/DynamicData/Internal/Notification.cs | 5 +- .../Internal/SharedDeliveryQueue.cs | 6 +- src/DynamicData/Kernel/Error.cs | 2 +- src/DynamicData/Kernel/InternalEx.cs | 8 +- src/DynamicData/Kernel/ItemWithIndex.cs | 42 +----- src/DynamicData/Kernel/ItemWithValue.cs | 50 +------ src/DynamicData/List/Change.cs | 2 +- src/DynamicData/List/ChangeAwareList.cs | 2 +- .../List/Internal/AnonymousObservableList.cs | 2 +- src/DynamicData/List/Internal/BufferIf.cs | 2 +- src/DynamicData/List/Internal/FilterStatic.cs | 2 +- src/DynamicData/List/Internal/ReaderWriter.cs | 4 - src/DynamicData/List/Internal/RefCount.cs | 4 - .../List/Internal/TransformAsync.cs | 18 +-- src/DynamicData/List/Internal/Transformer.cs | 18 +-- .../List/Internal/UnifiedChange.cs | 6 +- src/DynamicData/List/ItemChange.cs | 6 +- src/DynamicData/List/ListEx.cs | 6 +- src/DynamicData/List/ObservableListEx.Bind.cs | 1 - .../List/ObservableListEx.CastToObject.cs | 6 +- .../ObservableListEx.FlattenBufferResult.cs | 6 +- .../List/ObservableListEx.OnItemAdded.cs | 9 +- .../List/ObservableListEx.OnItemRefreshed.cs | 9 +- .../List/ObservableListEx.OnItemRemoved.cs | 11 +- .../List/ObservableListEx.Transform.cs | 4 +- .../List/ObservableListEx.TransformAsync.cs | 12 +- .../List/ObservableListEx.TransformMany.cs | 1 - .../List/ObservableListEx.WhereReasonsAre.cs | 1 + .../ObservableListEx.WhereReasonsAreNot.cs | 1 + src/DynamicData/Platforms/net45/PFilter.cs | 2 +- src/DynamicData/Platforms/net45/PTransform.cs | 8 +- 196 files changed, 739 insertions(+), 1027 deletions(-) delete mode 100644 src/DynamicData/Binding/Observable.cs diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 3073548db..ea3784f00 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -42,6 +42,15 @@ + + + + + + + + diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs index e5e52eb5e..8e9888614 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs @@ -3,6 +3,7 @@ using BenchmarkDotNet.Attributes; using Bogus; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; @@ -110,7 +111,7 @@ public ExpireAfter_Cache_ForStream() [Benchmark] public void RandomizedEditsAndExpirations() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .ExpireAfter( diff --git a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs index 021d406fc..9fd993d3f 100644 --- a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs @@ -1,4 +1,5 @@ using BenchmarkDotNet.Attributes; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; @@ -54,7 +55,7 @@ public FilterImmutable() [Benchmark] public void Adds() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .FilterImmutable(static item => item.IsIncluded) @@ -69,7 +70,7 @@ public void Adds() [Benchmark] public void AddsAndReplacements() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .FilterImmutable(static item => item.IsIncluded) @@ -87,7 +88,7 @@ public void AddsAndReplacements() [Benchmark] public void AddsAndRemoves() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .FilterImmutable(static item => item.IsIncluded) @@ -105,7 +106,7 @@ public void AddsAndRemoves() [Benchmark] public void AddsReplacementsAndRemoves() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .FilterImmutable(static item => item.IsIncluded) diff --git a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs index 3b2deb838..9af07b9ff 100644 --- a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs @@ -3,6 +3,7 @@ using BenchmarkDotNet.Attributes; using Bogus; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; @@ -105,8 +106,8 @@ public Filter_Cache_WithPredicateState() [Benchmark(Baseline = true)] public void RandomizedEditsAndStateChanges() { - using var source = new Subject>(); - using var predicateState = new Subject(); + using var source = new Signal>(); + using var predicateState = new Signal(); using var subscription = source .Filter( diff --git a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs index ee150510f..6d0eb19ce 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs @@ -1,4 +1,5 @@ using BenchmarkDotNet.Attributes; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; @@ -49,7 +50,7 @@ public StatelessFiltering() [Benchmark(Baseline = true)] public void Filter() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .Filter(static item => item.IsIncluded) @@ -63,7 +64,7 @@ public void Filter() [Benchmark] public void FilterImmutable() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .FilterImmutable(static item => item.IsIncluded) diff --git a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs index 5f2ff1469..5f40c356c 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs @@ -1,4 +1,5 @@ using BenchmarkDotNet.Attributes; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; @@ -49,7 +50,7 @@ public StatelessTransforming() [Benchmark(Baseline = true)] public void Transform() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .Transform(static item => item.Name) @@ -63,7 +64,7 @@ public void Transform() [Benchmark] public void TransformImmutable() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .TransformImmutable(static item => item.Name) diff --git a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs index 6dc7f665e..9653f6709 100644 --- a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs @@ -1,5 +1,6 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; @@ -46,7 +47,7 @@ static ToObservableChangeSet_Cache() [Arguments(1_000, 1_000)] public void AddsUpdatesAndFinalization(int itemCount, int sizeLimit) { - using var source = new Subject(); + using var source = new Signal(); using var subscription = source .ToObservableChangeSet( diff --git a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs index ac2d4f9f3..3610a25fe 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs @@ -1,4 +1,5 @@ using BenchmarkDotNet.Attributes; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; @@ -54,7 +55,7 @@ public TransformImmutable() [Benchmark] public void Adds() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .TransformImmutable(static item => item.Name) @@ -69,7 +70,7 @@ public void Adds() [Benchmark] public void AddsAndReplacements() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .TransformImmutable(static item => item.Name) @@ -87,7 +88,7 @@ public void AddsAndReplacements() [Benchmark] public void AddsAndRemoves() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .TransformImmutable(static item => item.Name) @@ -105,7 +106,7 @@ public void AddsAndRemoves() [Benchmark] public void AddsReplacementsAndRemoves() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .TransformImmutable(static item => item.Name) diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs index 33fab8678..c028238b5 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs @@ -3,6 +3,7 @@ using BenchmarkDotNet.Attributes; using Bogus; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.List; @@ -40,7 +41,7 @@ public Filter_List_Static_RandomizedBoundedEdits() [Benchmark(Baseline = true)] public void CurrentImplementation() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .Filter(Item.FilterByIsIncluded) diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs index 6bb50473c..7bc9f5965 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs @@ -3,6 +3,7 @@ using BenchmarkDotNet.Attributes; using Bogus; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.List; @@ -38,7 +39,7 @@ public Filter_List_Static_RandomizedUnboundedEdits() [Benchmark(Baseline = true)] public void CurrentImplementation() { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .Filter(Item.FilterByIsIncluded) diff --git a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs index 187a1c777..25dbedc8b 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs @@ -3,6 +3,7 @@ using BenchmarkDotNet.Attributes; using Bogus; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.List; @@ -31,8 +32,8 @@ public Filter_List_WithPredicateState() [Benchmark(Baseline = true)] public void RandomizedEditsAndStateChanges() { - using var source = new Subject>(); - using var predicateState = new Subject(); + using var source = new Signal>(); + using var predicateState = new Signal(); using var subscription = source .Filter( diff --git a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs index 6b70eef36..99a3f508a 100644 --- a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs +++ b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs @@ -1,5 +1,6 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.List; @@ -27,7 +28,7 @@ public class ToObservableChangeSet_List [Arguments(1_000, 1_000)] public void AddsUpdatesAndFinalization(int itemCount, int sizeLimit) { - using var source = new Subject(); + using var source = new Signal(); using var subscription = source .ToObservableChangeSet(limitSizeTo: sizeLimit) diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index 3309f2fef..d60a27cf4 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -26,6 +26,11 @@ + + + + + @@ -37,79 +42,13 @@ - - + - + - - - - - - - - - - - - - - - - (Sources.Length); - -foreach (var source in Sources) -{ - var sourcePath = Path.GetFullPath(source.ItemSpec); - if (!sourcePath.StartsWith(sourceRoot, StringComparison.OrdinalIgnoreCase)) - { - Log.LogError("Reactive source '{0}' is outside source root '{1}'.", sourcePath, sourceRoot); - return false; - } - - var relativePath = sourcePath.Substring(sourceRoot.Length) - .TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - var outputPath = Path.Combine(outputRoot, relativePath); - - Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); - - var text = File.ReadAllText(sourcePath); - text = Regex.Replace(text, @"(?m)^(\s*namespace\s+)DynamicData(?=([.;\s{]|$))", "$1DynamicData.Reactive"); - text = Regex.Replace(text, @"(?m)^(\s*using\s+(?:static\s+)?)DynamicData(?=([.;\s]|$))", "$1DynamicData.Reactive"); - text = Regex.Replace(text, @"(?m)^(\s*using\s+[A-Za-z_][A-Za-z0-9_]*\s*=\s*)DynamicData(?=([.;\s]|$))", "$1DynamicData.Reactive"); - text = text.Replace("global::DynamicData.", "global::DynamicData.Reactive."); - - File.WriteAllText(outputPath, text); - generated.Add(new TaskItem(outputPath)); -} - -GeneratedSources = generated.ToArray(); - ]]> - - - - - - - - - - diff --git a/src/DynamicData.Tests/AutoRefreshFilter.cs b/src/DynamicData.Tests/AutoRefreshFilter.cs index ad12e8358..52193a1ab 100644 --- a/src/DynamicData.Tests/AutoRefreshFilter.cs +++ b/src/DynamicData.Tests/AutoRefreshFilter.cs @@ -62,7 +62,7 @@ public void AutoRefreshWithObservablePredicate1() var items = new SourceList(); items.Add(item1); - var filterSubject = new BehaviorSubject>(_ => false); + var filterSubject = new StateSignal>(_ => false); var obsListDerived = items .Connect() @@ -106,7 +106,7 @@ public void AutoRefreshWithObservablePredicate2() var items = new ObservableCollection(); items.Add(item1); - var filterSubject = new BehaviorSubject>(_ => false); + var filterSubject = new StateSignal>(_ => false); var obsListDerived = items .ToObservableChangeSet() diff --git a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs index 87238fb6b..cbc8bdf58 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs @@ -11,7 +11,7 @@ public class IObservableListBindCacheSortedFixture : IDisposable private static readonly IComparer _comparerNameDesc = SortExpressionComparer.Descending(p => p.Name); - private readonly BehaviorSubject> _comparer = new(_comparerAgeAscThanNameAsc); + private readonly StateSignal> _comparer = new(_comparerAgeAscThanNameAsc); private readonly RandomPersonGenerator _generator = new(); diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs index 418472924..9c97e862c 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs @@ -16,7 +16,7 @@ public class IntegrationTests public async Task ItemDisposalErrors_ErrorPropagatesToDisposalsCompleted(ItemType itemType) { using var source = new SourceCache(static item => item.Id); - using var sourceCompletionSource = new Subject(); + using var sourceCompletionSource = new Signal(); ValueRecordingObserver? disposalsCompletedResults = null; @@ -74,7 +74,7 @@ public async Task ItemDisposalErrors_ErrorPropagatesToDisposalsCompleted(ItemTyp public async Task ItemDisposalsComplete_DisposalsCompletedOccursAndCompletes(ItemType itemType) { using var source = new SourceCache(static item => item.Id); - using var sourceCompletionSource = new Subject(); + using var sourceCompletionSource = new Signal(); ValueRecordingObserver? disposalsCompletedResults = null; @@ -129,7 +129,7 @@ public async Task ItemDisposalsComplete_DisposalsCompletedOccursAndCompletes(Ite public async Task ItemDisposalsOccurOnMultipleThreads_DisposalIsThreadSafe() { using var source = new SourceCache(static item => item.Id); - using var sourceCompletionSource = new Subject(); + using var sourceCompletionSource = new Signal(); ValueRecordingObserver? disposalsCompletedResults = null; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs index 06de9ce0c..1cb0c57cf 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs @@ -141,7 +141,7 @@ public void ItemIsAdded_SubscribesToPropertyChanged() public void ItemIsMoved_NotificationPropagates() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; @@ -529,7 +529,7 @@ public void SourceIsNull_ThrowsException() public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); var item1 = new Item() { Id = 1 }; var item2 = new Item() { Id = 2 }; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs index 3ae75dad5..8fa55bd38 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs @@ -144,7 +144,7 @@ public void ItemIsAdded_SubscribesToReevaluator() public void ItemIsMoved_NotificationPropagates() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; @@ -681,7 +681,7 @@ public void SourceIsNull_ThrowsException() public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); using var item1 = new Item() { Id = 1 }; using var item2 = new Item() { Id = 2 }; diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs index 34a4a3c83..738f45a8f 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs @@ -17,25 +17,25 @@ public static IObservable ObserveValue(Item item) observer.OnNext(item._value); return item._valueChanged.SubscribeSafe(observer); }); - + public static IObservable ObserveValueChanged(Item item) => item._valueChanged.Select(static _ => Unit.Default); - + public static int SelectId(Item item) => item.Id; - + public Item() => _valueChanged = new(); - + public required int Id { get => _id; init => _id = value; } - + public bool HasObservers => _valueChanged.HasObservers; - + public int Value { get => _value; @@ -43,31 +43,31 @@ public int Value { if (_value == value) return; - + _value = value; _valueChanged.OnNext(value); } } - + public void Complete() => _valueChanged.OnCompleted(); - + public void Dispose() { if (Interlocked.Exchange(ref _hasDisposed, true)) return; - + _valueChanged.OnCompleted(); _valueChanged.Dispose(); } - + public void SetError(Exception error) => _valueChanged.OnError(error); - - private readonly int _id; - private readonly Subject _valueChanged; - - private bool _hasDisposed; - private int _value; + + private readonly int _id; + private readonly Signal _valueChanged; + + private bool _hasDisposed; + private int _value; } } diff --git a/src/DynamicData.Tests/Cache/BatchIfFixture.cs b/src/DynamicData.Tests/Cache/BatchIfFixture.cs index d09dd5f02..ca430f2e4 100644 --- a/src/DynamicData.Tests/Cache/BatchIfFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfFixture.cs @@ -6,7 +6,7 @@ namespace DynamicData.Tests.Cache; public class BatchIfFixture : IDisposable { - private readonly ISubject _pausingSubject = new Subject(); + private readonly ISignal _pausingSubject = new Signal(); private readonly ChangeSetAggregator _results; @@ -20,7 +20,7 @@ public BatchIfFixture() _source = new SourceCache(p => p.Key); _results = _source.Connect().BatchIf(_pausingSubject, _scheduler).AsAggregator(); - // _results = _source.Connect().BatchIf(new BehaviorSubject(true), scheduler: _scheduler).AsAggregator(); + // _results = _source.Connect().BatchIf(new StateSignal(true), scheduler: _scheduler).AsAggregator(); } [Fact] @@ -107,6 +107,7 @@ public void Dispose() { _results.Dispose(); _source.Dispose(); + _pausingSubject.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs index 33d78d1f9..69e7d393c 100644 --- a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs @@ -21,7 +21,7 @@ public BatchIfWithTimeoutFixture() [Fact] public void InitialPause() { - var pausingSubject = new Subject(); + var pausingSubject = new Signal(); using var results = _source.Connect().BatchIf(pausingSubject, true, _scheduler).AsAggregator(); // no results because the initial pause state is pause _source.AddOrUpdate(new Person("A", 1)); @@ -48,7 +48,7 @@ public void InitialPause() [Fact] public void Timeout() { - var pausingSubject = new Subject(); + var pausingSubject = new Signal(); using var results = _source.Connect().BatchIf(pausingSubject, TimeSpan.FromSeconds(1), _scheduler).AsAggregator(); // no results because the initial pause state is pause _source.AddOrUpdate(new Person("A", 1)); @@ -79,7 +79,7 @@ public void Timeout() public class BatchIfWithTimeOutFixture : IDisposable { - private readonly ISubject _pausingSubject = new Subject(); + private readonly ISignal _pausingSubject = new Signal(); private readonly ChangeSetAggregator _results; @@ -119,6 +119,7 @@ public void Dispose() _results.Dispose(); _source.Dispose(); _pausingSubject.OnCompleted(); + _pausingSubject.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs index d9fcc426a..da64ba7a5 100644 --- a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs +++ b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs @@ -59,24 +59,24 @@ [Fact] public async Task GroupOn_DoesNotDeadlock() => [Fact] public async Task Page_DoesNotDeadlock() { - using var req = new BehaviorSubject(new PageRequest(1, 50)); + using var req = new StateSignal(new PageRequest(1, 50)); (await RunBidirectionalDeadlockTest(s => s.Sort(SortExpressionComparer.Ascending(p => p.Age)).Page(req))).Should().BeTrue(); } [Fact] public async Task Virtualise_DoesNotDeadlock() { - using var req = new BehaviorSubject(new VirtualRequest(0, 50)); + using var req = new StateSignal(new VirtualRequest(0, 50)); (await RunBidirectionalDeadlockTest(s => s.Sort(SortExpressionComparer.Ascending(p => p.Age)).Virtualise(req))).Should().BeTrue(); } [Fact] public async Task TransformWithForce_DoesNotDeadlock() { - using var force = new Subject>(); + using var force = new Signal>(); (await RunBidirectionalDeadlockTest(s => s.Transform((p, k) => new Person("T-" + p.Name, p.Age), force))).Should().BeTrue(); } [Fact] public async Task BatchIf_DoesNotDeadlock() => - (await RunBidirectionalDeadlockTest(s => s.BatchIf(new BehaviorSubject(false), false, (TimeSpan?)null))).Should().BeTrue(); + (await RunBidirectionalDeadlockTest(s => s.BatchIf(new StateSignal(false), false, (TimeSpan?)null))).Should().BeTrue(); [Fact] public async Task DisposeMany_DoesNotDeadlock() => (await RunBidirectionalDeadlockTest(s => s.DisposeMany())).Should().BeTrue(); @@ -86,8 +86,8 @@ [Fact] public async Task OnItemRemoved_DoesNotDeadlock() => [Fact] public async Task AllDangerous_Stacked_DoNotDeadlock() { - using var pageReq = new BehaviorSubject(new PageRequest(1, 100)); - using var force = new Subject>(); + using var pageReq = new StateSignal(new PageRequest(1, 100)); + using var force = new Signal>(); (await RunBidirectionalDeadlockTest( s => s.AutoRefresh(p => p.Age) .Filter(p => p.Age >= 0) @@ -101,8 +101,8 @@ [Fact] public async Task AllDangerous_Stacked_DoNotDeadlock() [Fact] public async Task MultiplePairs_Simultaneous_NoDeadlock() { - using var pageReq = new BehaviorSubject(new PageRequest(1, 50)); - using var virtReq = new BehaviorSubject(new VirtualRequest(0, 50)); + using var pageReq = new StateSignal(new PageRequest(1, 50)); + using var virtReq = new StateSignal(new VirtualRequest(0, 50)); var results = await Task.WhenAll( RunBidirectionalDeadlockTest(s => s.Sort(SortExpressionComparer.Ascending(p => p.Age)), 30), RunBidirectionalDeadlockTest(s => s.AutoRefresh(p => p.Age), 30), @@ -111,7 +111,7 @@ [Fact] public async Task MultiplePairs_Simultaneous_NoDeadlock() RunBidirectionalDeadlockTest(s => s.DisposeMany(), 30), RunBidirectionalDeadlockTest(s => s.Sort(SortExpressionComparer.Ascending(p => p.Age)).Page(pageReq), 30), RunBidirectionalDeadlockTest(s => s.Sort(SortExpressionComparer.Ascending(p => p.Age)).Virtualise(virtReq), 30), - RunBidirectionalDeadlockTest(s => s.BatchIf(new BehaviorSubject(false), false, (TimeSpan?)null), 30)); + RunBidirectionalDeadlockTest(s => s.BatchIf(new StateSignal(false), false, (TimeSpan?)null), 30)); results.Should().AllSatisfy(r => r.Should().BeTrue()); } diff --git a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs index 0206fe515..e19d671e5 100644 --- a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs @@ -4,7 +4,7 @@ namespace DynamicData.Tests.Cache; public sealed class DisposeManyFixture : IDisposable { - private readonly Subject> _changeSetsSource; + private readonly Signal> _changeSetsSource; private readonly SourceCache _itemsSource; diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs index 121c3b8e8..f552fe50b 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs @@ -12,7 +12,7 @@ public sealed class ForStream [Fact] public void ExpiredItemIsRemoved_RemovalIsSkipped() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = CreateTestScheduler(); @@ -61,7 +61,7 @@ public void ExpiredItemIsRemoved_RemovalIsSkipped() [Fact] public void ItemIsRemovedBeforeExpiration_ExpirationIsCancelled() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = CreateTestScheduler(); @@ -113,7 +113,7 @@ public void ItemIsRemovedBeforeExpiration_ExpirationIsCancelled() [Fact] public void NextItemToExpireIsReplaced_ExpirationIsRescheduledIfNeeded() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = CreateTestScheduler(); @@ -190,7 +190,7 @@ public void NextItemToExpireIsReplaced_ExpirationIsRescheduledIfNeeded() [Fact] public void PollingIntervalIsGiven_RemovalsAreScheduledAtInterval() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = CreateTestScheduler(); @@ -356,7 +356,7 @@ public void PollingIntervalIsGiven_RemovalsAreScheduledAtInterval() [Fact] public void PollingIntervalIsNotGiven_RemovalsAreScheduledImmediately() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = CreateTestScheduler(); @@ -506,7 +506,7 @@ public void PollingIntervalIsNotGiven_RemovalsAreScheduledImmediately() [Fact] public void RemovalsArePending_CompletionWaitsForRemovals() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = CreateTestScheduler(); @@ -558,7 +558,7 @@ public void RemovalsArePending_CompletionWaitsForRemovals() [Fact] public void SchedulerIsInaccurate_RemovalsAreNotSkipped() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = new FakeScheduler() { @@ -595,7 +595,7 @@ public void SchedulerIsInaccurate_RemovalsAreNotSkipped() [Fact] public void SourceCompletes_CompletionIsPropagated() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = CreateTestScheduler(); @@ -670,7 +670,7 @@ public void SourceCompletesImmediately_CompletionIsPropagated() [Fact] public void SourceErrors_ErrorIsPropagated() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = CreateTestScheduler(); @@ -754,7 +754,7 @@ public void SourceIsNull_ThrowsException() [Fact] public async Task ThreadPoolSchedulerIsUsedWithoutPolling_ExpirationIsThreadSafe() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = ThreadPoolSequencer.Instance; @@ -784,7 +784,7 @@ public async Task ThreadPoolSchedulerIsUsedWithoutPolling_ExpirationIsThreadSafe [Fact] public async Task ThreadPoolSchedulerIsUsedWithPolling_ExpirationIsThreadSafe() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = ThreadPoolSequencer.Instance; @@ -816,14 +816,14 @@ public async Task ThreadPoolSchedulerIsUsedWithPolling_ExpirationIsThreadSafe() [Fact] public void TimeSelectorIsNull_ThrowsException() - => FluentActions.Invoking(() => new Subject>().ExpireAfter( + => FluentActions.Invoking(() => new Signal>().ExpireAfter( timeSelector: null!)) .Should().Throw(); [Fact] public void TimeSelectorThrows_ErrorIsPropagated() { - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = CreateTestScheduler(); diff --git a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs index e3c7b4cca..b25cac251 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs @@ -104,7 +104,7 @@ public void ItemsAreAdded_MatchingItemsPropagate(EmptyChangesetPolicy emptyChang public void ItemsAreMoved_MovementsAreIgnored(EmptyChangesetPolicy emptyChangesetPolicy) { // Setup - using var source = new Subject>(); + using var source = new Signal>(); var items = new[] { diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs index 8028f7fc8..efe13a797 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs @@ -27,8 +27,8 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() .Select(mask => new Func(item => Item.FilterByIdInclusionMask(mask, item))) .ToArray(); - using var source = new Subject>(); - using var predicateChanged = new Subject>(); + using var source = new Signal>(); + using var predicateChanged = new Signal>(); // UUT Initialization using var subscription = source diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs index 3ce3f5e7f..ed10a3d7a 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs @@ -87,7 +87,7 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt { // Setup using var source = new TestSourceCache(Item.SelectId); - using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); + using var predicateChanged = new StateSignal>(Item.FilterByIsIncluded); source.AddOrUpdate(new[] { @@ -144,10 +144,10 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceC }); var predicateChanged = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject>() + ? new Signal>() : Observable.Return(Item.FilterByIsIncluded); - var reapplyFilter = new Subject(); + var reapplyFilter = new Signal(); // UUT Initialization & Action using var subscription = source.Connect() @@ -156,7 +156,7 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceC .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results); - if (predicateChanged is Subject> subject) + if (predicateChanged is Signal> subject) { subject.OnNext(Item.FilterByIsIncluded); subject.OnCompleted(); @@ -194,7 +194,7 @@ public void PredicateChangedCompletesBeforeInitialValue_CompletionPropagatesIfEm using var source = new TestSourceCache(Item.SelectId); var predicateChanged = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject>() + ? new Signal>() : Observable.Empty>(); // UUT Initialization & Action @@ -206,7 +206,7 @@ public void PredicateChangedCompletesBeforeInitialValue_CompletionPropagatesIfEm .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results); - if (predicateChanged is Subject> subject) + if (predicateChanged is Signal> subject) subject.OnCompleted(); results.Error.Should().BeNull(); @@ -228,7 +228,7 @@ public void PredicateChangedFails_ErrorPropagates(CompletionStrategy completionS var error = new Exception("Test"); var predicateChanged = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject>() + ? new Signal>() : Observable.Throw>(error); // UUT Initialization & Action @@ -239,7 +239,7 @@ public void PredicateChangedFails_ErrorPropagates(CompletionStrategy completionS .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results); - if (predicateChanged is Subject> subject) + if (predicateChanged is Signal> subject) subject.OnError(error); results.Error.Should().Be(error, "errors should propagate downstream"); @@ -313,7 +313,7 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple new Item() { Id = 6, IsIncluded = false } }); - using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); + using var predicateChanged = new StateSignal>(Item.FilterByIsIncluded); // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) @@ -349,8 +349,8 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() { // Setup - using var source = new Subject>(); - using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); + using var source = new Signal>(); + using var predicateChanged = new StateSignal>(Item.FilterByIsIncluded); // UUT Initialization using var subscription = source diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs index 51e3f36b4..884842d03 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs @@ -27,9 +27,9 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() .Select(mask => new Func(item => Item.FilterByIdInclusionMask(mask, item))) .ToArray(); - using var source = new Subject>(); - using var predicateChanged = new Subject>(); - using var reapplyFilter = new Subject(); + using var source = new Signal>(); + using var predicateChanged = new Signal>(); + using var reapplyFilter = new Signal(); // UUT Initialization using var subscription = source diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs index 1e797bc96..0b8c496d1 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs @@ -84,7 +84,7 @@ public void PredicateChangedChanges_ItemsAreReFiltered(EmptyChangesetPolicy empt { // Setup using var source = new TestSourceCache(Item.SelectId); - using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); + using var predicateChanged = new StateSignal>(Item.FilterByIsIncluded); source.AddOrUpdate(new[] { @@ -146,10 +146,10 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceA }); var predicateChanged = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject>() + ? new Signal>() : Observable.Return(Item.FilterByIsIncluded); - var reapplyFilter = new Subject(); + var reapplyFilter = new Signal(); // UUT Initialization & Action using var subscription = source.Connect() @@ -160,7 +160,7 @@ public void PredicateChangedCompletesAfterInitialValue_CompletionWaitsForSourceA .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results); - if (predicateChanged is Subject> subject) + if (predicateChanged is Signal> subject) { subject.OnNext(Item.FilterByIsIncluded); subject.OnCompleted(); @@ -214,7 +214,7 @@ public void PredicateChangedCompletesBeforeInitialValue_CompletionPropagatesIfEm using var source = new TestSourceCache(Item.SelectId); var predicateChanged = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject>() + ? new Signal>() : Observable.Empty>(); // UUT Initialization & Action @@ -227,7 +227,7 @@ public void PredicateChangedCompletesBeforeInitialValue_CompletionPropagatesIfEm .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results); - if (predicateChanged is Subject> subject) + if (predicateChanged is Signal> subject) subject.OnCompleted(); results.Error.Should().BeNull(); @@ -249,7 +249,7 @@ public void PredicateChangedFails_ErrorPropagates(CompletionStrategy completionS var error = new Exception("Test"); var predicateChanged = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject>() + ? new Signal>() : Observable.Throw>(error); // UUT Initialization & Action @@ -261,7 +261,7 @@ public void PredicateChangedFails_ErrorPropagates(CompletionStrategy completionS .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results); - if (predicateChanged is Subject> subject) + if (predicateChanged is Signal> subject) subject.OnError(error); results.Error.Should().Be(error, "errors should propagate downstream"); @@ -299,10 +299,10 @@ public void ReapplyFilterCompletes_CompletionWaitsForSourceAndPredicateChangedCo new Item() { Id = 6, IsIncluded = false } }); - var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); + var predicateChanged = new StateSignal>(Item.FilterByIsIncluded); var reapplyFilter = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject() + ? new Signal() : Observable.Empty(); // UUT Initialization & Action @@ -314,7 +314,7 @@ public void ReapplyFilterCompletes_CompletionWaitsForSourceAndPredicateChangedCo .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results); - if (reapplyFilter is Subject subject) + if (reapplyFilter is Signal subject) subject.OnCompleted(); results.Error.Should().BeNull(); @@ -357,7 +357,7 @@ public void ReapplyFilterFails_ErrorPropagates(CompletionStrategy completionStra var error = new Exception("Test"); var reapplyFilter = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject() + ? new Signal() : Observable.Throw(error); // UUT Initialization & Action @@ -369,7 +369,7 @@ public void ReapplyFilterFails_ErrorPropagates(CompletionStrategy completionStra .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results); - if (reapplyFilter is Subject subject) + if (reapplyFilter is Signal subject) subject.OnError(error); results.Error.Should().Be(error, "errors should propagate downstream"); @@ -392,7 +392,7 @@ public void ReapplyFilterOccurs_ItemsAreReFiltered(EmptyChangesetPolicy emptyCha { // Setup using var source = new TestSourceCache(Item.SelectId); - using var reapplyFilter = new Subject(); + using var reapplyFilter = new Signal(); source.AddOrUpdate(new[] { @@ -499,8 +499,8 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedAndRea new Item() { Id = 6, IsIncluded = false } }); - using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); - using var reapplyFilter = new Subject(); + using var predicateChanged = new StateSignal>(Item.FilterByIsIncluded); + using var reapplyFilter = new Signal(); // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) @@ -552,9 +552,9 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedAndRea public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() { // Setup - using var source = new Subject>(); - using var predicateChanged = new BehaviorSubject>(Item.FilterByIsIncluded); - using var reapplyFilter = new Subject(); + using var source = new Signal>(); + using var predicateChanged = new StateSignal>(Item.FilterByIsIncluded); + using var reapplyFilter = new Signal(); // UUT Initialization using var subscription = source diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs index a3004d95f..9f9f3f3ef 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs @@ -26,8 +26,8 @@ public async Task NotificationsOccurOnDifferentThreads_OperatorIsThreadSafe() randomizer: randomizer) .ToArray(); - using var source = new Subject>(); - using var predicateState = new Subject(); + using var source = new Signal>(); + using var predicateState = new Signal(); // UUT Initialization using var subscription = source diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs index 6ececdca8..ec0576f96 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs @@ -106,7 +106,7 @@ public void PredicateStateCompletesAfterInitialValue_CompletionWaitsForSourceCom }); var predicateState = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject() + ? new Signal() : Observable.Return(new object()); // UUT Initialization & Action @@ -118,7 +118,7 @@ public void PredicateStateCompletesAfterInitialValue_CompletionWaitsForSourceCom .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results); - if (predicateState is Subject subject) + if (predicateState is Signal subject) { subject.OnNext(new()); subject.OnCompleted(); @@ -156,7 +156,7 @@ public void PredicateStateCompletesBeforeInitialValue_CompletionPropagatesIfEmpt using var source = new TestSourceCache(Item.SelectId); var predicateState = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject() + ? new Signal() : Observable.Empty(); // UUT Initialization & Action @@ -169,7 +169,7 @@ public void PredicateStateCompletesBeforeInitialValue_CompletionPropagatesIfEmpt .ValidateChangeSets(static item => item.Id) .RecordCacheItems(out var results); - if (predicateState is Subject subject) + if (predicateState is Signal subject) subject.OnCompleted(); results.Error.Should().BeNull(); @@ -191,7 +191,7 @@ public void PredicateStateFails_ErrorPropagates(CompletionStrategy completionStr var error = new Exception("Test"); var predicateState = (completionStrategy is CompletionStrategy.Asynchronous) - ? new Subject() + ? new Signal() : Observable.Throw(error); // UUT Initialization & Action @@ -203,7 +203,7 @@ public void PredicateStateFails_ErrorPropagates(CompletionStrategy completionStr .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - if (predicateState is Subject subject) + if (predicateState is Signal subject) subject.OnError(error); results.Error.Should().Be(error, "errors should propagate downstream"); @@ -226,7 +226,7 @@ public void PredicateStateChanges_ItemsAreReFiltered(EmptyChangesetPolicy emptyC { // Setup using var source = new TestSourceCache(Item.SelectId); - using var predicateState = new BehaviorSubject(0x5); + using var predicateState = new StateSignal(0x5); source.AddOrUpdate(new[] { @@ -324,7 +324,7 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple new Item() { Id = 6, IsIncluded = false } }); - using var predicateState = new BehaviorSubject(new object()); + using var predicateState = new StateSignal(new object()); // UUT Initialization & Action if (completionStrategy is CompletionStrategy.Immediate) @@ -362,8 +362,8 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForPredicateChangedComple public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() { // Setup - using var source = new Subject>(); - using var predicateState = new BehaviorSubject(new()); + using var source = new Signal>(); + using var predicateState = new StateSignal(new()); // UUT Initialization using var subscription = source diff --git a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs index 464e7bb78..efdc508eb 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs @@ -48,7 +48,7 @@ public void SourceCompletes_CompletionPropagates(CompletionStrategy completionSt public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); // UUT Intialization using var subscription = source diff --git a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs index dd08677c4..f04cab29d 100644 --- a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs @@ -7,7 +7,7 @@ public sealed class FilterImmutableFixture [Fact] public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded() { - using var source = new Subject>(); + using var source = new Signal>(); using var results = source .FilterImmutable(predicate: Item.Predicate) @@ -87,7 +87,7 @@ public void ItemsAreManipulated_UnmatchedItemsAreExcludedAndIndexesAreDiscarded( [Fact] public void ItemsAreMoved_ChangesAreNotPropagated() { - using var source = new Subject>(); + using var source = new Signal>(); using var results = source .FilterImmutable(predicate: Item.Predicate) @@ -126,7 +126,7 @@ public void PredicateIsNull_ThrowsException() [Fact] public void PredicateThrows_ExceptionIsCaptured() { - using var source = new Subject>(); + using var source = new Signal>(); var error = new Exception(); @@ -148,7 +148,7 @@ public void PredicateThrows_ExceptionIsCaptured() [Fact] public void SourceCompletes_CompletionIsPropagated() { - using var source = new Subject>(); + using var source = new Signal>(); using var results = source .FilterImmutable(predicate: Item.Predicate) @@ -208,7 +208,7 @@ public void SourceCompletesImmediately_CompletionIsPropagated() [Fact] public void SourceErrors_ErrorIsPropagated() { - using var source = new Subject>(); + using var source = new Signal>(); var error = new Exception(); @@ -276,7 +276,7 @@ public void SourceIsNull_ThrowsException() [Fact] public void SuppressEmptyChangesetsIsFalse_EmptyChangesetsArePublished() { - using var source = new Subject>(); + using var source = new Signal>(); using var results = source .FilterImmutable( @@ -295,7 +295,7 @@ public void SuppressEmptyChangesetsIsFalse_EmptyChangesetsArePublished() [Fact] public void SuppressEmptyChangesetsIsTrue_EmptyChangesetsAreNotPublished() { - using var source = new Subject>(); + using var source = new Signal>(); using var results = source .FilterImmutable(predicate: Item.Predicate) @@ -308,7 +308,7 @@ public void SuppressEmptyChangesetsIsTrue_EmptyChangesetsAreNotPublished() results.Messages.Should().BeEmpty("no source operations should have generated changes"); } - private static void ManipulateExcludedItems(ISubject> source) + private static void ManipulateExcludedItems(ISignal> source) { var item1 = new Item() { Id = 1, IsIncluded = false }; source.OnNext(new ChangeSet() diff --git a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs index 5965e450c..83d02b589 100644 --- a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs @@ -108,7 +108,7 @@ public void ObservableFilterUsedToDetermineInclusion() public void ObservableFilterTriggersAddAndRemove() { // having - ISubject filterSubject = new Subject(); + ISignal filterSubject = new Signal(); using var filterStats = _source.Connect().FilterOnObservable(_ => filterSubject).AsAggregator(); @@ -131,7 +131,7 @@ public void ObservableFilterTriggersAddAndRemove() public void ObservableFilterDuplicateValuesHaveNoEffect() { // having - ISubject filterSubject = new Subject(); + ISignal filterSubject = new Signal(); using var filterStats = _source.Connect().FilterOnObservable(_ => filterSubject).AsAggregator(); @@ -158,7 +158,7 @@ public void ObservableFilterChangesCanBeBuffered() { // having TestScheduler? scheduler = new TestScheduler(); - ISubject filterSubject = new Subject(); + ISignal filterSubject = new Signal(); using var filterStats = _source.Connect().FilterOnObservable(_ => filterSubject, TimeSpan.FromSeconds(1), scheduler).AsAggregator(); diff --git a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs index bc8b9a8a4..1ff5d53c2 100644 --- a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs @@ -20,7 +20,7 @@ Task> Loader() return Task.FromResult(items); } - var data = Observable.FromAsync((Func>>)Loader).ToObservableChangeSet(p => p.Key).AsObservableCache(); + var data = Signal.FromAsync((Func>>)Loader).ToObservableChangeSet(p => p.Key).AsObservableCache(); data.Count.Should().Be(100); } @@ -36,7 +36,7 @@ Task> Loader() Exception? error = null; - var data = Observable.FromAsync((Func>>)Loader).ToObservableChangeSet(p => p.Key).Subscribe((changes) => { }, ex => error = ex); + var data = Signal.FromAsync((Func>>)Loader).ToObservableChangeSet(p => p.Key).Subscribe((changes) => { }, ex => error = ex); error.Should().NotBeNull(); } @@ -51,9 +51,9 @@ Task> Loader() Exception? error = null; - var data = Observable.FromAsync(Loader).ToObservableChangeSet(p => p.Key).Subscribe(changes => { }, ex => error = ex); + var data = Signal.FromAsync(Loader).ToObservableChangeSet(p => p.Key).Subscribe(changes => { }, ex => error = ex); - var data2 = Observable.FromAsync(Loader).ToObservableChangeSet(p => p.Key).AsObservableCache().Connect().Subscribe(changes => { }, ex => error = ex); + var data2 = Signal.FromAsync(Loader).ToObservableChangeSet(p => p.Key).AsObservableCache().Connect().Subscribe(changes => { }, ex => error = ex); //var subscribed = data.Connect() // diff --git a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs index c28b20845..1ddaa9882 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs @@ -18,14 +18,14 @@ public class GroupControllerFixture : IDisposable return p.Age <= 60 ? AgeBracket.Adult : AgeBracket.Pensioner; }; - private readonly ISubject _refresher; + private readonly Signal _refresher; private readonly ISourceCache _source; public GroupControllerFixture() { _source = new SourceCache(p => p.Name); - _refresher = new Subject(); + _refresher = new Signal(); _grouped = _source.Connect().Group(_grouper, _refresher).AsObservableCache(); } @@ -42,6 +42,7 @@ public void Dispose() { _source?.Dispose(); _grouped?.Dispose(); + _refresher.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs index cdec445ef..5a8dc8205 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs @@ -18,7 +18,7 @@ public class GroupControllerForFilteredItemsFixture : IDisposable return p.Age <= 60 ? AgeBracket.Adult : AgeBracket.Pensioner; }; - private readonly ISubject _refreshSubject = new Subject(); + private readonly Signal _refreshSubject = new Signal(); private readonly ISourceCache _source; @@ -42,6 +42,7 @@ public void Dispose() { _source.Dispose(); _grouped.Dispose(); + _refreshSubject.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs index 86dcd4589..44142fdd4 100644 --- a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs @@ -2,7 +2,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; - using Person = DynamicData.Tests.Domain.Person; namespace DynamicData.Tests.Cache; @@ -25,8 +24,8 @@ public class GroupOnDynamicFixture : IDisposable private readonly GroupChangeSetAggregator _groupResults; private readonly Faker _faker; private readonly Randomizer _randomizer; - private readonly BehaviorSubject?> _keySelectionSubject = new (null); - private readonly Subject _regroupSubject = new (); + private readonly StateSignal?> _keySelectionSubject = new (null); + private readonly Signal _regroupSubject = new (); public GroupOnDynamicFixture() { diff --git a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs index f6332f08b..7878440f2 100644 --- a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs @@ -3,7 +3,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; - using Person = DynamicData.Tests.Domain.Person; namespace DynamicData.Tests.Cache; @@ -24,7 +23,7 @@ public class GroupOnObservableFixture : IDisposable private readonly SourceCache _cache = new (p => p.UniqueKey); private readonly ChangeSetAggregator _results; private readonly GroupChangeSetAggregator _groupResults; - private readonly Subject _grouperShutdown; + private readonly Signal _grouperShutdown; private readonly Faker _faker; private readonly Randomizer _randomizer = new(0x3141_5926); diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs index e95be5596..95bac6209 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs @@ -11,7 +11,7 @@ public class InnerJoinFixtureRaceCondition [Fact] public void LetsSeeWhetherWeCanRandomlyHitARaceCondition() { - var ids = ObservableChangeSet.Create(sourceCache => { return Observable.Range(1, 1000000, Scheduler.Default).Subscribe(x => sourceCache.AddOrUpdate(x)); }, x => x); + var ids = ObservableChangeSet.Create(sourceCache => { return Observable.Range(1, 1000000, Sequencer.Default).Subscribe(x => sourceCache.AddOrUpdate(x)); }, x => x); var itemsCache = new SourceCache(x => x.Id); itemsCache.AddOrUpdate( diff --git a/src/DynamicData.Tests/Cache/MergeManyFixture.cs b/src/DynamicData.Tests/Cache/MergeManyFixture.cs index 568aad5e7..b4fdcbc03 100644 --- a/src/DynamicData.Tests/Cache/MergeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyFixture.cs @@ -61,9 +61,9 @@ public void RemovedItemWillNotCauseInvocation() stream.Dispose(); } - private class ObjectWithObservable(int id) + private class ObjectWithObservable(int id) : IDisposable { - private readonly ISubject _changed = new Subject(); + private readonly Signal _changed = new Signal(); private bool _value; @@ -76,5 +76,10 @@ public void InvokeObservable(bool value) _value = value; _changed.OnNext(value); } - } + + public void Dispose() + { + _changed.Dispose(); + } +} } diff --git a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs index 7d2fba117..ac620ede8 100644 --- a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs @@ -73,9 +73,9 @@ public void RemovedItemWillNotCauseInvocation() stream.Dispose(); } - private class ObjectWithObservable(int id) + private class ObjectWithObservable(int id) : IDisposable { - private readonly ISubject _changed = new Subject(); + private readonly Signal _changed = new Signal(); private bool _value; @@ -88,5 +88,9 @@ public void InvokeObservable(bool value) _value = value; _changed.OnNext(value); } - } + public void Dispose() + { + _changed.Dispose(); + } +} } diff --git a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs index a39a947ef..a79b069e6 100644 --- a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs @@ -178,9 +178,9 @@ public void MergedStreamFailsWhenSourceFails() receivedError.Should().Be(expectedError); } - private class ObjectWithObservable(int id) + private class ObjectWithObservable(int id) : IDisposable { - private readonly ISubject _changed = new Subject(); + private readonly Signal _changed = new Signal(); private bool _value; @@ -197,5 +197,7 @@ public void InvokeObservable(bool value) _value = value; _changed.OnNext(value); } + + public void Dispose() => _changed.Dispose(); } } diff --git a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs index cbd4848a7..6171dfe7a 100644 --- a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs +++ b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs @@ -11,7 +11,7 @@ public void InitialiStatusIsLoadding() { var invoked = false; var status = ConnectionStatus.Pending; - var subscription = new Subject().MonitorStatus().Subscribe( + var subscription = new Signal().MonitorStatus().Subscribe( s => { invoked = true; @@ -27,7 +27,7 @@ public void MultipleInvokesDoNotCallLoadedAgain() { var invoked = false; var invocations = 0; - var subject = new Subject(); + var subject = new Signal(); var subscription = subject.MonitorStatus().Where(status => status == ConnectionStatus.Loaded).Subscribe( s => { @@ -49,7 +49,7 @@ public void SetToError() { var invoked = false; var status = ConnectionStatus.Pending; - var subject = new Subject(); + var subject = new Signal(); Exception exception; var subscription = subject.MonitorStatus().Subscribe( @@ -72,7 +72,7 @@ public void SetToLoaded() { var invoked = false; var status = ConnectionStatus.Pending; - var subject = new Subject(); + var subject = new Signal(); var subscription = subject.MonitorStatus().Subscribe( s => { diff --git a/src/DynamicData.Tests/Cache/PageFixture.cs b/src/DynamicData.Tests/Cache/PageFixture.cs index af38365e6..da66ca64c 100644 --- a/src/DynamicData.Tests/Cache/PageFixture.cs +++ b/src/DynamicData.Tests/Cache/PageFixture.cs @@ -13,9 +13,9 @@ public class PageFixture : IDisposable private readonly RandomPersonGenerator _generator = new(); - private readonly ISubject _pager; + private readonly ISignal _pager; - private readonly ISubject> _sort; + private readonly ISignal> _sort; private readonly ISourceCache _source; @@ -23,8 +23,8 @@ public PageFixture() { _source = new SourceCache(p => p.Name); _comparer = SortExpressionComparer.Ascending(p => p.Name).ThenByAscending(p => p.Age); - _sort = new BehaviorSubject>(_comparer); - _pager = new BehaviorSubject(new PageRequest(1, 25)); + _sort = new StateSignal>(_comparer); + _pager = new StateSignal(new PageRequest(1, 25)); _aggregators = _source.Connect().Sort(_sort, resetThreshold: 200).Page(_pager).AsAggregator(); } @@ -61,6 +61,8 @@ public void Dispose() { _source.Dispose(); _aggregators.Dispose(); + _pager.Dispose(); + _sort.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs index a38019635..d684666b0 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs @@ -39,11 +39,11 @@ public abstract class SortAndBindObservableFixture : IDisposable private readonly SortExpressionComparer _defaultComparer = SortExpressionComparer.Ascending(p => p.Name).ThenByAscending(p => p.Age); [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "By Design.")] - private protected readonly BehaviorSubject> ComparerObservable; + private protected readonly StateSignal> ComparerObservable; protected SortAndBindObservableFixture() { - ComparerObservable = new BehaviorSubject>(_defaultComparer); + ComparerObservable = new StateSignal>(_defaultComparer); // It's ok in this case to call VirtualMemberCallInConstructor diff --git a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs index d658579b9..c2ed47247 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs @@ -69,7 +69,7 @@ public abstract class SortAndPageAndBindFixtureBase : IDisposable protected readonly SourceCache Source = new(p => p.Name); protected readonly IComparer Comparer = SortExpressionComparer.Ascending(p => p.Age).ThenByAscending(p => p.Name); - private protected readonly ISubject PageRequests = new BehaviorSubject(new PageRequest(0, 25)); + private protected readonly ISignal PageRequests = new StateSignal(new PageRequest(0, 25)); protected readonly ChangeSetAggregator Aggregator; protected readonly IList List; @@ -367,5 +367,6 @@ public void Dispose() Source.Dispose(); Aggregator.Dispose(); PageRequests.OnCompleted(); + PageRequests.Dispose(); } } diff --git a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs index b76fec1a0..4c44eb7a4 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs @@ -6,13 +6,13 @@ namespace DynamicData.Tests.Cache; public sealed class SortAndPageWithComparerChangesFixture : SortAndPageFixtureBase { - private BehaviorSubject> _comparerSubject; + private StateSignal> _comparerSubject; private readonly IComparer _descComparer = SortExpressionComparer.Descending(p => p.Age).ThenByAscending(p => p.Name); protected override ChangeSetAggregator> SetUpTests() { - _comparerSubject = new BehaviorSubject>(Comparer); + _comparerSubject = new StateSignal>(Comparer); return Source.Connect() .SortAndPage(_comparerSubject, PageRequests) @@ -76,7 +76,7 @@ public abstract class SortAndPageFixtureBase : IDisposable protected readonly SourceCache Source = new(p => p.Name); protected readonly IComparer Comparer = SortExpressionComparer.Ascending(p => p.Age).ThenByAscending(p => p.Name); - private protected readonly ISubject PageRequests = new BehaviorSubject(new PageRequest(1, 25)); + private protected readonly ISignal PageRequests = new StateSignal(new PageRequest(1, 25)); protected readonly ChangeSetAggregator> Aggregator; @@ -399,5 +399,6 @@ public void Dispose() Source.Dispose(); Aggregator.Dispose(); PageRequests.OnCompleted(); + PageRequests.Dispose(); } } diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs index 5e0236cd5..19c660ae5 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs @@ -69,7 +69,7 @@ public abstract class SortAndVirtualizeAndBindFixtureBase : IDisposable protected readonly SourceCache Source = new(p => p.Name); protected readonly IComparer Comparer = SortExpressionComparer.Ascending(p => p.Age).ThenByAscending(p => p.Name); - private protected readonly ISubject VirtualRequests = new BehaviorSubject(new VirtualRequest(0, 25)); + private protected readonly ISignal VirtualRequests = new StateSignal(new VirtualRequest(0, 25)); protected readonly ChangeSetAggregator Aggregator; protected readonly IList List; @@ -367,5 +367,6 @@ public void Dispose() Source.Dispose(); Aggregator.Dispose(); VirtualRequests.OnCompleted(); + VirtualRequests.Dispose(); } } diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs index 3f8a0ef20..0a9846f52 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs @@ -6,13 +6,13 @@ namespace DynamicData.Tests.Cache; public sealed class SortAndVirtualizeWithComparerChangesFixture : SortAndVirtualizeFixtureBase { - private BehaviorSubject> _comparerSubject ; + private StateSignal> _comparerSubject ; private readonly IComparer _descComparer = SortExpressionComparer.Descending(p => p.Age).ThenByAscending(p => p.Name); protected override ChangeSetAggregator> SetUpTests() { - _comparerSubject = new BehaviorSubject>(Comparer); + _comparerSubject = new StateSignal>(Comparer); return Source.Connect() .SortAndVirtualize(_comparerSubject, VirtualRequests) @@ -75,7 +75,7 @@ public abstract class SortAndVirtualizeFixtureBase : IDisposable protected readonly SourceCache Source = new(p => p.Name); protected readonly IComparer Comparer = SortExpressionComparer.Ascending(p => p.Age).ThenByAscending(p => p.Name); - private protected readonly ISubject VirtualRequests = new BehaviorSubject(new VirtualRequest(0, 25)); + private protected readonly ISignal VirtualRequests = new StateSignal(new VirtualRequest(0, 25)); protected readonly ChangeSetAggregator> Aggregator; @@ -378,5 +378,6 @@ public void Dispose() Source.Dispose(); Aggregator.Dispose(); VirtualRequests.OnCompleted(); + VirtualRequests.Dispose(); } } diff --git a/src/DynamicData.Tests/Cache/SortFixture.cs b/src/DynamicData.Tests/Cache/SortFixture.cs index 7225b38c0..6e9c8366c 100644 --- a/src/DynamicData.Tests/Cache/SortFixture.cs +++ b/src/DynamicData.Tests/Cache/SortFixture.cs @@ -255,7 +255,7 @@ public void Dispose() public void DoesNotThrow1() { var cache = new SourceCache(d => d.Id); - var sortPump = new Subject(); + var sortPump = new Signal(); var disposable = cache.Connect().Sort(SortExpressionComparer.Ascending(d => d.Id), sortPump).Subscribe(); disposable.Dispose(); @@ -265,7 +265,7 @@ public void DoesNotThrow1() public void DoesNotThrow2() { var cache = new SourceCache(d => d.Id); - var disposable = cache.Connect().Sort(new BehaviorSubject>(SortExpressionComparer.Ascending(d => d.Id))).Subscribe(); + var disposable = cache.Connect().Sort(new StateSignal>(SortExpressionComparer.Ascending(d => d.Id))).Subscribe(); disposable.Dispose(); } @@ -356,7 +356,7 @@ public void SortAfterFilter() { var source = new SourceCache(p => p.Key); - var filterSubject = new BehaviorSubject>(p => true); + var filterSubject = new StateSignal>(p => true); var agg = new SortedChangeSetAggregator(source.Connect().Filter(filterSubject).Group(x => (TestString)x.Key).Transform(x => new ViewModel(x.Key)).Sort(new ViewModel.Comparer())); @@ -377,7 +377,7 @@ public void SortAfterFilterList() { var source = new SourceList(); - var filterSubject = new BehaviorSubject>(p => true); + var filterSubject = new StateSignal>(p => true); var agg = source.Connect().Filter(filterSubject).Transform(x => new ViewModel(x.Name)).Sort(new ViewModel.Comparer()).AsAggregator(); @@ -781,7 +781,7 @@ public void Dispose() public void DoesNotThrow1() { var cache = new SourceCache(d => d.Id); - var sortPump = new Subject(); + var sortPump = new Signal(); var disposable = cache.Connect().Sort(SortExpressionComparer.Ascending(d => d.Id), sortPump).Subscribe(); disposable.Dispose(); @@ -791,7 +791,7 @@ public void DoesNotThrow1() public void DoesNotThrow2() { var cache = new SourceCache(d => d.Id); - var disposable = cache.Connect().Sort(new BehaviorSubject>(SortExpressionComparer.Ascending(d => d.Id))).Subscribe(); + var disposable = cache.Connect().Sort(new StateSignal>(SortExpressionComparer.Ascending(d => d.Id))).Subscribe(); disposable.Dispose(); } @@ -882,7 +882,7 @@ public void SortAfterFilter() { var source = new SourceCache(p => p.Key); - var filterSubject = new BehaviorSubject>(p => true); + var filterSubject = new StateSignal>(p => true); var agg = new SortedChangeSetAggregator(source.Connect().Filter(filterSubject).Group(x => (TestString)x.Key).Transform(x => new ViewModel(x.Key)).Sort(new ViewModel.Comparer())); @@ -903,7 +903,7 @@ public void SortAfterFilterList() { var source = new SourceList(); - var filterSubject = new BehaviorSubject>(p => true); + var filterSubject = new StateSignal>(p => true); var agg = source.Connect().Filter(filterSubject).Transform(x => new ViewModel(x.Name)).Sort(new ViewModel.Comparer()).AsAggregator(); diff --git a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs index 6b84eaf0a..3c9cc8e92 100644 --- a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs +++ b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs @@ -12,7 +12,7 @@ public class SortObservableFixture : IDisposable private readonly SortExpressionComparer _comparer; [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "By Design.")] - private readonly BehaviorSubject> _comparerObservable; + private readonly StateSignal> _comparerObservable; private readonly RandomPersonGenerator _generator = new(); @@ -23,7 +23,7 @@ public class SortObservableFixture : IDisposable public SortObservableFixture() { _comparer = SortExpressionComparer.Ascending(p => p.Name).ThenByAscending(p => p.Age); - _comparerObservable = new BehaviorSubject>(_comparer); + _comparerObservable = new StateSignal>(_comparer); _cache = new SourceCache(p => p.Name); // _sortController = new SortController(_comparer); diff --git a/src/DynamicData.Tests/Cache/SwitchFixture.cs b/src/DynamicData.Tests/Cache/SwitchFixture.cs index f47c848c5..bccb35717 100644 --- a/src/DynamicData.Tests/Cache/SwitchFixture.cs +++ b/src/DynamicData.Tests/Cache/SwitchFixture.cs @@ -10,7 +10,7 @@ public class SwitchFixture public void ClearsForNewSource() { using var source = new SourceCache(p => p.Name); - using var switchable = new BehaviorSubject>(source); + using var switchable = new StateSignal>(source); var results = switchable.Switch().AsAggregator(); var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); @@ -35,7 +35,7 @@ public void ClearsForNewSource() public void PoulatesFirstSource() { using var source = new SourceCache(p => p.Name); - using var switchable = new BehaviorSubject>(source); + using var switchable = new StateSignal>(source); var results = switchable.Switch().AsAggregator(); var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); @@ -48,7 +48,7 @@ public void PoulatesFirstSource() public void PropagatesOuterErrors() { using var source = new SourceCache(p => p.Name); - using var switchable = new BehaviorSubject>(source); + using var switchable = new StateSignal>(source); var results = switchable.Switch().AsAggregator(); var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); @@ -64,13 +64,13 @@ public void PropagatesOuterErrors() public void PropagatesInnerErrors() { using var source = new SourceCache(p => p.Name); - using var switchable = new BehaviorSubject>>(source.Connect()); + using var switchable = new StateSignal>>(source.Connect()); var results = switchable.Switch().AsAggregator(); var inital = Enumerable.Range(1, 100).Select(i => new Person("Person" + i, i)).ToArray(); source.AddOrUpdate(inital); - using var source2 = new BehaviorSubject>(ChangeSet.Empty); + using var source2 = new StateSignal>(ChangeSet.Empty); switchable.OnNext(source2); diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs index 5194c123c..92de88ee6 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -12,7 +12,7 @@ public class UnitTests public void ExpireAfterThrows_ErrorPropagates() { // Setup - using var source = new Subject(); + using var source = new Signal(); var error = new Exception("Test Exception"); @@ -48,7 +48,7 @@ public void ExpireAfterThrows_ErrorPropagates() [Fact] public void KeySelectorIsNull_ThrowsException() => FluentActions.Invoking(() => ObservableCacheEx.ToObservableChangeSet( - source: new Subject(), + source: new Signal(), keySelector: null!)) .Should().Throw(); @@ -56,7 +56,7 @@ public void KeySelectorIsNull_ThrowsException() public void KeySelectorThrows_ErrorPropagates() { // Setup - using var source = new Subject(); + using var source = new Signal(); var error = new Exception("Test Exception"); @@ -91,7 +91,7 @@ public void KeySelectorThrows_ErrorPropagates() public void SizeLimitIsExceeded_OldestItemsAreRemoved() { // Setup - using var source = new Subject(); + using var source = new Signal(); // UUT Initialization using var subscription = source @@ -163,7 +163,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var source = sourceType switch { - SourceType.Asynchronous => new Subject(), + SourceType.Asynchronous => new Signal(), SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -180,7 +180,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - if (source is Subject subject) + if (source is Signal subject) { subject.OnNext(item); subject.OnCompleted(); @@ -218,7 +218,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var source = sourceType switch { - SourceType.Asynchronous => new Subject(), + SourceType.Asynchronous => new Signal(), SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -235,7 +235,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - if (source is Subject subject) + if (source is Signal subject) { subject.OnNext(item); subject.OnCompleted(); @@ -256,7 +256,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsRescheduled() { // Setup - using var source = new Subject(); + using var source = new Signal(); var scheduler = new TestScheduler(); @@ -374,7 +374,7 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() { // Setup - using var source = new Subject(); + using var source = new Signal(); var scheduler = new TestScheduler(); @@ -468,7 +468,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) var source = sourceType switch { - SourceType.Asynchronous => new Subject(), + SourceType.Asynchronous => new Signal(), SourceType.Immediate => Observable.Throw(error), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -480,7 +480,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - if (source is Subject subject) + if (source is Signal subject) subject.OnError(error); results.Error.Should().BeSameAs(error, "errors should propagate"); diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs index 54ddc575b..27a256f6b 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -12,7 +12,7 @@ public class UnitTests public void ExpireAfterThrows_ErrorPropagates() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); var error = new Exception("Test Exception"); @@ -51,7 +51,7 @@ public void ExpireAfterThrows_ErrorPropagates() [Fact] public void KeySelectorIsNull_ThrowsException() => FluentActions.Invoking(() => ObservableCacheEx.ToObservableChangeSet( - source: new Subject>(), + source: new Signal>(), keySelector: null!)) .Should().Throw(); @@ -59,7 +59,7 @@ public void KeySelectorIsNull_ThrowsException() public void KeySelectorThrows_ErrorPropagates() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); var error = new Exception("Test Exception"); @@ -97,7 +97,7 @@ public void KeySelectorThrows_ErrorPropagates() public void SizeLimitIsExceeded_OldestItemsAreRemoved() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); // UUT Initialization using var subscription = source @@ -174,7 +174,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var source = sourceType switch { - SourceType.Asynchronous => new Subject>(), + SourceType.Asynchronous => new Signal>(), SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -191,7 +191,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - if (source is Subject> subject) + if (source is Signal> subject) { subject.OnNext(items); subject.OnCompleted(); @@ -234,7 +234,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var source = sourceType switch { - SourceType.Asynchronous => new Subject>(), + SourceType.Asynchronous => new Signal>(), SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -251,7 +251,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - if (source is Subject> subject) + if (source is Signal> subject) { subject.OnNext(items); subject.OnCompleted(); @@ -272,7 +272,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsRescheduled() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = new TestScheduler(); @@ -354,7 +354,7 @@ public void SourceEmitsRepeatedItems_RepeatedItemsAreUpdatedAndExpirationIsResch public void SourceEmitsUniqueItems_ItemsAreAddedAndRemovedWhenExpired() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = new TestScheduler(); @@ -430,7 +430,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) var source = sourceType switch { - SourceType.Asynchronous => new Subject>(), + SourceType.Asynchronous => new Signal>(), SourceType.Immediate => Observable.Throw>(error), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -442,7 +442,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) .ValidateChangeSets(Item.SelectId) .RecordCacheItems(out var results); - if (source is Subject> subject) + if (source is Signal> subject) subject.OnError(error); results.Error.Should().BeSameAs(error, "errors should propagate"); diff --git a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs index 1bf3addaf..57774c593 100644 --- a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs @@ -116,7 +116,7 @@ public async Task RemoveFlowsToTheEnd() public void ReTransformAll() { var people = Enumerable.Range(1, 10).Select(i => new Person("Name" + i, i)).ToArray(); - var forceTransform = new Subject(); + var forceTransform = new Signal(); using var stub = new TransformStub(forceTransform); stub.Source.AddOrUpdate(people); @@ -139,7 +139,7 @@ public void ReTransformAll() public void ReTransformSelected() { var people = Enumerable.Range(1, 10).Select(i => new Person("Name" + i, i)).ToArray(); - var forceTransform = new Subject>(); + var forceTransform = new Signal>(); using var stub = new TransformStub(forceTransform); stub.Source.AddOrUpdate(people); diff --git a/src/DynamicData.Tests/Cache/TransformFixture.cs b/src/DynamicData.Tests/Cache/TransformFixture.cs index 90ea20898..23ff66c09 100644 --- a/src/DynamicData.Tests/Cache/TransformFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformFixture.cs @@ -68,7 +68,7 @@ public void Remove() public void ReTransformAll() { var people = Enumerable.Range(1, 10).Select(i => new Person("Name" + i, i)).ToArray(); - var forceTransform = new Subject(); + var forceTransform = new Signal(); using var stub = new TransformStub(forceTransform); stub.Source.AddOrUpdate(people); @@ -91,7 +91,7 @@ public void ReTransformAll() public void ReTransformSelected() { var people = Enumerable.Range(1, 10).Select(i => new Person("Name" + i, i)).ToArray(); - var forceTransform = new Subject>(); + var forceTransform = new Signal>(); using var stub = new TransformStub(forceTransform); stub.Source.AddOrUpdate(people); diff --git a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs index d56767612..7cf8bad72 100644 --- a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs @@ -7,7 +7,7 @@ public sealed class TransformImmutableFixture [Fact] public void ItemsAreManipulated_ItemsAreTransformed() { - using var source = new Subject>(); + using var source = new Signal>(); using var results = source .TransformImmutable(transformFactory: Item.NameSelector) @@ -93,7 +93,7 @@ public void ItemsAreManipulated_ItemsAreTransformed() [Fact] public void SourceCompletes_CompletionIsPropagated() { - using var source = new Subject>(); + using var source = new Signal>(); using var results = source .TransformImmutable(transformFactory: Item.NameSelector) @@ -153,7 +153,7 @@ public void SourceCompletesImmediately_CompletionIsPropagated() [Fact] public void SourceErrors_ErrorIsPropagated() { - using var source = new Subject>(); + using var source = new Signal>(); var error = new Exception(); @@ -228,7 +228,7 @@ public void TransformFactoryIsNull_ThrowsException() [Fact] public void TransformFactoryThrows_ExceptionIsCaptured() { - using var source = new Subject>(); + using var source = new Signal>(); var error = new Exception(); @@ -251,7 +251,7 @@ public void TransformFactoryThrows_ExceptionIsCaptured() [Fact] public void TDestinationIsValueType_DoesNotThrowException() { - using var source = new Subject>(); + using var source = new Signal>(); using var results = source .TransformImmutable(transformFactory: static value => value.Length) diff --git a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs index 9861b5443..9d310729d 100644 --- a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs @@ -83,10 +83,10 @@ public async Task ResultUpdatesOnFutureValues() // Create an observable that fires a wrong value on an interval a fixed number of times // then fires the expected value before completing IObservable CreateChildObs(Animal a, int id) => - Observable.Interval(UpdateTime) + Signal.Every(UpdateTime) .Select(n => $"{a.Name}-{id}-{n}") .Take(UpdateCount) - .Concat(Observable.Return(a.Name)); + .Concat(Signal.Emit(a.Name)); // Arrange var shared = _animalCache.Connect().TransformOnObservable(CreateChildObs).Publish(); diff --git a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs index eb1d76daf..224011770 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs @@ -10,7 +10,7 @@ public class TransformSafeAsyncFixture public void ReTransformAll() { var people = Enumerable.Range(1, 10).Select(i => new Person("Name" + i, i)).ToArray(); - var forceTransform = new Subject(); + var forceTransform = new Signal(); using var stub = new TransformStub(forceTransform); stub.Source.AddOrUpdate(people); @@ -33,7 +33,7 @@ public void ReTransformAll() public void ReTransformSelected() { var people = Enumerable.Range(1, 10).Select(i => new Person("Name" + i, i)).ToArray(); - var forceTransform = new Subject>(); + var forceTransform = new Signal>(); using var stub = new TransformStub(forceTransform); stub.Source.AddOrUpdate(people); diff --git a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs index 90e4174e8..d821d1cef 100644 --- a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs @@ -4,7 +4,7 @@ namespace DynamicData.Tests.Cache; public class TransformTreeFixture : IDisposable { - private readonly BehaviorSubject, bool>> _filter; + private readonly StateSignal, bool>> _filter; private readonly IObservableCache, int> _result; @@ -14,7 +14,7 @@ public TransformTreeFixture() { _sourceCache = new SourceCache(e => e.Id); - _filter = new BehaviorSubject, bool>>(n => n.IsRoot); + _filter = new StateSignal, bool>>(n => n.IsRoot); _result = _sourceCache.Connect().TransformToTree(e => e.BossId, _filter).AsObservableCache(); } diff --git a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs index e4b3fd66e..b2781bab6 100644 --- a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs @@ -84,9 +84,9 @@ public void MultipleValuesReturnTrue() subscribed.Dispose(); } - private class ObjectWithObservable(int id) + private class ObjectWithObservable(int id) : IDisposable { - private readonly ISubject _changed = new Subject(); + private readonly ISignal _changed = new Signal(); public int Id { get; } = id; @@ -99,5 +99,10 @@ public void InvokeObservable(bool value) Value = value; _changed.OnNext(value); } - } + + public void Dispose() + { + _changed.Dispose(); + } +} } diff --git a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs index b28997552..5e70a3c86 100644 --- a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs @@ -91,9 +91,9 @@ public void ValuesPublishedOnSubscriptionDoNotTriggerPrematureOutput() results.RecordedValues[0].Should().Be(true, because: "One of the two items in the source has a true value"); } - private class ObjectWithObservable(int id) + private class ObjectWithObservable(int id) : IDisposable { - private readonly ISubject _changed = new Subject(); + private readonly ISignal _changed = new Signal(); public int Id { get; } = id; @@ -106,5 +106,10 @@ public void InvokeObservable(bool value) Value = value; _changed.OnNext(value); } - } + + public void Dispose() + { + _changed.Dispose(); + } +} } diff --git a/src/DynamicData.Tests/Domain/PersonObs.cs b/src/DynamicData.Tests/Domain/PersonObs.cs index 2756134f2..c613b2e51 100644 --- a/src/DynamicData.Tests/Domain/PersonObs.cs +++ b/src/DynamicData.Tests/Domain/PersonObs.cs @@ -3,7 +3,7 @@ namespace DynamicData.Tests.Domain; [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1001:Types that own disposable fields should be disposable", Justification = "Acceptable in test.")] public class PersonObs(string name, int age, string gender = "F", string? parentName = null) : IEquatable { - private readonly BehaviorSubject _age = new BehaviorSubject(age); + private readonly StateSignal _age = new StateSignal(age); public PersonObs(string firstname, string lastname, int age, string gender = "F", string? parentName = null) : this(firstname + " " + lastname, age, gender, parentName) diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index 7c3855931..779d5a59c 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -28,8 +28,10 @@ + + diff --git a/src/DynamicData.Tests/EnumerableIListFixture.cs b/src/DynamicData.Tests/EnumerableIListFixture.cs index 025f5678c..f68dc42b4 100644 --- a/src/DynamicData.Tests/EnumerableIListFixture.cs +++ b/src/DynamicData.Tests/EnumerableIListFixture.cs @@ -41,7 +41,7 @@ public void EnumerableIListTests() [Fact] public void ExceptionTests() { - var exSubject = new Subject(); + var exSubject = new Signal(); object exceptionRecived = default!; exSubject.ObserveOn(Sequencer.Immediate).Subscribe(ex => { exceptionRecived = ex; }); diff --git a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs index 94df93b11..47b8bf352 100644 --- a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs +++ b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs @@ -48,11 +48,11 @@ public void ParentOnNext_CalledForEachChangeSet() public void ChildOnNext_CalledForEachEmission() { using var source = new SourceCache(x => x.Key); - var childSubjects = new List>(); + var childSubjects = new List>(); var observer = new TestObserver(); using var sub = new TestSubscription(observer, key => { - var subj = new Subject(); + var subj = new Signal(); childSubjects.Add(subj); return subj; }); @@ -98,7 +98,7 @@ public void Batching_ChildUpdatesSettleBeforeEmit() using var sub = new TestSubscription(observer, key => { Interlocked.Increment(ref childCount); - return new BehaviorSubject($"sync-{key}"); + return new StateSignal($"sync-{key}"); }); sub.ExposeCreateParent(source.Connect()); @@ -117,11 +117,11 @@ public void Batching_ChildUpdatesSettleBeforeEmit() public void Completion_RequiresParentAndAllChildren() { using var source = new TestSourceCache(x => x.Key); - var childSubjects = new List>(); + var childSubjects = new List>(); var observer = new TestObserver(); using var sub = new TestSubscription(observer, key => { - var subj = new Subject(); + var subj = new Signal(); childSubjects.Add(subj); return subj; }); @@ -153,11 +153,11 @@ public void Completion_ParentOnly_NoChildren() public void Disposal_StopsAllEmissions() { using var source = new SourceCache(x => x.Key); - var childSubjects = new List>(); + var childSubjects = new List>(); var observer = new TestObserver(); var sub = new TestSubscription(observer, key => { - var subj = new Subject(); + var subj = new Signal(); childSubjects.Add(subj); return subj; }); @@ -199,7 +199,7 @@ public void Serialization_ParentAndChildDoNotInterleave() observer, key => { - var subj = new Subject(); + var subj = new Signal(); return subj; }, onParent: () => { lock (callLog) callLog.Add("P-start"); Thread.Sleep(1); lock (callLog) callLog.Add("P-end"); }, diff --git a/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs b/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs index 0af364964..371e25b9c 100644 --- a/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs +++ b/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs @@ -5,11 +5,7 @@ namespace DynamicData.Tests.Internal; public class DeliveryQueueFixture { -#if NET9_0_OR_GREATER private readonly Lock _gate = new(); -#else - private readonly object _gate = new(); -#endif /// Helper observer that captures OnNext items into a list. private sealed class ListObserver : IObserver @@ -47,12 +43,14 @@ public void OnCompleted() { } } private static void EnqueueAndDeliver(DeliveryQueue queue, T item) + where T : notnull { using var scope = queue.AcquireLock(); scope.EnqueueNext(item); } private static void TriggerDelivery(DeliveryQueue queue) + where T : notnull { using var scope = queue.AcquireLock(); } @@ -549,4 +547,4 @@ public void ErrorTerminatesAndClearsPending() observer.Error.Should().BeSameAs(error); queue.IsTerminated.Should().BeTrue(); } -} \ No newline at end of file +} diff --git a/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs b/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs index 4601f4136..dc358bebd 100644 --- a/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs +++ b/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs @@ -9,11 +9,7 @@ namespace DynamicData.Tests.Internal; public class SharedDeliveryQueueFixture { -#if NET9_0_OR_GREATER private readonly Lock _gate = new(); -#else - private readonly object _gate = new(); -#endif [Fact] public void SingleSourceDeliversItems() @@ -176,4 +172,4 @@ private sealed class TestObserver(Action onNext) : IObserver public void OnError(Exception error) => Error = error; public void OnCompleted() => IsCompleted = true; } -} \ No newline at end of file +} diff --git a/src/DynamicData.Tests/List/BatchIfFixture.cs b/src/DynamicData.Tests/List/BatchIfFixture.cs index d879aa429..52c20c6ad 100644 --- a/src/DynamicData.Tests/List/BatchIfFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfFixture.cs @@ -6,7 +6,7 @@ namespace DynamicData.Tests.List; public class BatchIfFixture : IDisposable { - private readonly ISubject _pausingSubject = new Subject(); + private readonly ISignal _pausingSubject = new Signal(); private readonly ChangeSetAggregator _results; @@ -16,7 +16,7 @@ public class BatchIfFixture : IDisposable public BatchIfFixture() { - _pausingSubject = new Subject(); + _pausingSubject = new Signal(); _scheduler = new TestScheduler(); _source = new SourceList(); _results = _source.Connect().BufferIf(_pausingSubject, _scheduler).AsAggregator(); @@ -90,6 +90,7 @@ public void Dispose() { _results.Dispose(); _source.Dispose(); + _pausingSubject.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs index 8acfa45b4..7d3c7de74 100644 --- a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs @@ -6,7 +6,7 @@ namespace DynamicData.Tests.List; public class BatchIfWithTimeOutFixture : IDisposable { - private readonly ISubject _pausingSubject = new Subject(); + private readonly ISignal _pausingSubject = new Signal(); private readonly ChangeSetAggregator _results; @@ -16,7 +16,7 @@ public class BatchIfWithTimeOutFixture : IDisposable public BatchIfWithTimeOutFixture() { - _pausingSubject = new Subject(); + _pausingSubject = new Signal(); _scheduler = new TestScheduler(); _source = new SourceList(); _results = _source.Connect().BufferIf(_pausingSubject, TimeSpan.FromMinutes(1), _scheduler).AsAggregator(); @@ -47,6 +47,7 @@ public void Dispose() _results.Dispose(); _source.Dispose(); _pausingSubject.OnCompleted(); + _pausingSubject?.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/List/DisposeManyFixture.cs b/src/DynamicData.Tests/List/DisposeManyFixture.cs index d846e62b2..5552cf913 100644 --- a/src/DynamicData.Tests/List/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/List/DisposeManyFixture.cs @@ -4,7 +4,7 @@ namespace DynamicData.Tests.List; public sealed class DisposeManyFixture : IDisposable { - private readonly Subject> _changeSetsSource; + private readonly Signal> _changeSetsSource; private readonly SourceList _itemsSource; diff --git a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs index 956dea5ae..5e1f22562 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs @@ -6,7 +6,7 @@ namespace DynamicData.Tests.List; public class FilterControllerFixtureWithClearAndReplace : IDisposable { - private readonly ISubject> _filter; + private readonly ISignal> _filter; private readonly ChangeSetAggregator _results; @@ -15,7 +15,7 @@ public class FilterControllerFixtureWithClearAndReplace : IDisposable public FilterControllerFixtureWithClearAndReplace() { _source = new SourceList(); - _filter = new BehaviorSubject>(p => p.Age > 20); + _filter = new StateSignal>(p => p.Age > 20); _results = _source.Connect().Filter(_filter, ListFilterPolicy.ClearAndReplace).AsAggregator(); } @@ -143,6 +143,7 @@ public void Dispose() { _source.Dispose(); _results.Dispose(); + _filter.Dispose(); } [Fact] @@ -243,7 +244,7 @@ public void UpdateNotMatched() [Fact] public void VeryLargeDataSet() { - var filter = new BehaviorSubject>(i => false); + var filter = new StateSignal>(i => false); var source = new SourceList(); var result = source.Connect().Filter(filter, ListFilterPolicy.ClearAndReplace).AsObservableList(); diff --git a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs index 05cac99df..8b3c0a32d 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs @@ -6,7 +6,7 @@ namespace DynamicData.Tests.List; public class FilterControllerFixtureWithDiffSet : IDisposable { - private readonly ISubject> _filter; + private readonly ISignal> _filter; private readonly ChangeSetAggregator _results; @@ -15,7 +15,7 @@ public class FilterControllerFixtureWithDiffSet : IDisposable public FilterControllerFixtureWithDiffSet() { _source = new SourceList(); - _filter = new BehaviorSubject>(p => p.Age > 20); + _filter = new StateSignal>(p => p.Age > 20); _results = _source.Connect().Filter(_filter).AsAggregator(); } @@ -143,6 +143,7 @@ public void Dispose() { _source.Dispose(); _results.Dispose(); + _filter.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/List/FilterFixture.Static.cs b/src/DynamicData.Tests/List/FilterFixture.Static.cs index 25093c311..da66f03e6 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Static.cs @@ -577,7 +577,7 @@ public void SourceIsNull_ThrowsException() public void SubscriptionIsDisposed_SubscriptionDisposalPropagates() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); // UUT Initialization using var subscription = source diff --git a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs index d0373923d..41ac9da99 100644 --- a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs +++ b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs @@ -19,7 +19,7 @@ public WithPredicateState(ITestOutputHelper output) public void ChangesAreMadeAfterInitialPredicateState_ItemsAreFiltered(ListFilterPolicy filterPolicy) { using var source = new TestSourceList(); - using var predicateState = new Subject(); + using var predicateState = new Signal(); using var subscription = source .Connect() @@ -192,7 +192,7 @@ IEnumerable EnumerateFilteredItems() public void ChangesAreMadeAfterMultiplePredicateStateChanges_ItemsAreFilteredWithLatestPredicateState(ListFilterPolicy filterPolicy) { using var source = new SourceList(); - using var predicateState = new BehaviorSubject(1); + using var predicateState = new StateSignal(1); using var subscription = source .Connect() @@ -229,7 +229,7 @@ public void ChangesAreMadeAfterMultiplePredicateStateChanges_ItemsAreFilteredWit public void ChangesAreMadeBeforeInitialPredicateState_ItemsAreFilteredOnPredicateState(ListFilterPolicy filterPolicy) { using var source = new TestSourceList(); - using var predicateState = new Subject(); + using var predicateState = new Signal(); using var subscription = source .Connect() @@ -318,7 +318,7 @@ public void ChangesAreMadeBeforeInitialPredicateState_ItemsAreFilteredOnPredicat public void FilterPolicyIsClearAndReplace_ReFilteringPreservesOrder() { using var source = new SourceList(); - using var predicateState = new BehaviorSubject(1); + using var predicateState = new StateSignal(1); using var subscription = source .Connect() @@ -371,7 +371,7 @@ public void PredicateIsNull_ExceptionIsThrown() public void PredicateStateChanges_ItemsAreReFiltered(ListFilterPolicy filterPolicy) { using var source = new SourceList(); - using var predicateState = new BehaviorSubject(1); + using var predicateState = new StateSignal(1); using var subscription = source .Connect() @@ -410,7 +410,7 @@ IEnumerable EnumerateFilteredItems() [InlineData(ListFilterPolicy.ClearAndReplace)] public void PredicateStateCompletesAfterInitialValue_CompletionWaitsForSourceCompletion(ListFilterPolicy filterPolicy) { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .Filter( @@ -435,7 +435,7 @@ public void PredicateStateCompletesAfterInitialValue_CompletionWaitsForSourceCom [InlineData(ListFilterPolicy.ClearAndReplace)] public void PredicateStateCompletesImmediately_CompletionIsPropagated(ListFilterPolicy filterPolicy) { - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .Filter( @@ -457,8 +457,8 @@ public void PredicateStateCompletesImmediately_CompletionIsPropagated(ListFilter [InlineData(ListFilterPolicy.ClearAndReplace)] public void PredicateStateErrors_ErrorIsPropagated(ListFilterPolicy filterPolicy) { - using var source = new Subject>(); - using var predicateState = new Subject(); + using var source = new Signal>(); + using var predicateState = new Signal(); using var subscription = source .Filter( @@ -484,7 +484,7 @@ public void PredicateStateErrors_ErrorIsPropagated(ListFilterPolicy filterPolicy [InlineData(ListFilterPolicy.ClearAndReplace)] public void PredicateStateErrorsImmediately_ErrorIsPropagated(ListFilterPolicy filterPolicy) { - using var source = new Subject>(); + using var source = new Signal>(); var error = new Exception("This is a test."); @@ -529,9 +529,9 @@ public async Task SourceAndPredicateStateNotifyFromDifferentThreads_FilteringIsT valueCount: 5_000, randomizer: randomizer); - using var source = new Subject>(); + using var source = new Signal>(); - using var predicateState = new Subject(); + using var predicateState = new Signal(); using var subscription = source .Filter( @@ -582,9 +582,9 @@ await Task.WhenAll( [InlineData(ListFilterPolicy.ClearAndReplace)] public void SourceCompletesWhenEmpty_CompletionIsPropagated(ListFilterPolicy filterPolicy) { - using var source = new Subject>(); + using var source = new Signal>(); - using var predicateState = new Subject(); + using var predicateState = new Signal(); using var subscription = source .Filter( @@ -608,9 +608,9 @@ public void SourceCompletesWhenEmpty_CompletionIsPropagated(ListFilterPolicy fil [InlineData(ListFilterPolicy.ClearAndReplace)] public void SourceCompletesWhenNotEmpty_CompletionWaitsForStateCompletion(ListFilterPolicy filterPolicy) { - using var source = new Subject>(); + using var source = new Signal>(); - using var predicateState = new Subject(); + using var predicateState = new Signal(); using var subscription = source .Filter( @@ -638,7 +638,7 @@ public void SourceCompletesWhenNotEmpty_CompletionWaitsForStateCompletion(ListFi [InlineData(ListFilterPolicy.ClearAndReplace)] public void SourceCompletesImmediately_CompletionIsPropagated(ListFilterPolicy filterPolicy) { - using var predicateState = new Subject(); + using var predicateState = new Signal(); using var subscription = Observable.Empty>() .Filter( @@ -660,9 +660,9 @@ public void SourceCompletesImmediately_CompletionIsPropagated(ListFilterPolicy f [InlineData(ListFilterPolicy.ClearAndReplace)] public void SourceErrors_ErrorIsPropagated(ListFilterPolicy filterPolicy) { - using var source = new Subject>(); + using var source = new Signal>(); - using var predicateState = new Subject(); + using var predicateState = new Signal(); using var subscription = source .Filter( @@ -688,7 +688,7 @@ public void SourceErrors_ErrorIsPropagated(ListFilterPolicy filterPolicy) [InlineData(ListFilterPolicy.ClearAndReplace)] public void SourceErrorsImmediately_ErrorIsPropagated(ListFilterPolicy filterPolicy) { - using var predicateState = new Subject(); + using var predicateState = new Signal(); var error = new Exception("This is a test."); @@ -721,9 +721,9 @@ public void SourceIsNull_ExceptionIsThrown() [InlineData(ListFilterPolicy.ClearAndReplace)] public void SubscriptionIsDisposed_UnsubscriptionIsPropagated(ListFilterPolicy filterPolicy) { - using var source = new Subject>(); + using var source = new Signal>(); - using var predicateState = new Subject(); + using var predicateState = new Signal(); using var subscription = source .Filter( @@ -747,9 +747,9 @@ public void SubscriptionIsDisposed_UnsubscriptionIsPropagated(ListFilterPolicy f [InlineData("predicateState", "source")] public void SuppressEmptyChangeSetsIsFalse_EmptyChangesetsArePropagatedAndOnlyFinalCompletionIsPropagated(params string[] completionOrder) { - using var source = new Subject>(); + using var source = new Signal>(); - using var predicateState = new Subject(); + using var predicateState = new Signal(); using var subscription = source .Filter( diff --git a/src/DynamicData.Tests/List/FilterWithObservable.cs b/src/DynamicData.Tests/List/FilterWithObservable.cs index 975de33a0..31af66494 100644 --- a/src/DynamicData.Tests/List/FilterWithObservable.cs +++ b/src/DynamicData.Tests/List/FilterWithObservable.cs @@ -7,7 +7,7 @@ namespace DynamicData.Tests.List; public class FilterWithObservable : IDisposable { - private readonly BehaviorSubject> _filter; + private readonly StateSignal> _filter; private readonly ChangeSetAggregator _results; @@ -16,7 +16,7 @@ public class FilterWithObservable : IDisposable public FilterWithObservable() { _source = new SourceList(); - _filter = new BehaviorSubject>(p => p.Age > 20); + _filter = new StateSignal>(p => p.Age > 20); _results = _source.Connect().Filter(_filter).AsAggregator(); } @@ -115,7 +115,7 @@ public void BatchSuccessiveUpdates() [Fact] public void ChainFilters() { - var filter2 = new BehaviorSubject>(person1 => person1.Age > 20); + var filter2 = new StateSignal>(person1 => person1.Age > 20); var stream = _source.Connect().Filter(_filter).Filter(filter2); diff --git a/src/DynamicData.Tests/List/FromAsyncFixture.cs b/src/DynamicData.Tests/List/FromAsyncFixture.cs index f493fc7b0..2b345e73c 100644 --- a/src/DynamicData.Tests/List/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/List/FromAsyncFixture.cs @@ -20,7 +20,7 @@ Task> Loader() return Task.FromResult(items); } - var data = Observable.FromAsync((Func>>)Loader).ToObservableChangeSet().AsObservableList(); + var data = Signal.FromAsync((Func>>)Loader).ToObservableChangeSet().AsObservableList(); data.Count.Should().Be(100); } @@ -36,7 +36,7 @@ Task> Loader() Exception? error = null; - var data = Observable.FromAsync((Func>>)Loader).ToObservableChangeSet().Subscribe((changes) => { }, ex => error = ex); + var data = Signal.FromAsync((Func>>)Loader).ToObservableChangeSet().Subscribe((changes) => { }, ex => error = ex); error.Should().NotBeNull(); } @@ -52,7 +52,7 @@ Task> Loader() Exception? error = null; - var data = Observable.FromAsync((Func>>)Loader).ToObservableChangeSet().AsObservableList(); + var data = Signal.FromAsync((Func>>)Loader).ToObservableChangeSet().AsObservableList(); var subscribed = data.Connect().Subscribe(changes => { }, ex => error = ex); diff --git a/src/DynamicData.Tests/List/GroupImmutableFixture.cs b/src/DynamicData.Tests/List/GroupImmutableFixture.cs index 86830f535..5812bb7da 100644 --- a/src/DynamicData.Tests/List/GroupImmutableFixture.cs +++ b/src/DynamicData.Tests/List/GroupImmutableFixture.cs @@ -7,7 +7,7 @@ namespace DynamicData.Tests.List; public class GroupImmutableFixture : IDisposable { - private readonly ISubject _regrouper; + private readonly ISignal _regrouper; private readonly ChangeSetAggregator> _results; @@ -16,7 +16,7 @@ public class GroupImmutableFixture : IDisposable public GroupImmutableFixture() { _source = new SourceList(); - _regrouper = new Subject(); + _regrouper = new Signal(); _results = _source.Connect().GroupWithImmutableState(p => p.Age, _regrouper).AsAggregator(); } @@ -60,6 +60,7 @@ public void Dispose() { _source.Dispose(); _results.Dispose(); + _regrouper.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/List/MergeManyFixture.cs b/src/DynamicData.Tests/List/MergeManyFixture.cs index 1ea3079c6..662624dd8 100644 --- a/src/DynamicData.Tests/List/MergeManyFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyFixture.cs @@ -148,9 +148,9 @@ public void MergedStreamFailsWhenSourceFails() receivedError.Should().Be(expectedError); } - private class ObjectWithObservable(int id) + private class ObjectWithObservable(int id) : IDisposable { - private readonly ISubject _changed = new Subject(); + private readonly ISignal _changed = new Signal(); private bool _value; @@ -167,5 +167,7 @@ public void InvokeObservable(bool value) _value = value; _changed.OnNext(value); } + + public void Dispose() => _changed.Dispose(); } } diff --git a/src/DynamicData.Tests/List/PageFixture.cs b/src/DynamicData.Tests/List/PageFixture.cs index 6918cd390..d4b418ee1 100644 --- a/src/DynamicData.Tests/List/PageFixture.cs +++ b/src/DynamicData.Tests/List/PageFixture.cs @@ -9,7 +9,7 @@ public class PageFixture : IDisposable { private readonly RandomPersonGenerator _generator = new(); - private readonly ISubject _requestSubject = new BehaviorSubject(new PageRequest(1, 25)); + private readonly ISignal _requestSubject = new StateSignal(new PageRequest(1, 25)); private readonly ChangeSetAggregator _results; @@ -26,6 +26,7 @@ public void Dispose() _requestSubject.OnCompleted(); _source.Dispose(); _results.Dispose(); + _requestSubject.Dispose(); } [Fact] @@ -142,7 +143,7 @@ public class PageFixtureWithNoInitialData [Fact] public void SimplePaging() { - using var pager = new BehaviorSubject(new PageRequest(0, 0)); + using var pager = new StateSignal(new PageRequest(0, 0)); using var sourceList = new SourceList(); using var sut = new SimplePaging(sourceList, pager); // Add items to source @@ -170,7 +171,7 @@ public void DoesNotThrowWithDuplicates() var source = new SourceList(); source.AddRange(Enumerable.Repeat("item", 10)); source.Connect() - .Page(new BehaviorSubject(new PageRequest(0, 3))) + .Page(new StateSignal(new PageRequest(0, 3))) .Clone(result) .Subscribe(); diff --git a/src/DynamicData.Tests/List/SortFixture.cs b/src/DynamicData.Tests/List/SortFixture.cs index 038d47946..1edb414fe 100644 --- a/src/DynamicData.Tests/List/SortFixture.cs +++ b/src/DynamicData.Tests/List/SortFixture.cs @@ -16,7 +16,7 @@ public class SortChangedFixture public void SortsWithoutError() { var source = new SourceList(); - var sorter = new Subject>(); + var sorter = new Signal>(); source.AddRange(Enumerable.Range(1, 10).Select(i => new ListItem(i))); diff --git a/src/DynamicData.Tests/List/SortMutableFixture.cs b/src/DynamicData.Tests/List/SortMutableFixture.cs index 2bb9683e8..d3b610d37 100644 --- a/src/DynamicData.Tests/List/SortMutableFixture.cs +++ b/src/DynamicData.Tests/List/SortMutableFixture.cs @@ -8,13 +8,13 @@ namespace DynamicData.Tests.List; public class SortMutableFixture : IDisposable { - private readonly ISubject> _changeComparer; + private readonly ISignal> _changeComparer; private readonly IComparer _comparer = SortExpressionComparer.Ascending(p => p.Age).ThenByAscending(p => p.Name); private readonly RandomPersonGenerator _generator = new(); - private readonly ISubject _resort; + private readonly ISignal _resort; private readonly ChangeSetAggregator _results; @@ -23,8 +23,8 @@ public class SortMutableFixture : IDisposable public SortMutableFixture() { _source = new SourceList(); - _changeComparer = new BehaviorSubject>(_comparer); - _resort = new Subject(); + _changeComparer = new StateSignal>(_comparer); + _resort = new Signal(); _results = _source.Connect().Sort(_changeComparer, resetThreshold: 25, resort: _resort).AsAggregator(); } @@ -51,6 +51,8 @@ public void Dispose() { _results.Dispose(); _source.Dispose(); + _changeComparer.Dispose(); + _resort.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/List/SwitchFixture.cs b/src/DynamicData.Tests/List/SwitchFixture.cs index 4a4bdc502..c0e7eb179 100644 --- a/src/DynamicData.Tests/List/SwitchFixture.cs +++ b/src/DynamicData.Tests/List/SwitchFixture.cs @@ -8,12 +8,12 @@ public class SwitchFixture : IDisposable private readonly ISourceList _source; - private readonly ISubject> _switchable; + private readonly ISignal> _switchable; public SwitchFixture() { _source = new SourceList(); - _switchable = new BehaviorSubject>(_source); + _switchable = new StateSignal>(_source); _results = _switchable.Switch().AsAggregator(); } @@ -42,6 +42,7 @@ public void Dispose() { _source.Dispose(); _results.Dispose(); + _switchable.Dispose(); } [Fact] diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs index 3dc4585a0..b25ba4ade 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -12,7 +12,7 @@ public class UnitTests public void ExpireAfterThrows_ErrorPropagates() { // Setup - using var source = new Subject(); + using var source = new Signal(); var error = new Exception("Test Exception"); @@ -45,7 +45,7 @@ public void ExpireAfterThrows_ErrorPropagates() public void SizeLimitIsExceeded_OldestItemsAreRemoved() { // Setup - using var source = new Subject(); + using var source = new Signal(); // UUT Initialization using var subscription = source @@ -112,7 +112,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var source = sourceType switch { - SourceType.Asynchronous => new Subject(), + SourceType.Asynchronous => new Signal(), SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -128,7 +128,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio .ValidateChangeSets() .RecordListItems(out var results); - if (source is Subject subject) + if (source is Signal subject) { subject.OnNext(item); subject.OnCompleted(); @@ -166,7 +166,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var source = sourceType switch { - SourceType.Asynchronous => new Subject(), + SourceType.Asynchronous => new Signal(), SourceType.Immediate => Observable.Return(item), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -182,7 +182,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour .ValidateChangeSets() .RecordListItems(out var results); - if (source is Subject subject) + if (source is Signal subject) { subject.OnNext(item); subject.OnCompleted(); @@ -203,7 +203,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() { // Setup - using var source = new Subject(); + using var source = new Signal(); var scheduler = new TestScheduler(); @@ -308,7 +308,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) var source = sourceType switch { - SourceType.Asynchronous => new Subject(), + SourceType.Asynchronous => new Signal(), SourceType.Immediate => Observable.Throw(error), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -320,7 +320,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) .ValidateChangeSets() .RecordListItems(out var results); - if (source is Subject subject) + if (source is Signal subject) subject.OnError(error); results.Error.Should().BeSameAs(error, "errors should propagate"); diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs index 7dbf8bb0a..fb2a21f33 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -12,7 +12,7 @@ public class UnitTests public void ExpireAfterThrows_ErrorPropagates() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); var error = new Exception("Test Exception"); @@ -48,7 +48,7 @@ public void ExpireAfterThrows_ErrorPropagates() public void SizeLimitIsExceeded_OldestItemsAreRemoved() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); // UUT Initialization using var subscription = source @@ -120,7 +120,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio var source = sourceType switch { - SourceType.Asynchronous => new Subject>(), + SourceType.Asynchronous => new Signal>(), SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -136,7 +136,7 @@ public void SourceCompletesWhenExpirationsArePending_CompletionWaitsForExpiratio .ValidateChangeSets() .RecordListItems(out var results); - if (source is Subject> subject) + if (source is Signal> subject) { subject.OnNext(items); subject.OnCompleted(); @@ -181,7 +181,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour var source = sourceType switch { - SourceType.Asynchronous => new Subject>(), + SourceType.Asynchronous => new Signal>(), SourceType.Immediate => Observable.Return>(items), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -197,7 +197,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour .ValidateChangeSets() .RecordListItems(out var results); - if (source is Subject> subject) + if (source is Signal> subject) { subject.OnNext(items); subject.OnCompleted(); @@ -218,7 +218,7 @@ public void SourceCompletesWhenNoExpirationsArePending_CompletionPropagates(Sour public void SourceEmitsItems_ItemsAreAddedAndRemovedWhenExpired() { // Setup - using var source = new Subject>(); + using var source = new Signal>(); var scheduler = new TestScheduler(); @@ -301,7 +301,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) var source = sourceType switch { - SourceType.Asynchronous => new Subject>(), + SourceType.Asynchronous => new Signal>(), SourceType.Immediate => Observable.Throw>(error), _ => throw new ArgumentOutOfRangeException(nameof(sourceType)) }; @@ -313,7 +313,7 @@ public void SourceFails_ErrorPropagates(SourceType sourceType) .ValidateChangeSets() .RecordListItems(out var results); - if (source is Subject> subject) + if (source is Signal> subject) subject.OnError(error); results.Error.Should().BeSameAs(error, "errors should propagate"); diff --git a/src/DynamicData.Tests/List/VirtualisationFixture.cs b/src/DynamicData.Tests/List/VirtualisationFixture.cs index 626502596..8699e857f 100644 --- a/src/DynamicData.Tests/List/VirtualisationFixture.cs +++ b/src/DynamicData.Tests/List/VirtualisationFixture.cs @@ -8,7 +8,7 @@ public class VirtualisationFixture : IDisposable { private readonly RandomPersonGenerator _generator = new(); - private readonly ISubject _requestSubject = new BehaviorSubject(new VirtualRequest(0, 25)); + private readonly ISignal _requestSubject = new StateSignal(new VirtualRequest(0, 25)); private readonly ChangeSetAggregator _results; @@ -24,6 +24,7 @@ public void Dispose() { _source.Dispose(); _results.Dispose(); + _requestSubject.Dispose(); } [Fact] @@ -133,7 +134,7 @@ public void DoesNotThrowWithDuplicates() var source = new SourceList(); source.AddRange(Enumerable.Repeat("item", 10)); source.Connect() - .Virtualise(new BehaviorSubject(new VirtualRequest(0, 3))) + .Virtualise(new StateSignal(new VirtualRequest(0, 3))) .Clone(result) .Subscribe(); diff --git a/src/DynamicData.Tests/Utilities/TestSourceCache.cs b/src/DynamicData.Tests/Utilities/TestSourceCache.cs index c3171bd8d..c816f39d4 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceCache.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceCache.cs @@ -8,8 +8,8 @@ public sealed class TestSourceCache where TKey : notnull { private readonly IObservable _countChanged; - private readonly BehaviorSubject _error; - private readonly BehaviorSubject _hasCompleted; + private readonly StateSignal _error; + private readonly StateSignal _hasCompleted; private readonly SourceCache _source; public TestSourceCache(Func keySelector) diff --git a/src/DynamicData.Tests/Utilities/TestSourceList.cs b/src/DynamicData.Tests/Utilities/TestSourceList.cs index d364fe0cf..3b496ccb0 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceList.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceList.cs @@ -5,10 +5,10 @@ public sealed class TestSourceList where T : notnull { private readonly IObservable _countChanged; - private readonly BehaviorSubject _error; - private readonly BehaviorSubject _hasCompleted; - private readonly Subject> _refreshRequested; - private readonly Subject> _refreshRequestedPreview; + private readonly StateSignal _error; + private readonly StateSignal _hasCompleted; + private readonly Signal> _refreshRequested; + private readonly Signal> _refreshRequestedPreview; private readonly SourceList _source; public TestSourceList() diff --git a/src/DynamicData/Aggregation/AggregateItem.cs b/src/DynamicData/Aggregation/AggregateItem.cs index cef641f87..a346ab930 100644 --- a/src/DynamicData/Aggregation/AggregateItem.cs +++ b/src/DynamicData/Aggregation/AggregateItem.cs @@ -11,31 +11,10 @@ namespace DynamicData.Aggregation; /// /// Initializes a new instance of the struct. /// -/// The type. -/// The item. -public readonly struct AggregateItem(AggregateType type, TObject item) : IEquatable> +/// The type. +/// The item. +public readonly record struct AggregateItem(AggregateType Type, TObject Item) { - /// - /// Gets the type. - /// - public AggregateType Type { get; } = type; - - /// - /// Gets the item. - /// - public TObject Item { get; } = item; - - public static bool operator ==(in AggregateItem left, in AggregateItem right) => left.Equals(right); - - public static bool operator !=(in AggregateItem left, in AggregateItem right) => !(left == right); - - /// - public override bool Equals(object? obj) => obj is AggregateItem aggItem && Equals(aggItem); - - /// - public bool Equals(AggregateItem other) => - Type == other.Type && EqualityComparer.Default.Equals(Item, other.Item); - /// public override int GetHashCode() { diff --git a/src/DynamicData/Aggregation/Avg.cs b/src/DynamicData/Aggregation/Avg.cs index 85bb3b160..9dfb17498 100644 --- a/src/DynamicData/Aggregation/Avg.cs +++ b/src/DynamicData/Aggregation/Avg.cs @@ -4,9 +4,4 @@ namespace DynamicData.Aggregation; -internal readonly struct Avg(int count, TValue sum) -{ - public int Count { get; } = count; - - public TValue Sum { get; } = sum; -} +internal readonly record struct Avg(int Count, TValue Sum); diff --git a/src/DynamicData/Aggregation/AvgEx.cs b/src/DynamicData/Aggregation/AvgEx.cs index 0567fd3ea..fdda5c793 100644 --- a/src/DynamicData/Aggregation/AvgEx.cs +++ b/src/DynamicData/Aggregation/AvgEx.cs @@ -299,7 +299,11 @@ public static IObservable Avg(this IObservable> source, /// /// An observable of averages. /// - public static IObservable Avg(this IObservable> source, Func valueSelector, int emptyValue = 0) => source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / (double)values.Count); + public static IObservable Avg(this IObservable> source, Func valueSelector, int emptyValue = 0) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / (double)values.Count); + } /// /// Continuous calculation of the average of the underlying data source. @@ -321,7 +325,11 @@ public static IObservable Avg(this IObservable> source, /// The value selector. /// The empty value. /// An observable of averages as a double value. - public static IObservable Avg(this IObservable> source, Func valueSelector, long emptyValue = 0) => source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / (double)values.Count); + public static IObservable Avg(this IObservable> source, Func valueSelector, long emptyValue = 0) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / (double)values.Count); + } /// /// Continuous calculation of the average of the underlying data source. @@ -345,7 +353,11 @@ public static IObservable Avg(this IObservable> source, /// /// An observable of averages. /// - public static IObservable Avg(this IObservable> source, Func valueSelector, double emptyValue = 0) => source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / (double)values.Count); + public static IObservable Avg(this IObservable> source, Func valueSelector, double emptyValue = 0) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / (double)values.Count); + } /// /// Continuous calculation of the average of the underlying data source. @@ -369,7 +381,11 @@ public static IObservable Avg(this IObservable> source, /// /// An observable of averages. /// - public static IObservable Avg(this IObservable> source, Func valueSelector, decimal emptyValue = 0) => source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / values.Count); + public static IObservable Avg(this IObservable> source, Func valueSelector, decimal emptyValue = 0) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / values.Count); + } /// /// Averages the specified value selector. @@ -391,7 +407,11 @@ public static IObservable Avg(this IObservable> source, /// /// An observable of averages. /// - public static IObservable Avg(this IObservable> source, Func valueSelector, float emptyValue = 0) => source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / values.Count); + public static IObservable Avg(this IObservable> source, Func valueSelector, float emptyValue = 0) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / values.Count); + } /// /// Continuous calculation of the average of the underlying data source. diff --git a/src/DynamicData/Aggregation/CountEx.cs b/src/DynamicData/Aggregation/CountEx.cs index 8845bdc71..1b34c4666 100644 --- a/src/DynamicData/Aggregation/CountEx.cs +++ b/src/DynamicData/Aggregation/CountEx.cs @@ -35,7 +35,11 @@ public static IObservable Count(this IObservableThe type of the object. /// The source. /// An observable which emits the count. - public static IObservable Count(this IObservable> source) => source.Accumulate(0, _ => 1, (current, increment) => current + increment, (current, increment) => current - increment); + public static IObservable Count(this IObservable> source) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.Accumulate(0, _ => 1, (current, increment) => current + increment, (current, increment) => current - increment); + } /// /// Counts the total number of items in the underlying data source. diff --git a/src/DynamicData/Aggregation/StdDev.cs b/src/DynamicData/Aggregation/StdDev.cs index 81932c8d9..d43cce9a7 100644 --- a/src/DynamicData/Aggregation/StdDev.cs +++ b/src/DynamicData/Aggregation/StdDev.cs @@ -4,11 +4,4 @@ namespace DynamicData.Aggregation; -internal readonly struct StdDev(int count, TValue sumOfItems, TValue sumOfSquares) -{ - public int Count { get; } = count; - - public TValue SumOfItems { get; } = sumOfItems; - - public TValue SumOfSquares { get; } = sumOfSquares; -} +internal readonly record struct StdDev(int Count, TValue SumOfItems, TValue SumOfSquares); diff --git a/src/DynamicData/Aggregation/StdDevEx.cs b/src/DynamicData/Aggregation/StdDevEx.cs index 406e1da48..b7a9d3da9 100644 --- a/src/DynamicData/Aggregation/StdDevEx.cs +++ b/src/DynamicData/Aggregation/StdDevEx.cs @@ -137,7 +137,11 @@ public static IObservable StdDev(this IObservableThe value selector. /// The fallback value. /// An observable which emits the standard deviation value. - public static IObservable StdDev(this IObservable> source, Func valueSelector, int fallbackValue = 0) => source.StdDevCalc(t => (long)valueSelector(t), fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); + public static IObservable StdDev(this IObservable> source, Func valueSelector, int fallbackValue = 0) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.StdDevCalc(t => (long)valueSelector(t), fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); + } /// /// Continual computation of the standard deviation of the values in the underlying data source. @@ -147,8 +151,11 @@ public static IObservable StdDev(this IObservableThe value selector. /// The fallback value. /// An observable which emits the standard deviation value. - public static IObservable StdDev(this IObservable> source, Func valueSelector, long fallbackValue = 0) => - source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); + public static IObservable StdDev(this IObservable> source, Func valueSelector, long fallbackValue = 0) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); + } /// /// Continual computation of the standard deviation of the values in the underlying data source. @@ -158,8 +165,11 @@ public static IObservable StdDev(this IObservableThe value selector. /// The fallback value. /// An observable which emits the standard deviation value. - public static IObservable StdDev(this IObservable> source, Func valueSelector, decimal fallbackValue = 0M) => - source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0M / (values.Count - 1))); + public static IObservable StdDev(this IObservable> source, Func valueSelector, decimal fallbackValue = 0M) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0M / (values.Count - 1))); + } /// /// Continual computation of the standard deviation of the values in the underlying data source. @@ -169,7 +179,11 @@ public static IObservable StdDev(this IObservableThe value selector. /// The fallback value. /// An observable which emits the standard deviation value. - public static IObservable StdDev(this IObservable> source, Func valueSelector, double fallbackValue = 0) => source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); + public static IObservable StdDev(this IObservable> source, Func valueSelector, double fallbackValue = 0) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); + } /// /// Continual computation of the standard deviation of the values in the underlying data source. @@ -179,7 +193,11 @@ public static IObservable StdDev(this IObservableThe value selector. /// The fallback value. /// An observable which emits the standard deviation value. - public static IObservable StdDev(this IObservable> source, Func valueSelector, float fallbackValue = 0) => source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); + public static IObservable StdDev(this IObservable> source, Func valueSelector, float fallbackValue = 0) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); + } private static IObservable StdDevCalc(this IObservable> source, Func valueSelector, TResult fallbackValue, Func, TValue, StdDev> addAction, Func, TValue, StdDev> removeAction, Func, TResult> resultAction) { diff --git a/src/DynamicData/Aggregation/SumEx.cs b/src/DynamicData/Aggregation/SumEx.cs index 6d3f59a9a..65857e7b8 100644 --- a/src/DynamicData/Aggregation/SumEx.cs +++ b/src/DynamicData/Aggregation/SumEx.cs @@ -251,7 +251,11 @@ public static IObservable Sum(this IObservable> s /// The source. /// The value selector. /// An observable which emits the summed value. - public static IObservable Sum(this IObservable> source, Func valueSelector) => source.Accumulate(0, t => valueSelector(t).GetValueOrDefault(), (current, value) => current + value, (current, value) => current - value); + public static IObservable Sum(this IObservable> source, Func valueSelector) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.Accumulate(0, t => valueSelector(t).GetValueOrDefault(), (current, value) => current + value, (current, value) => current - value); + } /// /// Continual computes the sum of values matching the value selector. diff --git a/src/DynamicData/Binding/IObservableListEx.cs b/src/DynamicData/Binding/IObservableListEx.cs index 4b46e5013..c2e867029 100644 --- a/src/DynamicData/Binding/IObservableListEx.cs +++ b/src/DynamicData/Binding/IObservableListEx.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs index 0836bf2de..9836aee0b 100644 --- a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs +++ b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs @@ -23,7 +23,7 @@ public static class NotifyPropertyChangedEx { source.ThrowArgumentNullExceptionIfNull(nameof(source)); - return Observable.FromEventPattern(handler => source.PropertyChanged += handler, handler => source.PropertyChanged -= handler).Where(x => propertiesToMonitor.Length == 0 || propertiesToMonitor.Contains(x.EventArgs.PropertyName!)).Select(_ => source); + return Observable.FromEventPattern(handler => source.PropertyChanged += handler, handler => source.PropertyChanged -= handler).Where(x => propertiesToMonitor.Length == 0 || propertiesToMonitor.Contains(x.EventArgs.PropertyName!)).Select(_ => source); } /// diff --git a/src/DynamicData/Binding/Observable.cs b/src/DynamicData/Binding/Observable.cs deleted file mode 100644 index f877c2169..000000000 --- a/src/DynamicData/Binding/Observable.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -namespace DynamicData.Binding; - -internal static class Observable -{ - public static IObservable Default { get; } = Observable.Return(default); - - public static IObservable Empty { get; } = Observable.Empty(); - - public static IObservable Never { get; } = Observable.Never(); -} diff --git a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs index 0393a4e2f..2f303e38b 100644 --- a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs @@ -17,7 +17,7 @@ namespace DynamicData.Binding; /// The number of changes before a Reset event is used. /// Use replace instead of remove / add for updates. /// Should a reset be fired for a first time load.This option is due to historic reasons where a reset would be fired for the first time load regardless of the number of changes. -/// collection. +/// collection. public class ObservableCollectionAdaptor(IObservableCollection collection, int refreshThreshold, #pragma warning disable CS9113 // Parameter is unread. bool allowReplace = true, diff --git a/src/DynamicData/Binding/ObservableCollectionEx.cs b/src/DynamicData/Binding/ObservableCollectionEx.cs index cfa6bec81..d8b496d3d 100644 --- a/src/DynamicData/Binding/ObservableCollectionEx.cs +++ b/src/DynamicData/Binding/ObservableCollectionEx.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; using System.Collections.Specialized; namespace DynamicData.Binding; @@ -104,7 +103,7 @@ public static IObservable> ToObservableChangeSetThe source. /// An observable that emits the change set. /// source. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Roslynator", "RCS1146:Use conditional access.", Justification = "net 7.0 has error when conditional access is used.")] + [SuppressMessage("Roslynator", "RCS1146:Use conditional access.", Justification = "net 7.0 has error when conditional access is used.")] public static IObservable> ToObservableChangeSet(this TCollection source) where TCollection : INotifyCollectionChanged, IEnumerable where T : notnull diff --git a/src/DynamicData/Binding/ObservableCollectionExtended.cs b/src/DynamicData/Binding/ObservableCollectionExtended.cs index a31f1e8d7..29837c62c 100644 --- a/src/DynamicData/Binding/ObservableCollectionExtended.cs +++ b/src/DynamicData/Binding/ObservableCollectionExtended.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; using System.Collections.Specialized; namespace DynamicData.Binding; diff --git a/src/DynamicData/Binding/PropertyValue.cs b/src/DynamicData/Binding/PropertyValue.cs index 1f782386f..af6e7405b 100644 --- a/src/DynamicData/Binding/PropertyValue.cs +++ b/src/DynamicData/Binding/PropertyValue.cs @@ -7,9 +7,12 @@ namespace DynamicData.Binding; /// /// Container holding sender and latest property value. /// +/// Gets the Sender. +/// Gets latest observed value. +/// Gets a value indicating whether flag to indicated that the value was unobtainable when observing a deeply nested struct. /// The type of the object. /// The type of the value. -public sealed class PropertyValue : IEquatable> +public sealed record PropertyValue(TObject Sender, TValue? Value, bool UnobtainableValue) { /// /// Initializes a new instance of the class. @@ -17,82 +20,15 @@ public sealed class PropertyValue : IEquatableThe sender. /// The value. public PropertyValue(TObject sender, TValue value) + : this(sender, value, default) { - Sender = sender; - Value = value; } internal PropertyValue(TObject sender) + : this(sender, default, true) { - Sender = sender; - UnobtainableValue = true; - Value = default; } - /// - /// Gets the Sender. - /// - public TObject Sender { get; } - - /// - /// Gets latest observed value. - /// - public TValue? Value { get; } - - /// - /// Gets a value indicating whether flag to indicated that the value was unobtainable when observing a deeply nested struct. - /// - internal bool UnobtainableValue { get; } - - /// - /// Implements the operator ==. - /// - /// The left. - /// The right. - /// - /// The result of the operator. - /// - public static bool operator ==(PropertyValue? left, PropertyValue? right) => Equals(left, right); - - /// - /// Implements the operator !=. - /// - /// The left. - /// The right. - /// - /// The result of the operator. - /// - public static bool operator !=(PropertyValue? left, PropertyValue? right) => !Equals(left, right); - - /// - public bool Equals(PropertyValue? other) - { - if (other is null) - { - return false; - } - - if (ReferenceEquals(this, other)) - { - return true; - } - - if (other.Value is null && Value is null) - { - return true; - } - - if (other.Value is null || Value is null) - { - return false; - } - - return EqualityComparer.Default.Equals(Sender, other.Sender) && EqualityComparer.Default.Equals(Value, other.Value); - } - - /// - public override bool Equals(object? obj) => obj is PropertyValue propertyValue && Equals(propertyValue); - /// public override int GetHashCode() { diff --git a/src/DynamicData/Cache/Change.cs b/src/DynamicData/Cache/Change.cs index 9593871b3..e36daf7f9 100644 --- a/src/DynamicData/Cache/Change.cs +++ b/src/DynamicData/Cache/Change.cs @@ -74,7 +74,7 @@ public Change(TKey key, TObject current, int currentIndex, int previousIndex) /// or /// For , must supply previous value. /// - public Change(ChangeReason reason, TKey key, TObject current, in Optional previous, int currentIndex = -1, int previousIndex = -1) + public Change(ChangeReason reason, TKey key, TObject current, in Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) : this() { Current = current; @@ -119,7 +119,7 @@ public Change(ChangeReason reason, TKey key, TObject current, in OptionalGets the item from before the change. /// This is only when is . /// - public Optional Previous { get; } + public Kernel.Optional Previous { get; } /// /// Gets the previous index. diff --git a/src/DynamicData/Cache/ChangeAwareCache.cs b/src/DynamicData/Cache/ChangeAwareCache.cs index ecf3df403..947fef1ba 100644 --- a/src/DynamicData/Cache/ChangeAwareCache.cs +++ b/src/DynamicData/Cache/ChangeAwareCache.cs @@ -85,7 +85,7 @@ public void AddOrUpdate(TObject item, TKey key) /// Create a change set from recorded changes and clears known changes. /// /// A change set with the key/value changes. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0301:Simplify collection initialization", Justification = "This would result in differing operation")] + [SuppressMessage("Style", "IDE0301:Simplify collection initialization", Justification = "This would result in differing operation")] public ChangeSet CaptureChanges() { if (_changes.Count == 0) @@ -136,7 +136,7 @@ public void Clone(IChangeSet changes) } /// - public Optional Lookup(TKey key) => _data.Lookup(key); + public Kernel.Optional Lookup(TKey key) => _data.Lookup(key); /// /// Raises an evaluate change for the specified keys. diff --git a/src/DynamicData/Cache/IGrouping.cs b/src/DynamicData/Cache/IGrouping.cs index b951ff715..6efb30e84 100644 --- a/src/DynamicData/Cache/IGrouping.cs +++ b/src/DynamicData/Cache/IGrouping.cs @@ -50,5 +50,5 @@ public interface IGrouping /// /// The key. /// The value that is looked up. - Optional Lookup(TKey key); + Kernel.Optional Lookup(TKey key); } diff --git a/src/DynamicData/Cache/IObservableCache.cs b/src/DynamicData/Cache/IObservableCache.cs index 8897962a6..907350a51 100644 --- a/src/DynamicData/Cache/IObservableCache.cs +++ b/src/DynamicData/Cache/IObservableCache.cs @@ -42,5 +42,5 @@ public interface IObservableCache : IConnectableCache /// The key. /// An optional with the looked up value. - Optional Lookup(TKey key); + Kernel.Optional Lookup(TKey key); } diff --git a/src/DynamicData/Cache/IQuery.cs b/src/DynamicData/Cache/IQuery.cs index 4f071c272..8dd4937e4 100644 --- a/src/DynamicData/Cache/IQuery.cs +++ b/src/DynamicData/Cache/IQuery.cs @@ -44,5 +44,5 @@ public interface IQuery /// /// The key. /// The looked up value. - Optional Lookup(TKey key); + Kernel.Optional Lookup(TKey key); } diff --git a/src/DynamicData/Cache/IntermediateCache.cs b/src/DynamicData/Cache/IntermediateCache.cs index 4494449a5..533e4568e 100644 --- a/src/DynamicData/Cache/IntermediateCache.cs +++ b/src/DynamicData/Cache/IntermediateCache.cs @@ -64,7 +64,7 @@ public IObservable> Connect(Func? predi public void Edit(Action> updateAction) => _innerCache.UpdateFromIntermediate(updateAction); /// - public Optional Lookup(TKey key) => _innerCache.Lookup(key); + public Kernel.Optional Lookup(TKey key) => _innerCache.Lookup(key); /// public IObservable> Preview(Func? predicate = null) diff --git a/src/DynamicData/Cache/Internal/AbstractFilter.cs b/src/DynamicData/Cache/Internal/AbstractFilter.cs index 5e86dd997..ba9f6ea61 100644 --- a/src/DynamicData/Cache/Internal/AbstractFilter.cs +++ b/src/DynamicData/Cache/Internal/AbstractFilter.cs @@ -23,7 +23,7 @@ public IChangeSet Refresh(IEnumerable { // this is an internal method only so we can be sure there are no duplicate keys in the result // (therefore safe to parallelise) - Optional> Factory(KeyValuePair kv) + Kernel.Optional> Factory(KeyValuePair kv) { var existing = _cache.Lookup(kv.Key); var matches = Filter(kv.Value); @@ -57,7 +57,7 @@ public IChangeSet Update(IChangeSet updates) protected abstract IEnumerable GetChangesWithFilter(ChangeSet updates); - protected abstract IEnumerable> Refresh(IEnumerable> items, Func, Optional>> factory); + protected abstract IEnumerable> Refresh(IEnumerable> items, Func, Kernel.Optional>> factory); private ChangeSet ProcessResult(IEnumerable source) { diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index 56617ee2f..7db27f721 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs @@ -11,7 +11,7 @@ internal sealed class AnonymousObservableCache : IObservableCache where TObject : notnull where TKey : notnull { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed through _cleanUp")] + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed through _cleanUp")] private readonly IObservableCache _cache; private readonly IDisposable _cleanUp; @@ -44,7 +44,7 @@ public AnonymousObservableCache(IObservableCache cache) public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => _cache.Connect(predicate, suppressEmptyChangeSets); - public Optional Lookup(TKey key) => _cache.Lookup(key); + public Kernel.Optional Lookup(TKey key) => _cache.Lookup(key); public IObservable> Preview(Func? predicate = null) => _cache.Preview(predicate); diff --git a/src/DynamicData/Cache/Internal/AnonymousQuery.cs b/src/DynamicData/Cache/Internal/AnonymousQuery.cs index f83fd2018..071d99d33 100644 --- a/src/DynamicData/Cache/Internal/AnonymousQuery.cs +++ b/src/DynamicData/Cache/Internal/AnonymousQuery.cs @@ -18,5 +18,5 @@ internal sealed class AnonymousQuery(Cache cache) public IEnumerable> KeyValues => _cache.KeyValues; - public Optional Lookup(TKey key) => _cache.Lookup(key); + public Kernel.Optional Lookup(TKey key) => _cache.Lookup(key); } diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index 878f7f8e9..8089b10b2 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs @@ -21,7 +21,7 @@ public static IObservable> Create( { var gate = new object(); var itemsByKey = new Dictionary(); - var disposalsCompleted = new ReplaySubject(1); + var disposalsCompleted = new ReplaySignal(1); var pendingAsyncDisposals = 0; var teardownStarted = false; var teardownCompleted = false; diff --git a/src/DynamicData/Cache/Internal/Cache.cs b/src/DynamicData/Cache/Internal/Cache.cs index 0a882ad88..a7d9554d4 100644 --- a/src/DynamicData/Cache/Internal/Cache.cs +++ b/src/DynamicData/Cache/Internal/Cache.cs @@ -57,7 +57,7 @@ public void Clone(IChangeSet changes) } } - public Optional Lookup(TKey key) => _data.Lookup(key); + public Kernel.Optional Lookup(TKey key) => _data.Lookup(key); /// /// Sends a signal for operators to recalculate it's state. diff --git a/src/DynamicData/Cache/Internal/CacheUpdater.cs b/src/DynamicData/Cache/Internal/CacheUpdater.cs index 8eb6eadf8..7cad46bb3 100644 --- a/src/DynamicData/Cache/Internal/CacheUpdater.cs +++ b/src/DynamicData/Cache/Internal/CacheUpdater.cs @@ -200,13 +200,13 @@ public void Load(IEnumerable items) AddOrUpdate(items); } - public Optional Lookup(TKey key) + public Kernel.Optional Lookup(TKey key) { var item = _cache.Lookup(key); return item.HasValue ? item.Value : Optional.None(); } - public Optional Lookup(TObject item) + public Kernel.Optional Lookup(TObject item) { if (_keySelector is null) { diff --git a/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs b/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs index ae973094e..0deba2273 100644 --- a/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs +++ b/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs @@ -141,7 +141,7 @@ private void OnItemRemoved(ChangeSetCache[] sourceCaches, TObject } } - private void OnItemUpdated(ChangeSetCache[] sources, TObject item, TKey key, in Optional prev) + private void OnItemUpdated(ChangeSetCache[] sources, TObject item, TKey key, in Kernel.Optional prev) { var cached = _resultCache.Lookup(key); @@ -219,7 +219,7 @@ private void ForceEvaluate(ChangeSetCache[] sources, TKey key) UpdateToBestValue(sources, key, cached); } - private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key, in Optional current) + private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key, in Kernel.Optional current) { // Determine which value should be the one seen downstream var candidate = LookupBestValue(sources, key); @@ -248,7 +248,7 @@ private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key return true; } - private Optional LookupBestValue(ChangeSetCache[] sources, TKey key) + private Kernel.Optional LookupBestValue(ChangeSetCache[] sources, TKey key) { if (sources.Length == 0) { diff --git a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs index 2db71092b..4d9344ee1 100644 --- a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs +++ b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs @@ -4,11 +4,11 @@ namespace DynamicData.Cache.Internal; -internal sealed class EditDiffChangeSetOptional(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) +internal sealed class EditDiffChangeSetOptional(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) where TObject : notnull where TKey : notnull { - private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); private readonly IEqualityComparer _equalityComparer = equalityComparer ?? EqualityComparer.Default; diff --git a/src/DynamicData/Cache/Internal/ExpirableItem.cs b/src/DynamicData/Cache/Internal/ExpirableItem.cs index ab02ac3d1..87714e917 100644 --- a/src/DynamicData/Cache/Internal/ExpirableItem.cs +++ b/src/DynamicData/Cache/Internal/ExpirableItem.cs @@ -4,26 +4,8 @@ namespace DynamicData.Cache.Internal; -internal readonly struct ExpirableItem(TObject value, TKey key, DateTime dateTime, long index = 0) : IEquatable> +internal readonly record struct ExpirableItem(TObject Value, TKey Key, DateTime ExpireAt, long Index = 0) { - public TObject Value { get; } = value; - - public TKey Key { get; } = key; - - public DateTime ExpireAt { get; } = dateTime; - - public long Index { get; } = index; - - public static bool operator ==(in ExpirableItem left, in ExpirableItem right) => left.Equals(right); - - public static bool operator !=(in ExpirableItem left, in ExpirableItem right) => !left.Equals(right); - - /// - public bool Equals(ExpirableItem other) => EqualityComparer.Default.Equals(Key, other.Key) && ExpireAt.Equals(other.ExpireAt); - - /// - public override bool Equals(object? obj) => obj is ExpirableItem expItem && Equals(expItem); - /// public override int GetHashCode() { diff --git a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs index 4c1b014b8..3a4446a19 100644 --- a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs @@ -43,10 +43,8 @@ private sealed class Subscription private readonly IDisposable? _sourceSubscription; private readonly bool _suppressEmptyChangeSets; -#if NET9_0_OR_GREATER private readonly Lock _downstreamGate = new(); private readonly Lock _upstreamGate = new(); -#endif private bool _hasInitialized; private bool _hasPredicateStateCompleted; @@ -117,19 +115,11 @@ public void Dispose() _sourceSubscription?.Dispose(); } -#if NET9_0_OR_GREATER private Lock DownstreamSynchronizationGate => _downstreamGate; private Lock UpstreamSynchronizationGate => _upstreamGate; -#else - private object DownstreamSynchronizationGate - => _downstreamChangesBuffer; - - private object UpstreamSynchronizationGate - => _itemStatesByKey; -#endif private ChangeSet AssembleDownstreamChanges() { diff --git a/src/DynamicData/Cache/Internal/FullJoinMany.cs b/src/DynamicData/Cache/Internal/FullJoinMany.cs index 28ae5a008..23e498b0e 100644 --- a/src/DynamicData/Cache/Internal/FullJoinMany.cs +++ b/src/DynamicData/Cache/Internal/FullJoinMany.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class FullJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) +internal sealed class FullJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +13,7 @@ internal sealed class FullJoinMany> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); diff --git a/src/DynamicData/Cache/Internal/ImmutableGroup.cs b/src/DynamicData/Cache/Internal/ImmutableGroup.cs index 82ffaae3d..26f07e0a8 100644 --- a/src/DynamicData/Cache/Internal/ImmutableGroup.cs +++ b/src/DynamicData/Cache/Internal/ImmutableGroup.cs @@ -46,7 +46,7 @@ public bool Equals(ImmutableGroup? other) public override int GetHashCode() => EqualityComparer.Default.GetHashCode(Key); - public Optional Lookup(TKey key) => _cache.Lookup(key); + public Kernel.Optional Lookup(TKey key) => _cache.Lookup(key); public override string ToString() => $"Grouping for: {Key} ({Count} items)"; } diff --git a/src/DynamicData/Cache/Internal/LeftJoin.cs b/src/DynamicData/Cache/Internal/LeftJoin.cs index 55e39c2aa..6fd38d1aa 100644 --- a/src/DynamicData/Cache/Internal/LeftJoin.cs +++ b/src/DynamicData/Cache/Internal/LeftJoin.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class LeftJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) +internal sealed class LeftJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +13,7 @@ internal sealed class LeftJoin { private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); @@ -89,7 +89,7 @@ public IObservable> Run() => Observable.Creat { var priorLeft = leftCache.Lookup(priorForeignKey); if (priorLeft.HasValue) - joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, Optional.None), priorForeignKey); + joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, Kernel.Optional.None), priorForeignKey); } if (left.HasValue) @@ -102,7 +102,7 @@ public IObservable> Run() => Observable.Creat case ChangeReason.Remove: if (left.HasValue) - joined.AddOrUpdate(_resultSelector(foreignKey, left.Value, Optional.None), foreignKey); + joined.AddOrUpdate(_resultSelector(foreignKey, left.Value, Kernel.Optional.None), foreignKey); rightForeignKeysByKey.Remove(change.Key); @@ -115,7 +115,7 @@ public IObservable> Run() => Observable.Creat { var priorLeft = leftCache.Lookup(priorForeignKey); if (priorLeft.HasValue) - joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, Optional.None), priorForeignKey); + joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, Kernel.Optional.None), priorForeignKey); if (left.HasValue) joined.AddOrUpdate(_resultSelector(foreignKey, left.Value, right), foreignKey); @@ -144,7 +144,7 @@ public IObservable> Run() => Observable.Creat hasInitialized = true; - return new CompositeDisposable(observerSubscription, leftCache, rightCache, rightShareConnection, leftShare.Connect(), queue); + return new MultipleDisposable(observerSubscription, leftCache, rightCache, rightShareConnection, leftShare.Connect(), queue); } }); } diff --git a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs index 1361f6287..b68aa99f9 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs @@ -17,14 +17,14 @@ public sealed class LockFreeObservableCache : IObservableCache> _changes = new(); + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] + private readonly Signal> _changes = new(); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] - private readonly Subject> _changesPreview = new(); + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] + private readonly Signal> _changesPreview = new(); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] - private readonly Subject _countChanged = new(); + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] + private readonly Signal _countChanged = new(); private readonly IDisposable _cleanUp; @@ -38,6 +38,11 @@ public sealed class LockFreeObservableCache : IObservableCacheThe source. public LockFreeObservableCache(IObservable> source) { + if (source is null) + { + throw new ArgumentNullException(nameof(source)); + } + _updater = new CacheUpdater(_innerCache); var loader = source.Select( @@ -88,7 +93,7 @@ public LockFreeObservableCache() public IReadOnlyDictionary KeyValues => new Dictionary(_innerCache.GetDictionary()); /// - public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => Observable.Defer( + public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => Signal.Lazy( () => { var initial = InternalEx.Return(() => _innerCache.GetInitialUpdates(predicate)); @@ -132,7 +137,7 @@ public void Edit(Action> editAction) /// /// Fast indexed lookup. /// - public Optional Lookup(TKey key) => _innerCache.Lookup(key); + public Kernel.Optional Lookup(TKey key) => _innerCache.Lookup(key); /// public IObservable> Preview(Func? predicate = null) => predicate is null ? _changesPreview : _changesPreview.Filter(predicate); diff --git a/src/DynamicData/Cache/Internal/ObservableWithValue.cs b/src/DynamicData/Cache/Internal/ObservableWithValue.cs index 59baa2bd6..aaca8525d 100644 --- a/src/DynamicData/Cache/Internal/ObservableWithValue.cs +++ b/src/DynamicData/Cache/Internal/ObservableWithValue.cs @@ -15,7 +15,7 @@ public ObservableWithValue(TObject item, IObservable source) public TObject Item { get; } - public Optional LatestValue { get; private set; } = Optional.None; + public Kernel.Optional LatestValue { get; private set; } = Kernel.Optional.None; public IObservable Observable { get; } } diff --git a/src/DynamicData/Cache/Internal/ReaderWriter.cs b/src/DynamicData/Cache/Internal/ReaderWriter.cs index bbe56eb14..93128a796 100644 --- a/src/DynamicData/Cache/Internal/ReaderWriter.cs +++ b/src/DynamicData/Cache/Internal/ReaderWriter.cs @@ -8,11 +8,7 @@ internal sealed class ReaderWriter(Func? keySelect where TObject : notnull where TKey : notnull { -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif private CacheUpdater? _activeUpdater; @@ -87,7 +83,7 @@ public ChangeSet GetInitialUpdates(Func? filter = } } - public Optional Lookup(TKey key) + public Kernel.Optional Lookup(TKey key) { lock (_locker) { diff --git a/src/DynamicData/Cache/Internal/RefCount.cs b/src/DynamicData/Cache/Internal/RefCount.cs index 5dc44b5e0..49f246d2d 100644 --- a/src/DynamicData/Cache/Internal/RefCount.cs +++ b/src/DynamicData/Cache/Internal/RefCount.cs @@ -8,11 +8,7 @@ internal sealed class RefCount(IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); diff --git a/src/DynamicData/Cache/Internal/RightJoin.cs b/src/DynamicData/Cache/Internal/RightJoin.cs index 26bc89128..90655b173 100644 --- a/src/DynamicData/Cache/Internal/RightJoin.cs +++ b/src/DynamicData/Cache/Internal/RightJoin.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class RightJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) +internal sealed class RightJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +13,7 @@ internal sealed class RightJoin> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, TRight, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, TRight, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); @@ -110,7 +110,7 @@ public IObservable> Run() => Observable.Crea case ChangeReason.Remove: if (right.HasValue) { - joinedCache.AddOrUpdate(_resultSelector(right.Value.key, Optional.None, right.Value.item), right.Value.key); + joinedCache.AddOrUpdate(_resultSelector(right.Value.key, Kernel.Optional.None, right.Value.item), right.Value.key); } break; @@ -137,7 +137,7 @@ public IObservable> Run() => Observable.Crea hasInitialized = true; - return new CompositeDisposable(observerSubscription, leftCache, rightCache, rightShare.Connect(), queue); + return new MultipleDisposable(observerSubscription, leftCache, rightCache, rightShare.Connect(), queue); } }); } diff --git a/src/DynamicData/Cache/Internal/RightJoinMany.cs b/src/DynamicData/Cache/Internal/RightJoinMany.cs index 825d71a90..6b947f3ee 100644 --- a/src/DynamicData/Cache/Internal/RightJoinMany.cs +++ b/src/DynamicData/Cache/Internal/RightJoinMany.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class RightJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) +internal sealed class RightJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +13,7 @@ internal sealed class RightJoinMany> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); diff --git a/src/DynamicData/Cache/Internal/SizeLimiter.cs b/src/DynamicData/Cache/Internal/SizeLimiter.cs index bfd0fa72f..8fb673df7 100644 --- a/src/DynamicData/Cache/Internal/SizeLimiter.cs +++ b/src/DynamicData/Cache/Internal/SizeLimiter.cs @@ -22,7 +22,7 @@ public IChangeSet Change(IChangeSet, } var notifications = _cache.CaptureChanges(); - var changed = notifications.Select(update => new Change(update.Reason, update.Key, update.Current.Value, update.Previous.HasValue ? update.Previous.Value.Value : Optional.None)); + var changed = notifications.Select(update => new Change(update.Reason, update.Key, update.Current.Value, update.Previous.HasValue ? update.Previous.Value.Value : Kernel.Optional.None)); return new ChangeSet(changed); } diff --git a/src/DynamicData/Cache/Internal/SortExtensions.cs b/src/DynamicData/Cache/Internal/SortExtensions.cs index c6275a358..7f011a7f9 100644 --- a/src/DynamicData/Cache/Internal/SortExtensions.cs +++ b/src/DynamicData/Cache/Internal/SortExtensions.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; - namespace DynamicData.Cache.Internal; internal static class SortExtensions diff --git a/src/DynamicData/Cache/Internal/StatusMonitor.cs b/src/DynamicData/Cache/Internal/StatusMonitor.cs index a617834aa..339b2bedb 100644 --- a/src/DynamicData/Cache/Internal/StatusMonitor.cs +++ b/src/DynamicData/Cache/Internal/StatusMonitor.cs @@ -9,7 +9,7 @@ internal sealed class StatusMonitor(IObservable source) public IObservable Run() => Observable.Create( observer => { - var statusSubject = new Subject(); + var statusSubject = new Signal(); var status = ConnectionStatus.Pending; void Error(Exception ex) diff --git a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs index 5f2ad040d..de4cf5665 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -59,11 +59,7 @@ private sealed class Subscription private readonly int _limitSizeTo; private readonly IScheduler _scheduler; private readonly IDisposable _sourceSubscription; - #if NET9_0_OR_GREATER private readonly Lock _synchronizationGate; - #else - private readonly object _synchronizationGate; - #endif private bool _hasInitialized; private bool _hasSourceCompleted; @@ -308,7 +304,7 @@ private void TryPublishDownstreamChanges() private readonly struct ScheduledExpiration { - public required SingleAssignmentDisposable Cancellation { get; init; } + public required OnceDisposable Cancellation { get; init; } public required Expiration Expiration { get; init; } } diff --git a/src/DynamicData/Cache/Internal/ToObservableOptional.cs b/src/DynamicData/Cache/Internal/ToObservableOptional.cs index 6557f78a9..8af6c6030 100644 --- a/src/DynamicData/Cache/Internal/ToObservableOptional.cs +++ b/src/DynamicData/Cache/Internal/ToObservableOptional.cs @@ -12,7 +12,7 @@ internal sealed class ToObservableOptional(IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); private readonly TKey _key = key; - public IObservable> Run() => Observable.Create>(observer => + public IObservable> Run() => Observable.Create>(observer => { var lastValue = Optional.None(); @@ -22,7 +22,7 @@ public IObservable> Run() => Observable.Create EmitChanges(IChangeSet changes, IObserver> observer, Optional lastValue) + private Kernel.Optional EmitChanges(IChangeSet changes, IObserver> observer, Kernel.Optional lastValue) { foreach (var change in changes.ToConcreteType()) { diff --git a/src/DynamicData/Cache/Internal/Transform.cs b/src/DynamicData/Cache/Internal/Transform.cs index e0da30457..056d53386 100644 --- a/src/DynamicData/Cache/Internal/Transform.cs +++ b/src/DynamicData/Cache/Internal/Transform.cs @@ -4,12 +4,12 @@ namespace DynamicData.Cache.Internal; -internal sealed class Transform(IObservable> source, Func, TKey, TDestination> transformFactory, Action>? exceptionCallback = null, bool transformOnRefresh = false) +internal sealed class Transform(IObservable> source, Func, TKey, TDestination> transformFactory, Action>? exceptionCallback = null, bool transformOnRefresh = false) where TDestination : notnull where TSource : notnull where TKey : notnull { - public IObservable> Run() => Observable.Defer(RunImpl); + public IObservable> Run() => Signal.Lazy(RunImpl); private IObservable> RunImpl() => source.Scan( (ChangeAwareCache?)null, diff --git a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs index 69c4c9169..16506d9fd 100644 --- a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs @@ -13,7 +13,7 @@ internal sealed class TransformWithInlineUpdate(IOb where TSource : notnull where TKey : notnull { - public IObservable> Run() => Observable.Defer(RunImpl); + public IObservable> Run() => Signal.Lazy(RunImpl); private IObservable> RunImpl() => source.Scan( (ChangeAwareCache?)null, diff --git a/src/DynamicData/Cache/ObservableCache.cs b/src/DynamicData/Cache/ObservableCache.cs index 80447ca15..23f40c5f8 100644 --- a/src/DynamicData/Cache/ObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCache.cs @@ -14,27 +14,23 @@ internal sealed class ObservableCache : IObservableCache> _changes = new(); + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] + private readonly Signal> _changes = new(); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] - private readonly Subject> _changesPreview = new(); + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] + private readonly Signal> _changesPreview = new(); private readonly IDisposable _cleanUp; - private readonly Lazy> _countChanged = new(() => new Subject()); + private readonly Lazy> _countChanged = new(() => new Signal()); private readonly Lazy _suspensionTracker; -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif private readonly ReaderWriter _readerWriter; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Terminated via NotifyCompleted in _cleanUp")] + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Terminated via NotifyCompleted in _cleanUp")] private readonly DeliveryQueue _notifications; private int _editLevel; // The level of recursion in editing. @@ -125,7 +121,7 @@ public IObservable> Connect(Func? predi public void Dispose() => _cleanUp.Dispose(); - public Optional Lookup(TKey key) => _readerWriter.Lookup(key); + public Kernel.Optional Lookup(TKey key) => _readerWriter.Lookup(key); public IObservable> Preview(Func? predicate = null) => predicate is null ? _changesPreview : _changesPreview.Filter(predicate); @@ -152,7 +148,7 @@ public IDisposable SuspendCount() lock (_locker) { _suspensionTracker.Value.SuspendCount(); - return Disposable.Create(this, static cache => cache.ResumeCount()); + return Scope.Create(this, static cache => cache.ResumeCount()); } } @@ -161,7 +157,7 @@ public IDisposable SuspendNotifications() lock (_locker) { _suspensionTracker.Value.SuspendNotifications(); - return Disposable.Create(this, static cache => cache.ResumeNotifications()); + return Scope.Create(this, static cache => cache.ResumeNotifications()); } } @@ -333,20 +329,18 @@ private void ResumeCount() private void ResumeNotifications() { - using (var notifications = _notifications.AcquireLock()) - { - Debug.Assert(_suspensionTracker.IsValueCreated, "Should not be Resuming Notifications without Suspend Notifications instance"); + using var notifications = _notifications.AcquireLock(); + Debug.Assert(_suspensionTracker.IsValueCreated, "Should not be Resuming Notifications without Suspend Notifications instance"); - var (changes, emitResume) = _suspensionTracker.Value.ResumeNotifications(); - if (changes is not null) - { - notifications.EnqueueNext(new CacheUpdate(changes, _readerWriter.Count, ++_currentVersion)); - } + var (changes, emitResume) = _suspensionTracker.Value.ResumeNotifications(); + if (changes is not null) + { + notifications.EnqueueNext(new CacheUpdate(changes, _readerWriter.Count, ++_currentVersion)); + } - if (emitResume) - { - _suspensionTracker.Value.EmitResumeNotification(); - } + if (emitResume) + { + _suspensionTracker.Value.EmitResumeNotification(); } } @@ -443,7 +437,7 @@ private void EmitCount(int count) private sealed class SuspensionTracker : IDisposable { - private readonly BehaviorSubject _areNotificationsSuspended = new(false); + private readonly BehaviorSignal _areNotificationsSuspended = new(false); private List> _pendingChanges = []; diff --git a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs index 5be9b0125..13308decf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; using DynamicData.Binding; // ReSharper disable once CheckNamespace @@ -23,7 +22,7 @@ public static partial class ObservableCacheEx /// The that will receive the changes. /// The number of changes before a reset notification is triggered. /// An observable which will emit change sets. - /// source. + /// source. /// public static IObservable> Bind(this IObservable> source, IObservableCollection destination, int refreshThreshold = BindingOptions.DefaultResetThreshold) where TObject : notnull @@ -51,7 +50,7 @@ public static IObservable> Bind(this IO /// The that will receive the changes. /// The that controls binding behavior. /// An observable which will emit change sets. - /// source. + /// source. public static IObservable> Bind(this IObservable> source, IObservableCollection destination, BindingOptions options) where TObject : notnull where TKey : notnull @@ -98,7 +97,7 @@ public static IObservable> Bind(this IO /// The output that will be populated with the results. /// The that controls binding behavior. /// An observable which will emit change sets. - /// source. + /// source. public static IObservable> Bind(this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, BindingOptions options) where TObject : notnull where TKey : notnull @@ -121,7 +120,7 @@ public static IObservable> Bind(this IO /// When , uses Replace instead of Remove/Add for updates in the bound collection. Not all platforms support replace notifications. /// An optional that controls how the target collection is updated. /// An observable which will emit change sets. - /// source. + /// source. public static IObservable> Bind(this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = BindingOptions.DefaultResetThreshold, bool useReplaceForUpdates = BindingOptions.DefaultUseReplaceForUpdates, IObservableCollectionAdaptor? adaptor = null) where TObject : notnull where TKey : notnull @@ -174,7 +173,7 @@ public static IObservable> Bind(t /// The that will receive the changes. /// The that controls binding behavior. /// An observable which will emit change sets. - /// source. + /// source. public static IObservable> Bind(this IObservable> source, IObservableCollection destination, BindingOptions options) where TObject : notnull where TKey : notnull @@ -223,7 +222,7 @@ public static IObservable> Bind(t /// The output that will be populated with the results. /// The that controls binding behavior. /// An observable which will emit change sets. - /// source. + /// source. public static IObservable> Bind(this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, BindingOptions options) where TObject : notnull where TKey : notnull @@ -248,7 +247,7 @@ public static IObservable> Bind(this IO /// When , uses Replace instead of Remove/Add for updates in the bound collection. Not all platforms support replace notifications. /// An that specify an adaptor to change the algorithm to update the target collection. /// An observable which will emit change sets. - /// source. + /// source. public static IObservable> Bind(this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = BindingOptions.DefaultResetThreshold, bool useReplaceForUpdates = BindingOptions.DefaultUseReplaceForUpdates, ISortedObservableCollectionAdaptor? adaptor = null) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs index abf5a0cff..861f2f510 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs @@ -115,7 +115,7 @@ public static IObservable> EditDiff(thi /// /// /// or is . - public static IObservable> EditDiff(this IObservable> source, Func keySelector, IEqualityComparer? equalityComparer = null) + public static IObservable> EditDiff(this IObservable> source, Func keySelector, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs index 9a8a83cde..20e357601 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs @@ -19,7 +19,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left and right values into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) + public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, Kernel.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -77,7 +77,7 @@ public static IObservable> FullJoin /// /// - public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) + public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, Kernel.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs index f5da307fb..760fd80d5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs @@ -19,7 +19,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left value and the right group into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -78,7 +78,7 @@ public static IObservable> FullJoinMany /// /// - public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs index 1576a31b2..c017227a9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs @@ -22,7 +22,14 @@ public static partial class ObservableCacheEx /// An observable which emits change sets and ignores updates equal to the lambda. public static IObservable> IgnoreUpdateWhen(this IObservable> source, Func ignoreFunction) where TObject : notnull - where TKey : notnull => source.Select( + where TKey : notnull + { + if (source is null) + { + throw new ArgumentNullException(nameof(source)); + } + + return source.Select( updates => { var result = updates.Where( @@ -37,4 +44,5 @@ public static IObservable> IgnoreUpdateWhen(result); }).NotEmpty(); + } } diff --git a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs index 37848290e..d9f79c0ac 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs @@ -32,5 +32,9 @@ public static partial class ObservableCacheEx /// public static IObservable> InvokeEvaluate(this IObservable> source) where TObject : IEvaluateAware - where TKey : notnull => source.Do(changes => changes.Where(u => u.Reason == ChangeReason.Refresh).ForEach(u => u.Current.Evaluate())); + where TKey : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.Do(changes => changes.Where(u => u.Reason == ChangeReason.Refresh).ForEach(u => u.Current.Evaluate())); + } } diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs index 60cb091ae..d23204d43 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs @@ -19,7 +19,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the left value and the optional right into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) + public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -77,7 +77,7 @@ public static IObservable> LeftJoin /// /// - public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) + public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs index 2e7c00975..73b5dc814 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs @@ -19,7 +19,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left and right values into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) + public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -77,7 +77,7 @@ public static IObservable> RightJoin /// /// - public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) + public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs index b01283931..e2ce6441b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs @@ -19,7 +19,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left value and the right group into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -78,7 +78,7 @@ public static IObservable> RightJoinMany /// /// - public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs index 1f70a4b54..f1d35345a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; using DynamicData.Binding; namespace DynamicData; diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs index a4ef74553..592d9bdaf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs @@ -40,7 +40,7 @@ public static partial class ObservableCacheEx /// is . /// /// - public static IObservable> ToObservableOptional(this IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) + public static IObservable> ToObservableOptional(this IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { @@ -63,19 +63,19 @@ public static IObservable> ToObservableOptional /// /// Worth noting: Uses lock-based coordination. If the key exists synchronously on Connect(), the initial None may or may not be emitted depending on timing. /// - public static IObservable> ToObservableOptional(this IObservable> source, TKey key, bool initialOptionalWhenMissing, IEqualityComparer? equalityComparer = null) + public static IObservable> ToObservableOptional(this IObservable> source, TKey key, bool initialOptionalWhenMissing, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { if (initialOptionalWhenMissing) { - return Observable.Defer(() => + return Signal.Lazy(() => { var seenValue = false; return source.ToObservableOptional(key, equalityComparer) .Do(_ => seenValue = true) - .Merge(Observable.Defer(() => seenValue - ? Observable.Empty>() + .Merge(Signal.Lazy(() => seenValue + ? Observable.Empty>() : Observable.Return(Optional.None()))); }); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs index 1770d0d5d..3f3ca9971 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs @@ -42,7 +42,7 @@ public static IObservable> Transform /// This overload accepts a bool transformOnRefresh flag. When , Refresh changes cause re-transformation (emitted as Update). - public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, bool transformOnRefresh) + public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, bool transformOnRefresh) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -117,7 +117,7 @@ public static IObservable> Transform /// /// or is . - public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable>? forceTransform = null) + public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -155,7 +155,7 @@ public static IObservable> Transform /// This overload accepts of to force re-transformation of ALL items when the observable emits. - public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable forceTransform) + public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs index 60a9be37d..c15762075 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs @@ -13,7 +13,7 @@ namespace DynamicData; /// public static partial class ObservableCacheEx { - /// + /// /// This overload takes a simpler factory that receives only the current item. /// [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] @@ -28,7 +28,7 @@ public static IObservable> TransformAsync transformFactory(current), forceTransform); } - /// + /// /// This overload takes a factory that receives the current item and key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func> transformFactory, IObservable>? forceTransform = null) @@ -43,14 +43,14 @@ public static IObservable> TransformAsync - /// Async version of . + /// Async version of . /// Projects each item using an async factory that returns . /// /// The type of the transformed items. /// The type of the source items. /// The type of the key. /// The source to transform asynchronously. - /// The async function that produces a from the current source item, the previous source item (if any), and the key. + /// The async function that produces a from the current source item, the previous source item (if any), and the key. /// An observable that, when it emits a predicate, re-transforms all items for which the predicate returns . Re-transformed items are emitted as changes. If , no forced re-transforms occur. /// An observable changeset of transformed items. /// @@ -70,13 +70,13 @@ public static IObservable> TransformAsyncWorth noting: Transforms are batched per changeset (all tasks must complete before the next changeset is processed). Completion waits for in-flight transforms. Remove does NOT cancel in-flight transforms for the removed key. /// /// Factory exceptions propagate as . Use - /// + /// /// to catch factory errors without terminating the stream. /// /// /// or is . [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, IObservable>? forceTransform = null) + public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -87,7 +87,7 @@ public static IObservable> TransformAsync(source, transformFactory, null, forceTransform).Run(); } - /// + /// /// This overload accepts to control concurrency and Refresh handling. The factory receives only the current item. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func> transformFactory, TransformAsyncOptions options) @@ -101,7 +101,7 @@ public static IObservable> TransformAsync transformFactory(current), options); } - /// + /// /// This overload accepts to control concurrency and Refresh handling. The factory receives the current item and key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func> transformFactory, TransformAsyncOptions options) @@ -115,10 +115,10 @@ public static IObservable> TransformAsync transformFactory(current, key), options); } - /// + /// /// This overload accepts to control concurrency and Refresh handling. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, TransformAsyncOptions options) + public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, TransformAsyncOptions options) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs index 85a0a8e3e..3ecc9c3db 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; using DynamicData.Cache.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs index 79fa372d2..3311061ee 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs @@ -27,7 +27,7 @@ public static IObservable> TransformSafe transformFactory(current), errorHandler, forceTransform.ForForced()); } - /// + /// /// This overload accepts a factory that receives the current item and key. public static IObservable> TransformSafe(this IObservable> source, Func transformFactory, Action> errorHandler, IObservable>? forceTransform = null) where TDestination : notnull @@ -49,20 +49,20 @@ public static IObservable> TransformSafeThe type of the source items. /// The type of the key. /// The source to transform with error handling. - /// The that produces a from the current source item, the previous source item (if any), and the key. + /// The that produces a from the current source item, the previous source item (if any), and the key. /// A callback invoked when throws. Receives an containing the exception and the faulting item. The item is skipped and the stream continues. /// An optional that, when it emits a predicate, re-transforms all items for which the predicate returns . If , no forced re-transforms occur. /// An observable changeset of transformed items. /// /// - /// Behaves identically to + /// Behaves identically to /// except that factory exceptions are routed to instead of propagating as . /// Source-level errors (i.e. the source observable itself erroring) still propagate normally. /// /// Worth noting: Factory exceptions are caught per-item; the faulting item is skipped and reported to the error handler while the stream continues. Source-level errors still terminate the stream. /// /// , , or is . - public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) + public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -78,14 +78,14 @@ public static IObservable> TransformSafe(source, transformFactory, errorHandler).Run(); } - /// + /// /// This overload accepts of to force re-transformation of ALL items. The factory receives only the current item. public static IObservable> TransformSafe(this IObservable> source, Func transformFactory, Action> errorHandler, IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull => source.TransformSafe((cur, _, _) => transformFactory(cur), errorHandler, forceTransform.ForForced()); - /// + /// /// This overload accepts of to force re-transformation of ALL items. The factory receives the current item and key. public static IObservable> TransformSafe(this IObservable> source, Func transformFactory, Action> errorHandler, IObservable forceTransform) where TDestination : notnull @@ -99,9 +99,9 @@ public static IObservable> TransformSafe transformFactory(cur, key), errorHandler, forceTransform.ForForced()); } - /// + /// /// This overload accepts of to force re-transformation of ALL items. - public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable forceTransform) + public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs index 386cf7a1a..3a9815e4d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs @@ -58,7 +58,7 @@ public static IObservable> TransformSafeAsyncCombines the async execution model of with the error-safe behavior of . /// , , or is . [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) + public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -103,7 +103,7 @@ public static IObservable> TransformSafeAsync /// This overload accepts to control concurrency and Refresh handling. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, TransformAsyncOptions options) + public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, TransformAsyncOptions options) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs index eeb89d22b..c99b03002 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs @@ -23,5 +23,13 @@ public static partial class ObservableCacheEx /// An observable that emits the sorted changesets after updating item indices. public static IObservable> UpdateIndex(this IObservable> source) where TObject : IIndexAware - where TKey : notnull => source.Do(changes => changes.SortedItems.Select((update, index) => new { update, index }).ForEach(u => u.update.Value.Index = u.index)); + where TKey : notnull + { + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + return source.Do(changes => changes.SortedItems.Select((update, index) => new { update, index }).ForEach(u => u.update.Value.Index = u.index)); + } } diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs index 41ec68c0e..3543c1482 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs @@ -29,6 +29,7 @@ public static IObservable> WhereReasonsAreNot /// Options for the sort and virtualize operator. /// -public record struct SortAndPageOptions() +public readonly record struct SortAndPageOptions() { /// /// The sort reset threshold ie the number of changes before a reset is fired. diff --git a/src/DynamicData/Cache/SortAndVirtualizeOptions.cs b/src/DynamicData/Cache/SortAndVirtualizeOptions.cs index fa6843347..c0b655da2 100644 --- a/src/DynamicData/Cache/SortAndVirtualizeOptions.cs +++ b/src/DynamicData/Cache/SortAndVirtualizeOptions.cs @@ -9,7 +9,7 @@ namespace DynamicData; /// /// Options for the sort and virtualize operator. /// -public record struct SortAndVirtualizeOptions() +public readonly record struct SortAndVirtualizeOptions() { /// /// The sort reset threshold ie the number of changes before a reset is fired. diff --git a/src/DynamicData/Cache/SourceCache.cs b/src/DynamicData/Cache/SourceCache.cs index 5d281579c..cf41d6cba 100644 --- a/src/DynamicData/Cache/SourceCache.cs +++ b/src/DynamicData/Cache/SourceCache.cs @@ -54,7 +54,7 @@ public sealed class SourceCache(Func keySelector) public void Edit(Action> updateAction) => _innerCache.UpdateFromSource(updateAction); /// - public Optional Lookup(TKey key) => _innerCache.Lookup(key); + public Kernel.Optional Lookup(TKey key) => _innerCache.Lookup(key); /// public IObservable> Preview(Func? predicate = null) => _innerCache.Preview(predicate); diff --git a/src/DynamicData/Diagnostics/ChangeStatistics.cs b/src/DynamicData/Diagnostics/ChangeStatistics.cs index b9ddf9f49..96d0830db 100644 --- a/src/DynamicData/Diagnostics/ChangeStatistics.cs +++ b/src/DynamicData/Diagnostics/ChangeStatistics.cs @@ -7,57 +7,20 @@ namespace DynamicData.Diagnostics; /// /// Object used to capture accumulated changes. /// -public class ChangeStatistics : IEquatable +/// Gets the index. +/// Gets the adds. +/// Gets the updates. +/// Gets the removes. +/// Gets the refreshes. +/// Gets the moves. +/// Gets the count. +public record ChangeStatistics(int Index, int Adds, int Updates, int Removes, int Refreshes, int Moves, int Count) { /// /// Initializes a new instance of the class. /// - public ChangeStatistics() => Index = -1; - - /// - /// Initializes a new instance of the class. - /// - /// The index of the change. - /// The number of additions. - /// The number of updates. - /// The number of removals. - /// The number of refreshes. - /// The number of moves. - /// The new count. - public ChangeStatistics(int index, int adds, int updates, int removes, int refreshes, int moves, int count) - { - Index = index; - Adds = adds; - Updates = updates; - Removes = removes; - Refreshes = refreshes; - Moves = moves; - Count = count; - } - - /// - /// Gets the adds. - /// - /// - /// The adds. - /// - public int Adds { get; } - - /// - /// Gets the count. - /// - /// - /// The count. - /// - public int Count { get; } - - /// - /// Gets the index. - /// - /// - /// The index. - /// - public int Index { get; } + public ChangeStatistics() + : this(-1, default, default, default, default, default, default) => Index = -1; /// /// Gets the last updated. @@ -67,73 +30,6 @@ public ChangeStatistics(int index, int adds, int updates, int removes, int refre /// public DateTime LastUpdated { get; } = DateTime.Now; - /// - /// Gets the moves. - /// - /// - /// The moves. - /// - public int Moves { get; } - - /// - /// Gets the refreshes. - /// - /// - /// The refreshes. - /// - public int Refreshes { get; } - - /// - /// Gets the removes. - /// - /// - /// The removes. - /// - public int Removes { get; } - - /// - /// Gets the updates. - /// - /// - /// The updates. - /// - public int Updates { get; } - - /// - /// Checks to see if both sides are equal. - /// - /// The left side to compare. - /// The right side to compare. - /// If the two sides are equal. - public static bool operator ==(ChangeStatistics left, ChangeStatistics right) => Equals(left, right); - - /// - /// Checks to see if both sides are not equal. - /// - /// The left side to compare. - /// The right side to compare. - /// If the two sides are not equal. - public static bool operator !=(ChangeStatistics left, ChangeStatistics right) => !Equals(left, right); - - /// - public bool Equals(ChangeStatistics? other) - { - if (other is null) - { - return false; - } - - if (ReferenceEquals(this, other)) - { - return true; - } - - return Adds == other.Adds && Updates == other.Updates && Removes == other.Removes && Refreshes == other.Refreshes && Moves == other.Moves && Count == other.Count && Index == other.Index && LastUpdated.Equals(other.LastUpdated); - } - - /// - public override bool Equals(object? obj) => obj is ChangeStatistics change && Equals(change); - /// public override int GetHashCode() { diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index 5cb986922..a06b7d01b 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -26,6 +26,7 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int + diff --git a/src/DynamicData/Experimental/ISubjectWithRefCount.cs b/src/DynamicData/Experimental/ISubjectWithRefCount.cs index f90c451d3..3f92c5930 100644 --- a/src/DynamicData/Experimental/ISubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/ISubjectWithRefCount.cs @@ -8,7 +8,7 @@ namespace DynamicData.Experimental; /// A subject which also contains its current reference count. /// /// The type of item. -internal interface ISubjectWithRefCount : ISubject +internal interface ISubjectWithRefCount : ISignal { /// Gets number of subscribers. /// diff --git a/src/DynamicData/Experimental/SubjectWithRefCount.cs b/src/DynamicData/Experimental/SubjectWithRefCount.cs index e5a5a94e0..a4de5d41c 100644 --- a/src/DynamicData/Experimental/SubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/SubjectWithRefCount.cs @@ -12,9 +12,9 @@ namespace DynamicData.Experimental; /// Initializes a new instance of the class. /// /// The subject to perform reference counting on. -internal sealed class SubjectWithRefCount(ISubject? subject = null) : ISubjectWithRefCount +internal sealed class SubjectWithRefCount(ISignal? subject = null) : ISubjectWithRefCount { - private readonly ISubject _subject = subject ?? new Subject(); + private readonly ISignal _subject = subject ?? new Signal(); private bool _isDisposed; diff --git a/src/DynamicData/Experimental/Watcher.cs b/src/DynamicData/Experimental/Watcher.cs index 938293a92..25ea7e7c5 100644 --- a/src/DynamicData/Experimental/Watcher.cs +++ b/src/DynamicData/Experimental/Watcher.cs @@ -2,6 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using ReactiveUI.Primitives; + namespace DynamicData.Experimental; internal sealed class Watcher : IWatcher @@ -10,16 +12,12 @@ internal sealed class Watcher : IWatcher { private readonly IDisposable _disposer; -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly IObservableCache _source; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly IntermediateCache>, TKey> _subscribers = new(); public Watcher(IObservable> source, IScheduler scheduler) @@ -72,7 +70,7 @@ public IObservable> Watch(TKey key) => Observable.Create>(new ReplaySubject>(1)); + subject = new SubjectWithRefCount>(new ReplaySignal>(1)); var initial = _source.Lookup(key); if (initial.HasValue) diff --git a/src/DynamicData/Internal/CacheParentSubscription.cs b/src/DynamicData/Internal/CacheParentSubscription.cs index 4a3371ee3..76b4451ce 100644 --- a/src/DynamicData/Internal/CacheParentSubscription.cs +++ b/src/DynamicData/Internal/CacheParentSubscription.cs @@ -23,7 +23,7 @@ internal abstract class CacheParentSubscription _childSubscriptions = new(); - private readonly SingleAssignmentDisposable _parentSubscription = new(); + private readonly OnceDisposable _parentSubscription = new(); private readonly SharedDeliveryQueue _queue; private readonly IObserver _observer; private int _subscriptionCounter = 1; // Starts at 1 for the parent subscription @@ -60,7 +60,7 @@ protected void AddChildSubscription(IObservable observable, TKey parentK Interlocked.Increment(ref _subscriptionCounter); // Create a container for the Disposable and add to the KeyedDisposable - var disposableContainer = _childSubscriptions.Add(parentKey, new SingleAssignmentDisposable()); + var disposableContainer = _childSubscriptions.Add(parentKey, new OnceDisposable()); // Create the subscription // Will Dispose immediately if OnCompleted fires upon subscription because OnCompleted disposes the container diff --git a/src/DynamicData/Internal/DeliveryQueue.cs b/src/DynamicData/Internal/DeliveryQueue.cs index 74a688f25..10c05d440 100644 --- a/src/DynamicData/Internal/DeliveryQueue.cs +++ b/src/DynamicData/Internal/DeliveryQueue.cs @@ -11,14 +11,11 @@ namespace DynamicData.Internal; /// /// The value type delivered via OnNext. internal sealed class DeliveryQueue : IObserver, IDisposable + where T : notnull { private readonly Queue> _queue = new(1); -#if NET9_0_OR_GREATER private readonly Lock _gate; -#else - private readonly object _gate; -#endif private readonly IObserver _observer; private int _drainThreadId = -1; diff --git a/src/DynamicData/Internal/KeyedDisposable.cs b/src/DynamicData/Internal/KeyedDisposable.cs index 4e2ab2951..13a411b31 100644 --- a/src/DynamicData/Internal/KeyedDisposable.cs +++ b/src/DynamicData/Internal/KeyedDisposable.cs @@ -16,11 +16,7 @@ internal sealed class KeyedDisposable : IDisposable { private readonly Dictionary _disposables = []; -#if NET9_0_OR_GREATER private readonly Lock _gate = new(); -#else - private readonly object _gate = new(); -#endif private bool _disposedValue; diff --git a/src/DynamicData/Internal/Notification.cs b/src/DynamicData/Internal/Notification.cs index e8a5ef413..77c512380 100644 --- a/src/DynamicData/Internal/Notification.cs +++ b/src/DynamicData/Internal/Notification.cs @@ -11,11 +11,12 @@ namespace DynamicData.Internal; /// is broken for value types in generic struct fields on .NET 9. /// internal readonly struct Notification + where T : notnull { - private readonly Optional _value; + private readonly Kernel.Optional _value; private readonly Exception? _error; - private Notification(Optional value, Exception? error) + private Notification(Kernel.Optional value, Exception? error) { _value = value; _error = error; diff --git a/src/DynamicData/Internal/SharedDeliveryQueue.cs b/src/DynamicData/Internal/SharedDeliveryQueue.cs index 83cc1097d..7a5c10890 100644 --- a/src/DynamicData/Internal/SharedDeliveryQueue.cs +++ b/src/DynamicData/Internal/SharedDeliveryQueue.cs @@ -16,11 +16,7 @@ internal sealed class SharedDeliveryQueue : IDisposable private readonly List _sources = []; private readonly Action? _onDrainComplete; -#if NET9_0_OR_GREATER private readonly Lock _gate; -#else - private readonly object _gate; -#endif private Bitset _activeBits = new(); private int _deadCount; @@ -98,6 +94,7 @@ private void EnsureDeliveryComplete() /// Creates a typed sub-queue bound to the specified observer. public DeliverySubQueue CreateQueue(IObserver observer) + where T : notnull { EnterLock(); try @@ -406,6 +403,7 @@ internal abstract class DrainableBase /// which acquires the parent's lock. /// internal sealed class DeliverySubQueue : DrainableBase, IObserver, IDisposable + where T : notnull { private readonly Queue> _items = new(1); private readonly SharedDeliveryQueue _parent; diff --git a/src/DynamicData/Kernel/Error.cs b/src/DynamicData/Kernel/Error.cs index 05d61f4a4..685e7a88f 100644 --- a/src/DynamicData/Kernel/Error.cs +++ b/src/DynamicData/Kernel/Error.cs @@ -15,7 +15,7 @@ namespace DynamicData.Kernel; /// The exception that caused the error. /// The value for the error. /// The key for the error. -[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "By Design.")] +[SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "By Design.")] public sealed class Error(Exception? exception, TObject value, TKey key) : IKeyValue, IEquatable> where TKey : notnull { diff --git a/src/DynamicData/Kernel/InternalEx.cs b/src/DynamicData/Kernel/InternalEx.cs index 8dfc36410..32f58e7be 100644 --- a/src/DynamicData/Kernel/InternalEx.cs +++ b/src/DynamicData/Kernel/InternalEx.cs @@ -9,11 +9,7 @@ namespace DynamicData.Kernel; /// public static class InternalEx { -#if NET9_0_OR_GREATER internal static Lock NewLock() => new(); -#else - internal static object NewLock() => new(); -#endif /// /// Retries the with back off. @@ -40,7 +36,7 @@ IObservable Retry(int failureCount) => return Observable.Throw(error); } - return Observable.Timer(delay.Value).SelectMany(Retry(failureCount + 1)); + return Signal.After(delay.Value).SelectMany(Retry(failureCount + 1)); }); return Retry(0); @@ -111,7 +107,7 @@ void ScheduleNext() => return disposable; } - internal static void OnNext(this ISubject source) => source.OnNext(Unit.Default); + internal static void OnNext(this ISignal source) => source.OnNext(Unit.Default); internal static void Swap(ref TSwap t1, ref TSwap t2) => (t2, t1) = (t1, t2); diff --git a/src/DynamicData/Kernel/ItemWithIndex.cs b/src/DynamicData/Kernel/ItemWithIndex.cs index 2fe6f7588..720ac7946 100644 --- a/src/DynamicData/Kernel/ItemWithIndex.cs +++ b/src/DynamicData/Kernel/ItemWithIndex.cs @@ -12,46 +12,10 @@ namespace DynamicData.Kernel; /// Initializes a new instance of the struct. /// Initializes a new instance of the class. /// -/// The item. -/// The index. -public readonly struct ItemWithIndex(T item, int index) : IEquatable> +/// The item. +/// The index. +public readonly record struct ItemWithIndex(T Item, int Index) { - /// - /// Gets the item. - /// - public T Item { get; } = item; - - /// - /// Gets the index. - /// - public int Index { get; } = index; - - /// Returns a value that indicates whether the values of two objects are equal. - /// The first value to compare. - /// The second value to compare. - /// true if the and parameters have the same value; otherwise, false. - public static bool operator ==(in ItemWithIndex left, in ItemWithIndex right) => left.Equals(right); - - /// Returns a value that indicates whether two objects have different values. - /// The first value to compare. - /// The second value to compare. - /// true if and are not equal; otherwise, false. - public static bool operator !=(in ItemWithIndex left, in ItemWithIndex right) => !left.Equals(right); - - /// - public bool Equals(ItemWithIndex other) => EqualityComparer.Default.Equals(Item, other.Item); - - /// - public override bool Equals(object? obj) - { - if (obj is null) - { - return false; - } - - return obj is ItemWithIndex itemWithIndex && Equals(itemWithIndex); - } - /// Returns the hash code for this instance. /// A 32-bit signed integer that is the hash code for this instance. public override int GetHashCode() => Item is null ? 0 : EqualityComparer.Default.GetHashCode(Item); diff --git a/src/DynamicData/Kernel/ItemWithValue.cs b/src/DynamicData/Kernel/ItemWithValue.cs index 16d22182b..2519f3836 100644 --- a/src/DynamicData/Kernel/ItemWithValue.cs +++ b/src/DynamicData/Kernel/ItemWithValue.cs @@ -13,54 +13,10 @@ namespace DynamicData.Kernel; /// Initializes a new instance of the struct. /// Initializes a new instance of the class. /// -/// The item. -/// The Value. -public readonly struct ItemWithValue(TObject item, TValue value) : IEquatable> +/// The item. +/// The Value. +public readonly record struct ItemWithValue(TObject Item, TValue Value) { - /// - /// Gets the item. - /// - public TObject Item { get; } = item; - - /// - /// Gets the Value. - /// - public TValue Value { get; } = value; - - /// - /// Implements the operator ==. - /// - /// The left. - /// The right. - /// - /// The result of the operator. - /// - public static bool operator ==(in ItemWithValue left, in ItemWithValue right) => Equals(left, right); - - /// - /// Implements the operator !=. - /// - /// The left. - /// The right. - /// - /// The result of the operator. - /// - public static bool operator !=(in ItemWithValue left, in ItemWithValue right) => !Equals(left, right); - - /// - public bool Equals(ItemWithValue other) => EqualityComparer.Default.Equals(Item, other.Item) && EqualityComparer.Default.Equals(Value, other.Value); - - /// - public override bool Equals(object? obj) - { - if (obj is null) - { - return false; - } - - return obj is ItemWithValue itemWithValue && Equals(itemWithValue); - } - /// public override int GetHashCode() { diff --git a/src/DynamicData/List/Change.cs b/src/DynamicData/List/Change.cs index 07e830ae6..94cc421aa 100644 --- a/src/DynamicData/List/Change.cs +++ b/src/DynamicData/List/Change.cs @@ -90,7 +90,7 @@ public Change(T current, int currentIndex, int previousIndex) /// or /// For , must supply an index. /// - public Change(ListChangeReason reason, T current, in Optional previous, int currentIndex = -1, int previousIndex = -1) + public Change(ListChangeReason reason, T current, in Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { if (reason == ListChangeReason.Add && previous.HasValue) { diff --git a/src/DynamicData/List/ChangeAwareList.cs b/src/DynamicData/List/ChangeAwareList.cs index 3d8c22ff8..500d944b2 100644 --- a/src/DynamicData/List/ChangeAwareList.cs +++ b/src/DynamicData/List/ChangeAwareList.cs @@ -83,7 +83,7 @@ public int Capacity /// /// Gets the last change in the collection. /// - private Optional> Last => _changes.Count == 0 ? Optional.None>() : _changes[_changes.Count - 1]; + private Kernel.Optional> Last => _changes.Count == 0 ? Optional.None>() : _changes[_changes.Count - 1]; /// /// Gets or sets the item at the specified index. diff --git a/src/DynamicData/List/Internal/AnonymousObservableList.cs b/src/DynamicData/List/Internal/AnonymousObservableList.cs index 0664702d4..86e4957b1 100644 --- a/src/DynamicData/List/Internal/AnonymousObservableList.cs +++ b/src/DynamicData/List/Internal/AnonymousObservableList.cs @@ -10,7 +10,7 @@ namespace DynamicData.List.Internal; internal sealed class AnonymousObservableList : IObservableList where T : notnull { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed through _cleanUp")] + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed through _cleanUp")] private readonly ISourceList _sourceList; private readonly IDisposable _cleanUp; diff --git a/src/DynamicData/List/Internal/BufferIf.cs b/src/DynamicData/List/Internal/BufferIf.cs index daadcee78..c3b4814b0 100644 --- a/src/DynamicData/List/Internal/BufferIf.cs +++ b/src/DynamicData/List/Internal/BufferIf.cs @@ -22,7 +22,7 @@ public IObservable> Run() => Observable.Create>( var paused = initialPauseState; var buffer = new ChangeSet(); var timeoutSubscriber = new SerialDisposable(); - var timeoutSubject = new Subject(); + var timeoutSubject = new Signal(); var bufferSelector = Observable.Return(initialPauseState).Concat(_pauseIfTrueSelector.Merge(timeoutSubject)).ObserveOn(_scheduler).Synchronize(locker).Publish(); diff --git a/src/DynamicData/List/Internal/FilterStatic.cs b/src/DynamicData/List/Internal/FilterStatic.cs index bd69d9e00..a55eaf67f 100644 --- a/src/DynamicData/List/Internal/FilterStatic.cs +++ b/src/DynamicData/List/Internal/FilterStatic.cs @@ -11,7 +11,7 @@ internal sealed class FilterStatic(IObservable> source, Func> _source = source ?? throw new ArgumentNullException(nameof(source)); - public IObservable> Run() => Observable.Defer(() => _source.Scan( + public IObservable> Run() => Signal.Lazy(() => _source.Scan( new ChangeAwareList(), (state, changes) => { diff --git a/src/DynamicData/List/Internal/ReaderWriter.cs b/src/DynamicData/List/Internal/ReaderWriter.cs index 57b413867..fb02b6253 100644 --- a/src/DynamicData/List/Internal/ReaderWriter.cs +++ b/src/DynamicData/List/Internal/ReaderWriter.cs @@ -7,11 +7,7 @@ namespace DynamicData.List.Internal; internal sealed class ReaderWriter where T : notnull { -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif private ChangeAwareList _data = new(); diff --git a/src/DynamicData/List/Internal/RefCount.cs b/src/DynamicData/List/Internal/RefCount.cs index 6994fcb15..323e08710 100644 --- a/src/DynamicData/List/Internal/RefCount.cs +++ b/src/DynamicData/List/Internal/RefCount.cs @@ -7,11 +7,7 @@ namespace DynamicData.List.Internal; internal sealed class RefCount(IObservable> source) where T : notnull { -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif private IObservableList? _list; private int _refCount; diff --git a/src/DynamicData/List/Internal/TransformAsync.cs b/src/DynamicData/List/Internal/TransformAsync.cs index 51671c5bd..0bfc2520d 100644 --- a/src/DynamicData/List/Internal/TransformAsync.cs +++ b/src/DynamicData/List/Internal/TransformAsync.cs @@ -8,14 +8,14 @@ internal sealed class TransformAsync where TSource : notnull where TDestination : notnull { - private readonly Func, int, Task.TransformedItemContainer>> _containerFactory; + private readonly Func, int, Task.TransformedItemContainer>> _containerFactory; private readonly IObservable> _source; private readonly bool _transformOnRefresh; public TransformAsync( IObservable> source, - Func, int, Task> factory, + Func, int, Task> factory, bool transformOnRefresh) { factory.ThrowArgumentNullExceptionIfNull(nameof(factory)); @@ -29,7 +29,7 @@ public TransformAsync( }; } - public IObservable> Run() => Observable.Defer(RunImpl); + public IObservable> Run() => Signal.Lazy(RunImpl); private IObservable> RunImpl() { @@ -75,7 +75,7 @@ private async Task Transform( var container = await _containerFactory( item.Item.Current, - Optional.None, + Kernel.Optional.None, transformed.Count).ConfigureAwait(false); transformed.Add(container); } @@ -84,7 +84,7 @@ await _containerFactory( var container = await _containerFactory( item.Item.Current, - Optional.None, + Kernel.Optional.None, change.CurrentIndex).ConfigureAwait(false); transformed.Insert(change.CurrentIndex, container); } @@ -95,7 +95,7 @@ await _containerFactory( case ListChangeReason.AddRange: { var startIndex = item.Range.Index < 0 ? transformed.Count : item.Range.Index; - var tasks = item.Range.Select((t, idx) => _containerFactory(t, Optional.None, idx + startIndex)); + var tasks = item.Range.Select((t, idx) => _containerFactory(t, Kernel.Optional.None, idx + startIndex)); var containers = await Task.WhenAll(tasks).ConfigureAwait(false); transformed.AddOrInsertRange(containers, item.Range.Index); break; @@ -106,7 +106,7 @@ await _containerFactory( var change = item.Item; if (_transformOnRefresh) { - Optional previous = transformed[change.CurrentIndex].Destination; + Kernel.Optional previous = transformed[change.CurrentIndex].Destination; var container = await _containerFactory(change.Current, previous, change.CurrentIndex) .ConfigureAwait(false); transformed[change.CurrentIndex] = container; @@ -123,7 +123,7 @@ await _containerFactory( { var change = item.Item; - Optional previous = transformed[change.PreviousIndex].Destination; + Kernel.Optional previous = transformed[change.PreviousIndex].Destination; if (change.CurrentIndex == change.PreviousIndex) { transformed[change.CurrentIndex] = await _containerFactory(change.Current, previous, change.CurrentIndex); @@ -131,7 +131,7 @@ await _containerFactory( else { transformed.RemoveAt(change.PreviousIndex); - transformed.Insert(change.CurrentIndex, await _containerFactory(change.Current, Optional.None, change.CurrentIndex)); + transformed.Insert(change.CurrentIndex, await _containerFactory(change.Current, Kernel.Optional.None, change.CurrentIndex)); } break; diff --git a/src/DynamicData/List/Internal/Transformer.cs b/src/DynamicData/List/Internal/Transformer.cs index 56689ac91..fa7f73ac1 100644 --- a/src/DynamicData/List/Internal/Transformer.cs +++ b/src/DynamicData/List/Internal/Transformer.cs @@ -8,13 +8,13 @@ internal sealed class Transformer where TSource : notnull where TDestination : notnull { - private readonly Func, int, TransformedItemContainer> _containerFactory; + private readonly Func, int, TransformedItemContainer> _containerFactory; private readonly IObservable> _source; private readonly bool _transformOnRefresh; - public Transformer(IObservable> source, Func, int, TDestination> factory, bool transformOnRefresh) + public Transformer(IObservable> source, Func, int, TDestination> factory, bool transformOnRefresh) { factory.ThrowArgumentNullExceptionIfNull(nameof(factory)); @@ -23,7 +23,7 @@ public Transformer(IObservable> source, Func new TransformedItemContainer(item, factory(item, prev, index)); } - public IObservable> Run() => Observable.Defer(RunImpl); + public IObservable> Run() => Signal.Lazy(RunImpl); private IObservable> RunImpl() => _source.Scan(new ChangeAwareList(), (state, changes) => { @@ -49,11 +49,11 @@ private void Transform(ChangeAwareList transformed, IC var change = item.Item; if (change.CurrentIndex < 0 || change.CurrentIndex >= transformed.Count) { - transformed.Add(_containerFactory(change.Current, Optional.None, transformed.Count)); + transformed.Add(_containerFactory(change.Current, Kernel.Optional.None, transformed.Count)); } else { - var converted = _containerFactory(change.Current, Optional.None, change.CurrentIndex); + var converted = _containerFactory(change.Current, Kernel.Optional.None, change.CurrentIndex); transformed.Insert(change.CurrentIndex, converted); } @@ -64,7 +64,7 @@ private void Transform(ChangeAwareList transformed, IC { var startIndex = item.Range.Index < 0 ? transformed.Count : item.Range.Index; - transformed.AddOrInsertRange(item.Range.Select((t, idx) => _containerFactory(t, Optional.None, idx + startIndex)), item.Range.Index); + transformed.AddOrInsertRange(item.Range.Select((t, idx) => _containerFactory(t, Kernel.Optional.None, idx + startIndex)), item.Range.Index); break; } @@ -86,7 +86,7 @@ private void Transform(ChangeAwareList transformed, IC if (_transformOnRefresh) { - Optional previous = transformed[index].Destination; + Kernel.Optional previous = transformed[index].Destination; transformed[index] = _containerFactory(change.Current, previous, index); } else @@ -115,7 +115,7 @@ private void Transform(ChangeAwareList transformed, IC } else { - Optional previous = transformed[change.PreviousIndex].Destination; + Kernel.Optional previous = transformed[change.PreviousIndex].Destination; if (change.CurrentIndex == change.PreviousIndex) { transformed[change.CurrentIndex] = _containerFactory(change.Current, previous, change.CurrentIndex); @@ -123,7 +123,7 @@ private void Transform(ChangeAwareList transformed, IC else { transformed.RemoveAt(change.PreviousIndex); - transformed.Insert(change.CurrentIndex, _containerFactory(change.Current, Optional.None, change.CurrentIndex)); + transformed.Insert(change.CurrentIndex, _containerFactory(change.Current, Kernel.Optional.None, change.CurrentIndex)); } } diff --git a/src/DynamicData/List/Internal/UnifiedChange.cs b/src/DynamicData/List/Internal/UnifiedChange.cs index eb971b7ae..9325080f2 100644 --- a/src/DynamicData/List/Internal/UnifiedChange.cs +++ b/src/DynamicData/List/Internal/UnifiedChange.cs @@ -4,11 +4,11 @@ namespace DynamicData.List.Internal; -internal readonly struct UnifiedChange(ListChangeReason reason, T current, Optional previous) : IEquatable> +internal readonly struct UnifiedChange(ListChangeReason reason, T current, Kernel.Optional previous) : IEquatable> where T : notnull { public UnifiedChange(ListChangeReason reason, T current) - : this(reason, current, Optional.None()) + : this(reason, current, Kernel.Optional.None()) { } @@ -16,7 +16,7 @@ public UnifiedChange(ListChangeReason reason, T current) public T Current { get; } = current; - public Optional Previous { get; } = previous; + public Kernel.Optional Previous { get; } = previous; public static bool operator ==(in UnifiedChange left, in UnifiedChange right) => left.Equals(right); diff --git a/src/DynamicData/List/ItemChange.cs b/src/DynamicData/List/ItemChange.cs index 4b7d31a46..d1c93547b 100644 --- a/src/DynamicData/List/ItemChange.cs +++ b/src/DynamicData/List/ItemChange.cs @@ -25,7 +25,7 @@ namespace DynamicData; /// The previous. /// Value of the current. /// Value of the previous. - public ItemChange(ListChangeReason reason, T current, in Optional previous, int currentIndex = -1, int previousIndex = -1) + public ItemChange(ListChangeReason reason, T current, in Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) : this() { Reason = reason; @@ -48,7 +48,7 @@ public ItemChange(ListChangeReason reason, T current, int currentIndex) Current = current; CurrentIndex = currentIndex; PreviousIndex = -1; - Previous = Optional.None; + Previous = Kernel.Optional.None; } /// @@ -70,7 +70,7 @@ public ItemChange(ListChangeReason reason, T current, int currentIndex) /// Gets the item from before the change. /// This is only when is . /// - public Optional Previous { get; } + public Kernel.Optional Previous { get; } /// /// Gets the previous index. diff --git a/src/DynamicData/List/ListEx.cs b/src/DynamicData/List/ListEx.cs index 7035b1d4d..b5ce7be21 100644 --- a/src/DynamicData/List/ListEx.cs +++ b/src/DynamicData/List/ListEx.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -291,11 +289,11 @@ public static int IndexOf(this IEnumerable source, T item, IEqualityCompar /// The item. /// The equality comparer. /// The index of the item if available. - public static Optional> IndexOfOptional(this IEnumerable source, T item, IEqualityComparer? equalityComparer = null) + public static Kernel.Optional> IndexOfOptional(this IEnumerable source, T item, IEqualityComparer? equalityComparer = null) { var comparer = equalityComparer ?? EqualityComparer.Default; var index = source.IndexOf(item, comparer); - return index < 0 ? Optional>.None : new ItemWithIndex(item, index); + return index < 0 ? Kernel.Optional>.None : new ItemWithIndex(item, index); } /// diff --git a/src/DynamicData/List/ObservableListEx.Bind.cs b/src/DynamicData/List/ObservableListEx.Bind.cs index a876bed88..f5b69b9fe 100644 --- a/src/DynamicData/List/ObservableListEx.Bind.cs +++ b/src/DynamicData/List/ObservableListEx.Bind.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; using DynamicData.Binding; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/List/ObservableListEx.CastToObject.cs b/src/DynamicData/List/ObservableListEx.CastToObject.cs index c24fffaaf..374845a09 100644 --- a/src/DynamicData/List/ObservableListEx.CastToObject.cs +++ b/src/DynamicData/List/ObservableListEx.CastToObject.cs @@ -18,5 +18,9 @@ public static partial class ObservableListEx /// A list changeset stream of object items. /// public static IObservable> CastToObject(this IObservable> source) - where T : class => source.Select(changes => changes.Transform(t => (object)t)); + where T : class + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.Select(changes => changes.Transform(t => (object)t)); + } } diff --git a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs index 062a31297..c8f5bea69 100644 --- a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs +++ b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs @@ -23,5 +23,9 @@ public static partial class ObservableListEx /// /// public static IObservable> FlattenBufferResult(this IObservable>> source) - where T : notnull => source.Where(x => x.Count != 0).Select(updates => new ChangeSet(updates.SelectMany(u => u))); + where T : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return source.Where(x => x.Count != 0).Select(updates => new ChangeSet(updates.SelectMany(u => u))); + } } diff --git a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs index d66024318..d1aaa44a7 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs @@ -39,7 +39,10 @@ public static IObservable> OnItemAdded( this IObservable> source, Action addAction) where T : notnull - => List.Internal.OnItemAdded.Create( - source: source, - addAction: addAction); + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return List.Internal.OnItemAdded.Create( + source: source, + addAction: addAction); + } } diff --git a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs index 23fc3eb5f..a7ddad69a 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs @@ -26,7 +26,10 @@ public static IObservable> OnItemRefreshed( this IObservable> source, Action refreshAction) where T : notnull - => List.Internal.OnItemRefreshed.Create( - source: source, - refreshAction: refreshAction); + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return List.Internal.OnItemRefreshed.Create( + source: source, + refreshAction: refreshAction); + } } diff --git a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs index c8f03fc77..fe47fd544 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs @@ -46,8 +46,11 @@ public static IObservable> OnItemRemoved( Action removeAction, bool invokeOnUnsubscribe = true) where T : notnull - => List.Internal.OnItemRemoved.Create( - source: source, - removeAction: removeAction, - invokeOnUnsubscribe: invokeOnUnsubscribe); + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + return List.Internal.OnItemRemoved.Create( + source: source, + removeAction: removeAction, + invokeOnUnsubscribe: invokeOnUnsubscribe); + } } diff --git a/src/DynamicData/List/ObservableListEx.Transform.cs b/src/DynamicData/List/ObservableListEx.Transform.cs index cbdf471c3..46135789b 100644 --- a/src/DynamicData/List/ObservableListEx.Transform.cs +++ b/src/DynamicData/List/ObservableListEx.Transform.cs @@ -75,7 +75,7 @@ public static IObservable> Transform - public static IObservable> Transform(this IObservable> source, Func, TDestination> transformFactory, bool transformOnRefresh = false) + public static IObservable> Transform(this IObservable> source, Func, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { @@ -90,7 +90,7 @@ public static IObservable> Transform - public static IObservable> Transform(this IObservable> source, Func, int, TDestination> transformFactory, bool transformOnRefresh = false) + public static IObservable> Transform(this IObservable> source, Func, int, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { diff --git a/src/DynamicData/List/ObservableListEx.TransformAsync.cs b/src/DynamicData/List/ObservableListEx.TransformAsync.cs index 196c1f851..3062e29cb 100644 --- a/src/DynamicData/List/ObservableListEx.TransformAsync.cs +++ b/src/DynamicData/List/ObservableListEx.TransformAsync.cs @@ -39,7 +39,7 @@ public static partial class ObservableListEx /// /// /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] + [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync( this IObservable> source, Func> transformFactory, @@ -57,7 +57,7 @@ public static IObservable> TransformAsync /// Async transform overload receiving the source item and its index. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] + [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync( this IObservable> source, Func> transformFactory, @@ -75,10 +75,10 @@ public static IObservable> TransformAsync /// Async transform overload receiving the source item and the previously transformed value. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] + [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync( this IObservable> source, - Func, Task> transformFactory, + Func, Task> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull @@ -93,10 +93,10 @@ public static IObservable> TransformAsync /// Async transform overload receiving the source item, previously transformed value, and index. This is the terminal overload that all other TransformAsync overloads delegate to. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] + [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync( this IObservable> source, - Func, int, Task> transformFactory, + Func, int, Task> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull diff --git a/src/DynamicData/List/ObservableListEx.TransformMany.cs b/src/DynamicData/List/ObservableListEx.TransformMany.cs index 8c211f6c9..9cf82eb82 100644 --- a/src/DynamicData/List/ObservableListEx.TransformMany.cs +++ b/src/DynamicData/List/ObservableListEx.TransformMany.cs @@ -2,7 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; using DynamicData.List.Internal; // ReSharper disable once CheckNamespace diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs index ae9a6b072..30436682d 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs @@ -31,6 +31,7 @@ public static IObservable> WhereReasonsAre(this IObservable> WhereReasonsAreNot(this IObservable< where T : notnull { reasons.ThrowArgumentNullExceptionIfNull(nameof(reasons)); + source.ThrowArgumentNullExceptionIfNull(nameof(source)); if (reasons.Length == 0) { diff --git a/src/DynamicData/Platforms/net45/PFilter.cs b/src/DynamicData/Platforms/net45/PFilter.cs index 375de57cc..55528c741 100644 --- a/src/DynamicData/Platforms/net45/PFilter.cs +++ b/src/DynamicData/Platforms/net45/PFilter.cs @@ -34,7 +34,7 @@ protected override IEnumerable GetChangesWithFilter(ChangeSet< return updates.Select(u => new UpdateWithFilter(Filter(u.Current), u)).ToArray(); } - protected override IEnumerable> Refresh(IEnumerable> items, Func, Optional>> factory) + protected override IEnumerable> Refresh(IEnumerable> items, Func, Kernel.Optional>> factory) { var keyValuePairs = items as KeyValuePair[] ?? items.ToArray(); diff --git a/src/DynamicData/Platforms/net45/PTransform.cs b/src/DynamicData/Platforms/net45/PTransform.cs index 4bfebda30..1c1f34855 100644 --- a/src/DynamicData/Platforms/net45/PTransform.cs +++ b/src/DynamicData/Platforms/net45/PTransform.cs @@ -9,7 +9,7 @@ namespace DynamicData.PLinq { internal sealed class PTransform( IObservable> source, - Func, TKey, TDestination> transformFactory, + Func, TKey, TDestination> transformFactory, ParallelisationOptions parallelisationOptions, Action>? exceptionCallback = null) where TDestination : notnull @@ -24,7 +24,7 @@ public IObservable> Run() => return transformer.NotEmpty().SubscribeSafe(observer); }); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0305:Simplify collection initialization", Justification = "A collection initializer is not equivalent to a .ToArray() call for a ParallelQuery. This change actually introduces a race-condition exception.")] + [SuppressMessage("Style", "IDE0305:Simplify collection initialization", Justification = "A collection initializer is not equivalent to a .ToArray() call for a ParallelQuery. This change actually introduces a race-condition exception.")] private ChangeSet DoTransform(ChangeAwareCache cache, IChangeSet changes) { var transformed = changes.ShouldParallelise(parallelisationOptions) @@ -106,7 +106,7 @@ public TransformResult(in Change change) : this() { Change = change; - Destination = Optional.None; + Destination = Kernel.Optional.None; Success = true; Key = change.Key; } @@ -126,7 +126,7 @@ public TransformResult(in Change change, Exception error) public bool Success { get; } - public Optional Destination { get; } + public Kernel.Optional Destination { get; } public TKey Key { get; } } From 41b032a77a1a6a36c3f991337fb3c97955aa4791 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Fri, 19 Jun 2026 23:45:43 +0100 Subject: [PATCH 05/36] Migrate to ReactiveUI.Primitives signals Replace Rx Subjects/BehaviorSubject/ReplaySubject and related primitives with ReactiveUI.Primitives equivalents (Signal, StateSignal, ReplaySignal) across cache, list, binding, and tests. Convert Observable helpers to Signal variants (Observable.Defer -> Signal.Lazy, Observable.FromAsync -> Signal.FromAsync), replace Do->Tap and Select->Map/Keep in several pipelines, and swap composite disposable types where appropriate (OnceDisposable/MultipleDisposable). Also introduce Kernel.Optional in place of Optional in internal cache types, add notnull constraints to SynchronizeSafe, tighten suppression attributes, and update various synchronization gates to use Lock. These changes aim to use the new primitives and avoid deadlocks / improve delivery semantics in multi-source operators. --- .../Cache/SortAndBindChange.cs | 24 +++++++++-------- .../Cache/SortAndBindInitial.cs | 18 +++++++------ .../AsyncDisposeManyFixture.UnitTests.cs | 10 +++---- .../Cache/CrossCacheDeadlockStressTest.cs | 27 ++++++++++--------- src/DynamicData/Binding/BindPaged.cs | 6 ++--- src/DynamicData/Binding/BindVirtualized.cs | 4 +-- src/DynamicData/Cache/Internal/Combiner.cs | 4 --- .../Cache/Internal/DynamicGrouper.cs | 6 ++--- src/DynamicData/Cache/Internal/FullJoin.cs | 8 +++--- src/DynamicData/Cache/Internal/GroupOn.cs | 6 +++-- .../Cache/Internal/QueryWhenChanged.cs | 2 +- src/DynamicData/Cache/Internal/Switch.cs | 2 +- .../Cache/Internal/TransformAsync.cs | 10 +++---- .../Cache/Internal/TransformMany.cs | 8 +++--- .../Internal/TransformWithForcedTransform.cs | 2 +- src/DynamicData/Cache/Internal/TreeBuilder.cs | 6 +++-- src/DynamicData/Cache/Node.cs | 8 +++--- .../Internal/SynchronizeSafeExtensions.cs | 14 +++++----- src/DynamicData/List/Internal/Combiner.cs | 6 +---- .../List/Internal/DynamicCombiner.cs | 9 +++---- src/DynamicData/List/Internal/GroupOn.cs | 4 +-- .../List/Internal/GroupOnImmutable.cs | 4 +-- src/DynamicData/List/Internal/MergeMany.cs | 4 +-- .../List/Internal/ToObservableChangeSet.cs | 6 +---- .../List/Internal/TransformMany.cs | 8 +++--- src/DynamicData/List/SourceList.cs | 10 +++---- 26 files changed, 101 insertions(+), 115 deletions(-) diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs index a610cccf4..7ddb4445e 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs @@ -1,6 +1,8 @@ -using System.Collections.ObjectModel; using BenchmarkDotNet.Attributes; using DynamicData.Binding; +using ReactiveUI.Primitives.Disposables; +using ReactiveUI.Primitives.Signals; +using System.Collections.ObjectModel; namespace DynamicData.Benchmarks.Cache; @@ -15,10 +17,10 @@ private record Item(string Name, int Id, int Ranking); .Ascending(i => i.Ranking) .ThenByAscending(i => i.Name); - Subject> _newSubject = new(); - Subject> _newSubjectOptimised = new(); - Subject> _oldSubject = new(); - Subject> _oldSubjectOptimised = new(); + Signal> _newSubject = new(); + Signal> _newSubjectOptimised = new(); + Signal> _oldSubject = new(); + Signal> _oldSubjectOptimised = new(); private IDisposable? _cleanUp; @@ -33,12 +35,12 @@ private record Item(string Name, int Id, int Ranking); [GlobalSetup] public void SetUp() { - _oldSubject = new Subject>(); - _oldSubjectOptimised = new Subject>(); - _newSubject = new Subject>(); - _newSubjectOptimised = new Subject>(); + _oldSubject = new Signal>(); + _oldSubjectOptimised = new Signal>(); + _newSubject = new Signal>(); + _newSubjectOptimised = new Signal>(); - _cleanUp = new CompositeDisposable + _cleanUp = new CompositeDisposable ( _newSubject.SortAndBind(out var newList, _comparer).Subscribe(), _newSubjectOptimised.SortAndBind(out var optimisedList, _comparer, new SortAndBindOptions @@ -82,7 +84,7 @@ public void SetUp() [Benchmark] public void NewOptimized() => RunTest(_newSubjectOptimised, _newListOptimised!); - void RunTest(Subject> subject, ReadOnlyObservableCollection list) + void RunTest(Signal> subject, ReadOnlyObservableCollection list) { var original = list[Count / 2]; var updated = original with { Ranking = _random.Next(1, 1000) }; diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs index 96b8048c0..038cc1ce4 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs @@ -1,5 +1,7 @@ using BenchmarkDotNet.Attributes; using DynamicData.Binding; +using ReactiveUI.Primitives.Disposables; +using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; @@ -13,10 +15,10 @@ private record Item(string Name, int Id, int Ranking); private readonly SortExpressionComparer _comparer = SortExpressionComparer.Ascending(i => i.Ranking).ThenByAscending(i => i.Name); - Subject> _newSubject = new(); - Subject> _newSubjectOptimised = new(); - Subject> _oldSubject = new(); - Subject> _oldSubjectOptimised = new(); + Signal> _newSubject = new(); + Signal> _newSubjectOptimised = new(); + Signal> _oldSubject = new(); + Signal> _oldSubjectOptimised = new(); private IDisposable? _cleanUp; private ChangeSet? _changeSet; @@ -27,10 +29,10 @@ private record Item(string Name, int Id, int Ranking); [GlobalSetup] public void SetUp() { - _oldSubject = new Subject>(); - _oldSubjectOptimised = new Subject>(); - _newSubject = new Subject>(); - _newSubjectOptimised = new Subject>(); + _oldSubject = new Signal>(); + _oldSubjectOptimised = new Signal>(); + _newSubject = new Signal>(); + _newSubjectOptimised = new Signal>(); var changeSet = new ChangeSet(Count); foreach (var i in Enumerable.Range(1, Count)) diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs index 3dc65893c..d8f313b14 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs @@ -16,7 +16,7 @@ public class UnitTests [InlineData(ItemType.ImmediateAsyncDisposable)] public void ItemsAreAddedMovedOrRefreshed_ItemsAreNotDisposed(ItemType itemType) { - using var source = new Subject>(); + using var source = new Signal>(); ValueRecordingObserver? disposalsCompletedResults = null; @@ -259,7 +259,7 @@ public void SourceCompletes_ItemsAreDisposedAndCompletionPropagates(SourceType s IObservable> source = (sourceType is SourceType.Immediate) ? Observable.Return(changeSet) - : new Subject>(); + : new Signal>(); ValueRecordingObserver? disposalsCompletedResults = null; @@ -275,7 +275,7 @@ public void SourceCompletes_ItemsAreDisposedAndCompletionPropagates(SourceType s disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - if (source is Subject> subject) + if (source is Signal> subject) { subject.OnNext(changeSet); subject.OnCompleted(); @@ -313,7 +313,7 @@ public void SourceErrors_ItemsAreDisposedAndErrorPropagates(SourceType sourceTyp IObservable> source = (sourceType is SourceType.Immediate) ? Observable.Return(changeSet) .Concat(Observable.Throw>(error)) - : new Subject>(); + : new Signal>(); ValueRecordingObserver? disposalsCompletedResults = null; @@ -329,7 +329,7 @@ public void SourceErrors_ItemsAreDisposedAndErrorPropagates(SourceType sourceTyp disposalsCompletedResults.Should().NotBeNull("disposalsCompletedAccessor should have been invoked"); - if (source is Subject> subject) + if (source is Signal> subject) { subject.OnNext(changeSet); subject.OnError(error); diff --git a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs index d5511b5e5..96c162c33 100644 --- a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs +++ b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs @@ -7,6 +7,7 @@ using DynamicData.Binding; using FluentAssertions; +using ReactiveUI.Primitives.Disposables; namespace DynamicData.Tests.Cache; @@ -203,21 +204,21 @@ public async Task AllOperators_CrossCache_NoDeadlock_CorrectResults() using var treeSource = new SourceCache(m => m.Id); // ── Subjects for dynamic parameters ───────────────────────── - using var pageRequests = new BehaviorSubject(new PageRequest(1, pageSize)); - using var virtualRequests = new BehaviorSubject(new VirtualRequest(0, virtualSize)); - using var pauseBatch = new BehaviorSubject(false); - using var forceTransform = new Subject>(); - using var switchSource = new BehaviorSubject>>(sourceA.Connect()); - using var comparerSubject = new BehaviorSubject>(RatingDescComparer.Instance); + using var pageRequests = new StateSignal(new PageRequest(1, pageSize)); + using var virtualRequests = new StateSignal(new VirtualRequest(0, virtualSize)); + using var pauseBatch = new StateSignal(false); + using var forceTransform = new Signal>(); + using var switchSource = new StateSignal>>(sourceA.Connect()); + using var comparerSubject = new StateSignal>(RatingDescComparer.Instance); // Stop signal for operators with a library gap — they don't forward OnCompleted: // Static Combiner (Or/And/Except), BatchIf, TransformToTree, Switch - using var stopSignal = new Subject(); + using var stopSignal = new Signal(); // ── Completion tracking ───────────────────────────────────── var completionTasks = new List(); var completionNames = new List(); - using var subs = new CompositeDisposable(); + using var subs = new MultipleDisposable(); // Helpers IObservableCache TrackCache(IObservable> pipeline, [System.Runtime.CompilerServices.CallerArgumentExpression(nameof(pipeline))] string? name = null) @@ -462,8 +463,8 @@ void TrackIntoCache(IObservable> pipeline, SourceC .TakeUntil(stopSignal)); // Second Page + Virtualise + BatchIf uses on sourceB - using var pageBSubject = new BehaviorSubject(new PageRequest(1, pageSize)); - using var pauseB = new BehaviorSubject(false); + using var pageBSubject = new StateSignal(new PageRequest(1, pageSize)); + using var pauseB = new StateSignal(false); var pageBCache = TrackCache( sourceB.Connect() @@ -472,7 +473,7 @@ void TrackIntoCache(IObservable> pipeline, SourceC .BatchIf(pauseB, false, (TimeSpan?)null) // BatchIf [2] .TakeUntil(stopSignal)); - using var virtBRequests = new BehaviorSubject(new VirtualRequest(0, virtualSize)); + using var virtBRequests = new StateSignal(new VirtualRequest(0, virtualSize)); var virtBCache = TrackCache( sourceB.Connect() .Sort(PriorityAscComparer.Instance) // Sort [4] @@ -524,7 +525,7 @@ void TrackIntoCache(IObservable> pipeline, SourceC completionNames.Add("QueryWhenChanged-A"); // Second Switch + GroupOnImmutable + GroupOnObservable - using var switchSource2 = new BehaviorSubject>>(sourceB.Connect()); + using var switchSource2 = new StateSignal>>(sourceB.Connect()); var switchCache2 = TrackCache( switchSource2.Switch() // Switch [2] .TakeUntil(stopSignal)); @@ -643,7 +644,7 @@ void TrackIntoCache(IObservable> pipeline, SourceC var finalAKeys = new HashSet(sourceA.Keys); var finalBKeys = new HashSet(sourceB.Keys); - // 2. Complete all BehaviorSubjects so multi-source operators can complete + // 2. Complete all StateSignals so multi-source operators can complete forceTransform.OnCompleted(); pageRequests.OnCompleted(); pageBSubject.OnCompleted(); diff --git a/src/DynamicData/Binding/BindPaged.cs b/src/DynamicData/Binding/BindPaged.cs index 6b8707e21..fe51bdff5 100644 --- a/src/DynamicData/Binding/BindPaged.cs +++ b/src/DynamicData/Binding/BindPaged.cs @@ -35,12 +35,12 @@ private IObservable> UseContextSortOptions() => { var shared = source.Publish(); - var subscriber = new SingleAssignmentDisposable(); + var subscriber = new OnceDisposable(); // I tried to make this work without subjects but had issues // making the comparedChanged observable to fire. Probably a deadlock - var changesSubject = new Subject>(); - var comparerSubject = new ReplaySubject>(1); + var changesSubject = new Signal>(); + var comparerSubject = new ReplaySignal>(1); // once we have the initial values, publish as normal. var subsequent = shared diff --git a/src/DynamicData/Binding/BindVirtualized.cs b/src/DynamicData/Binding/BindVirtualized.cs index 1cc951712..879f7fe0c 100644 --- a/src/DynamicData/Binding/BindVirtualized.cs +++ b/src/DynamicData/Binding/BindVirtualized.cs @@ -37,8 +37,8 @@ private IObservable> UseVirtualSortOptions() => // I tried to make this work without subjects but had issues // making the comparedChanged observable to fire. Probably a deadlock - var changesSubject = new Subject>(); - var comparerSubject = new ReplaySubject>(1); + var changesSubject = new Signal>(); + var comparerSubject = new ReplaySignal>(1); // once we have the initial values, publish as normal. var subsequent = shared diff --git a/src/DynamicData/Cache/Internal/Combiner.cs b/src/DynamicData/Cache/Internal/Combiner.cs index e1b73f834..ff7de18f5 100644 --- a/src/DynamicData/Cache/Internal/Combiner.cs +++ b/src/DynamicData/Cache/Internal/Combiner.cs @@ -13,11 +13,7 @@ internal sealed class Combiner(CombineOperator type, Action _combinedCache = new(); -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif private readonly IList> _sourceCaches = []; diff --git a/src/DynamicData/Cache/Internal/DynamicGrouper.cs b/src/DynamicData/Cache/Internal/DynamicGrouper.cs index ede740ddc..55738bd69 100644 --- a/src/DynamicData/Cache/Internal/DynamicGrouper.cs +++ b/src/DynamicData/Cache/Internal/DynamicGrouper.cs @@ -178,7 +178,7 @@ public void Dispose() _groupCache.Items.ForEach(group => (group as ManagedGroup)?.Dispose()); } - private static void PerformGroupRefresh(TKey key, in Optional> optionalGroup, SuspendTracker? suspendTracker = null) + private static void PerformGroupRefresh(TKey key, in Kernel.Optional> optionalGroup, SuspendTracker? suspendTracker = null) { if (optionalGroup.HasValue) { @@ -191,10 +191,10 @@ private static void PerformGroupRefresh(TKey key, in Optional> LookupGroup(TKey key) => + private Kernel.Optional> LookupGroup(TKey key) => _groupKeys.Lookup(key).Convert(LookupGroup); - private Optional> LookupGroup(TGroupKey groupKey) => + private Kernel.Optional> LookupGroup(TGroupKey groupKey) => _groupCache.Lookup(groupKey).Convert(static grp => (grp as ManagedGroup)!); private ManagedGroup GetOrAddGroup(TGroupKey groupKey) => diff --git a/src/DynamicData/Cache/Internal/FullJoin.cs b/src/DynamicData/Cache/Internal/FullJoin.cs index 5666930aa..3a5018a7a 100644 --- a/src/DynamicData/Cache/Internal/FullJoin.cs +++ b/src/DynamicData/Cache/Internal/FullJoin.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class FullJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) +internal sealed class FullJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, Kernel.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +13,7 @@ internal sealed class FullJoin { private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, Optional, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, Kernel.Optional, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); @@ -56,7 +56,7 @@ public IObservable> Run() => Observable.Creat else { // update with no left value - joinedCache.AddOrUpdate(_resultSelector(change.Key, Optional.None, rightLookup), change.Key); + joinedCache.AddOrUpdate(_resultSelector(change.Key, Kernel.Optional.None, rightLookup), change.Key); } break; @@ -98,7 +98,7 @@ public IObservable> Run() => Observable.Creat else { // update with no right value - joinedCache.AddOrUpdate(_resultSelector(change.Key, left, Optional.None), change.Key); + joinedCache.AddOrUpdate(_resultSelector(change.Key, left, Kernel.Optional.None), change.Key); } } diff --git a/src/DynamicData/Cache/Internal/GroupOn.cs b/src/DynamicData/Cache/Internal/GroupOn.cs index 98982946c..13305287c 100644 --- a/src/DynamicData/Cache/Internal/GroupOn.cs +++ b/src/DynamicData/Cache/Internal/GroupOn.cs @@ -2,6 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using ReactiveUI.Primitives; + namespace DynamicData.Cache.Internal; internal sealed class GroupOn(IObservable> source, Func groupSelectorKey, IObservable? regrouper) @@ -21,9 +23,9 @@ public IObservable> Run() => Observabl var queue = new SharedDeliveryQueue(); var grouper = new Grouper(_groupSelectorKey); - var groups = _source.SynchronizeSafe(queue).Finally(observer.OnCompleted).Select(grouper.Update).Where(changes => changes.Count != 0); + var groups = _source.SynchronizeSafe(queue).Finally(observer.OnCompleted).Map(grouper.Update).Keep(changes => changes.Count != 0); - var regroup = _regrouper.SynchronizeSafe(queue).Select(_ => grouper.Regroup()).Where(changes => changes.Count != 0); + var regroup = _regrouper.SynchronizeSafe(queue).Map(_ => grouper.Regroup()).Keep(changes => changes.Count != 0); var published = groups.Merge(regroup).Publish(); var subscriber = published.SubscribeSafe(observer); diff --git a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs index e5ea2ffdd..e8699904e 100644 --- a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs @@ -14,7 +14,7 @@ public IObservable> Run() { if (itemChangedTrigger is null) { - return Observable.Defer(() => + return Signal.Lazy(() => { return _source.Scan( (Cache?)null, diff --git a/src/DynamicData/Cache/Internal/Switch.cs b/src/DynamicData/Cache/Internal/Switch.cs index a33b744dd..b62557f6a 100644 --- a/src/DynamicData/Cache/Internal/Switch.cs +++ b/src/DynamicData/Cache/Internal/Switch.cs @@ -17,7 +17,7 @@ public IObservable> Run() => Observable.Create(); - var errors = new Subject>(); + var errors = new Signal>(); var populator = Observable.Switch( _sources diff --git a/src/DynamicData/Cache/Internal/TransformAsync.cs b/src/DynamicData/Cache/Internal/TransformAsync.cs index efa251e05..bf28f2818 100644 --- a/src/DynamicData/Cache/Internal/TransformAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformAsync.cs @@ -6,7 +6,7 @@ namespace DynamicData.Cache.Internal; internal class TransformAsync( IObservable> source, - Func, TKey, Task> transformFactory, + Func, TKey, Task> transformFactory, Action>? exceptionCallback, IObservable>? forceTransform = null, int? maximumConcurrency = null, @@ -41,7 +41,7 @@ private IObservable> DoTransform(ChangeAwareCache var toTransform = cache.KeyValues.Where(kvp => shouldTransform(kvp.Value.Source, kvp.Key)).Select(kvp => new Change(ChangeReason.Update, kvp.Key, kvp.Value.Source, kvp.Value.Source)).ToArray(); - return toTransform.Select(change => Observable.Defer(() => Transform(change).ToObservable())) + return toTransform.Select(change => Signal.Lazy(() => Transform(change).ToObservable())) .Merge(maximumConcurrency ?? int.MaxValue) .ToArray() .Select(transformed => ProcessUpdates(cache, transformed)); @@ -50,7 +50,7 @@ private IObservable> DoTransform(ChangeAwareCache private IObservable> DoTransform( ChangeAwareCache cache, IChangeSet changes) { - return changes.Select(change => Observable.FromAsync(() => Transform(change))) + return changes.Select(change => Signal.FromAsync(() => Transform(change))) .Merge(maximumConcurrency ?? int.MaxValue) .ToArray() .Select(transformed => ProcessUpdates(cache, transformed)); @@ -146,7 +146,7 @@ public TransformResult(in Change change, in TransformedItemContai public TransformResult(in Change change) { Change = change; - Container = Optional.None; + Container = Kernel.Optional.None; Success = true; Key = change.Key; } @@ -161,7 +161,7 @@ public TransformResult(in Change change, Exception error) public Change Change { get; } - public Optional Container { get; } + public Kernel.Optional Container { get; } public Exception? Error { get; } diff --git a/src/DynamicData/Cache/Internal/TransformMany.cs b/src/DynamicData/Cache/Internal/TransformMany.cs index 912835bf0..710c93b5a 100644 --- a/src/DynamicData/Cache/Internal/TransformMany.cs +++ b/src/DynamicData/Cache/Internal/TransformMany.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; - using DynamicData.Binding; namespace DynamicData.Cache.Internal; @@ -19,7 +17,7 @@ public TransformMany(IObservable> source, Func Observable.Defer( + t => Signal.Lazy( () => { var subsequentChanges = manySelector(t).ToObservableChangeSet(keySelector); @@ -39,7 +37,7 @@ public TransformMany(IObservable> source, Func Observable.Defer( + t => Signal.Lazy( () => { var subsequentChanges = manySelector(t).ToObservableChangeSet(keySelector); @@ -59,7 +57,7 @@ public TransformMany(IObservable> source, Func manySelector(x).Items, keySelector, - t => Observable.Defer( + t => Signal.Lazy( () => { var subsequentChanges = Observable.Create>(o => manySelector(t).Connect().Subscribe(o)); diff --git a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs index 50c900b75..11a00358c 100644 --- a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs +++ b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class TransformWithForcedTransform(IObservable> source, Func, TKey, TDestination> transformFactory, IObservable> forceTransform, Action>? exceptionCallback = null) +internal sealed class TransformWithForcedTransform(IObservable> source, Func, TKey, TDestination> transformFactory, IObservable> forceTransform, Action>? exceptionCallback = null) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/Internal/TreeBuilder.cs b/src/DynamicData/Cache/Internal/TreeBuilder.cs index 2afc5cb97..be1c78c0b 100644 --- a/src/DynamicData/Cache/Internal/TreeBuilder.cs +++ b/src/DynamicData/Cache/Internal/TreeBuilder.cs @@ -2,6 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +using ReactiveUI.Primitives; + namespace DynamicData.Cache.Internal; internal sealed class TreeBuilder(IObservable> source, Func pivotOn, IObservable, bool>>? predicateChanged) @@ -20,7 +22,7 @@ public IObservable, TKey>> Run() => Observable.Cr observer => { var queue = new SharedDeliveryQueue(); - var reFilterObservable = new BehaviorSubject(Unit.Default); + var reFilterObservable = new StateSignal(Unit.Default); var allData = _source.SynchronizeSafe(queue).AsObservableCache(); @@ -42,7 +44,7 @@ void UpdateChildren(Node parentNode) } // as nodes change, maintain parent and children - var parentSetter = allNodes.Connect().Do( + var parentSetter = allNodes.Connect().Tap( changes => { foreach (var group in changes.GroupBy(c => _pivotOn(c.Current.Item))) diff --git a/src/DynamicData/Cache/Node.cs b/src/DynamicData/Cache/Node.cs index eb45dce6d..11e3d4cd2 100644 --- a/src/DynamicData/Cache/Node.cs +++ b/src/DynamicData/Cache/Node.cs @@ -14,7 +14,7 @@ public class Node : IDisposable, IEquatable> where TObject : class where TKey : notnull { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly SourceCache, TKey> _children = new(n => n.Key); private readonly CompositeDisposable _cleanUp; @@ -37,13 +37,13 @@ public Node(TObject item, TKey key) /// The item. /// The key. /// The parent. - public Node(TObject item, TKey key, in Optional> parent) + public Node(TObject item, TKey key, in Kernel.Optional> parent) { Item = item ?? throw new ArgumentNullException(nameof(item)); Key = key; Parent = parent; Children = _children.AsObservableCache(); - _cleanUp = new(Children, _children); + _cleanUp = new CompositeDisposable(Children, _children); } /// @@ -91,7 +91,7 @@ public int Depth /// /// Gets the parent if it has one. /// - public Optional> Parent { get; internal set; } + public Kernel.Optional> Parent { get; internal set; } /// /// Determines whether the specified objects are equal. diff --git a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs index 0de44feb8..fefcedb73 100644 --- a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs +++ b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs @@ -35,7 +35,9 @@ internal static class SynchronizeSafeExtensions /// Synchronizes the source observable through a . /// Use when multiple sources of different types share a gate. /// - public static IObservable SynchronizeSafe(this IObservable source, SharedDeliveryQueue queue) => + public static IObservable SynchronizeSafe(this IObservable source, SharedDeliveryQueue queue) + where T : notnull + => Observable.Create(observer => { var subQueue = queue.CreateQueue(observer); @@ -48,11 +50,8 @@ public static IObservable SynchronizeSafe(this IObservable source, Shar /// Synchronizes the source observable through an implicitly created . /// Drop-in replacement for Synchronize(locker). /// -#if NET9_0_OR_GREATER - public static IObservable SynchronizeSafe(this IObservable source, Lock gate) => -#else - public static IObservable SynchronizeSafe(this IObservable source, object gate) => -#endif + public static IObservable SynchronizeSafe(this IObservable source, Lock gate) + where T : notnull => Observable.Create(observer => { var queue = new DeliveryQueue(gate, observer); @@ -67,7 +66,8 @@ public static IObservable SynchronizeSafe(this IObservable source, obje /// before the source subscription is disposed, ensuring all in-flight notifications /// are delivered before teardown. /// - public static IObservable SynchronizeSafe(this IObservable source) => + public static IObservable SynchronizeSafe(this IObservable source) + where T : notnull => Observable.Create(observer => { var queue = new DeliveryQueue(observer); diff --git a/src/DynamicData/List/Internal/Combiner.cs b/src/DynamicData/List/Internal/Combiner.cs index 6b356ed8d..ff35c2be2 100644 --- a/src/DynamicData/List/Internal/Combiner.cs +++ b/src/DynamicData/List/Internal/Combiner.cs @@ -9,11 +9,7 @@ namespace DynamicData.List.Internal; internal sealed class Combiner(ICollection>> source, CombineOperator type) where T : notnull { -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif private readonly ICollection>> _source = source ?? throw new ArgumentNullException(nameof(source)); @@ -132,7 +128,7 @@ private void UpdateItemMembership(T item, List> sourceL } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly", Justification = "By Design.")] + [SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly", Justification = "By Design.")] private IChangeSet UpdateResultList(IChangeSet changes, List> sourceLists, ChangeAwareListWithRefCounts resultList) { // child caches have been updated before we reached this point. diff --git a/src/DynamicData/List/Internal/DynamicCombiner.cs b/src/DynamicData/List/Internal/DynamicCombiner.cs index 534a43c27..ea2eb0f59 100644 --- a/src/DynamicData/List/Internal/DynamicCombiner.cs +++ b/src/DynamicData/List/Internal/DynamicCombiner.cs @@ -3,17 +3,14 @@ // See the LICENSE file in the project root for full license information. using DynamicData.Cache.Internal; +using ReactiveUI.Primitives; namespace DynamicData.List.Internal; internal sealed class DynamicCombiner(IObservableList>> source, CombineOperator type) where T : notnull { -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif private readonly IObservableList>> _source = source ?? throw new ArgumentNullException(nameof(source)); @@ -142,7 +139,7 @@ private IChangeSet UpdateItemSetMemberships(MergeContainer[] sourceLists, Cha return resultingList.CaptureChanges(); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly", Justification = "By Design.")] + [SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly", Justification = "By Design.")] private IChangeSet UpdateResultList(MergeContainer[] sourceLists, ChangeAwareListWithRefCounts resultList, IChangeSet changes) { // child caches have been updated before we reached this point. @@ -184,7 +181,7 @@ private IChangeSet UpdateResultList(MergeContainer[] sourceLists, ChangeAware private sealed class MergeContainer { - public MergeContainer(IObservable> source) => Source = source.Do(Clone); + public MergeContainer(IObservable> source) => Source = source.Tap(Clone); public IObservable> Source { get; } diff --git a/src/DynamicData/List/Internal/GroupOn.cs b/src/DynamicData/List/Internal/GroupOn.cs index adefca815..59e14ff62 100644 --- a/src/DynamicData/List/Internal/GroupOn.cs +++ b/src/DynamicData/List/Internal/GroupOn.cs @@ -230,13 +230,13 @@ public GroupWithAddIndicator(Group group, bool wasCreated) public bool WasCreated { get; } } - private sealed class ItemWithGroupKey(TObject item, TGroupKey group, Optional previousGroup) : IEquatable + private sealed class ItemWithGroupKey(TObject item, TGroupKey group, Kernel.Optional previousGroup) : IEquatable { public TGroupKey Group { get; set; } = group; public TObject Item { get; } = item; - public Optional PreviousGroup { get; } = previousGroup; + public Kernel.Optional PreviousGroup { get; } = previousGroup; /// Returns a value that indicates whether the values of two objects are equal. /// The first value to compare. diff --git a/src/DynamicData/List/Internal/GroupOnImmutable.cs b/src/DynamicData/List/Internal/GroupOnImmutable.cs index 26fbd357a..0fcfffd1a 100644 --- a/src/DynamicData/List/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/List/Internal/GroupOnImmutable.cs @@ -253,13 +253,13 @@ private sealed class GroupContainer(TGroupKey key) public IList List { get; } = new List(); } - private sealed class ItemWithGroupKey(TObject item, TGroupKey group, Optional previousGroup) : IEquatable + private sealed class ItemWithGroupKey(TObject item, TGroupKey group, Kernel.Optional previousGroup) : IEquatable { public TGroupKey Group { get; set; } = group; public TObject Item { get; } = item; - public Optional PreviousGroup { get; } = previousGroup; + public Kernel.Optional PreviousGroup { get; } = previousGroup; public static bool operator ==(ItemWithGroupKey left, ItemWithGroupKey right) => Equals(left, right); diff --git a/src/DynamicData/List/Internal/MergeMany.cs b/src/DynamicData/List/Internal/MergeMany.cs index 875e54be4..04f78f86b 100644 --- a/src/DynamicData/List/Internal/MergeMany.cs +++ b/src/DynamicData/List/Internal/MergeMany.cs @@ -29,10 +29,10 @@ public IObservable Run() => Observable.Create( private sealed class SubscriptionCounter : IDisposable { - private readonly Subject> _subject = new(); + private readonly Signal> _subject = new(); private int _subscriptionCount = 1; - public IObservable> DeferCleanup => Observable.Defer(() => + public IObservable> DeferCleanup => Signal.Lazy(() => { CheckCompleted(); return _subject.AsObservable(); diff --git a/src/DynamicData/List/Internal/ToObservableChangeSet.cs b/src/DynamicData/List/Internal/ToObservableChangeSet.cs index 93d6d0596..c335b2393 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -59,11 +59,7 @@ private sealed class Subscription private readonly int _limitSizeTo; private readonly IScheduler _scheduler; private readonly IDisposable _sourceSubscription; - #if NET9_0_OR_GREATER private readonly Lock _synchronizationGate; - #else - private readonly object _synchronizationGate; - #endif private bool _hasInitialized; private bool _hasSourceCompleted; @@ -342,7 +338,7 @@ private void TryPublishDownstreamChanges() private readonly struct ScheduledExpiration { - public required SingleAssignmentDisposable Cancellation { get; init; } + public required OnceDisposable Cancellation { get; init; } public required Expiration Expiration { get; init; } } diff --git a/src/DynamicData/List/Internal/TransformMany.cs b/src/DynamicData/List/Internal/TransformMany.cs index 4f2f86138..42bf6d889 100644 --- a/src/DynamicData/List/Internal/TransformMany.cs +++ b/src/DynamicData/List/Internal/TransformMany.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.Collections.ObjectModel; - using DynamicData.Binding; namespace DynamicData.List.Internal; @@ -20,7 +18,7 @@ public TransformMany(IObservable> source, Func Observable.Defer( + t => Signal.Lazy( () => { var subsequentChanges = manySelector(t).ToObservableChangeSet(); @@ -40,7 +38,7 @@ public TransformMany(IObservable> source, Func Observable.Defer( + t => Signal.Lazy( () => { var subsequentChanges = manySelector(t).ToObservableChangeSet(); @@ -60,7 +58,7 @@ public TransformMany(IObservable> source, Func new ManySelectorFunc(s, x => manySelector(x).Items), equalityComparer, - t => Observable.Defer( + t => Signal.Lazy( () => { var subsequentChanges = manySelector(t).Connect(); diff --git a/src/DynamicData/List/SourceList.cs b/src/DynamicData/List/SourceList.cs index 67339be44..6b0e64f6e 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.cs @@ -17,19 +17,15 @@ namespace DynamicData; public sealed class SourceList : ISourceList where T : notnull { - private readonly Subject> _changes = new(); + private readonly Signal> _changes = new(); - private readonly Subject> _changesPreview = new(); + private readonly Signal> _changesPreview = new(); private readonly IDisposable _cleanUp; - private readonly Lazy> _countChanged = new(() => new Subject()); + private readonly Lazy> _countChanged = new(() => new Signal()); -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif private readonly ReaderWriter _readerWriter = new(); From 1b069ebf332b98f00c244cb188948219c940ebda Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sat, 20 Jun 2026 09:50:57 +0100 Subject: [PATCH 06/36] Refactor ReactiveUI primitives and use Lock Clean up ReactiveUI primitives usage across the repo: remove redundant ReactiveUI.Primitives.Signals usings from benchmark/list files, add ReactiveUI.Primitives and disposable aliases to project files, and replace MultipleDisposable references with the CompositeDisposable alias. Switch TransformMany's synchronization lock from a plain object to a Lock instance. Also simplify a CreateTask call (remove explicit generic), adjust doc comments to reference Signal.OnNext, and apply minor csproj formatting/using updates to expose required ReactiveUI primitives and disposable aliases. --- .../Cache/ExpireAfter_Cache_ForStream.cs | 1 - .../Cache/FilterImmutable.cs | 1 - .../Cache/Filter_Cache_WithPredicateState.cs | 1 - .../Cache/SortAndBindChange.cs | 2 - .../Cache/SortAndBindInitial.cs | 2 - .../Cache/StatelessFiltering.cs | 1 - .../Cache/StatelessTransforming.cs | 1 - .../Cache/ToObservableChangeSet_Cache.cs | 1 - .../Cache/TransformImmutable.cs | 1 - .../DynamicData.Benchmarks.csproj | 61 ++++++++++--------- ...lter_List_Static_RandomizedBoundedEdits.cs | 1 - ...er_List_Static_RandomizedUnboundedEdits.cs | 1 - .../List/Filter_List_WithPredicateState.cs | 1 - .../List/ToObservableChangeSet_List.cs | 1 - .../Binding/WhenPropertyChangedRaceFixture.cs | 2 +- .../Cache/CrossCacheDeadlockStressTest.cs | 2 +- .../DynamicData.Tests.csproj | 1 + .../List/CreationFixtures.cs | 2 +- .../Binding/ObservablePropertyFactory.cs | 4 +- src/DynamicData/DynamicData.csproj | 2 + .../List/Internal/TransformMany.cs | 2 +- 21 files changed, 41 insertions(+), 50 deletions(-) diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs index 8e9888614..125ab48d2 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs @@ -3,7 +3,6 @@ using BenchmarkDotNet.Attributes; using Bogus; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs index 9fd993d3f..d264c0b5d 100644 --- a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs @@ -1,5 +1,4 @@ using BenchmarkDotNet.Attributes; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs index 9af07b9ff..e032853ae 100644 --- a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs @@ -3,7 +3,6 @@ using BenchmarkDotNet.Attributes; using Bogus; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs index 7ddb4445e..52a0a9eda 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs @@ -1,7 +1,5 @@ using BenchmarkDotNet.Attributes; using DynamicData.Binding; -using ReactiveUI.Primitives.Disposables; -using ReactiveUI.Primitives.Signals; using System.Collections.ObjectModel; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs index 038cc1ce4..358b73e62 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs @@ -1,7 +1,5 @@ using BenchmarkDotNet.Attributes; using DynamicData.Binding; -using ReactiveUI.Primitives.Disposables; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs index 6d0eb19ce..050465648 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs @@ -1,5 +1,4 @@ using BenchmarkDotNet.Attributes; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs index 5f40c356c..c0814bacd 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs @@ -1,5 +1,4 @@ using BenchmarkDotNet.Attributes; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs index 9653f6709..3a1fa4e1c 100644 --- a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs @@ -1,6 +1,5 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs index 3610a25fe..4239419e7 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs @@ -1,5 +1,4 @@ using BenchmarkDotNet.Attributes; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj index 753e591a6..ff45308a1 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -1,34 +1,37 @@  - - Exe - net10.0 - AnyCPU - false - ;1591;1701;1702;1705;CA1822;CA1001 - + + Exe + net10.0 + AnyCPU + false + ;1591;1701;1702;1705;CA1822;CA1001 + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs index c028238b5..3239b40cf 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs @@ -3,7 +3,6 @@ using BenchmarkDotNet.Attributes; using Bogus; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.List; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs index 7bc9f5965..c086c11d3 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs @@ -3,7 +3,6 @@ using BenchmarkDotNet.Attributes; using Bogus; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.List; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs index 25dbedc8b..2bce4940d 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs @@ -3,7 +3,6 @@ using BenchmarkDotNet.Attributes; using Bogus; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.List; diff --git a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs index 99a3f508a..de61f0c28 100644 --- a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs +++ b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs @@ -1,6 +1,5 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; -using ReactiveUI.Primitives.Signals; namespace DynamicData.Benchmarks.List; diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs index 6bc85c5e0..499cb0374 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs @@ -13,7 +13,7 @@ namespace DynamicData.Tests.Binding; /// /// Multi-threaded race tests for . /// Each test forces concurrency between the operator's subscribe call (or chain re-walk) and one or more -/// notifiers firing on other threads. +/// notifiers firing on other threads. /// public sealed class WhenPropertyChangedRaceFixture { diff --git a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs index 96c162c33..e448dd3d5 100644 --- a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs +++ b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs @@ -218,7 +218,7 @@ public async Task AllOperators_CrossCache_NoDeadlock_CorrectResults() // ── Completion tracking ───────────────────────────────────── var completionTasks = new List(); var completionNames = new List(); - using var subs = new MultipleDisposable(); + using var subs = new CompositeDisposable(); // Helpers IObservableCache TrackCache(IObservable> pipeline, [System.Runtime.CompilerServices.CallerArgumentExpression(nameof(pipeline))] string? name = null) diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index 779d5a59c..b1036fb6b 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -32,6 +32,7 @@ + diff --git a/src/DynamicData.Tests/List/CreationFixtures.cs b/src/DynamicData.Tests/List/CreationFixtures.cs index 59a50ed02..11f9b86c0 100644 --- a/src/DynamicData.Tests/List/CreationFixtures.cs +++ b/src/DynamicData.Tests/List/CreationFixtures.cs @@ -13,7 +13,7 @@ public void Create() ObservableChangeSet.Create( async list => { - var value = await CreateTask(10); + var value = await CreateTask(10); list.Add(value); return () => { }; })); diff --git a/src/DynamicData/Binding/ObservablePropertyFactory.cs b/src/DynamicData/Binding/ObservablePropertyFactory.cs index 1703e761d..b1660f0c1 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactory.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactory.cs @@ -86,7 +86,7 @@ private void OnPropertyChanged(object? sender, PropertyChangedEventArgs args) // user code and may throw; that exception routes to OnError. The downstream OnNext call // is NOT wrapped: per the Rx contract, if the user observer throws, the exception // propagates back to whoever invoked the PropertyChanged setter, matching what a plain - // Subject.OnNext would do. + // Signal.OnNext would do. private void EmitCurrent() { PropertyValue value; @@ -204,7 +204,7 @@ private void ProcessSignal(int level) // Drainer thread. The chain walk (Invoker / notifier Factory / ReadCurrent's accessor) // is user code and may throw; those exceptions route to OnError. The downstream // OnNext call is NOT wrapped: per the Rx contract, if the user observer throws, the - // exception propagates back through the drainer, matching what a plain Subject + // exception propagates back through the drainer, matching what a plain Signal // would do. // // The two cases (initial setup vs level-fire) collapse to: diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index a06b7d01b..35d365e31 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -30,6 +30,8 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int + + diff --git a/src/DynamicData/List/Internal/TransformMany.cs b/src/DynamicData/List/Internal/TransformMany.cs index 42bf6d889..406b389ba 100644 --- a/src/DynamicData/List/Internal/TransformMany.cs +++ b/src/DynamicData/List/Internal/TransformMany.cs @@ -117,7 +117,7 @@ private IObservable> CreateWithChangeSet() return new ManyContainer(collection, changes); }).Publish(); - var outerLock = new object(); + var outerLock = new Lock(); var initial = transformed.Synchronize(outerLock).Select(changes => new ChangeSet(new DestinationEnumerator(changes, _equalityComparer))); var subsequent = transformed.MergeMany(x => x.Changes).Synchronize(outerLock); From 01162697896b235828651506bd2dc7c70cf4e1f8 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sat, 20 Jun 2026 12:33:03 +0100 Subject: [PATCH 07/36] Remove unused ReactiveUI.Primitives usings Clean up: remove unused ReactiveUI.Primitives using directives across several files and simplify a CombineLatest call by dropping explicit named parameters. Affected files: GroupOn.cs, TreeBuilder.cs, TrueFor.cs (removed named args for CombineLatest), Watcher.cs, and DynamicCombiner.cs. This reduces compiler warnings and tidies up the code. --- src/DynamicData/Cache/Internal/GroupOn.cs | 2 -- src/DynamicData/Cache/Internal/TreeBuilder.cs | 2 -- src/DynamicData/Cache/Internal/TrueFor.cs | 4 ++-- src/DynamicData/Experimental/Watcher.cs | 2 -- src/DynamicData/List/Internal/DynamicCombiner.cs | 1 - 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/DynamicData/Cache/Internal/GroupOn.cs b/src/DynamicData/Cache/Internal/GroupOn.cs index 13305287c..1c5675482 100644 --- a/src/DynamicData/Cache/Internal/GroupOn.cs +++ b/src/DynamicData/Cache/Internal/GroupOn.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using ReactiveUI.Primitives; - namespace DynamicData.Cache.Internal; internal sealed class GroupOn(IObservable> source, Func groupSelectorKey, IObservable? regrouper) diff --git a/src/DynamicData/Cache/Internal/TreeBuilder.cs b/src/DynamicData/Cache/Internal/TreeBuilder.cs index be1c78c0b..31d0426eb 100644 --- a/src/DynamicData/Cache/Internal/TreeBuilder.cs +++ b/src/DynamicData/Cache/Internal/TreeBuilder.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using ReactiveUI.Primitives; - namespace DynamicData.Cache.Internal; internal sealed class TreeBuilder(IObservable> source, Func pivotOn, IObservable, bool>>? predicateChanged) diff --git a/src/DynamicData/Cache/Internal/TrueFor.cs b/src/DynamicData/Cache/Internal/TrueFor.cs index e544dc2b7..abaa58f63 100644 --- a/src/DynamicData/Cache/Internal/TrueFor.cs +++ b/src/DynamicData/Cache/Internal/TrueFor.cs @@ -25,9 +25,9 @@ public IObservable Run() .Publish(); var subscription = itemsWithValues.MergeMany(item => item.Observable).CombineLatest( - second: itemsWithValues.ToCollection(), + itemsWithValues.ToCollection(), // We don't need to actually look at the changed values, we just need them as a trigger to re-evaluate the matcher method. - resultSelector: (_, itemsWithValues) => _collectionMatcher.Invoke(itemsWithValues)) + (_, itemsWithValues) => _collectionMatcher.Invoke(itemsWithValues)) .DistinctUntilChanged() .SubscribeSafe(observer); diff --git a/src/DynamicData/Experimental/Watcher.cs b/src/DynamicData/Experimental/Watcher.cs index 25ea7e7c5..8ab646c97 100644 --- a/src/DynamicData/Experimental/Watcher.cs +++ b/src/DynamicData/Experimental/Watcher.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using ReactiveUI.Primitives; - namespace DynamicData.Experimental; internal sealed class Watcher : IWatcher diff --git a/src/DynamicData/List/Internal/DynamicCombiner.cs b/src/DynamicData/List/Internal/DynamicCombiner.cs index ea2eb0f59..efa5e1d34 100644 --- a/src/DynamicData/List/Internal/DynamicCombiner.cs +++ b/src/DynamicData/List/Internal/DynamicCombiner.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using DynamicData.Cache.Internal; -using ReactiveUI.Primitives; namespace DynamicData.List.Internal; From 2b4739828d4f2052c45b88e2ba946f0768e32f46 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sat, 20 Jun 2026 17:28:31 +0100 Subject: [PATCH 08/36] Remove ReactiveCompatibility layer Delete the large ReactiveCompatibility compatibility layer and related Optional type, and update internals to reflect the removal. Multiple kernel and list implementation files (OptionExtensions, OptionObservableExtensions, InternalEx, Change/ChangeAwareList/Transform/Transformer/UnifiedChange/ItemChange/ListEx/ObservableListEx and group/transform internals) plus net45 platform shims (PFilter/PTransform) and tests were modified to adapt to the change. This removes the old Rx compatibility surface in favor of the updated ReactiveUI/primitive APIs and simplifies the codebase. --- .../Internal/ReactiveCompatibility.cs | 3006 ----------------- src/DynamicData/Kernel/InternalEx.cs | 3 + src/DynamicData/Kernel/OptionExtensions.cs | 10 +- .../Kernel/OptionObservableExtensions.cs | 4 +- src/DynamicData/Kernel/Optional.cs | 197 -- src/DynamicData/List/Change.cs | 6 +- src/DynamicData/List/ChangeAwareList.cs | 4 +- src/DynamicData/List/Internal/GroupOn.cs | 4 +- .../List/Internal/GroupOnImmutable.cs | 4 +- .../List/Internal/TransformAsync.cs | 16 +- src/DynamicData/List/Internal/Transformer.cs | 16 +- .../List/Internal/UnifiedChange.cs | 6 +- src/DynamicData/List/ItemChange.cs | 6 +- src/DynamicData/List/ListEx.cs | 6 +- .../List/ObservableListEx.StartWithEmpty.cs | 7 +- .../List/ObservableListEx.Transform.cs | 4 +- .../List/ObservableListEx.TransformAsync.cs | 4 +- .../List/Tests/ChangeSetAggregator.cs | 2 + src/DynamicData/Platforms/net45/PFilter.cs | 2 +- src/DynamicData/Platforms/net45/PTransform.cs | 6 +- 20 files changed, 60 insertions(+), 3253 deletions(-) delete mode 100644 src/DynamicData/Internal/ReactiveCompatibility.cs delete mode 100644 src/DynamicData/Kernel/Optional.cs diff --git a/src/DynamicData/Internal/ReactiveCompatibility.cs b/src/DynamicData/Internal/ReactiveCompatibility.cs deleted file mode 100644 index 31ca7c3bb..000000000 --- a/src/DynamicData/Internal/ReactiveCompatibility.cs +++ /dev/null @@ -1,3006 +0,0 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -using System.Runtime.ExceptionServices; - -namespace DynamicData.Internal; - -/// -/// Compatibility helpers for the subset of Rx APIs used internally by DynamicData. -/// -internal static class ReactiveCompatibility; - -/// -/// Creates disposable instances compatible with the old Rx helper surface. -/// -internal static class Disposable -{ - /// - /// Gets a disposable that does nothing when disposed. - /// - public static IDisposable Empty { get; } = ReactiveUI.Primitives.Disposables.EmptyDisposable.Instance; - - /// - /// Creates a disposable that invokes the supplied action once. - /// - /// The action to invoke. - /// A disposable wrapper. - public static IDisposable Create(Action dispose) => ReactiveUI.Primitives.Disposables.Scope.Create(dispose); - - /// - /// Creates a disposable that invokes the supplied action once with state. - /// - /// The state type. - /// The state passed to the action. - /// The action to invoke. - /// A disposable wrapper. - public static IDisposable Create(TState state, Action dispose) => - ReactiveUI.Primitives.Disposables.Scope.Create(() => dispose(state)); -} - -/// -/// Scheduler aliases compatible with the old Rx static helper surface. -/// -internal static class Scheduler -{ - /// - /// Gets the default sequencer. - /// - public static IScheduler Default => Sequencer.Default; - - /// - /// Normalizes negative due times to zero. - /// - public static TimeSpan Normalize(TimeSpan dueTime) => Sequencer.Normalize(dueTime); -} - -/// -/// A mutable collection of disposables disposed as a group. -/// -internal sealed class CompositeDisposable : ReactiveUI.Primitives.Disposables.MultipleDisposable -{ - /// - /// Initializes a new instance of the class. - /// - public CompositeDisposable() - { - } - - /// - /// Initializes a new instance of the class. - /// - /// Initial disposables. - public CompositeDisposable(params IDisposable[] disposables) - { - foreach (var disposable in disposables) - { - Add(disposable); - } - } -} - -/// -/// A disposable whose inner disposable can be assigned once. -/// -internal sealed class SingleAssignmentDisposable : IDisposable -{ - private readonly object _locker = new(); - private IDisposable? _disposable; - private bool _disposed; - private bool _assigned; - - /// - /// Gets a value indicating whether this instance has been disposed. - /// - public bool IsDisposed - { - get - { - lock (_locker) - { - return _disposed; - } - } - } - - /// - /// Gets or sets the assigned disposable. - /// - public IDisposable? Disposable - { - get - { - lock (_locker) - { - return _disposable; - } - } - - set - { - IDisposable? toDispose = null; - lock (_locker) - { - if (_assigned) - { - throw new InvalidOperationException("Disposable has already been assigned."); - } - - _assigned = true; - if (_disposed) - { - toDispose = value; - } - else - { - _disposable = value; - } - } - - toDispose?.Dispose(); - } - } - - /// - public void Dispose() - { - IDisposable? toDispose = null; - lock (_locker) - { - if (_disposed) - { - return; - } - - _disposed = true; - toDispose = _disposable; - _disposable = null; - } - - toDispose?.Dispose(); - } -} - -/// -/// A disposable whose inner disposable can be replaced. -/// -internal sealed class SerialDisposable : IDisposable -{ - private readonly object _locker = new(); - private IDisposable? _disposable; - private bool _disposed; - - /// - /// Gets a value indicating whether this instance has been disposed. - /// - public bool IsDisposed - { - get - { - lock (_locker) - { - return _disposed; - } - } - } - - /// - /// Gets or sets the current disposable, disposing the previous value on replacement. - /// - public IDisposable? Disposable - { - get - { - lock (_locker) - { - return _disposable; - } - } - - set - { - IDisposable? previous; - lock (_locker) - { - if (_disposed) - { - previous = value; - value = null; - } - else - { - previous = _disposable; - _disposable = value; - } - } - - previous?.Dispose(); - } - } - - /// - public void Dispose() - { - IDisposable? toDispose = null; - lock (_locker) - { - if (_disposed) - { - return; - } - - _disposed = true; - toDispose = _disposable; - _disposable = null; - } - - toDispose?.Dispose(); - } -} - -/// -/// Represents a subject that is both an observer and observable. -/// -/// The element type. -internal interface ISubject : IObservable, IObserver -{ - /// - /// Gets a value indicating whether the subject currently has observers. - /// - bool HasObservers { get; } - - /// - /// Gets a value indicating whether the subject has been disposed. - /// - bool IsDisposed { get; } -} - -/// -/// A multicast subject. -/// -/// The element type. -internal sealed class Subject : ISubject, IDisposable -{ - private readonly object _locker = new(); - private readonly List> _observers = []; - private Exception? _error; - private bool _completed; - private bool _disposed; - - /// - public bool HasObservers - { - get - { - lock (_locker) - { - return _observers.Count != 0; - } - } - } - - /// - public bool IsDisposed - { - get - { - lock (_locker) - { - return _disposed; - } - } - } - - /// - public void Dispose() - { - lock (_locker) - { - _disposed = true; - _observers.Clear(); - } - } - - /// - public void OnCompleted() - { - IObserver[] observers; - lock (_locker) - { - if (_disposed || _completed || _error is not null) - { - return; - } - - _completed = true; - observers = [.. _observers]; - _observers.Clear(); - } - - foreach (var observer in observers) - { - observer.OnCompleted(); - } - } - - /// - public void OnError(Exception error) - { - IObserver[] observers; - lock (_locker) - { - if (_disposed || _completed || _error is not null) - { - return; - } - - _error = error; - observers = [.. _observers]; - _observers.Clear(); - } - - foreach (var observer in observers) - { - observer.OnError(error); - } - } - - /// - public void OnNext(T value) - { - IObserver[] observers; - lock (_locker) - { - if (_disposed || _completed || _error is not null) - { - return; - } - - observers = [.. _observers]; - } - - foreach (var observer in observers) - { - observer.OnNext(value); - } - } - - /// - public IDisposable Subscribe(IObserver observer) - { - lock (_locker) - { - if (_error is not null) - { - observer.OnError(_error); - return Disposable.Empty; - } - - if (_completed) - { - observer.OnCompleted(); - return Disposable.Empty; - } - - if (_disposed) - { - observer.OnCompleted(); - return Disposable.Empty; - } - - _observers.Add(observer); - } - - return Disposable.Create(() => - { - lock (_locker) - { - _observers.Remove(observer); - } - }); - } -} - -/// -/// A subject that replays its most recent value. -/// -/// The element type. -internal sealed class BehaviorSubject : ISubject, IDisposable -{ - private readonly BehaviorSignal _signal; - - /// - /// Initializes a new instance of the class. - /// - /// The initial value. - public BehaviorSubject(T value) => _signal = new(value); - - /// - /// Gets the current value. - /// - public T Value => _signal.Value; - - /// - public bool HasObservers => _signal.HasObservers; - - /// - public bool IsDisposed => _signal.IsDisposed; - - /// - public void Dispose() => _signal.Dispose(); - - /// - public void OnCompleted() => _signal.OnCompleted(); - - /// - public void OnError(Exception error) => _signal.OnError(error); - - /// - public void OnNext(T value) => _signal.OnNext(value); - - /// - public IDisposable Subscribe(IObserver observer) => _signal.Subscribe(observer); -} - -/// -/// A subject that replays buffered values to new subscribers. -/// -/// The element type. -internal sealed class ReplaySubject : ISubject, IDisposable -{ - private readonly object _locker = new(); - private readonly List _values = []; - private readonly List> _observers = []; - private readonly int? _bufferSize; - private Exception? _error; - private bool _completed; - private bool _disposed; - - /// - /// Initializes a new instance of the class. - /// - public ReplaySubject() - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The maximum number of values to replay. - public ReplaySubject(int bufferSize) - { - if (bufferSize < 0) - { - throw new ArgumentOutOfRangeException(nameof(bufferSize)); - } - - _bufferSize = bufferSize; - } - - /// - public bool HasObservers - { - get - { - lock (_locker) - { - return _observers.Count != 0; - } - } - } - - /// - public bool IsDisposed - { - get - { - lock (_locker) - { - return _disposed; - } - } - } - - /// - public void Dispose() - { - lock (_locker) - { - _disposed = true; - _observers.Clear(); - _values.Clear(); - } - } - - /// - public void OnCompleted() - { - IObserver[] observers; - lock (_locker) - { - ThrowIfDisposed(); - if (_completed || _error is not null) - { - return; - } - - _completed = true; - observers = [.. _observers]; - _observers.Clear(); - } - - foreach (var observer in observers) - { - observer.OnCompleted(); - } - } - - /// - public void OnError(Exception error) - { - if (error is null) - { - throw new ArgumentNullException(nameof(error)); - } - - IObserver[] observers; - lock (_locker) - { - ThrowIfDisposed(); - if (_completed || _error is not null) - { - return; - } - - _error = error; - observers = [.. _observers]; - _observers.Clear(); - } - - foreach (var observer in observers) - { - observer.OnError(error); - } - } - - /// - public void OnNext(T value) - { - IObserver[] observers; - lock (_locker) - { - ThrowIfDisposed(); - if (_completed || _error is not null) - { - return; - } - - _values.Add(value); - if (_bufferSize is { } bufferSize) - { - while (_values.Count > bufferSize) - { - _values.RemoveAt(0); - } - } - - observers = [.. _observers]; - } - - foreach (var observer in observers) - { - observer.OnNext(value); - } - } - - /// - public IDisposable Subscribe(IObserver observer) - { - if (observer is null) - { - throw new ArgumentNullException(nameof(observer)); - } - - T[] values; - Exception? error; - var completed = false; - - lock (_locker) - { - ThrowIfDisposed(); - values = [.. _values]; - error = _error; - completed = _completed; - if (error is null && !completed) - { - _observers.Add(observer); - } - } - - foreach (var value in values) - { - observer.OnNext(value); - } - - if (error is not null) - { - observer.OnError(error); - return Disposable.Empty; - } - - if (completed) - { - observer.OnCompleted(); - return Disposable.Empty; - } - - return Disposable.Create(() => - { - lock (_locker) - { - _observers.Remove(observer); - } - }); - } - - private void ThrowIfDisposed() - { - if (_disposed) - { - throw new ObjectDisposedException(GetType().FullName); - } - } -} - -/// -/// Factory methods compatible with the subset of the old Rx Observable surface used internally. -/// -internal static class Observable -{ - /// - /// Creates an observable from a subscribe function. - /// - public static IObservable Create(Func, IDisposable> subscribe) => - new AnonymousObservable(subscribe); - - /// - /// Creates an observable from an asynchronous subscribe function. - /// - public static IObservable Create(Func, Task> subscribe) => - Create(observer => - { - var subscription = new SerialDisposable(); - try - { - var task = subscribe(observer); - if (task.Status == TaskStatus.RanToCompletion) - { - subscription.Disposable = task.Result; - } - else - { - _ = AwaitSubscription(task, observer, subscription); - } - } - catch (Exception error) - { - observer.OnError(error); - } - - return subscription; - }); - - /// - /// Creates an observable from an asynchronous subscribe function. - /// - public static IObservable Create(Func, CancellationToken, Task> subscribe) => - Create(observer => - { - var cancellation = new CancellationTokenSource(); - var subscription = new CompositeDisposable(cancellation); - try - { - var task = subscribe(observer, cancellation.Token); - if (task.Status == TaskStatus.RanToCompletion) - { - subscription.Add(task.Result); - } - else - { - _ = AwaitSubscription(task, observer, subscription, cancellation.Token); - } - } - catch (Exception error) - { - if (!cancellation.IsCancellationRequested) - { - observer.OnError(error); - } - } - - return subscription; - }); - - /// - /// Defers observable creation until subscription. - /// - public static IObservable Defer(Func> factory) => - ReactiveUI.Primitives.Signals.Signal.Lazy(factory); - - /// - /// Defers asynchronous value creation until subscription. - /// - public static IObservable Defer(Func> factory) => FromAsync(factory); - - /// - /// Defers asynchronous observable creation until subscription. - /// - public static IObservable Defer(Func>> factory) => - FromAsync(factory).Switch(); - - /// - /// Creates an observable that completes immediately. - /// - public static IObservable Empty() => ReactiveUI.Primitives.Signals.Signal.None(); - - /// - /// Creates an observable that never completes. - /// - public static IObservable Never() => Create(_ => Disposable.Empty); - - /// - /// Creates an observable that emits a single value. - /// - public static IObservable Return(T value) => ReactiveUI.Primitives.Signals.Signal.Emit(value); - - /// - /// Creates an observable that terminates with an error. - /// - public static IObservable Throw(Exception error) => ReactiveUI.Primitives.Signals.Signal.Fail(error); - - /// - /// Creates an observable range. - /// - public static IObservable Range(int start, int count) => ReactiveUI.Primitives.Signals.Signal.Sequence(start, count); - - /// - /// Creates an observable range on a sequencer. - /// - public static IObservable Range(int start, int count, IScheduler scheduler) => - Enumerable.Range(start, count).ToObservable(scheduler); - - /// - /// Creates an observable from an asynchronous value factory. - /// - public static IObservable FromAsync(Func> taskFactory) => - Observable.Create(observer => - { - try - { - return taskFactory().ToObservable().Subscribe(observer); - } - catch (Exception error) - { - observer.OnError(error); - return Disposable.Empty; - } - }); - - /// - /// Creates an observable from an asynchronous value factory. - /// - public static IObservable FromAsync(Func> taskFactory) => - Observable.Create(observer => - { - var cancellation = new CancellationTokenSource(); - var subscription = new SerialDisposable(); - - try - { - subscription.Disposable = taskFactory(cancellation.Token).ToObservable().Subscribe(observer); - } - catch (Exception error) - { - observer.OnError(error); - } - - return Disposable.Create(() => - { - cancellation.Cancel(); - cancellation.Dispose(); - subscription.Dispose(); - }); - }); - - /// - /// Creates an observable from an asynchronous action factory. - /// - public static IObservable FromAsync(Func taskFactory) => - FromAsync(async () => - { - await taskFactory().ConfigureAwait(false); - return Unit.Default; - }); - - /// - /// Creates a timer observable. - /// - public static IObservable Timer(TimeSpan dueTime) => ReactiveUI.Primitives.Signals.Signal.After(dueTime); - - /// - /// Creates a timer observable. - /// - public static IObservable Timer(TimeSpan dueTime, IScheduler scheduler) => - ReactiveUI.Primitives.Signals.Signal.After(dueTime, scheduler); - - /// - /// Creates a timer observable. - /// - public static IObservable Timer(TimeSpan dueTime, TimeSpan period, IScheduler scheduler) => - ReactiveUI.Primitives.Signals.Signal.After(dueTime, period, scheduler); - - /// - /// Creates an observable that emits a sequential value at each interval. - /// - public static IObservable Interval(TimeSpan period) => - ReactiveUI.Primitives.Signals.Signal.Every(period); - - /// - /// Creates an observable that emits a sequential value at each interval. - /// - public static IObservable Interval(TimeSpan period, IScheduler scheduler) => - ReactiveUI.Primitives.Signals.Signal.Every(period, scheduler); - - /// - /// Merges observable sources. - /// - public static IObservable Merge(params IObservable[] sources) => sources.Merge(); - - /// - /// Merges observable sources. - /// - public static IObservable Merge(IEnumerable> sources) => sources.Merge(); - - /// - /// Concatenates observable sources. - /// - public static IObservable Concat(params IObservable[] sources) => sources.ToObservable().Concat(); - - /// - /// Concatenates observable sources. - /// - public static IObservable Concat(IEnumerable> sources) => sources.ToObservable().Concat(); - - /// - /// Switches to the latest inner observable. - /// - public static IObservable Switch(IObservable> source) => source.Switch(); - - /// - /// Projects values to enumerable sequences. - /// - public static IObservable SelectMany( - IObservable source, - Func> selector) => - source.SelectMany(selector); - - /// - /// Converts an event into event-pattern values. - /// - public static IObservable> FromEventPattern( - Action addHandler, - Action removeHandler) - where TEventHandler : Delegate - where TEventArgs : EventArgs => - Create>(observer => - { - if (addHandler is null) - { - throw new ArgumentNullException(nameof(addHandler)); - } - - if (removeHandler is null) - { - throw new ArgumentNullException(nameof(removeHandler)); - } - - void Handler(object? sender, TEventArgs eventArgs) => - observer.OnNext(new EventPattern(sender, eventArgs)); - - Action action = Handler; - var handler = (TEventHandler)Delegate.CreateDelegate(typeof(TEventHandler), action.Target, action.Method); - addHandler(handler); - return Disposable.Create(handler, removeHandler); - }); - - private static async Task AwaitSubscription( - Task task, - IObserver observer, - SerialDisposable subscription) - { - try - { - subscription.Disposable = await task.ConfigureAwait(false); - } - catch (Exception error) - { - observer.OnError(error); - } - } - - private static async Task AwaitSubscription( - Task task, - IObserver observer, - CompositeDisposable subscription, - CancellationToken cancellationToken) - { - try - { - subscription.Add(await task.ConfigureAwait(false)); - } - catch (Exception error) - { - if (!cancellationToken.IsCancellationRequested) - { - observer.OnError(error); - } - } - } -} - -/// -/// Observer factory helpers. -/// -internal static class Observer -{ - /// - /// Creates an observer from callbacks. - /// - public static IObserver Create(Action onNext) => - new AnonymousObserver(onNext, Throw, static () => { }); - - /// - /// Creates an observer from callbacks. - /// - public static IObserver Create(Action onNext, Action onError) => - new AnonymousObserver(onNext, onError, static () => { }); - - /// - /// Creates an observer from callbacks. - /// - public static IObserver Create(Action onNext, Action onCompleted) => - new AnonymousObserver(onNext, Throw, onCompleted); - - /// - /// Creates an observer from callbacks. - /// - public static IObserver Create(Action onNext, Action onError, Action onCompleted) => - new AnonymousObserver(onNext, onError, onCompleted); - - private static void Throw(Exception error) => ExceptionDispatchInfo.Capture(error).Throw(); -} - -/// -/// Observer implementation backed by delegates. -/// -/// The element type. -internal sealed class AnonymousObserver : IObserver -{ - private readonly Action _onNext; - private readonly Action _onError; - private readonly Action _onCompleted; - - /// - /// Initializes a new instance of the class. - /// - public AnonymousObserver(Action onNext, Action onError, Action onCompleted) - { - _onNext = onNext; - _onError = onError; - _onCompleted = onCompleted; - } - - /// - public void OnCompleted() => _onCompleted(); - - /// - public void OnError(Exception error) => _onError(error); - - /// - public void OnNext(T value) => _onNext(value); -} - -/// -/// Observable implementation backed by a subscribe delegate. -/// -/// The element type. -internal sealed class AnonymousObservable : IObservable -{ - private readonly Func, IDisposable> _subscribe; - - /// - /// Initializes a new instance of the class. - /// - public AnonymousObservable(Func, IDisposable> subscribe) => _subscribe = subscribe; - - /// - public IDisposable Subscribe(IObserver observer) - { - try - { - return _subscribe(observer) ?? Disposable.Empty; - } - catch (Exception error) - { - observer.OnError(error); - return Disposable.Empty; - } - } -} - -/// -/// Rx-style extension methods used by DynamicData internals. -/// -internal static class ObservableCompatibilityExtensions -{ - /// - /// Subscribes with no value handler. - /// - public static IDisposable Subscribe(this IObservable source) => - source.Subscribe(Observer.Create(static _ => { })); - - /// - /// Subscribes with a value handler. - /// - public static IDisposable Subscribe(this IObservable source, Action onNext) => - source.Subscribe(Observer.Create(onNext)); - - /// - /// Subscribes with value and error handlers. - /// - public static IDisposable Subscribe(this IObservable source, Action onNext, Action onError) => - source.Subscribe(Observer.Create(onNext, onError)); - - /// - /// Subscribes with value and completion handlers. - /// - public static IDisposable Subscribe(this IObservable source, Action onNext, Action onCompleted) => - source.Subscribe(Observer.Create(onNext, onCompleted)); - - /// - /// Subscribes with value, error, and completion handlers. - /// - public static IDisposable Subscribe(this IObservable source, Action onNext, Action onError, Action onCompleted) => - source.Subscribe(Observer.Create(onNext, onError, onCompleted)); - - /// - /// Subscribes an observer to the source. - /// - public static IDisposable SubscribeSafe(this IObservable source, IObserver observer) - { - var subscription = new SerialDisposable(); - var stopped = 0; - - void StopWithError(Exception error) - { - if (Interlocked.Exchange(ref stopped, 1) == 0) - { - try - { - observer.OnError(error); - } - finally - { - subscription.Dispose(); - } - } - } - - subscription.Disposable = source.Subscribe( - value => - { - if (Volatile.Read(ref stopped) != 0) - { - return; - } - - try - { - observer.OnNext(value); - } - catch (Exception error) - { - StopWithError(error); - } - }, - error => - { - StopWithError(error); - }, - () => - { - if (Interlocked.Exchange(ref stopped, 1) == 0) - { - try - { - observer.OnCompleted(); - } - finally - { - subscription.Dispose(); - } - } - }); - - return subscription; - } - - /// - /// Hides the identity of an observable. - /// - public static IObservable AsObservable(this IObservable source) => - Observable.Create(source.Subscribe); - - /// - /// Projects each value. - /// - public static IObservable Select( - this IObservable source, - Func selector) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - source.Subscribe( - value => - { - TResult result; - try - { - result = selector(value); - } - catch (Exception error) - { - observer.OnError(error); - return; - } - - observer.OnNext(result); - }, - observer.OnError, - observer.OnCompleted)); - - /// - /// Projects each value with its index. - /// - public static IObservable Select( - this IObservable source, - Func selector) - => Observable.Create(observer => - { - var index = -1; - return source.Subscribe( - value => - { - TResult result; - try - { - result = selector(value, Interlocked.Increment(ref index)); - } - catch (Exception error) - { - observer.OnError(error); - return; - } - - observer.OnNext(result); - }, - observer.OnError, - observer.OnCompleted); - }); - - /// - /// Filters values. - /// - public static IObservable Where(this IObservable source, Func predicate) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - source.Subscribe( - value => - { - bool keep; - try - { - keep = predicate(value); - } - catch (Exception error) - { - observer.OnError(error); - return; - } - - if (keep) - { - observer.OnNext(value); - } - }, - observer.OnError, - observer.OnCompleted)); - - /// - /// Projects values to observable sequences and merges the results. - /// - public static IObservable SelectMany( - this IObservable source, - Func> selector) => - source.Select(selector).Merge(); - - /// - /// Projects each value to the same observable sequence and merges the results. - /// - public static IObservable SelectMany( - this IObservable source, - IObservable other) => - source.Select(_ => other).Merge(); - - /// - /// Projects values to enumerable sequences and merges the results. - /// - public static IObservable SelectMany( - this IObservable source, - Func> selector) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - source.Subscribe( - value => - { - IEnumerable values; - try - { - values = selector(value); - } - catch (Exception error) - { - observer.OnError(error); - return; - } - - foreach (var result in values) - { - observer.OnNext(result); - } - }, - observer.OnError, - observer.OnCompleted)); - - /// - /// Projects values with a result selector. - /// - public static IObservable SelectMany( - this IObservable source, - Func> collectionSelector, - Func resultSelector) => - source.SelectMany(value => collectionSelector(value).Select(inner => resultSelector(value, inner))); - - /// - /// Merges two observable sources. - /// - public static IObservable Merge(this IObservable first, IObservable second) => - new[] { first, second }.Merge(); - - /// - /// Merges observable sources. - /// - public static IObservable Merge(this IEnumerable> sources) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - var disposables = new CompositeDisposable(); - var remaining = 1; - var gate = new object(); - var stopped = false; - - void CompleteOne() - { - lock (gate) - { - if (stopped) - { - return; - } - - if (--remaining == 0) - { - stopped = true; - observer.OnCompleted(); - } - } - } - - void Fail(Exception error) - { - var shouldDispose = false; - lock (gate) - { - if (stopped) - { - return; - } - - stopped = true; - observer.OnError(error); - shouldDispose = true; - } - - if (shouldDispose) - { - disposables.Dispose(); - } - } - - foreach (var source in sources) - { - lock (gate) - { - if (stopped) - { - break; - } - - remaining++; - } - - disposables.Add(source.Subscribe( - value => - { - lock (gate) - { - if (!stopped) - { - observer.OnNext(value); - } - } - }, - Fail, - CompleteOne)); - } - - CompleteOne(); - return disposables; - }); - - /// - /// Merges a sequence of observable sources. - /// - public static IObservable Merge(this IObservable> sources) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - var subscriptions = new CompositeDisposable(); - var outerCompleted = false; - var active = 0; - var gate = new object(); - var stopped = false; - - void Fail(Exception error) - { - var shouldDispose = false; - lock (gate) - { - if (stopped) - { - return; - } - - stopped = true; - observer.OnError(error); - shouldDispose = true; - } - - if (shouldDispose) - { - subscriptions.Dispose(); - } - } - - void TryComplete() - { - if (!stopped && outerCompleted && active == 0) - { - stopped = true; - observer.OnCompleted(); - } - } - - subscriptions.Add(sources.Subscribe( - inner => - { - lock (gate) - { - if (stopped) - { - return; - } - - active++; - } - - var innerSubscription = new SingleAssignmentDisposable(); - subscriptions.Add(innerSubscription); - innerSubscription.Disposable = inner.Subscribe( - value => - { - lock (gate) - { - if (!stopped) - { - observer.OnNext(value); - } - } - }, - Fail, - () => - { - subscriptions.Remove(innerSubscription); - lock (gate) - { - if (stopped) - { - return; - } - - active--; - TryComplete(); - } - }); - }, - Fail, - () => - { - lock (gate) - { - if (stopped) - { - return; - } - - outerCompleted = true; - TryComplete(); - } - })); - - return subscriptions; - }); - - /// - /// Merges observable sources with a maximum concurrency. - /// - public static IObservable Merge(this IEnumerable> sources, int maxConcurrent) - { - if (maxConcurrent <= 0) - { - throw new ArgumentOutOfRangeException(nameof(maxConcurrent)); - } - - return ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - var subscriptions = new CompositeDisposable(); - var enumerator = sources.GetEnumerator(); - var gate = new object(); - var active = 0; - var stopped = false; - - bool SubscribeNext() - { - IObservable? next = null; - lock (gate) - { - if (stopped) - { - return false; - } - - if (enumerator.MoveNext()) - { - next = enumerator.Current; - active++; - } - else if (active == 0) - { - stopped = true; - observer.OnCompleted(); - return false; - } - else - { - return false; - } - } - - if (next is null) - { - return false; - } - - var inner = new SingleAssignmentDisposable(); - subscriptions.Add(inner); - inner.Disposable = next.Subscribe( - value => - { - lock (gate) - { - if (!stopped) - { - observer.OnNext(value); - } - } - }, - error => - { - lock (gate) - { - if (stopped) - { - return; - } - - stopped = true; - } - - observer.OnError(error); - subscriptions.Dispose(); - }, - () => - { - subscriptions.Remove(inner); - lock (gate) - { - active--; - } - - SubscribeNext(); - }); - - return true; - } - - for (var i = 0; i < maxConcurrent; i++) - { - if (!SubscribeNext()) - { - break; - } - } - - subscriptions.Add(enumerator); - return subscriptions; - }); - } - - /// - /// Concatenates observable sources. - /// - public static IObservable Concat(this IObservable first, IObservable second) => - new[] { first, second }.ToObservable().Concat(); - - /// - /// Concatenates observable sources. - /// - public static IObservable Concat(this IObservable> sources) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - var subscriptions = new CompositeDisposable(); - var queue = new Queue>(); - var gate = new object(); - var outerCompleted = false; - var active = false; - - void Drain() - { - IObservable? next = null; - lock (gate) - { - if (active || queue.Count == 0) - { - if (outerCompleted && !active && queue.Count == 0) - { - observer.OnCompleted(); - } - - return; - } - - active = true; - next = queue.Dequeue(); - } - - var inner = new SingleAssignmentDisposable(); - subscriptions.Add(inner); - inner.Disposable = next.Subscribe( - observer.OnNext, - observer.OnError, - () => - { - subscriptions.Remove(inner); - lock (gate) - { - active = false; - } - - Drain(); - }); - } - - subscriptions.Add(sources.Subscribe( - source => - { - lock (gate) - { - queue.Enqueue(source); - } - - Drain(); - }, - observer.OnError, - () => - { - lock (gate) - { - outerCompleted = true; - } - - Drain(); - })); - - return subscriptions; - }); - - /// - /// Concatenates task results in source order. - /// - public static IObservable Concat(this IObservable> source) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - var disposables = new CompositeDisposable(); - var gate = new object(); - var queue = new Queue>(); - var outerCompleted = false; - var active = false; - - void Drain() - { - Task? next = null; - lock (gate) - { - if (active) - { - return; - } - - if (queue.Count == 0) - { - if (outerCompleted) - { - observer.OnCompleted(); - } - - return; - } - - active = true; - next = queue.Dequeue(); - } - - void Finish() - { - lock (gate) - { - active = false; - } - - Drain(); - } - - if (next.IsCompleted) - { - EmitCompletedTask(next, observer, Finish); - } - else - { - _ = AwaitTask(next, observer, Finish); - } - } - - disposables.Add(source.Subscribe( - task => - { - lock (gate) - { - queue.Enqueue(task); - } - - Drain(); - }, - observer.OnError, - () => - { - lock (gate) - { - outerCompleted = true; - } - - Drain(); - })); - - return disposables; - }); - - private static async Task AwaitTask(Task task, IObserver observer, Action completed) - { - try - { - observer.OnNext(await task.ConfigureAwait(false)); - } - catch (Exception error) - { - observer.OnError(error); - return; - } - - completed(); - } - - private static void EmitCompletedTask(Task task, IObserver observer, Action completed) - { - if (task.IsCanceled) - { - observer.OnError(new TaskCanceledException(task)); - return; - } - - if (task.IsFaulted) - { - observer.OnError(task.Exception?.InnerException ?? (Exception?)task.Exception ?? new InvalidOperationException("Task faulted without an exception.")); - return; - } - - observer.OnNext(task.Result); - completed(); - } - - /// - /// Switches to the latest inner observable. - /// - public static IObservable Switch(this IObservable> sources) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - var subscriptions = new CompositeDisposable(); - var current = new SerialDisposable(); - var gate = new object(); - var outerCompleted = false; - var active = 0; - subscriptions.Add(current); - - void TryComplete() - { - if (outerCompleted && active == 0) - { - observer.OnCompleted(); - } - } - - subscriptions.Add(sources.Subscribe( - inner => - { - Interlocked.Increment(ref active); - var mine = active; - current.Disposable = inner.Subscribe( - observer.OnNext, - observer.OnError, - () => - { - if (Volatile.Read(ref active) == mine) - { - Interlocked.Decrement(ref active); - lock (gate) - { - TryComplete(); - } - } - }); - }, - observer.OnError, - () => - { - lock (gate) - { - outerCompleted = true; - TryComplete(); - } - })); - - return subscriptions; - }); - - /// - /// Prefixes values to an observable. - /// - public static IObservable StartWith(this IObservable source, params T[] values) => - values.ToObservable().Concat(source); - - /// - /// Prefixes a value to an observable. - /// - public static IObservable Prepend(this IObservable source, T value) => - source.StartWith(value); - - /// - /// Accumulates values. - /// - public static IObservable Scan( - this IObservable source, - TAccumulate seed, - Func accumulator) - => Observable.Create(observer => - { - var current = seed; - return source.Subscribe( - value => - { - try - { - current = accumulator(current, value); - } - catch (Exception error) - { - observer.OnError(error); - return; - } - - observer.OnNext(current); - }, - observer.OnError, - observer.OnCompleted); - }); - - /// - /// Buffers values by count. - /// - public static IObservable> Buffer(this IObservable source, int count) => - ReactiveUI.Primitives.Signals.Signal.Create>(observer => - { - var buffer = new List(count); - return source.Subscribe( - value => - { - buffer.Add(value); - if (buffer.Count < count) - { - return; - } - - observer.OnNext(buffer.ToArray()); - buffer.Clear(); - }, - observer.OnError, - () => - { - if (buffer.Count != 0) - { - observer.OnNext(buffer.ToArray()); - } - - observer.OnCompleted(); - }); - }); - - /// - /// Buffers values by time. - /// - public static IObservable> Buffer(this IObservable source, TimeSpan timeSpan) => - source.Buffer(timeSpan, Sequencer.Default); - - /// - /// Buffers values by time. - /// - public static IObservable> Buffer(this IObservable source, TimeSpan timeSpan, IScheduler scheduler) => - ReactiveUI.Primitives.Signals.Signal.Create>(observer => - { - var gate = new object(); - var buffer = new List(); - var disposables = new CompositeDisposable(); - - void Flush() - { - T[] values; - lock (gate) - { - if (buffer.Count == 0) - { - return; - } - - values = [.. buffer]; - buffer.Clear(); - } - - observer.OnNext(values); - } - - disposables.Add(source.Subscribe( - value => - { - lock (gate) - { - buffer.Add(value); - } - }, - observer.OnError, - () => - { - Flush(); - observer.OnCompleted(); - })); - - disposables.Add(scheduler.ScheduleRecurringAction(timeSpan, Flush)); - return disposables; - }); - - /// - /// Distinct values. - /// - public static IObservable Distinct(this IObservable source) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - var seen = new HashSet(); - return source.Subscribe( - value => - { - if (seen.Add(value)) - { - observer.OnNext(value); - } - }, - observer.OnError, - observer.OnCompleted); - }); - - /// - /// Emits values when they differ from the previous value. - /// - public static IObservable DistinctUntilChanged(this IObservable source) => - source.DistinctUntilChanged(EqualityComparer.Default); - - /// - /// Emits values when they differ from the previous value. - /// - public static IObservable DistinctUntilChanged(this IObservable source, IEqualityComparer comparer) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - var hasValue = false; - var previous = default(T); - return source.Subscribe( - value => - { - if (!hasValue || !comparer.Equals(previous!, value)) - { - hasValue = true; - previous = value; - observer.OnNext(value); - } - }, - observer.OnError, - observer.OnCompleted); - }); - - /// - /// Takes a fixed number of values. - /// - public static IObservable Take(this IObservable source, int count) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - if (count <= 0) - { - observer.OnCompleted(); - return Disposable.Empty; - } - - var seen = 0; - var subscription = new SerialDisposable(); - subscription.Disposable = source.Subscribe( - value => - { - if (seen >= count) - { - return; - } - - observer.OnNext(value); - if (++seen == count) - { - observer.OnCompleted(); - subscription.Dispose(); - } - }, - observer.OnError, - observer.OnCompleted); - return subscription; - }); - - /// - /// Takes values until the other observable produces a value or error. - /// - public static IObservable TakeUntil(this IObservable source, IObservable other) => - Observable.Create(observer => - { - var disposables = new CompositeDisposable(); - var gate = new object(); - var stopped = false; - - void Stop(Action terminal) - { - var shouldStop = false; - lock (gate) - { - if (!stopped) - { - stopped = true; - shouldStop = true; - } - } - - if (shouldStop) - { - terminal(); - disposables.Dispose(); - } - } - - disposables.Add(source.Subscribe( - value => - { - lock (gate) - { - if (!stopped) - { - observer.OnNext(value); - } - } - }, - error => Stop(() => observer.OnError(error)), - () => Stop(observer.OnCompleted))); - - disposables.Add(other.Subscribe( - _ => Stop(observer.OnCompleted), - error => Stop(() => observer.OnError(error)), - static () => { })); - - return disposables; - }); - - /// - /// Skips a fixed number of values. - /// - public static IObservable Skip(this IObservable source, int count) - { - var seen = 0; - return source.Where(_ => seen++ >= count); - } - - /// - /// Skips values while a predicate is true. - /// - public static IObservable SkipWhile(this IObservable source, Func predicate) - { - var skipping = true; - return source.Where(value => - { - if (!skipping) - { - return true; - } - - skipping = predicate(value); - return !skipping; - }); - } - - /// - /// Invokes an action for each value. - /// - public static IObservable Do(this IObservable source, Action onNext) => - source.Do(onNext, static () => { }); - - /// - /// Invokes actions for values and errors. - /// - public static IObservable Do(this IObservable source, Action onNext, Action onError) => - source.Do(onNext, onError, static () => { }); - - /// - /// Invokes actions for values and completion. - /// - public static IObservable Do(this IObservable source, Action onNext, Action onCompleted) => - source.Do(onNext, static _ => { }, onCompleted); - - /// - /// Invokes actions for values, errors, and completion. - /// - public static IObservable Do( - this IObservable source, - Action onNext, - Action onError, - Action onCompleted) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - source.Subscribe( - value => - { - onNext(value); - observer.OnNext(value); - }, - error => - { - onError(error); - observer.OnError(error); - }, - () => - { - onCompleted(); - observer.OnCompleted(); - })); - - /// - /// Invokes an action when the subscription terminates. - /// - public static IObservable Finally(this IObservable source, Action finallyAction) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - var invoked = 0; - - void InvokeFinally() - { - if (Interlocked.Exchange(ref invoked, 1) == 0) - { - finallyAction(); - } - } - - var subscription = source.Subscribe( - observer.OnNext, - error => - { - try - { - observer.OnError(error); - } - finally - { - InvokeFinally(); - } - }, - () => - { - try - { - observer.OnCompleted(); - } - finally - { - InvokeFinally(); - } - }); - - return Disposable.Create(() => - { - subscription.Dispose(); - InvokeFinally(); - }); - }); - - /// - /// Throttles values by dropping pending values until no new value arrives for the duration. - /// - public static IObservable Throttle(this IObservable source, TimeSpan dueTime, IScheduler scheduler) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - { - var gate = new object(); - var version = 0; - var disposables = new CompositeDisposable(); - var timer = new SerialDisposable(); - disposables.Add(timer); - - disposables.Add(source.Subscribe( - value => - { - var id = Interlocked.Increment(ref version); - timer.Disposable = scheduler.Schedule(dueTime, () => - { - if (Volatile.Read(ref version) == id) - { - lock (gate) - { - observer.OnNext(value); - } - } - }); - }, - observer.OnError, - observer.OnCompleted)); - - return disposables; - }); - - /// - /// Observes values on a sequencer. - /// - public static IObservable ObserveOn(this IObservable source, IScheduler scheduler) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - source.Subscribe( - value => scheduler.Schedule(() => observer.OnNext(value)), - error => scheduler.Schedule(() => observer.OnError(error)), - () => scheduler.Schedule(observer.OnCompleted))); - - /// - /// Synchronizes observer calls with a lock. - /// - public static IObservable Synchronize(this IObservable source) => source.Synchronize(new object()); - - /// - /// Synchronizes observer calls with a lock. - /// - public static IObservable Synchronize(this IObservable source, object gate) => - ReactiveUI.Primitives.Signals.Signal.Create(observer => - source.Subscribe( - value => - { - lock (gate) - { - observer.OnNext(value); - } - }, - error => - { - lock (gate) - { - observer.OnError(error); - } - }, - () => - { - lock (gate) - { - observer.OnCompleted(); - } - })); - - /// - /// Creates a connectable observable using a subject. - /// - public static IConnectableObservable Publish(this IObservable source) => - new ConnectableObservable(source, new Subject()); - - /// - /// Creates a connectable observable that replays all values to late subscribers. - /// - public static IConnectableObservable Replay(this IObservable source) => - new ConnectableObservable(source, new ReplaySubject()); - - /// - /// Creates a connectable observable that replays buffered values to late subscribers. - /// - public static IConnectableObservable Replay(this IObservable source, int bufferSize) => - new ConnectableObservable(source, new ReplaySubject(bufferSize)); - - /// - /// Creates a connectable observable and applies a selector. - /// - public static IObservable Publish(this IObservable source, Func, IObservable> selector) => - Observable.Create(observer => - { - var connectable = source.Publish(); - var subscription = selector(connectable).Subscribe(observer); - var connection = connectable.Connect(); - return new CompositeDisposable(subscription, connection); - }); - - /// - /// Shares a single subscription while observers are present. - /// - public static IObservable RefCount(this IConnectableObservable source) - { - var gate = new object(); - var count = 0; - IDisposable? connection = null; - - return Observable.Create(observer => - { - var subscription = source.Subscribe(observer); - - lock (gate) - { - count++; - connection ??= source.Connect(); - } - - return Disposable.Create(() => - { - subscription.Dispose(); - - IDisposable? connectionToDispose = null; - lock (gate) - { - count--; - if (count == 0) - { - connectionToDispose = connection; - connection = null; - } - } - - connectionToDispose?.Dispose(); - }); - }); - } - - /// - /// Connects when the required number of observers subscribe. - /// - public static IObservable AutoConnect(this IConnectableObservable source) => source.AutoConnect(1); - - /// - /// Connects when the required number of observers subscribe. - /// - public static IObservable AutoConnect(this IConnectableObservable source, int minObservers) => - minObservers <= 0 - ? AutoConnectImmediately(source) - : Observable.Create(observer => - { - var subscription = source.Subscribe(observer); - var count = Interlocked.Increment(ref AutoConnectState.Counts.GetValue(source, static _ => new StrongBox()).Value); - if (count == minObservers) - { - AutoConnectState.Connections.GetValue(source, static item => new SerialDisposable()).Disposable = source.Connect(); - } - - return subscription; - }); - - private static IObservable AutoConnectImmediately(IConnectableObservable source) - { - var connection = AutoConnectState.Connections.GetValue(source, static _ => new SerialDisposable()); - if (connection.Disposable is null) - { - connection.Disposable = source.Connect(); - } - - return Observable.Create(source.Subscribe); - } - - /// - /// Converts an enumerable to an observable. - /// - public static IObservable ToObservable(this IEnumerable source) => - Observable.Create(observer => - { - try - { - foreach (var value in source) - { - observer.OnNext(value); - } - - observer.OnCompleted(); - } - catch (Exception error) - { - observer.OnError(error); - } - - return Disposable.Empty; - }); - - /// - /// Converts an enumerable to an observable. - /// - public static IObservable ToObservable(this IEnumerable source, IScheduler scheduler) => - Observable.Create(observer => scheduler.Schedule(() => - { - foreach (var value in source) - { - observer.OnNext(value); - } - - observer.OnCompleted(); - })); - - /// - /// Converts a task to an observable. - /// - public static IObservable ToObservable(this Task task) => - Observable.Create(observer => - { - if (task.IsCompleted) - { - EmitCompletedTask( - task, - observer, - static () => { }); - if (task.Status == TaskStatus.RanToCompletion) - { - observer.OnCompleted(); - } - - return Disposable.Empty; - } - - var disposed = 0; - _ = AwaitTask( - task, - observer, - () => - { - if (Volatile.Read(ref disposed) == 0) - { - observer.OnCompleted(); - } - }); - - return Disposable.Create(() => Interlocked.Exchange(ref disposed, 1)); - }); - - /// - /// Blocks until the observable completes and returns the collected values. - /// - public static IEnumerable ToEnumerable(this IObservable source) - { - var values = new List(); - Exception? failure = null; - using var completed = new ManualResetEventSlim(); - using var subscription = source.Subscribe( - values.Add, - error => - { - failure = error; - completed.Set(); - }, - completed.Set); - - completed.Wait(); - if (failure is not null) - { - ExceptionDispatchInfo.Capture(failure).Throw(); - } - - return values; - } - - /// - /// Collects values into a list. - /// - public static IObservable> ToList(this IObservable source) => - source.Aggregate((IList)new List(), (list, value) => - { - list.Add(value); - return list; - }); - - /// - /// Converts the observable to a task for the final value. - /// - public static Task ToTask(this IObservable source) - { - var completion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var subscription = new SerialDisposable(); - var hasValue = false; - var lastValue = default(T); - subscription.Disposable = source.Subscribe( - value => - { - hasValue = true; - lastValue = value; - }, - error => - { - subscription.Dispose(); - completion.TrySetException(error); - }, - () => - { - subscription.Dispose(); - if (hasValue) - { - completion.TrySetResult(lastValue!); - } - else - { - completion.TrySetException(new InvalidOperationException("Sequence contains no elements.")); - } - }); - - return completion.Task; - } - - /// - /// Gets an awaiter for the final observable value. - /// - public static TaskAwaiter GetAwaiter(this IObservable source) => - source.ToTask().GetAwaiter(); - - /// - /// Supplies a default value when the source is empty. - /// - public static IObservable DefaultIfEmpty(this IObservable source, T defaultValue) => - Observable.Create(observer => - { - var seen = false; - return source.Subscribe( - value => - { - seen = true; - observer.OnNext(value); - }, - observer.OnError, - () => - { - if (!seen) - { - observer.OnNext(defaultValue); - } - - observer.OnCompleted(); - }); - }); - - /// - /// Aggregates values. - /// - public static IObservable Aggregate( - this IObservable source, - TAccumulate seed, - Func accumulator) => - Observable.Create(observer => - { - var current = seed; - return source.Subscribe( - value => current = accumulator(current, value), - observer.OnError, - () => - { - observer.OnNext(current); - observer.OnCompleted(); - }); - }); - - /// - /// Collects values into an array. - /// - public static IObservable ToArray(this IObservable source) => - source.Aggregate(new List(), (list, value) => - { - list.Add(value); - return list; - }).Select(static list => list.ToArray()); - - /// - /// Determines whether any values match the predicate. - /// - public static IObservable Any(this IObservable source, Func predicate) => - Observable.Create(observer => - { - var subscription = new SerialDisposable(); - subscription.Disposable = source.Subscribe( - value => - { - if (!predicate(value)) - { - return; - } - - observer.OnNext(true); - observer.OnCompleted(); - subscription.Dispose(); - }, - observer.OnError, - () => - { - observer.OnNext(false); - observer.OnCompleted(); - }); - return subscription; - }); - - /// - /// Determines whether all values match the predicate. - /// - public static IObservable All(this IObservable source, Func predicate) => - Observable.Create(observer => - { - var subscription = new SerialDisposable(); - subscription.Disposable = source.Subscribe( - value => - { - if (predicate(value)) - { - return; - } - - observer.OnNext(false); - observer.OnCompleted(); - subscription.Dispose(); - }, - observer.OnError, - () => - { - observer.OnNext(true); - observer.OnCompleted(); - }); - return subscription; - }); - - /// - /// Counts source values. - /// - public static IObservable Count(this IObservable source) => - source.Aggregate(0, static (count, _) => count + 1); - - /// - /// Emits the last value, or the default value when the source is empty. - /// - public static IObservable LastOrDefaultAsync(this IObservable source) => - Observable.Create(observer => - { - var last = default(T); - return source.Subscribe( - value => last = value, - observer.OnError, - () => - { - observer.OnNext(last!); - observer.OnCompleted(); - }); - }); - - /// - /// Combines latest values from two sources. - /// - public static IObservable CombineLatest( - this IObservable first, - IObservable second, - Func resultSelector) => - Observable.Create(observer => - { - var gate = new object(); - var firstHasValue = false; - var secondHasValue = false; - var firstValue = default(TFirst); - var secondValue = default(TSecond); - var firstCompleted = false; - var secondCompleted = false; - - void TryComplete() - { - if (firstCompleted && secondCompleted) - { - observer.OnCompleted(); - } - } - - return new CompositeDisposable( - first.Subscribe( - value => - { - lock (gate) - { - firstValue = value; - firstHasValue = true; - if (secondHasValue) - { - observer.OnNext(resultSelector(firstValue!, secondValue!)); - } - } - }, - observer.OnError, - () => - { - lock (gate) - { - firstCompleted = true; - TryComplete(); - } - }), - second.Subscribe( - value => - { - lock (gate) - { - secondValue = value; - secondHasValue = true; - if (firstHasValue) - { - observer.OnNext(resultSelector(firstValue!, secondValue!)); - } - } - }, - observer.OnError, - () => - { - lock (gate) - { - secondCompleted = true; - TryComplete(); - } - })); - }); - - /// - /// Combines latest values from three sources. - /// - public static IObservable CombineLatest( - this IObservable source1, - IObservable source2, - IObservable source3, - Func resultSelector) => - source1.CombineLatest(source2, ValueTuple.Create).CombineLatest(source3, (pair, value3) => resultSelector(pair.Item1, pair.Item2, value3)); - - /// - /// Combines latest values from four sources. - /// - public static IObservable CombineLatest( - this IObservable source1, - IObservable source2, - IObservable source3, - IObservable source4, - Func resultSelector) => - source1.CombineLatest(source2, source3, (value1, value2, value3) => (value1, value2, value3)) - .CombineLatest(source4, (tuple, value4) => resultSelector(tuple.value1, tuple.value2, tuple.value3, value4)); - - /// - /// Combines latest values from five sources. - /// - public static IObservable CombineLatest( - this IObservable source1, - IObservable source2, - IObservable source3, - IObservable source4, - IObservable source5, - Func resultSelector) => - source1.CombineLatest(source2, source3, source4, (value1, value2, value3, value4) => (value1, value2, value3, value4)) - .CombineLatest(source5, (tuple, value5) => resultSelector(tuple.value1, tuple.value2, tuple.value3, tuple.value4, value5)); - - /// - /// Combines latest values from six sources. - /// - public static IObservable CombineLatest( - this IObservable source1, - IObservable source2, - IObservable source3, - IObservable source4, - IObservable source5, - IObservable source6, - Func resultSelector) => - source1.CombineLatest(source2, source3, source4, source5, (value1, value2, value3, value4, value5) => (value1, value2, value3, value4, value5)) - .CombineLatest(source6, (tuple, value6) => resultSelector(tuple.value1, tuple.value2, tuple.value3, tuple.value4, tuple.value5, value6)); - - /// - /// Zips two observable sources. - /// - public static IObservable Zip( - this IObservable first, - IObservable second, - Func resultSelector) => - Observable.Create(observer => - { - var gate = new object(); - var firstQueue = new Queue(); - var secondQueue = new Queue(); - var firstCompleted = false; - var secondCompleted = false; - - void Drain() - { - while (firstQueue.Count != 0 && secondQueue.Count != 0) - { - observer.OnNext(resultSelector(firstQueue.Dequeue(), secondQueue.Dequeue())); - } - - if ((firstCompleted && firstQueue.Count == 0) || (secondCompleted && secondQueue.Count == 0)) - { - observer.OnCompleted(); - } - } - - return new CompositeDisposable( - first.Subscribe( - value => - { - lock (gate) - { - firstQueue.Enqueue(value); - Drain(); - } - }, - observer.OnError, - () => - { - lock (gate) - { - firstCompleted = true; - Drain(); - } - }), - second.Subscribe( - value => - { - lock (gate) - { - secondQueue.Enqueue(value); - Drain(); - } - }, - observer.OnError, - () => - { - lock (gate) - { - secondCompleted = true; - Drain(); - } - })); - }); - - /// - /// Ignores all values and preserves termination. - /// - public static IObservable IgnoreElements(this IObservable source) => - Observable.Create(observer => source.Subscribe(static _ => { }, observer.OnError, observer.OnCompleted)); - - /// - /// Handles errors by switching to a replacement observable. - /// - public static IObservable Catch(this IObservable source, Func> handler) - where TException : Exception => - Observable.Create(observer => - { - var subscription = new SerialDisposable(); - subscription.Disposable = source.Subscribe( - observer.OnNext, - error => - { - if (error is TException typed) - { - subscription.Disposable = handler(typed).Subscribe(observer); - } - else - { - observer.OnError(error); - } - }, - observer.OnCompleted); - return subscription; - }); - - private static class AutoConnectState - { - public static readonly ConditionalWeakTable, StrongBox> Counts = new(); - public static readonly ConditionalWeakTable, SerialDisposable> Connections = new(); - } -} - -/// -/// Represents a connectable observable source. -/// -/// The element type. -internal interface IConnectableObservable : IObservable -{ - /// - /// Connects the source. - /// - /// The connection lifetime. - IDisposable Connect(); -} - -/// -/// A simple connectable observable implementation. -/// -/// The element type. -internal sealed class ConnectableObservable : IConnectableObservable -{ - private readonly IObservable _source; - private readonly ISubject _subject; - private readonly object _locker = new(); - private IDisposable? _connection; - private bool _terminated; - - /// - /// Initializes a new instance of the class. - /// - /// The source observable. - /// The multicast subject. - public ConnectableObservable(IObservable source, ISubject subject) - { - _source = source; - _subject = subject; - } - - /// - public IDisposable Connect() - { - lock (_locker) - { - if (_terminated) - { - return Disposable.Empty; - } - - if (_connection is null) - { - var subscription = _source.Subscribe( - _subject.OnNext, - error => - { - lock (_locker) - { - _terminated = true; - _connection = null; - } - - _subject.OnError(error); - }, - () => - { - lock (_locker) - { - _terminated = true; - _connection = null; - } - - _subject.OnCompleted(); - }); - - if (_terminated) - { - subscription.Dispose(); - return Disposable.Empty; - } - - IDisposable? connection = null; - connection = Disposable.Create(() => - { - subscription.Dispose(); - lock (_locker) - { - if (ReferenceEquals(_connection, connection)) - { - _connection = null; - } - } - }); - _connection = connection; - } - - return _connection; - } - } - - /// - public IDisposable Subscribe(IObserver observer) => _subject.Subscribe(observer); -} - -/// -/// A disposable that invokes two disposable actions. -/// -internal sealed class CompositeActionDisposable : IDisposable -{ - private readonly IDisposable _first; - private readonly Action _second; - - /// - /// Initializes a new instance of the class. - /// - public CompositeActionDisposable(IDisposable first, Action second) - { - _first = first; - _second = second; - } - - /// - public void Dispose() - { - _first.Dispose(); - _second(); - } -} diff --git a/src/DynamicData/Kernel/InternalEx.cs b/src/DynamicData/Kernel/InternalEx.cs index 32f58e7be..c395f08b2 100644 --- a/src/DynamicData/Kernel/InternalEx.cs +++ b/src/DynamicData/Kernel/InternalEx.cs @@ -26,6 +26,9 @@ public static class InternalEx public static IObservable RetryWithBackOff(this IObservable source, Func backOffStrategy) where TException : Exception { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + backOffStrategy.ThrowArgumentNullExceptionIfNull(nameof(backOffStrategy)); + IObservable Retry(int failureCount) => source.Catch( error => diff --git a/src/DynamicData/Kernel/OptionExtensions.cs b/src/DynamicData/Kernel/OptionExtensions.cs index 0c6c982cc..87af9886d 100644 --- a/src/DynamicData/Kernel/OptionExtensions.cs +++ b/src/DynamicData/Kernel/OptionExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -24,7 +24,7 @@ public static Optional Convert(this in Opti { converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); - return source.HasValue ? converter(source.Value) : Optional.None(); + return source.HasValue ? converter(source.Value) : Optional.None; } /// @@ -42,7 +42,7 @@ public static Optional Convert(this in Opti { converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); - return source.HasValue ? converter(source.Value) : Optional.None(); + return source.HasValue ? converter(source.Value) : Optional.None; } /// @@ -108,7 +108,7 @@ public static Optional FirstOrOptional(this IEnumerable source, Func.Create(item); } - return Optional.None(); + return Optional.None; } /// @@ -174,7 +174,7 @@ public static Optional Lookup(this IDictionary(); + return result ? contained : Optional.None; } /// diff --git a/src/DynamicData/Kernel/OptionObservableExtensions.cs b/src/DynamicData/Kernel/OptionObservableExtensions.cs index de8a4d7d1..f221ddb26 100644 --- a/src/DynamicData/Kernel/OptionObservableExtensions.cs +++ b/src/DynamicData/Kernel/OptionObservableExtensions.cs @@ -27,7 +27,7 @@ public static IObservable> Convert source.ThrowArgumentNullExceptionIfNull(nameof(source)); converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); - return source.Select(optional => optional.HasValue ? converter(optional.Value) : Optional.None()); + return source.Select(optional => optional.HasValue ? converter(optional.Value) : Optional.None); } /// @@ -48,7 +48,7 @@ public static IObservable> Convert source.ThrowArgumentNullExceptionIfNull(nameof(source)); converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); - return source.Select(optional => optional.HasValue ? converter(optional.Value) : Optional.None()); + return source.Select(optional => optional.HasValue ? converter(optional.Value) : Optional.None); } /// diff --git a/src/DynamicData/Kernel/Optional.cs b/src/DynamicData/Kernel/Optional.cs deleted file mode 100644 index a7dc27af0..000000000 --- a/src/DynamicData/Kernel/Optional.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -namespace DynamicData.Kernel; - -/// -/// The equivalent of a nullable type which works on value and reference types. -/// -/// The underlying value type of the generic type.1. -[SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "Deliberate usage.")] -[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Class names the same, generic differences.")] -public readonly struct Optional : IEquatable> - where T : notnull -{ - private readonly T? _value; - - /// - /// Initializes a new instance of the struct. - /// - /// The value. - internal Optional(T? value) - { - if (value is null) - { - HasValue = false; - _value = default; - } - else - { - _value = value; - HasValue = true; - } - } - - /// - /// Gets the default valueless optional. - /// - public static Optional None { get; } - - /// - /// Gets a value indicating whether the current object has a value. - /// - /// - /// - /// true if the current object has a value; false if the current object has no value. - /// - public bool HasValue { get; } - - /// - /// Gets the value of the current value. - /// - /// - /// - /// The value of the current object if the property is true. An exception is thrown if the property is false. - /// - /// The property is false. - public T Value - { - get - { - if (!HasValue || _value is null) - { - throw new InvalidOperationException("Optional has no value"); - } - - return _value; - } - } - - /// - /// Implicit cast from the vale to the optional. - /// - /// The value. - /// The optional value. - public static implicit operator Optional(T? value) => ToOptional(value); - - /// - /// Explicit cast from option to value. - /// - /// The value. - /// The optional value. - public static explicit operator T?(in Optional value) => FromOptional(value); - - public static bool operator ==(in Optional left, in Optional right) => left.Equals(right); - - public static bool operator !=(in Optional left, in Optional right) => !left.Equals(right); - - /// - /// Creates the specified value. - /// - /// The value. - /// The optional value. - public static Optional Create(T? value) => new(value); - - /// - /// Gets the value from the optional value. - /// - /// The optional value. - /// The value. - public static T? FromOptional(in Optional value) => value.Value; - - /// - /// Gets the optional from a value. - /// - /// The value to get the optional for. - /// The optional. - public static Optional ToOptional(T? value) => new(value); - - /// - public bool Equals(Optional other) - { - if (!HasValue) - { - return !other.HasValue; - } - - if (!other.HasValue) - { - return false; - } - - if (_value is null && other._value is null) - { - return true; - } - - if (_value is null || other._value is null) - { - return false; - } - - return HasValue.Equals(other.HasValue) && EqualityComparer.Default.Equals(_value, other._value); - } - - /// - public override bool Equals(object? obj) - { - if (obj is null) - { - return false; - } - - return obj is Optional optional && Equals(optional); - } - - /// - public override int GetHashCode() - { - unchecked - { - if (_value is null) - { - return 0; - } - - return (HasValue.GetHashCode() * 397) ^ EqualityComparer.Default.GetHashCode(_value); - } - } - - /// - public override string? ToString() - { - if (_value is null) - { - return ""; - } - - return !HasValue ? "" : _value.ToString(); - } -} - -/// -/// Optional factory class. -/// -[SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "By Design.")] -public static class Optional -{ - /// - /// Returns an None optional value for the specified type. - /// - /// The type of the item. - /// The optional value. - public static Optional None() - where T : notnull - => Optional.None; - - /// - /// Wraps the specified value in an Optional container. - /// - /// The type of the item. - /// The value. - /// The optional value. - public static Optional Some(T? value) - where T : notnull - => new(value); -} diff --git a/src/DynamicData/List/Change.cs b/src/DynamicData/List/Change.cs index 94cc421aa..b117c6066 100644 --- a/src/DynamicData/List/Change.cs +++ b/src/DynamicData/List/Change.cs @@ -19,7 +19,7 @@ public sealed class Change : IEquatable> /// The current. /// The index. public Change(ListChangeReason reason, T current, int index = -1) - : this(reason, current, Optional.None(), index) + : this(reason, current, Optional.None, index) { } @@ -70,7 +70,7 @@ public Change(T current, int currentIndex, int previousIndex) } Reason = ListChangeReason.Moved; - Item = new ItemChange(Reason, current, Optional.None(), currentIndex, previousIndex); + Item = new ItemChange(Reason, current, Optional.None, currentIndex, previousIndex); Range = RangeChange.Empty; } @@ -90,7 +90,7 @@ public Change(T current, int currentIndex, int previousIndex) /// or /// For , must supply an index. /// - public Change(ListChangeReason reason, T current, in Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) + public Change(ListChangeReason reason, T current, in Optional previous, int currentIndex = -1, int previousIndex = -1) { if (reason == ListChangeReason.Add && previous.HasValue) { diff --git a/src/DynamicData/List/ChangeAwareList.cs b/src/DynamicData/List/ChangeAwareList.cs index 500d944b2..f96cc8a70 100644 --- a/src/DynamicData/List/ChangeAwareList.cs +++ b/src/DynamicData/List/ChangeAwareList.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -83,7 +83,7 @@ public int Capacity /// /// Gets the last change in the collection. /// - private Kernel.Optional> Last => _changes.Count == 0 ? Optional.None>() : _changes[_changes.Count - 1]; + private Optional> Last => _changes.Count == 0 ? Optional>.None : _changes[_changes.Count - 1]; /// /// Gets or sets the item at the specified index. diff --git a/src/DynamicData/List/Internal/GroupOn.cs b/src/DynamicData/List/Internal/GroupOn.cs index 59e14ff62..adefca815 100644 --- a/src/DynamicData/List/Internal/GroupOn.cs +++ b/src/DynamicData/List/Internal/GroupOn.cs @@ -230,13 +230,13 @@ public GroupWithAddIndicator(Group group, bool wasCreated) public bool WasCreated { get; } } - private sealed class ItemWithGroupKey(TObject item, TGroupKey group, Kernel.Optional previousGroup) : IEquatable + private sealed class ItemWithGroupKey(TObject item, TGroupKey group, Optional previousGroup) : IEquatable { public TGroupKey Group { get; set; } = group; public TObject Item { get; } = item; - public Kernel.Optional PreviousGroup { get; } = previousGroup; + public Optional PreviousGroup { get; } = previousGroup; /// Returns a value that indicates whether the values of two objects are equal. /// The first value to compare. diff --git a/src/DynamicData/List/Internal/GroupOnImmutable.cs b/src/DynamicData/List/Internal/GroupOnImmutable.cs index 0fcfffd1a..26fbd357a 100644 --- a/src/DynamicData/List/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/List/Internal/GroupOnImmutable.cs @@ -253,13 +253,13 @@ private sealed class GroupContainer(TGroupKey key) public IList List { get; } = new List(); } - private sealed class ItemWithGroupKey(TObject item, TGroupKey group, Kernel.Optional previousGroup) : IEquatable + private sealed class ItemWithGroupKey(TObject item, TGroupKey group, Optional previousGroup) : IEquatable { public TGroupKey Group { get; set; } = group; public TObject Item { get; } = item; - public Kernel.Optional PreviousGroup { get; } = previousGroup; + public Optional PreviousGroup { get; } = previousGroup; public static bool operator ==(ItemWithGroupKey left, ItemWithGroupKey right) => Equals(left, right); diff --git a/src/DynamicData/List/Internal/TransformAsync.cs b/src/DynamicData/List/Internal/TransformAsync.cs index 0bfc2520d..7703dfb60 100644 --- a/src/DynamicData/List/Internal/TransformAsync.cs +++ b/src/DynamicData/List/Internal/TransformAsync.cs @@ -8,14 +8,14 @@ internal sealed class TransformAsync where TSource : notnull where TDestination : notnull { - private readonly Func, int, Task.TransformedItemContainer>> _containerFactory; + private readonly Func, int, Task.TransformedItemContainer>> _containerFactory; private readonly IObservable> _source; private readonly bool _transformOnRefresh; public TransformAsync( IObservable> source, - Func, int, Task> factory, + Func, int, Task> factory, bool transformOnRefresh) { factory.ThrowArgumentNullExceptionIfNull(nameof(factory)); @@ -75,7 +75,7 @@ private async Task Transform( var container = await _containerFactory( item.Item.Current, - Kernel.Optional.None, + Optional.None, transformed.Count).ConfigureAwait(false); transformed.Add(container); } @@ -84,7 +84,7 @@ await _containerFactory( var container = await _containerFactory( item.Item.Current, - Kernel.Optional.None, + Optional.None, change.CurrentIndex).ConfigureAwait(false); transformed.Insert(change.CurrentIndex, container); } @@ -95,7 +95,7 @@ await _containerFactory( case ListChangeReason.AddRange: { var startIndex = item.Range.Index < 0 ? transformed.Count : item.Range.Index; - var tasks = item.Range.Select((t, idx) => _containerFactory(t, Kernel.Optional.None, idx + startIndex)); + var tasks = item.Range.Select((t, idx) => _containerFactory(t, Optional.None, idx + startIndex)); var containers = await Task.WhenAll(tasks).ConfigureAwait(false); transformed.AddOrInsertRange(containers, item.Range.Index); break; @@ -106,7 +106,7 @@ await _containerFactory( var change = item.Item; if (_transformOnRefresh) { - Kernel.Optional previous = transformed[change.CurrentIndex].Destination; + Optional previous = transformed[change.CurrentIndex].Destination; var container = await _containerFactory(change.Current, previous, change.CurrentIndex) .ConfigureAwait(false); transformed[change.CurrentIndex] = container; @@ -123,7 +123,7 @@ await _containerFactory( { var change = item.Item; - Kernel.Optional previous = transformed[change.PreviousIndex].Destination; + Optional previous = transformed[change.PreviousIndex].Destination; if (change.CurrentIndex == change.PreviousIndex) { transformed[change.CurrentIndex] = await _containerFactory(change.Current, previous, change.CurrentIndex); @@ -131,7 +131,7 @@ await _containerFactory( else { transformed.RemoveAt(change.PreviousIndex); - transformed.Insert(change.CurrentIndex, await _containerFactory(change.Current, Kernel.Optional.None, change.CurrentIndex)); + transformed.Insert(change.CurrentIndex, await _containerFactory(change.Current, Optional.None, change.CurrentIndex)); } break; diff --git a/src/DynamicData/List/Internal/Transformer.cs b/src/DynamicData/List/Internal/Transformer.cs index fa7f73ac1..8262c9598 100644 --- a/src/DynamicData/List/Internal/Transformer.cs +++ b/src/DynamicData/List/Internal/Transformer.cs @@ -8,13 +8,13 @@ internal sealed class Transformer where TSource : notnull where TDestination : notnull { - private readonly Func, int, TransformedItemContainer> _containerFactory; + private readonly Func, int, TransformedItemContainer> _containerFactory; private readonly IObservable> _source; private readonly bool _transformOnRefresh; - public Transformer(IObservable> source, Func, int, TDestination> factory, bool transformOnRefresh) + public Transformer(IObservable> source, Func, int, TDestination> factory, bool transformOnRefresh) { factory.ThrowArgumentNullExceptionIfNull(nameof(factory)); @@ -49,11 +49,11 @@ private void Transform(ChangeAwareList transformed, IC var change = item.Item; if (change.CurrentIndex < 0 || change.CurrentIndex >= transformed.Count) { - transformed.Add(_containerFactory(change.Current, Kernel.Optional.None, transformed.Count)); + transformed.Add(_containerFactory(change.Current, Optional.None, transformed.Count)); } else { - var converted = _containerFactory(change.Current, Kernel.Optional.None, change.CurrentIndex); + var converted = _containerFactory(change.Current, Optional.None, change.CurrentIndex); transformed.Insert(change.CurrentIndex, converted); } @@ -64,7 +64,7 @@ private void Transform(ChangeAwareList transformed, IC { var startIndex = item.Range.Index < 0 ? transformed.Count : item.Range.Index; - transformed.AddOrInsertRange(item.Range.Select((t, idx) => _containerFactory(t, Kernel.Optional.None, idx + startIndex)), item.Range.Index); + transformed.AddOrInsertRange(item.Range.Select((t, idx) => _containerFactory(t, Optional.None, idx + startIndex)), item.Range.Index); break; } @@ -86,7 +86,7 @@ private void Transform(ChangeAwareList transformed, IC if (_transformOnRefresh) { - Kernel.Optional previous = transformed[index].Destination; + Optional previous = transformed[index].Destination; transformed[index] = _containerFactory(change.Current, previous, index); } else @@ -115,7 +115,7 @@ private void Transform(ChangeAwareList transformed, IC } else { - Kernel.Optional previous = transformed[change.PreviousIndex].Destination; + Optional previous = transformed[change.PreviousIndex].Destination; if (change.CurrentIndex == change.PreviousIndex) { transformed[change.CurrentIndex] = _containerFactory(change.Current, previous, change.CurrentIndex); @@ -123,7 +123,7 @@ private void Transform(ChangeAwareList transformed, IC else { transformed.RemoveAt(change.PreviousIndex); - transformed.Insert(change.CurrentIndex, _containerFactory(change.Current, Kernel.Optional.None, change.CurrentIndex)); + transformed.Insert(change.CurrentIndex, _containerFactory(change.Current, Optional.None, change.CurrentIndex)); } } diff --git a/src/DynamicData/List/Internal/UnifiedChange.cs b/src/DynamicData/List/Internal/UnifiedChange.cs index 9325080f2..9088320f6 100644 --- a/src/DynamicData/List/Internal/UnifiedChange.cs +++ b/src/DynamicData/List/Internal/UnifiedChange.cs @@ -4,11 +4,11 @@ namespace DynamicData.List.Internal; -internal readonly struct UnifiedChange(ListChangeReason reason, T current, Kernel.Optional previous) : IEquatable> +internal readonly struct UnifiedChange(ListChangeReason reason, T current, Optional previous) : IEquatable> where T : notnull { public UnifiedChange(ListChangeReason reason, T current) - : this(reason, current, Kernel.Optional.None()) + : this(reason, current, Optional.None) { } @@ -16,7 +16,7 @@ public UnifiedChange(ListChangeReason reason, T current) public T Current { get; } = current; - public Kernel.Optional Previous { get; } = previous; + public Optional Previous { get; } = previous; public static bool operator ==(in UnifiedChange left, in UnifiedChange right) => left.Equals(right); diff --git a/src/DynamicData/List/ItemChange.cs b/src/DynamicData/List/ItemChange.cs index d1c93547b..4b7d31a46 100644 --- a/src/DynamicData/List/ItemChange.cs +++ b/src/DynamicData/List/ItemChange.cs @@ -25,7 +25,7 @@ namespace DynamicData; /// The previous. /// Value of the current. /// Value of the previous. - public ItemChange(ListChangeReason reason, T current, in Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) + public ItemChange(ListChangeReason reason, T current, in Optional previous, int currentIndex = -1, int previousIndex = -1) : this() { Reason = reason; @@ -48,7 +48,7 @@ public ItemChange(ListChangeReason reason, T current, int currentIndex) Current = current; CurrentIndex = currentIndex; PreviousIndex = -1; - Previous = Kernel.Optional.None; + Previous = Optional.None; } /// @@ -70,7 +70,7 @@ public ItemChange(ListChangeReason reason, T current, int currentIndex) /// Gets the item from before the change. /// This is only when is . /// - public Kernel.Optional Previous { get; } + public Optional Previous { get; } /// /// Gets the previous index. diff --git a/src/DynamicData/List/ListEx.cs b/src/DynamicData/List/ListEx.cs index b5ce7be21..0c935a6e8 100644 --- a/src/DynamicData/List/ListEx.cs +++ b/src/DynamicData/List/ListEx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -289,11 +289,11 @@ public static int IndexOf(this IEnumerable source, T item, IEqualityCompar /// The item. /// The equality comparer. /// The index of the item if available. - public static Kernel.Optional> IndexOfOptional(this IEnumerable source, T item, IEqualityComparer? equalityComparer = null) + public static Optional> IndexOfOptional(this IEnumerable source, T item, IEqualityComparer? equalityComparer = null) { var comparer = equalityComparer ?? EqualityComparer.Default; var index = source.IndexOf(item, comparer); - return index < 0 ? Kernel.Optional>.None : new ItemWithIndex(item, index); + return index < 0 ? Optional>.None : new ItemWithIndex(item, index); } /// diff --git a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs index 5e1fdd320..80854ec12 100644 --- a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs @@ -20,5 +20,10 @@ public static partial class ObservableListEx /// /// public static IObservable> StartWithEmpty(this IObservable> source) - where T : notnull => source.StartWith(ChangeSet.Empty); + where T : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + + return source.StartWith(ChangeSet.Empty); + } } diff --git a/src/DynamicData/List/ObservableListEx.Transform.cs b/src/DynamicData/List/ObservableListEx.Transform.cs index 46135789b..cbdf471c3 100644 --- a/src/DynamicData/List/ObservableListEx.Transform.cs +++ b/src/DynamicData/List/ObservableListEx.Transform.cs @@ -75,7 +75,7 @@ public static IObservable> Transform - public static IObservable> Transform(this IObservable> source, Func, TDestination> transformFactory, bool transformOnRefresh = false) + public static IObservable> Transform(this IObservable> source, Func, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { @@ -90,7 +90,7 @@ public static IObservable> Transform - public static IObservable> Transform(this IObservable> source, Func, int, TDestination> transformFactory, bool transformOnRefresh = false) + public static IObservable> Transform(this IObservable> source, Func, int, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { diff --git a/src/DynamicData/List/ObservableListEx.TransformAsync.cs b/src/DynamicData/List/ObservableListEx.TransformAsync.cs index 3062e29cb..a116edae7 100644 --- a/src/DynamicData/List/ObservableListEx.TransformAsync.cs +++ b/src/DynamicData/List/ObservableListEx.TransformAsync.cs @@ -78,7 +78,7 @@ public static IObservable> TransformAsync> TransformAsync( this IObservable> source, - Func, Task> transformFactory, + Func, Task> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull @@ -96,7 +96,7 @@ public static IObservable> TransformAsync> TransformAsync( this IObservable> source, - Func, int, Task> transformFactory, + Func, int, Task> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull diff --git a/src/DynamicData/List/Tests/ChangeSetAggregator.cs b/src/DynamicData/List/Tests/ChangeSetAggregator.cs index 4de790d0d..976964b17 100644 --- a/src/DynamicData/List/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/List/Tests/ChangeSetAggregator.cs @@ -22,6 +22,8 @@ public class ChangeSetAggregator : IDisposable /// The source. public ChangeSetAggregator(IObservable> source) { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + var published = source.Publish(); Data = published.AsObservableList(); diff --git a/src/DynamicData/Platforms/net45/PFilter.cs b/src/DynamicData/Platforms/net45/PFilter.cs index 55528c741..375de57cc 100644 --- a/src/DynamicData/Platforms/net45/PFilter.cs +++ b/src/DynamicData/Platforms/net45/PFilter.cs @@ -34,7 +34,7 @@ protected override IEnumerable GetChangesWithFilter(ChangeSet< return updates.Select(u => new UpdateWithFilter(Filter(u.Current), u)).ToArray(); } - protected override IEnumerable> Refresh(IEnumerable> items, Func, Kernel.Optional>> factory) + protected override IEnumerable> Refresh(IEnumerable> items, Func, Optional>> factory) { var keyValuePairs = items as KeyValuePair[] ?? items.ToArray(); diff --git a/src/DynamicData/Platforms/net45/PTransform.cs b/src/DynamicData/Platforms/net45/PTransform.cs index 1c1f34855..54e0f56fc 100644 --- a/src/DynamicData/Platforms/net45/PTransform.cs +++ b/src/DynamicData/Platforms/net45/PTransform.cs @@ -9,7 +9,7 @@ namespace DynamicData.PLinq { internal sealed class PTransform( IObservable> source, - Func, TKey, TDestination> transformFactory, + Func, TKey, TDestination> transformFactory, ParallelisationOptions parallelisationOptions, Action>? exceptionCallback = null) where TDestination : notnull @@ -106,7 +106,7 @@ public TransformResult(in Change change) : this() { Change = change; - Destination = Kernel.Optional.None; + Destination = Optional.None; Success = true; Key = change.Key; } @@ -126,7 +126,7 @@ public TransformResult(in Change change, Exception error) public bool Success { get; } - public Kernel.Optional Destination { get; } + public Optional Destination { get; } public TKey Key { get; } } From 929eb53eecec6068b84fbda0796e9ce30862ad66 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sat, 20 Jun 2026 17:34:20 +0100 Subject: [PATCH 09/36] Use ReactiveUI.Primitives.Optional across project Replace usages of DynamicData.Kernel.Optional with ReactiveUI.Primitives.Optional throughout the codebase and update related API surface (API approval files). Make several small API shape changes (make some structs readonly, expose init-only properties, and adjust ctor parameter names). Switch DynamicData.Reactive from package refs to local ReactiveUI.Primitives project references and add an MSBuild target to rewrite/generate Reactive sources into the intermediate output (with adjusted excludes and conditional removal of AsyncDisposeMany). Also update benchmark usings and a few tests/fixtures to match the updated Optional and generated-source changes. --- src/DynamicData.Benchmarks/Cache/EditDiff.cs | 4 +- .../DynamicData.Benchmarks.csproj | 3 + .../DynamicData.Reactive.csproj | 23 +- ...cDataReactiveTests.DotNet10_0.verified.txt | 215 +++++++----------- ...s.DynamicDataTests.DotNet10_0.verified.txt | 215 +++++++----------- .../AsyncDisposeManyFixture.UnitTests.cs | 5 +- .../Cache/CrossCacheDeadlockStressTest.cs | 1 - .../Cache/EditDiffChangeSetOptionalFixture.cs | 5 +- .../Cache/ToObservableOptionalFixture.cs | 1 - .../DynamicData.Tests.csproj | 5 + .../Kernal/DistinctUpdateFixture.cs | 5 +- src/DynamicData.Tests/Kernal/OptionFixture.cs | 54 ++--- .../Kernal/OptionObservableFixture.cs | 16 +- src/DynamicData.Tests/Kernal/UpdateFixture.cs | 5 +- src/DynamicData/Aggregation/AggregationEx.cs | 18 +- src/DynamicData/Aggregation/MaxEx.cs | 32 ++- src/DynamicData/Cache/Change.cs | 10 +- src/DynamicData/Cache/ChangeAwareCache.cs | 4 +- src/DynamicData/Cache/IGrouping.cs | 4 +- src/DynamicData/Cache/IntermediateCache.cs | 2 +- .../Cache/Internal/AbstractFilter.cs | 6 +- .../Internal/AnonymousObservableCache.cs | 2 +- .../Cache/Internal/AnonymousQuery.cs | 2 +- src/DynamicData/Cache/Internal/Cache.cs | 4 +- .../Cache/Internal/CacheUpdater.cs | 6 +- .../Cache/Internal/ChangeSetMergeTracker.cs | 10 +- .../Cache/Internal/DynamicGrouper.cs | 6 +- .../Internal/EditDiffChangeSetOptional.cs | 6 +- src/DynamicData/Cache/Internal/FullJoin.cs | 8 +- .../Cache/Internal/FullJoinMany.cs | 4 +- 30 files changed, 318 insertions(+), 363 deletions(-) diff --git a/src/DynamicData.Benchmarks/Cache/EditDiff.cs b/src/DynamicData.Benchmarks/Cache/EditDiff.cs index e8ca3f5a7..4a27a847e 100644 --- a/src/DynamicData.Benchmarks/Cache/EditDiff.cs +++ b/src/DynamicData.Benchmarks/Cache/EditDiff.cs @@ -1,7 +1,5 @@ using BenchmarkDotNet.Attributes; -using DynamicData.Kernel; - namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] @@ -44,7 +42,7 @@ public void OptionalAddsAndRemoves(int maxItems) .Range(0, MaxItems) .Select(n => (n % 2) == 0 ? new Person(n, "Name") - : Optional.None()) + : Optional.None) .ToObservable() .EditDiff(p => p.Id) .Subscribe(); diff --git a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj index ff45308a1..3ebc5ebae 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -25,8 +25,11 @@ + + + diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index d60a27cf4..8dc9082a4 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -12,9 +12,13 @@ true - + + + + @@ -26,11 +30,6 @@ - - - - - @@ -43,12 +42,20 @@ - + + + + + + + + + - + diff --git a/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataReactiveTests.DotNet10_0.verified.txt b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataReactiveTests.DotNet10_0.verified.txt index c8331afb6..e3d1b2e30 100644 --- a/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataReactiveTests.DotNet10_0.verified.txt +++ b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataReactiveTests.DotNet10_0.verified.txt @@ -7,14 +7,10 @@ namespace DynamicData.Reactive.Aggregation { public readonly struct AggregateItem : System.IEquatable> { - public AggregateItem(DynamicData.Reactive.Aggregation.AggregateType type, TObject item) { } - public TObject Item { get; } - public DynamicData.Reactive.Aggregation.AggregateType Type { get; } - public bool Equals(DynamicData.Reactive.Aggregation.AggregateItem other) { } - public override bool Equals(object? obj) { } + public AggregateItem(DynamicData.Reactive.Aggregation.AggregateType Type, TObject Item) { } + public TObject Item { get; init; } + public DynamicData.Reactive.Aggregation.AggregateType Type { get; init; } public override int GetHashCode() { } - public static bool operator !=(in DynamicData.Reactive.Aggregation.AggregateItem left, in DynamicData.Reactive.Aggregation.AggregateItem right) { } - public static bool operator ==(in DynamicData.Reactive.Aggregation.AggregateItem left, in DynamicData.Reactive.Aggregation.AggregateItem right) { } } public enum AggregateType { @@ -456,14 +452,12 @@ namespace DynamicData.Reactive.Binding public sealed class PropertyValue : System.IEquatable> { public PropertyValue(TObject sender, TValue value) { } - public TObject Sender { get; } - public TValue Value { get; } - public bool Equals(DynamicData.Reactive.Binding.PropertyValue? other) { } - public override bool Equals(object? obj) { } + public PropertyValue(TObject Sender, TValue? Value, bool UnobtainableValue) { } + public TObject Sender { get; init; } + public bool UnobtainableValue { get; init; } + public TValue Value { get; init; } public override int GetHashCode() { } public override string ToString() { } - public static bool operator !=(DynamicData.Reactive.Binding.PropertyValue? left, DynamicData.Reactive.Binding.PropertyValue? right) { } - public static bool operator ==(DynamicData.Reactive.Binding.PropertyValue? left, DynamicData.Reactive.Binding.PropertyValue? right) { } } public readonly struct SortAndBindOptions : System.IEquatable { @@ -544,7 +538,7 @@ namespace DynamicData.Reactive.Cache.Internal public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } public void Dispose() { } public void Edit(System.Action> editAction) { } - public DynamicData.Reactive.Kernel.Optional Lookup(TKey key) { } + public ReactiveUI.Primitives.Optional Lookup(TKey key) { } public System.IObservable> Preview(System.Func? predicate = null) { } public System.IObservable> Watch(TKey key) { } } @@ -567,7 +561,7 @@ namespace DynamicData.Reactive public DynamicData.Reactive.ChangeSet CaptureChanges() { } public void Clear() { } public void Clone(DynamicData.Reactive.IChangeSet changes) { } - public DynamicData.Reactive.Kernel.Optional Lookup(TKey key) { } + public ReactiveUI.Primitives.Optional Lookup(TKey key) { } public void Refresh() { } public void Refresh(System.Collections.Generic.IEnumerable keys) { } public void Refresh(TKey key) { } @@ -680,7 +674,7 @@ namespace DynamicData.Reactive public Change(DynamicData.Reactive.ListChangeReason reason, System.Collections.Generic.IEnumerable items, int index = -1) { } public Change(DynamicData.Reactive.ListChangeReason reason, T current, int index = -1) { } public Change(T current, int currentIndex, int previousIndex) { } - public Change(DynamicData.Reactive.ListChangeReason reason, T current, in DynamicData.Reactive.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public Change(DynamicData.Reactive.ListChangeReason reason, T current, in ReactiveUI.Primitives.Optional previous, int currentIndex = -1, int previousIndex = -1) { } public DynamicData.Reactive.ItemChange Item { get; } public DynamicData.Reactive.RangeChange Range { get; } public DynamicData.Reactive.ListChangeReason Reason { get; } @@ -698,11 +692,11 @@ namespace DynamicData.Reactive { public Change(DynamicData.Reactive.ChangeReason reason, TKey key, TObject current, int index = -1) { } public Change(TKey key, TObject current, int currentIndex, int previousIndex) { } - public Change(DynamicData.Reactive.ChangeReason reason, TKey key, TObject current, in DynamicData.Reactive.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public Change(DynamicData.Reactive.ChangeReason reason, TKey key, TObject current, in ReactiveUI.Primitives.Optional previous, int currentIndex = -1, int previousIndex = -1) { } public TObject Current { get; } public int CurrentIndex { get; } public TKey Key { get; } - public DynamicData.Reactive.Kernel.Optional Previous { get; } + public ReactiveUI.Primitives.Optional Previous { get; } public int PreviousIndex { get; } public DynamicData.Reactive.ChangeReason Reason { get; } public bool Equals(DynamicData.Reactive.Change other) { } @@ -841,7 +835,7 @@ namespace DynamicData.Reactive TGroupKey Key { get; } System.Collections.Generic.IEnumerable> KeyValues { get; } System.Collections.Generic.IEnumerable Keys { get; } - DynamicData.Reactive.Kernel.Optional Lookup(TKey key); + ReactiveUI.Primitives.Optional Lookup(TKey key); } public interface IImmutableGroupChangeSet : DynamicData.Reactive.IChangeSet, DynamicData.Reactive.IChangeSet, TGroupKey>, System.Collections.Generic.IEnumerable, TGroupKey>>, System.Collections.IEnumerable where TObject : notnull @@ -875,7 +869,7 @@ namespace DynamicData.Reactive System.Collections.Generic.IReadOnlyList Items { get; } System.Collections.Generic.IReadOnlyDictionary KeyValues { get; } System.Collections.Generic.IReadOnlyList Keys { get; } - DynamicData.Reactive.Kernel.Optional Lookup(TKey key); + ReactiveUI.Primitives.Optional Lookup(TKey key); } public interface IObservableList : System.IDisposable where T : notnull @@ -909,7 +903,7 @@ namespace DynamicData.Reactive System.Collections.Generic.IEnumerable Items { get; } System.Collections.Generic.IEnumerable> KeyValues { get; } System.Collections.Generic.IEnumerable Keys { get; } - DynamicData.Reactive.Kernel.Optional Lookup(TKey key); + ReactiveUI.Primitives.Optional Lookup(TKey key); } public interface ISortedChangeSetAdaptor where TObject : notnull @@ -997,7 +991,7 @@ namespace DynamicData.Reactive public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } public void Dispose() { } public void Edit(System.Action> updateAction) { } - public DynamicData.Reactive.Kernel.Optional Lookup(TKey key) { } + public ReactiveUI.Primitives.Optional Lookup(TKey key) { } public System.IObservable> Preview(System.Func? predicate = null) { } public System.IDisposable SuspendCount() { } public System.IDisposable SuspendNotifications() { } @@ -1008,10 +1002,10 @@ namespace DynamicData.Reactive { public static readonly DynamicData.Reactive.ItemChange Empty; public ItemChange(DynamicData.Reactive.ListChangeReason reason, T current, int currentIndex) { } - public ItemChange(DynamicData.Reactive.ListChangeReason reason, T current, in DynamicData.Reactive.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public ItemChange(DynamicData.Reactive.ListChangeReason reason, T current, in ReactiveUI.Primitives.Optional previous, int currentIndex = -1, int previousIndex = -1) { } public T Current { get; } public int CurrentIndex { get; } - public DynamicData.Reactive.Kernel.Optional Previous { get; } + public ReactiveUI.Primitives.Optional Previous { get; } public int PreviousIndex { get; } public DynamicData.Reactive.ListChangeReason Reason { get; } public bool Equals(DynamicData.Reactive.ItemChange other) { } @@ -1049,7 +1043,7 @@ namespace DynamicData.Reactive where T : notnull { } public static int IndexOf(this System.Collections.Generic.IEnumerable source, T item) { } public static int IndexOf(this System.Collections.Generic.IEnumerable source, T item, System.Collections.Generic.IEqualityComparer equalityComparer) { } - public static DynamicData.Reactive.Kernel.Optional> IndexOfOptional(this System.Collections.Generic.IEnumerable source, T item, System.Collections.Generic.IEqualityComparer? equalityComparer = null) { } + public static ReactiveUI.Primitives.Optional> IndexOfOptional(this System.Collections.Generic.IEnumerable source, T item, System.Collections.Generic.IEqualityComparer? equalityComparer = null) { } public static void Remove(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items) { } public static void RemoveMany(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable itemsToRemove) { } public static void Replace(this System.Collections.Generic.IList source, T original, T replaceWith) { } @@ -1073,13 +1067,13 @@ namespace DynamicData.Reactive where TKey : notnull { public Node(TObject item, TKey key) { } - public Node(TObject item, TKey key, in DynamicData.Reactive.Kernel.Optional> parent) { } + public Node(TObject item, TKey key, in ReactiveUI.Primitives.Optional> parent) { } public DynamicData.Reactive.IObservableCache, TKey> Children { get; } public int Depth { get; } public bool IsRoot { get; } public TObject Item { get; } public TKey Key { get; } - public DynamicData.Reactive.Kernel.Optional> Parent { get; } + public ReactiveUI.Primitives.Optional> Parent { get; } public void Dispose() { } protected virtual void Dispose(bool isDisposing) { } public bool Equals(DynamicData.Reactive.Node? other) { } @@ -1277,7 +1271,7 @@ namespace DynamicData.Reactive public static void EditDiff(this DynamicData.Reactive.ISourceCache source, System.Collections.Generic.IEnumerable allItems, System.Func areItemsEqual) where TObject : notnull where TKey : notnull { } - public static System.IObservable> EditDiff(this System.IObservable> source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + public static System.IObservable> EditDiff(this System.IObservable> source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { } public static System.IObservable> EditDiff(this System.IObservable> source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) @@ -1348,25 +1342,25 @@ namespace DynamicData.Reactive public static System.IObservable> ForEachChange(this System.IObservable> source, System.Action> action) where TObject : notnull where TKey : notnull { } - public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.Kernel.Optional, TDestination> resultSelector) + public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, ReactiveUI.Primitives.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.Kernel.Optional, TDestination> resultSelector) + public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, ReactiveUI.Primitives.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) + public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) + public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -1456,13 +1450,13 @@ namespace DynamicData.Reactive public static System.IObservable> InvokeEvaluate(this System.IObservable> source) where TObject : DynamicData.Reactive.Binding.IEvaluateAware where TKey : notnull { } - public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -1728,25 +1722,25 @@ namespace DynamicData.Reactive public static void RemoveKeys(this DynamicData.Reactive.ISourceCache source, System.Collections.Generic.IEnumerable keys) where TObject : notnull where TKey : notnull { } - public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) + public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) + public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) + public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) + public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Reactive.IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -1885,10 +1879,10 @@ namespace DynamicData.Reactive public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func keySelector, System.Func? expireAfter = null, int limitSizeTo = -1, System.Reactive.Concurrency.IScheduler? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, System.Collections.Generic.IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, bool initialOptionalWhenMissing, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, bool initialOptionalWhenMissing, System.Collections.Generic.IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { } public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Collections.Generic.IComparer comparer) @@ -1929,15 +1923,15 @@ namespace DynamicData.Reactive where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable forceTransform) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable>? forceTransform = null) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, bool transformOnRefresh) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, bool transformOnRefresh) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -1957,11 +1951,11 @@ namespace DynamicData.Reactive where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, DynamicData.Reactive.TransformAsyncOptions options) + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, DynamicData.Reactive.TransformAsyncOptions options) where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.IObservable>? forceTransform = null) + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -2077,11 +2071,11 @@ namespace DynamicData.Reactive where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -2101,11 +2095,11 @@ namespace DynamicData.Reactive where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, DynamicData.Reactive.TransformAsyncOptions options) + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, DynamicData.Reactive.TransformAsyncOptions options) where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -2461,25 +2455,25 @@ namespace DynamicData.Reactive public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, TDestination> transformFactory, bool transformOnRefresh = false) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, int, TDestination> transformFactory, bool transformOnRefresh = false) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, int, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } - public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } - public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, int, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, int, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) @@ -2550,14 +2544,14 @@ namespace DynamicData.Reactive public void SetStartingIndex(int index) { } public override string ToString() { } } - public struct SortAndPageOptions : System.IEquatable + public readonly struct SortAndPageOptions : System.IEquatable { public SortAndPageOptions() { } public int InitialCapacity { get; init; } public int ResetThreshold { get; init; } public bool UseBinarySearch { get; init; } } - public struct SortAndVirtualizeOptions : System.IEquatable + public readonly struct SortAndVirtualizeOptions : System.IEquatable { public SortAndVirtualizeOptions() { } public int InitialCapacity { get; init; } @@ -2615,7 +2609,7 @@ namespace DynamicData.Reactive public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } public void Dispose() { } public void Edit(System.Action> updateAction) { } - public DynamicData.Reactive.Kernel.Optional Lookup(TKey key) { } + public ReactiveUI.Primitives.Optional Lookup(TKey key) { } public System.IObservable> Preview(System.Func? predicate = null) { } public System.IDisposable SuspendCount() { } public System.IDisposable SuspendNotifications() { } @@ -2709,21 +2703,17 @@ namespace DynamicData.Reactive.Diagnostics public class ChangeStatistics : System.IEquatable { public ChangeStatistics() { } - public ChangeStatistics(int index, int adds, int updates, int removes, int refreshes, int moves, int count) { } - public int Adds { get; } - public int Count { get; } - public int Index { get; } + public ChangeStatistics(int Index, int Adds, int Updates, int Removes, int Refreshes, int Moves, int Count) { } + public int Adds { get; init; } + public int Count { get; init; } + public int Index { get; init; } public System.DateTime LastUpdated { get; } - public int Moves { get; } - public int Refreshes { get; } - public int Removes { get; } - public int Updates { get; } - public bool Equals(DynamicData.Reactive.Diagnostics.ChangeStatistics? other) { } - public override bool Equals(object? obj) { } + public int Moves { get; init; } + public int Refreshes { get; init; } + public int Removes { get; init; } + public int Updates { get; init; } public override int GetHashCode() { } public override string ToString() { } - public static bool operator !=(DynamicData.Reactive.Diagnostics.ChangeStatistics left, DynamicData.Reactive.Diagnostics.ChangeStatistics right) { } - public static bool operator ==(DynamicData.Reactive.Diagnostics.ChangeStatistics left, DynamicData.Reactive.Diagnostics.ChangeStatistics right) { } } public class ChangeSummary { @@ -2799,27 +2789,19 @@ namespace DynamicData.Reactive.Kernel } public readonly struct ItemWithIndex : System.IEquatable> { - public ItemWithIndex(T item, int index) { } - public int Index { get; } - public T Item { get; } - public bool Equals(DynamicData.Reactive.Kernel.ItemWithIndex other) { } - public override bool Equals(object? obj) { } + public ItemWithIndex(T Item, int Index) { } + public int Index { get; init; } + public T Item { get; init; } public override int GetHashCode() { } public override string ToString() { } - public static bool operator !=(in DynamicData.Reactive.Kernel.ItemWithIndex left, in DynamicData.Reactive.Kernel.ItemWithIndex right) { } - public static bool operator ==(in DynamicData.Reactive.Kernel.ItemWithIndex left, in DynamicData.Reactive.Kernel.ItemWithIndex right) { } } public readonly struct ItemWithValue : System.IEquatable> { - public ItemWithValue(TObject item, TValue value) { } - public TObject Item { get; } - public TValue Value { get; } - public bool Equals(DynamicData.Reactive.Kernel.ItemWithValue other) { } - public override bool Equals(object? obj) { } + public ItemWithValue(TObject Item, TValue Value) { } + public TObject Item { get; init; } + public TValue Value { get; init; } public override int GetHashCode() { } public override string ToString() { } - public static bool operator !=(in DynamicData.Reactive.Kernel.ItemWithValue left, in DynamicData.Reactive.Kernel.ItemWithValue right) { } - public static bool operator ==(in DynamicData.Reactive.Kernel.ItemWithValue left, in DynamicData.Reactive.Kernel.ItemWithValue right) { } } public sealed class OptionElse { @@ -2827,86 +2809,61 @@ namespace DynamicData.Reactive.Kernel } public static class OptionExtensions { - public static DynamicData.Reactive.Kernel.Optional Convert(this in DynamicData.Reactive.Kernel.Optional source, System.Func> converter) + public static ReactiveUI.Primitives.Optional Convert(this in ReactiveUI.Primitives.Optional source, System.Func> converter) where TSource : notnull where TDestination : notnull { } - public static DynamicData.Reactive.Kernel.Optional Convert(this in DynamicData.Reactive.Kernel.Optional source, System.Func converter) + public static ReactiveUI.Primitives.Optional Convert(this in ReactiveUI.Primitives.Optional source, System.Func converter) where TSource : notnull where TDestination : notnull { } - public static TDestination? ConvertOr(this in DynamicData.Reactive.Kernel.Optional source, System.Func converter, System.Func fallbackConverter) + public static TDestination? ConvertOr(this in ReactiveUI.Primitives.Optional source, System.Func converter, System.Func fallbackConverter) where TSource : notnull { } - public static DynamicData.Reactive.Kernel.Optional FirstOrOptional(this System.Collections.Generic.IEnumerable source, System.Func selector) + public static ReactiveUI.Primitives.Optional FirstOrOptional(this System.Collections.Generic.IEnumerable source, System.Func selector) where T : notnull { } - public static DynamicData.Reactive.Kernel.OptionElse IfHasValue(this DynamicData.Reactive.Kernel.Optional? source, System.Action action) + public static DynamicData.Reactive.Kernel.OptionElse IfHasValue(this ReactiveUI.Primitives.Optional? source, System.Action action) where T : notnull { } - public static DynamicData.Reactive.Kernel.OptionElse IfHasValue(this in DynamicData.Reactive.Kernel.Optional source, System.Action action) + public static DynamicData.Reactive.Kernel.OptionElse IfHasValue(this in ReactiveUI.Primitives.Optional source, System.Action action) where T : notnull { } - public static DynamicData.Reactive.Kernel.Optional Lookup(this System.Collections.Generic.IDictionary source, TKey key) + public static ReactiveUI.Primitives.Optional Lookup(this System.Collections.Generic.IDictionary source, TKey key) where TValue : notnull { } - public static DynamicData.Reactive.Kernel.Optional OrElse(this in DynamicData.Reactive.Kernel.Optional source, System.Func> fallbackOperation) + public static ReactiveUI.Primitives.Optional OrElse(this in ReactiveUI.Primitives.Optional source, System.Func> fallbackOperation) where T : notnull { } public static bool RemoveIfContained(this System.Collections.Generic.IDictionary source, TKey key) { } - public static System.Collections.Generic.IEnumerable SelectValues(this System.Collections.Generic.IEnumerable> source) + public static System.Collections.Generic.IEnumerable SelectValues(this System.Collections.Generic.IEnumerable> source) where T : notnull { } public static T ValueOr(this T? source, T defaultValue) where T : struct { } - public static T ValueOr(this in DynamicData.Reactive.Kernel.Optional source, System.Func valueSelector) + public static T ValueOr(this in ReactiveUI.Primitives.Optional source, System.Func valueSelector) where T : notnull { } - public static T? ValueOrDefault(this in DynamicData.Reactive.Kernel.Optional source) + public static T? ValueOrDefault(this in ReactiveUI.Primitives.Optional source) where T : notnull { } - public static T ValueOrThrow(this in DynamicData.Reactive.Kernel.Optional source, System.Func exceptionGenerator) + public static T ValueOrThrow(this in ReactiveUI.Primitives.Optional source, System.Func exceptionGenerator) where T : notnull { } } public static class OptionObservableExtensions { - public static System.IObservable> Convert(this System.IObservable> source, System.Func> converter) + public static System.IObservable> Convert(this System.IObservable> source, System.Func> converter) where TSource : notnull where TDestination : notnull { } - public static System.IObservable> Convert(this System.IObservable> source, System.Func converter) + public static System.IObservable> Convert(this System.IObservable> source, System.Func converter) where TSource : notnull where TDestination : notnull { } - public static System.IObservable ConvertOr(this System.IObservable> source, System.Func converter, System.Func fallbackConverter) + public static System.IObservable ConvertOr(this System.IObservable> source, System.Func converter, System.Func fallbackConverter) where TSource : notnull { } - public static System.IObservable> OnHasNoValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) + public static System.IObservable> OnHasNoValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) where T : notnull { } - public static System.IObservable> OnHasValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) + public static System.IObservable> OnHasValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) where T : notnull { } - public static System.IObservable> OrElse(this System.IObservable> source, System.Func> fallbackOperation) + public static System.IObservable> OrElse(this System.IObservable> source, System.Func> fallbackOperation) where T : notnull { } - public static System.IObservable SelectValues(this System.IObservable> source) + public static System.IObservable SelectValues(this System.IObservable> source) where T : notnull { } - public static System.IObservable ValueOr(this System.IObservable> source, System.Func valueSelector) + public static System.IObservable ValueOr(this System.IObservable> source, System.Func valueSelector) where T : notnull { } - public static System.IObservable ValueOrDefault(this System.IObservable> source) - where T : notnull { } - public static System.IObservable ValueOrThrow(this System.IObservable> source, System.Func exceptionGenerator) - where T : notnull { } - } - public static class Optional - { - public static DynamicData.Reactive.Kernel.Optional None() + public static System.IObservable ValueOrDefault(this System.IObservable> source) where T : notnull { } - public static DynamicData.Reactive.Kernel.Optional Some(T? value) + public static System.IObservable ValueOrThrow(this System.IObservable> source, System.Func exceptionGenerator) where T : notnull { } } - public readonly struct Optional : System.IEquatable> - where T : notnull - { - public bool HasValue { get; } - public T Value { get; } - public static DynamicData.Reactive.Kernel.Optional None { get; } - public bool Equals(DynamicData.Reactive.Kernel.Optional other) { } - public override bool Equals(object? obj) { } - public override int GetHashCode() { } - public override string? ToString() { } - public static DynamicData.Reactive.Kernel.Optional Create(T? value) { } - public static T? FromOptional(in DynamicData.Reactive.Kernel.Optional value) { } - public static DynamicData.Reactive.Kernel.Optional ToOptional(T? value) { } - public static T? op_Explicit(in DynamicData.Reactive.Kernel.Optional value) { } - public static DynamicData.Reactive.Kernel.Optional op_Implicit(T? value) { } - public static bool operator !=(in DynamicData.Reactive.Kernel.Optional left, in DynamicData.Reactive.Kernel.Optional right) { } - public static bool operator ==(in DynamicData.Reactive.Kernel.Optional left, in DynamicData.Reactive.Kernel.Optional right) { } - } } namespace DynamicData.Reactive.List { diff --git a/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet10_0.verified.txt b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet10_0.verified.txt index dfc954f44..5a14a98c2 100644 --- a/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet10_0.verified.txt +++ b/src/DynamicData.Tests/API/ApiApprovalTests.DynamicDataTests.DotNet10_0.verified.txt @@ -7,14 +7,10 @@ namespace DynamicData.Aggregation { public readonly struct AggregateItem : System.IEquatable> { - public AggregateItem(DynamicData.Aggregation.AggregateType type, TObject item) { } - public TObject Item { get; } - public DynamicData.Aggregation.AggregateType Type { get; } - public bool Equals(DynamicData.Aggregation.AggregateItem other) { } - public override bool Equals(object? obj) { } + public AggregateItem(DynamicData.Aggregation.AggregateType Type, TObject Item) { } + public TObject Item { get; init; } + public DynamicData.Aggregation.AggregateType Type { get; init; } public override int GetHashCode() { } - public static bool operator !=(in DynamicData.Aggregation.AggregateItem left, in DynamicData.Aggregation.AggregateItem right) { } - public static bool operator ==(in DynamicData.Aggregation.AggregateItem left, in DynamicData.Aggregation.AggregateItem right) { } } public enum AggregateType { @@ -456,14 +452,12 @@ namespace DynamicData.Binding public sealed class PropertyValue : System.IEquatable> { public PropertyValue(TObject sender, TValue value) { } - public TObject Sender { get; } - public TValue Value { get; } - public bool Equals(DynamicData.Binding.PropertyValue? other) { } - public override bool Equals(object? obj) { } + public PropertyValue(TObject Sender, TValue? Value, bool UnobtainableValue) { } + public TObject Sender { get; init; } + public bool UnobtainableValue { get; init; } + public TValue Value { get; init; } public override int GetHashCode() { } public override string ToString() { } - public static bool operator !=(DynamicData.Binding.PropertyValue? left, DynamicData.Binding.PropertyValue? right) { } - public static bool operator ==(DynamicData.Binding.PropertyValue? left, DynamicData.Binding.PropertyValue? right) { } } public readonly struct SortAndBindOptions : System.IEquatable { @@ -544,7 +538,7 @@ namespace DynamicData.Cache.Internal public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } public void Dispose() { } public void Edit(System.Action> editAction) { } - public DynamicData.Kernel.Optional Lookup(TKey key) { } + public ReactiveUI.Primitives.Optional Lookup(TKey key) { } public System.IObservable> Preview(System.Func? predicate = null) { } public System.IObservable> Watch(TKey key) { } } @@ -567,7 +561,7 @@ namespace DynamicData public DynamicData.ChangeSet CaptureChanges() { } public void Clear() { } public void Clone(DynamicData.IChangeSet changes) { } - public DynamicData.Kernel.Optional Lookup(TKey key) { } + public ReactiveUI.Primitives.Optional Lookup(TKey key) { } public void Refresh() { } public void Refresh(System.Collections.Generic.IEnumerable keys) { } public void Refresh(TKey key) { } @@ -680,7 +674,7 @@ namespace DynamicData public Change(DynamicData.ListChangeReason reason, System.Collections.Generic.IEnumerable items, int index = -1) { } public Change(DynamicData.ListChangeReason reason, T current, int index = -1) { } public Change(T current, int currentIndex, int previousIndex) { } - public Change(DynamicData.ListChangeReason reason, T current, in DynamicData.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public Change(DynamicData.ListChangeReason reason, T current, in ReactiveUI.Primitives.Optional previous, int currentIndex = -1, int previousIndex = -1) { } public DynamicData.ItemChange Item { get; } public DynamicData.RangeChange Range { get; } public DynamicData.ListChangeReason Reason { get; } @@ -698,11 +692,11 @@ namespace DynamicData { public Change(DynamicData.ChangeReason reason, TKey key, TObject current, int index = -1) { } public Change(TKey key, TObject current, int currentIndex, int previousIndex) { } - public Change(DynamicData.ChangeReason reason, TKey key, TObject current, in DynamicData.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public Change(DynamicData.ChangeReason reason, TKey key, TObject current, in ReactiveUI.Primitives.Optional previous, int currentIndex = -1, int previousIndex = -1) { } public TObject Current { get; } public int CurrentIndex { get; } public TKey Key { get; } - public DynamicData.Kernel.Optional Previous { get; } + public ReactiveUI.Primitives.Optional Previous { get; } public int PreviousIndex { get; } public DynamicData.ChangeReason Reason { get; } public bool Equals(DynamicData.Change other) { } @@ -841,7 +835,7 @@ namespace DynamicData TGroupKey Key { get; } System.Collections.Generic.IEnumerable> KeyValues { get; } System.Collections.Generic.IEnumerable Keys { get; } - DynamicData.Kernel.Optional Lookup(TKey key); + ReactiveUI.Primitives.Optional Lookup(TKey key); } public interface IImmutableGroupChangeSet : DynamicData.IChangeSet, DynamicData.IChangeSet, TGroupKey>, System.Collections.Generic.IEnumerable, TGroupKey>>, System.Collections.IEnumerable where TObject : notnull @@ -875,7 +869,7 @@ namespace DynamicData System.Collections.Generic.IReadOnlyList Items { get; } System.Collections.Generic.IReadOnlyDictionary KeyValues { get; } System.Collections.Generic.IReadOnlyList Keys { get; } - DynamicData.Kernel.Optional Lookup(TKey key); + ReactiveUI.Primitives.Optional Lookup(TKey key); } public interface IObservableList : System.IDisposable where T : notnull @@ -909,7 +903,7 @@ namespace DynamicData System.Collections.Generic.IEnumerable Items { get; } System.Collections.Generic.IEnumerable> KeyValues { get; } System.Collections.Generic.IEnumerable Keys { get; } - DynamicData.Kernel.Optional Lookup(TKey key); + ReactiveUI.Primitives.Optional Lookup(TKey key); } public interface ISortedChangeSetAdaptor where TObject : notnull @@ -997,7 +991,7 @@ namespace DynamicData public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } public void Dispose() { } public void Edit(System.Action> updateAction) { } - public DynamicData.Kernel.Optional Lookup(TKey key) { } + public ReactiveUI.Primitives.Optional Lookup(TKey key) { } public System.IObservable> Preview(System.Func? predicate = null) { } public System.IDisposable SuspendCount() { } public System.IDisposable SuspendNotifications() { } @@ -1008,10 +1002,10 @@ namespace DynamicData { public static readonly DynamicData.ItemChange Empty; public ItemChange(DynamicData.ListChangeReason reason, T current, int currentIndex) { } - public ItemChange(DynamicData.ListChangeReason reason, T current, in DynamicData.Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) { } + public ItemChange(DynamicData.ListChangeReason reason, T current, in ReactiveUI.Primitives.Optional previous, int currentIndex = -1, int previousIndex = -1) { } public T Current { get; } public int CurrentIndex { get; } - public DynamicData.Kernel.Optional Previous { get; } + public ReactiveUI.Primitives.Optional Previous { get; } public int PreviousIndex { get; } public DynamicData.ListChangeReason Reason { get; } public bool Equals(DynamicData.ItemChange other) { } @@ -1049,7 +1043,7 @@ namespace DynamicData where T : notnull { } public static int IndexOf(this System.Collections.Generic.IEnumerable source, T item) { } public static int IndexOf(this System.Collections.Generic.IEnumerable source, T item, System.Collections.Generic.IEqualityComparer equalityComparer) { } - public static DynamicData.Kernel.Optional> IndexOfOptional(this System.Collections.Generic.IEnumerable source, T item, System.Collections.Generic.IEqualityComparer? equalityComparer = null) { } + public static ReactiveUI.Primitives.Optional> IndexOfOptional(this System.Collections.Generic.IEnumerable source, T item, System.Collections.Generic.IEqualityComparer? equalityComparer = null) { } public static void Remove(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable items) { } public static void RemoveMany(this System.Collections.Generic.IList source, System.Collections.Generic.IEnumerable itemsToRemove) { } public static void Replace(this System.Collections.Generic.IList source, T original, T replaceWith) { } @@ -1073,13 +1067,13 @@ namespace DynamicData where TKey : notnull { public Node(TObject item, TKey key) { } - public Node(TObject item, TKey key, in DynamicData.Kernel.Optional> parent) { } + public Node(TObject item, TKey key, in ReactiveUI.Primitives.Optional> parent) { } public DynamicData.IObservableCache, TKey> Children { get; } public int Depth { get; } public bool IsRoot { get; } public TObject Item { get; } public TKey Key { get; } - public DynamicData.Kernel.Optional> Parent { get; } + public ReactiveUI.Primitives.Optional> Parent { get; } public void Dispose() { } protected virtual void Dispose(bool isDisposing) { } public bool Equals(DynamicData.Node? other) { } @@ -1277,7 +1271,7 @@ namespace DynamicData public static void EditDiff(this DynamicData.ISourceCache source, System.Collections.Generic.IEnumerable allItems, System.Func areItemsEqual) where TObject : notnull where TKey : notnull { } - public static System.IObservable> EditDiff(this System.IObservable> source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + public static System.IObservable> EditDiff(this System.IObservable> source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { } public static System.IObservable> EditDiff(this System.IObservable> source, System.Func keySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) @@ -1348,25 +1342,25 @@ namespace DynamicData public static System.IObservable> ForEachChange(this System.IObservable> source, System.Action> action) where TObject : notnull where TKey : notnull { } - public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Kernel.Optional, TDestination> resultSelector) + public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, ReactiveUI.Primitives.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.Kernel.Optional, TDestination> resultSelector) + public static System.IObservable> FullJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, ReactiveUI.Primitives.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) + public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) + public static System.IObservable> FullJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -1456,13 +1450,13 @@ namespace DynamicData public static System.IObservable> InvokeEvaluate(this System.IObservable> source) where TObject : DynamicData.Binding.IEvaluateAware where TKey : notnull { } - public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) + public static System.IObservable> LeftJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -1728,25 +1722,25 @@ namespace DynamicData public static void RemoveKeys(this DynamicData.ISourceCache source, System.Collections.Generic.IEnumerable keys) where TObject : notnull where TKey : notnull { } - public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) + public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) + public static System.IObservable> RightJoin(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) + public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull where TRightKey : notnull where TDestination : notnull { } - public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) + public static System.IObservable> RightJoinMany(this System.IObservable> left, System.IObservable> right, System.Func rightKeySelector, System.Func, DynamicData.IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -1885,10 +1879,10 @@ namespace DynamicData public static System.IObservable> ToObservableChangeSet(this System.IObservable source, System.Func keySelector, System.Func? expireAfter = null, int limitSizeTo = -1, ReactiveUI.Primitives.Concurrency.ISequencer? scheduler = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, System.Collections.Generic.IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { } - public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, bool initialOptionalWhenMissing, System.Collections.Generic.IEqualityComparer? equalityComparer = null) + public static System.IObservable> ToObservableOptional(this System.IObservable> source, TKey key, bool initialOptionalWhenMissing, System.Collections.Generic.IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { } public static System.IObservable> ToSortedCollection(this System.IObservable> source, System.Collections.Generic.IComparer comparer) @@ -1929,15 +1923,15 @@ namespace DynamicData where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable forceTransform) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable>? forceTransform = null) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, bool transformOnRefresh) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, bool transformOnRefresh) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -1957,11 +1951,11 @@ namespace DynamicData where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, DynamicData.TransformAsyncOptions options) + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, DynamicData.TransformAsyncOptions options) where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.IObservable>? forceTransform = null) + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -2077,11 +2071,11 @@ namespace DynamicData where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable forceTransform) + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + public static System.IObservable> TransformSafe(this System.IObservable> source, System.Func, TKey, TDestination> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -2101,11 +2095,11 @@ namespace DynamicData where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, DynamicData.TransformAsyncOptions options) + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, DynamicData.TransformAsyncOptions options) where TDestination : notnull where TSource : notnull where TKey : notnull { } - public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) + public static System.IObservable> TransformSafeAsync(this System.IObservable> source, System.Func, TKey, System.Threading.Tasks.Task> transformFactory, System.Action> errorHandler, System.IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull { } @@ -2461,25 +2455,25 @@ namespace DynamicData public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, TDestination> transformFactory, bool transformOnRefresh = false) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } public static System.IObservable> Transform(this System.IObservable> source, System.Func transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } - public static System.IObservable> Transform(this System.IObservable> source, System.Func, int, TDestination> transformFactory, bool transformOnRefresh = false) + public static System.IObservable> Transform(this System.IObservable> source, System.Func, int, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } - public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } - public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, int, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) + public static System.IObservable> TransformAsync(this System.IObservable> source, System.Func, int, System.Threading.Tasks.Task> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { } public static System.IObservable> TransformMany(this System.IObservable> source, System.Func> manySelector, System.Collections.Generic.IEqualityComparer? equalityComparer = null) @@ -2550,14 +2544,14 @@ namespace DynamicData public void SetStartingIndex(int index) { } public override string ToString() { } } - public struct SortAndPageOptions : System.IEquatable + public readonly struct SortAndPageOptions : System.IEquatable { public SortAndPageOptions() { } public int InitialCapacity { get; init; } public int ResetThreshold { get; init; } public bool UseBinarySearch { get; init; } } - public struct SortAndVirtualizeOptions : System.IEquatable + public readonly struct SortAndVirtualizeOptions : System.IEquatable { public SortAndVirtualizeOptions() { } public int InitialCapacity { get; init; } @@ -2615,7 +2609,7 @@ namespace DynamicData public System.IObservable> Connect(System.Func? predicate = null, bool suppressEmptyChangeSets = true) { } public void Dispose() { } public void Edit(System.Action> updateAction) { } - public DynamicData.Kernel.Optional Lookup(TKey key) { } + public ReactiveUI.Primitives.Optional Lookup(TKey key) { } public System.IObservable> Preview(System.Func? predicate = null) { } public System.IDisposable SuspendCount() { } public System.IDisposable SuspendNotifications() { } @@ -2709,21 +2703,17 @@ namespace DynamicData.Diagnostics public class ChangeStatistics : System.IEquatable { public ChangeStatistics() { } - public ChangeStatistics(int index, int adds, int updates, int removes, int refreshes, int moves, int count) { } - public int Adds { get; } - public int Count { get; } - public int Index { get; } + public ChangeStatistics(int Index, int Adds, int Updates, int Removes, int Refreshes, int Moves, int Count) { } + public int Adds { get; init; } + public int Count { get; init; } + public int Index { get; init; } public System.DateTime LastUpdated { get; } - public int Moves { get; } - public int Refreshes { get; } - public int Removes { get; } - public int Updates { get; } - public bool Equals(DynamicData.Diagnostics.ChangeStatistics? other) { } - public override bool Equals(object? obj) { } + public int Moves { get; init; } + public int Refreshes { get; init; } + public int Removes { get; init; } + public int Updates { get; init; } public override int GetHashCode() { } public override string ToString() { } - public static bool operator !=(DynamicData.Diagnostics.ChangeStatistics left, DynamicData.Diagnostics.ChangeStatistics right) { } - public static bool operator ==(DynamicData.Diagnostics.ChangeStatistics left, DynamicData.Diagnostics.ChangeStatistics right) { } } public class ChangeSummary { @@ -2799,27 +2789,19 @@ namespace DynamicData.Kernel } public readonly struct ItemWithIndex : System.IEquatable> { - public ItemWithIndex(T item, int index) { } - public int Index { get; } - public T Item { get; } - public bool Equals(DynamicData.Kernel.ItemWithIndex other) { } - public override bool Equals(object? obj) { } + public ItemWithIndex(T Item, int Index) { } + public int Index { get; init; } + public T Item { get; init; } public override int GetHashCode() { } public override string ToString() { } - public static bool operator !=(in DynamicData.Kernel.ItemWithIndex left, in DynamicData.Kernel.ItemWithIndex right) { } - public static bool operator ==(in DynamicData.Kernel.ItemWithIndex left, in DynamicData.Kernel.ItemWithIndex right) { } } public readonly struct ItemWithValue : System.IEquatable> { - public ItemWithValue(TObject item, TValue value) { } - public TObject Item { get; } - public TValue Value { get; } - public bool Equals(DynamicData.Kernel.ItemWithValue other) { } - public override bool Equals(object? obj) { } + public ItemWithValue(TObject Item, TValue Value) { } + public TObject Item { get; init; } + public TValue Value { get; init; } public override int GetHashCode() { } public override string ToString() { } - public static bool operator !=(in DynamicData.Kernel.ItemWithValue left, in DynamicData.Kernel.ItemWithValue right) { } - public static bool operator ==(in DynamicData.Kernel.ItemWithValue left, in DynamicData.Kernel.ItemWithValue right) { } } public sealed class OptionElse { @@ -2827,86 +2809,61 @@ namespace DynamicData.Kernel } public static class OptionExtensions { - public static DynamicData.Kernel.Optional Convert(this in DynamicData.Kernel.Optional source, System.Func> converter) + public static ReactiveUI.Primitives.Optional Convert(this in ReactiveUI.Primitives.Optional source, System.Func> converter) where TSource : notnull where TDestination : notnull { } - public static DynamicData.Kernel.Optional Convert(this in DynamicData.Kernel.Optional source, System.Func converter) + public static ReactiveUI.Primitives.Optional Convert(this in ReactiveUI.Primitives.Optional source, System.Func converter) where TSource : notnull where TDestination : notnull { } - public static TDestination? ConvertOr(this in DynamicData.Kernel.Optional source, System.Func converter, System.Func fallbackConverter) + public static TDestination? ConvertOr(this in ReactiveUI.Primitives.Optional source, System.Func converter, System.Func fallbackConverter) where TSource : notnull { } - public static DynamicData.Kernel.Optional FirstOrOptional(this System.Collections.Generic.IEnumerable source, System.Func selector) + public static ReactiveUI.Primitives.Optional FirstOrOptional(this System.Collections.Generic.IEnumerable source, System.Func selector) where T : notnull { } - public static DynamicData.Kernel.OptionElse IfHasValue(this DynamicData.Kernel.Optional? source, System.Action action) + public static DynamicData.Kernel.OptionElse IfHasValue(this ReactiveUI.Primitives.Optional? source, System.Action action) where T : notnull { } - public static DynamicData.Kernel.OptionElse IfHasValue(this in DynamicData.Kernel.Optional source, System.Action action) + public static DynamicData.Kernel.OptionElse IfHasValue(this in ReactiveUI.Primitives.Optional source, System.Action action) where T : notnull { } - public static DynamicData.Kernel.Optional Lookup(this System.Collections.Generic.IDictionary source, TKey key) + public static ReactiveUI.Primitives.Optional Lookup(this System.Collections.Generic.IDictionary source, TKey key) where TValue : notnull { } - public static DynamicData.Kernel.Optional OrElse(this in DynamicData.Kernel.Optional source, System.Func> fallbackOperation) + public static ReactiveUI.Primitives.Optional OrElse(this in ReactiveUI.Primitives.Optional source, System.Func> fallbackOperation) where T : notnull { } public static bool RemoveIfContained(this System.Collections.Generic.IDictionary source, TKey key) { } - public static System.Collections.Generic.IEnumerable SelectValues(this System.Collections.Generic.IEnumerable> source) + public static System.Collections.Generic.IEnumerable SelectValues(this System.Collections.Generic.IEnumerable> source) where T : notnull { } public static T ValueOr(this T? source, T defaultValue) where T : struct { } - public static T ValueOr(this in DynamicData.Kernel.Optional source, System.Func valueSelector) + public static T ValueOr(this in ReactiveUI.Primitives.Optional source, System.Func valueSelector) where T : notnull { } - public static T? ValueOrDefault(this in DynamicData.Kernel.Optional source) + public static T? ValueOrDefault(this in ReactiveUI.Primitives.Optional source) where T : notnull { } - public static T ValueOrThrow(this in DynamicData.Kernel.Optional source, System.Func exceptionGenerator) + public static T ValueOrThrow(this in ReactiveUI.Primitives.Optional source, System.Func exceptionGenerator) where T : notnull { } } public static class OptionObservableExtensions { - public static System.IObservable> Convert(this System.IObservable> source, System.Func> converter) + public static System.IObservable> Convert(this System.IObservable> source, System.Func> converter) where TSource : notnull where TDestination : notnull { } - public static System.IObservable> Convert(this System.IObservable> source, System.Func converter) + public static System.IObservable> Convert(this System.IObservable> source, System.Func converter) where TSource : notnull where TDestination : notnull { } - public static System.IObservable ConvertOr(this System.IObservable> source, System.Func converter, System.Func fallbackConverter) + public static System.IObservable ConvertOr(this System.IObservable> source, System.Func converter, System.Func fallbackConverter) where TSource : notnull { } - public static System.IObservable> OnHasNoValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) + public static System.IObservable> OnHasNoValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) where T : notnull { } - public static System.IObservable> OnHasValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) + public static System.IObservable> OnHasValue(this System.IObservable> source, System.Action action, System.Action? elseAction = null) where T : notnull { } - public static System.IObservable> OrElse(this System.IObservable> source, System.Func> fallbackOperation) + public static System.IObservable> OrElse(this System.IObservable> source, System.Func> fallbackOperation) where T : notnull { } - public static System.IObservable SelectValues(this System.IObservable> source) + public static System.IObservable SelectValues(this System.IObservable> source) where T : notnull { } - public static System.IObservable ValueOr(this System.IObservable> source, System.Func valueSelector) + public static System.IObservable ValueOr(this System.IObservable> source, System.Func valueSelector) where T : notnull { } - public static System.IObservable ValueOrDefault(this System.IObservable> source) - where T : notnull { } - public static System.IObservable ValueOrThrow(this System.IObservable> source, System.Func exceptionGenerator) - where T : notnull { } - } - public static class Optional - { - public static DynamicData.Kernel.Optional None() + public static System.IObservable ValueOrDefault(this System.IObservable> source) where T : notnull { } - public static DynamicData.Kernel.Optional Some(T? value) + public static System.IObservable ValueOrThrow(this System.IObservable> source, System.Func exceptionGenerator) where T : notnull { } } - public readonly struct Optional : System.IEquatable> - where T : notnull - { - public bool HasValue { get; } - public T Value { get; } - public static DynamicData.Kernel.Optional None { get; } - public bool Equals(DynamicData.Kernel.Optional other) { } - public override bool Equals(object? obj) { } - public override int GetHashCode() { } - public override string? ToString() { } - public static DynamicData.Kernel.Optional Create(T? value) { } - public static T? FromOptional(in DynamicData.Kernel.Optional value) { } - public static DynamicData.Kernel.Optional ToOptional(T? value) { } - public static T? op_Explicit(in DynamicData.Kernel.Optional value) { } - public static DynamicData.Kernel.Optional op_Implicit(T? value) { } - public static bool operator !=(in DynamicData.Kernel.Optional left, in DynamicData.Kernel.Optional right) { } - public static bool operator ==(in DynamicData.Kernel.Optional left, in DynamicData.Kernel.Optional right) { } - } } namespace DynamicData.List { diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs index d8f313b14..420c86039 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs @@ -1,5 +1,4 @@ using DynamicData.Cache.Internal; -using DynamicData.Kernel; using FluentAssertions; @@ -66,8 +65,8 @@ public void ItemsAreAddedMovedOrRefreshed_ItemsAreNotDisposed(ItemType itemType) items.Move(2, 1, items[2]); source.OnNext(new ChangeSet() { - new(reason: ChangeReason.Moved, key: items[0].Id, current: items[0], previous: Optional.None(), currentIndex: 0, previousIndex: 2), - new(reason: ChangeReason.Moved, key: items[1].Id, current: items[1], previous: Optional.None(), currentIndex: 1, previousIndex: 2) + new(reason: ChangeReason.Moved, key: items[0].Id, current: items[0], previous: Optional.None, currentIndex: 0, previousIndex: 2), + new(reason: ChangeReason.Moved, key: items[1].Id, current: items[1], previous: Optional.None, currentIndex: 1, previousIndex: 2) }); results.Error.Should().BeNull(); diff --git a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs index e448dd3d5..4758ebe37 100644 --- a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs +++ b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs @@ -7,7 +7,6 @@ using DynamicData.Binding; using FluentAssertions; -using ReactiveUI.Primitives.Disposables; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs index 9e5a2f291..e62e89266 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs @@ -1,13 +1,12 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; -using DynamicData.Kernel; using FluentAssertions; namespace DynamicData.Tests.Cache; public class EditDiffChangeSetOptionalFixture { - private static readonly Optional s_noPerson = Optional.None(); + private static readonly Optional s_noPerson = Optional.None; private const int MaxItems = 1097; @@ -178,7 +177,7 @@ public void ResultFailsIfAndOnlyIfSourceFails (bool failSource) receivedError.Should().Be(failSource ? testException : default); } - private static Optional CreatePerson(int id, string name) => Optional.Some(new Person(id, name)); + private static Optional CreatePerson(int id, string name) => Optional.Some(new Person(id, name)); private class PersonComparer : IEqualityComparer { diff --git a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs index 557f35105..54a9dcd3c 100644 --- a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs @@ -1,5 +1,4 @@ using System.Diagnostics.CodeAnalysis; -using DynamicData.Kernel; using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index b1036fb6b..0e050574d 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -29,10 +29,15 @@ + + + + + diff --git a/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs b/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs index 5321cfd1b..4ff413cec 100644 --- a/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs +++ b/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs @@ -1,4 +1,3 @@ -using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; @@ -16,7 +15,7 @@ public void Add() update.Key.Should().Be(person); update.Reason.Should().Be(ChangeReason.Add); update.Current.Should().Be(person); - update.Previous.Should().Be(Optional.None()); + update.Previous.Should().Be(Optional.None); } [Fact] @@ -28,7 +27,7 @@ public void Remove() update.Key.Should().Be(person); update.Reason.Should().Be(ChangeReason.Remove); update.Current.Should().Be(person); - update.Previous.Should().Be(Optional.None()); + update.Previous.Should().Be(Optional.None); } [Fact] diff --git a/src/DynamicData.Tests/Kernal/OptionFixture.cs b/src/DynamicData.Tests/Kernal/OptionFixture.cs index 6ee3f8c26..35e350855 100644 --- a/src/DynamicData.Tests/Kernal/OptionFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionFixture.cs @@ -49,22 +49,22 @@ public void OptionIfHasValueInvokedIfOptionHasValue() [Fact] public void OptionNoneHasNoValue() { - var option = Optional.None>(); + var option = Optional>.None; option.HasValue.Should().BeFalse(); } [Fact] public void OptionSetToNullHasNoValue1() { - Person? person = null; - var option = Optional.Some(person); + Person person = default!; + var option = Optional.Some(person); option.HasValue.Should().BeFalse(); } [Fact] public void OptionSetToNullHasNoValue2() { - Person? person = null; + Person person = default!; Optional option = person; option.HasValue.Should().BeFalse(); } @@ -73,7 +73,7 @@ public void OptionSetToNullHasNoValue2() public void OptionSomeHasValue() { var person = new Person("Name", 20); - var option = Optional.Some(person); + var option = Optional.Some(person); option.HasValue.Should().BeTrue(); ReferenceEquals(person, option.Value).Should().BeTrue(); } @@ -87,7 +87,7 @@ public void OptionConvertThrowsIfConverterIsNull() try { - Optional.None().Convert(converter!); + Optional.None.Convert(converter!); } catch (ArgumentNullException) { @@ -100,13 +100,13 @@ public void OptionConvertThrowsIfConverterIsNull() [Fact] public void OptionConvertToOptionalInvokesConverterWithValue() { - var option = Optional.Some(string.Empty); + var option = Optional.Some(string.Empty); var invoked = false; Optional Converter(string input) { invoked = true; - return Optional.Some(input); + return Optional.Some(input); } var result = option.Convert(Converter); @@ -118,13 +118,13 @@ Optional Converter(string input) [Fact] public void OptionConvertToOptionalInvokesConverterOnlyWithValue() { - var option = Optional.None(); + var option = Optional.None; var invoked = false; Optional Converter(string input) { invoked = true; - return Optional.Some(input); + return Optional.Some(input); } var result = option.Convert(Converter); @@ -138,7 +138,7 @@ public void OptionConvertToOptionalCanReturnValue() { const int TestData = 37; - var option = Optional.Some(TestData.ToString()); + var option = Optional.Some(TestData.ToString()); var result = option.Convert(ParseInt); @@ -149,7 +149,7 @@ public void OptionConvertToOptionalCanReturnValue() [Fact] public void OptionConvertToOptionalCanReturnNone() { - var option = Optional.Some("Not An Int"); + var option = Optional.Some("Not An Int"); var result = option.Convert(ParseInt); @@ -165,7 +165,7 @@ public void OptionConvertToOptionalThrowsIfConverterIsNull() try { - Optional.None().Convert(converter!); + Optional.None.Convert(converter!); } catch (ArgumentNullException) { @@ -178,13 +178,13 @@ public void OptionConvertToOptionalThrowsIfConverterIsNull() [Fact] public void OptionOrElseInvokesWithoutValue() { - var option = Optional.None(); + var option = Optional.None; var invoked = false; Optional Fallback() { invoked = true; - return Optional.None(); + return Optional.None; } var result = option.OrElse(Fallback); @@ -195,13 +195,13 @@ Optional Fallback() [Fact] public void OptionOrElseInvokesOnlyWithoutValue() { - var option = Optional.Some(string.Empty); + var option = Optional.Some(string.Empty); var invoked = false; Optional Fallback() { invoked = true; - return Optional.None(); + return Optional.None; } var result = option.OrElse(Fallback); @@ -214,7 +214,7 @@ public void OptionOrElseCanReturnValue() { const string TestString = nameof(TestString); - var option = Optional.None(); + var option = Optional.None; var result = option.OrElse(() => TestString); result.HasValue.Should().BeTrue(); @@ -224,8 +224,8 @@ public void OptionOrElseCanReturnValue() [Fact] public void OptionOrElseCanReturnNone() { - var option = Optional.None(); - var result = option.OrElse(Optional.None); + var option = Optional.None; + var result = option.OrElse(() => Optional.None); result.HasValue.Should().BeFalse(); } @@ -235,9 +235,9 @@ public void OptionOrElseCanBeChained() { const int Expected = unchecked((int)0xc001d00d); - var option = Optional.None(); - var result = option.OrElse(Optional.None) - .OrElse(() => Optional.Some(Expected.ToString("x"))) + var option = Optional.None; + var result = option.OrElse(() => Optional.None) + .OrElse(() => Optional.Some(Expected.ToString("x"))) .Convert(s => ParseInt(s).OrElse(() => ParseHex(s))); result.HasValue.Should().BeTrue(); @@ -251,9 +251,9 @@ public void OptionOrElseThrowsIfFallbackIsNull() try { - Optional.None().OrElse(null!); + Optional.None.OrElse(null!); } - catch(ArgumentNullException) + catch (ArgumentNullException) { caught = true; } @@ -262,8 +262,8 @@ public void OptionOrElseThrowsIfFallbackIsNull() } private static Optional ParseInt(string input) => - int.TryParse(input, out var result) ? Optional.Some(result) : Optional.None(); + int.TryParse(input, out var result) ? Optional.Some(result) : Optional.None; private static Optional ParseHex(string input) => - int.TryParse(input, NumberStyles.HexNumber, null, out var result) ? Optional.Some(result) : Optional.None(); + int.TryParse(input, NumberStyles.HexNumber, null, out var result) ? Optional.Some(result) : Optional.None; } diff --git a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs index 180ddecf6..45ede3823 100644 --- a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs @@ -9,13 +9,13 @@ public class OptionObservableFixture private const int NoneCount = 5; private const int SomeCount = 10; - private static Optional NotConvertableToInt { get; } = Optional.Some("NOT AN INT"); + private static Optional NotConvertableToInt { get; } = Optional.Some("NOT AN INT"); private static IEnumerable IntEnum { get; } = Enumerable.Range(0, SomeCount); private static IEnumerable StringEnum { get; } = IntEnum.Select(n => n.ToString()); - private static IEnumerable> OptIntEnum { get; } = IntEnum.Select(i => Optional.Some(i)); - private static IEnumerable> OptNoneIntEnum { get; } = Enumerable.Repeat(Optional.None(), NoneCount); - private static IEnumerable> OptNoneStringEnum { get; } = Enumerable.Repeat(Optional.None(), NoneCount); - private static IEnumerable> OptStringEnum { get; } = StringEnum.Select(str => Optional.Some(str)); + private static IEnumerable> OptIntEnum { get; } = IntEnum.Select(i => Optional.Some(i)); + private static IEnumerable> OptNoneIntEnum { get; } = Enumerable.Repeat(Optional.None, NoneCount); + private static IEnumerable> OptNoneStringEnum { get; } = Enumerable.Repeat(Optional.None, NoneCount); + private static IEnumerable> OptStringEnum { get; } = StringEnum.Select(str => Optional.Some(str)); private static IEnumerable> OptStringWithNoneEnum { get; } = OptNoneStringEnum.Concat(OptStringEnum); private static IEnumerable> OptStringWithBadEnum { get; } = OptStringEnum.Prepend(NotConvertableToInt); private static IEnumerable> OptStringWithBadAndNoneEnum { get; } = OptStringWithNoneEnum.Prepend(NotConvertableToInt); @@ -120,7 +120,7 @@ public void ConvertOptionalWillConvertValues() // then intList.Should().BeSubsetOf(results); - results.Should().Contain(Optional.None()); + results.Should().Contain(Optional.None); } [Fact] @@ -158,7 +158,7 @@ public void ConvertOrConvertsOrFallsback() public void OrElseFallsback() { // having - var observable = OptIntEnum.ToObservable().StartWith(Optional.None()); + var observable = OptIntEnum.ToObservable().StartWith(Optional.None); // when var results = observable.OrElse(() => -1).ToEnumerable(); @@ -274,7 +274,7 @@ public void ValueOrThrowFailsWithGeneratedError() } private static Optional ParseIntOpt(string input) => - int.TryParse(input, out var result) ? Optional.Some(result) : Optional.None(); + int.TryParse(input, out var result) ? Optional.Some(result) : Optional.None; private static int ParseInt(string input) => int.Parse(input); } diff --git a/src/DynamicData.Tests/Kernal/UpdateFixture.cs b/src/DynamicData.Tests/Kernal/UpdateFixture.cs index 698f5c245..5ae46c623 100644 --- a/src/DynamicData.Tests/Kernal/UpdateFixture.cs +++ b/src/DynamicData.Tests/Kernal/UpdateFixture.cs @@ -1,4 +1,3 @@ -using DynamicData.Kernel; using DynamicData.Tests.Domain; using FluentAssertions; @@ -16,7 +15,7 @@ public void Add() update.Key.Should().Be("Person"); update.Reason.Should().Be(ChangeReason.Add); update.Current.Should().Be(person); - update.Previous.Should().Be(Optional.None()); + update.Previous.Should().Be(Optional.None); } [Fact] @@ -28,7 +27,7 @@ public void Remove() update.Key.Should().Be("Person"); update.Reason.Should().Be(ChangeReason.Remove); update.Current.Should().Be(person); - update.Previous.Should().Be(Optional.None()); + update.Previous.Should().Be(Optional.None); } [Fact] diff --git a/src/DynamicData/Aggregation/AggregationEx.cs b/src/DynamicData/Aggregation/AggregationEx.cs index af3d45bca..0e5597be3 100644 --- a/src/DynamicData/Aggregation/AggregationEx.cs +++ b/src/DynamicData/Aggregation/AggregationEx.cs @@ -45,8 +45,13 @@ public static IObservable> ForAggregation( /// The source. /// The invalidate. /// An observable which emits the value. - public static IObservable InvalidateWhen(this IObservable source, IObservable invalidate) => - invalidate.StartWith(Unit.Default).Select(_ => source).Switch().DistinctUntilChanged(); + public static IObservable InvalidateWhen(this IObservable source, IObservable invalidate) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + invalidate.ThrowArgumentNullExceptionIfNull(nameof(invalidate)); + + return invalidate.StartWith(Unit.Default).Select(_ => source).Switch().DistinctUntilChanged(); + } /// /// Used to invalidate an aggregating stream. Used when there has been an inline change. @@ -56,8 +61,13 @@ public static IObservable InvalidateWhen(this IObservable source, IObse /// The source. /// The invalidate. /// An observable which emits the value. - public static IObservable InvalidateWhen(this IObservable source, IObservable invalidate) => - invalidate.StartWith(default(TTrigger)).Select(_ => source).Switch().DistinctUntilChanged(); + public static IObservable InvalidateWhen(this IObservable source, IObservable invalidate) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + invalidate.ThrowArgumentNullExceptionIfNull(nameof(invalidate)); + + return invalidate.StartWith(default(TTrigger)).Select(_ => source).Switch().DistinctUntilChanged(); + } /// /// Applies an accumulator when items are added to and removed from specified stream, diff --git a/src/DynamicData/Aggregation/MaxEx.cs b/src/DynamicData/Aggregation/MaxEx.cs index 30e1e96de..585f4b8b0 100644 --- a/src/DynamicData/Aggregation/MaxEx.cs +++ b/src/DynamicData/Aggregation/MaxEx.cs @@ -29,7 +29,13 @@ private enum MaxOrMin /// public static IObservable Maximum(this IObservable> source, Func valueSelector, TResult emptyValue = default) where TObject : notnull - where TResult : struct, IComparable => source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Max, emptyValue); + where TResult : struct, IComparable + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + + return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Max, emptyValue); + } /// /// Continually calculates the maximum value from the underlying data source. @@ -46,7 +52,13 @@ public static IObservable Maximum(this IObservable Maximum(this IObservable> source, Func valueSelector, TResult emptyValue = default) where TObject : notnull where TKey : notnull - where TResult : struct, IComparable => source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Max, emptyValue); + where TResult : struct, IComparable + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + + return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Max, emptyValue); + } /// /// Continually calculates the minimum value from the underlying data source. @@ -59,7 +71,13 @@ public static IObservable Maximum(this IObserva /// A distinct observable of the minimums item. public static IObservable Minimum(this IObservable> source, Func valueSelector, TResult emptyValue = default) where TObject : notnull - where TResult : struct, IComparable => source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Min, emptyValue); + where TResult : struct, IComparable + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + + return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Min, emptyValue); + } /// /// Continually calculates the minimum value from the underlying data source. @@ -76,7 +94,13 @@ public static IObservable Minimum(this IObservable Minimum(this IObservable> source, Func valueSelector, TResult emptyValue = default) where TObject : notnull where TKey : notnull - where TResult : struct, IComparable => source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Min, emptyValue); + where TResult : struct, IComparable + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + + return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Min, emptyValue); + } private static IObservable Calculate(this IObservable> source, Func valueSelector, MaxOrMin maxOrMin, TResult emptyValue = default) where TResult : struct, IComparable diff --git a/src/DynamicData/Cache/Change.cs b/src/DynamicData/Cache/Change.cs index e36daf7f9..ec9360400 100644 --- a/src/DynamicData/Cache/Change.cs +++ b/src/DynamicData/Cache/Change.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -22,7 +22,7 @@ namespace DynamicData; /// The current. /// The index. public Change(ChangeReason reason, TKey key, TObject current, int index = -1) - : this(reason, key, current, Optional.None(), index) + : this(reason, key, current, Optional.None, index) { } @@ -53,7 +53,7 @@ public Change(TKey key, TObject current, int currentIndex, int previousIndex) } Current = current; - Previous = Optional.None(); + Previous = Optional.None; Key = key; Reason = ChangeReason.Moved; CurrentIndex = currentIndex; @@ -74,7 +74,7 @@ public Change(TKey key, TObject current, int currentIndex, int previousIndex) /// or /// For , must supply previous value. /// - public Change(ChangeReason reason, TKey key, TObject current, in Kernel.Optional previous, int currentIndex = -1, int previousIndex = -1) + public Change(ChangeReason reason, TKey key, TObject current, in Optional previous, int currentIndex = -1, int previousIndex = -1) : this() { Current = current; @@ -119,7 +119,7 @@ public Change(ChangeReason reason, TKey key, TObject current, in Kernel.Optional /// Gets the item from before the change. /// This is only when is . /// - public Kernel.Optional Previous { get; } + public Optional Previous { get; } /// /// Gets the previous index. diff --git a/src/DynamicData/Cache/ChangeAwareCache.cs b/src/DynamicData/Cache/ChangeAwareCache.cs index 947fef1ba..0fbfa969a 100644 --- a/src/DynamicData/Cache/ChangeAwareCache.cs +++ b/src/DynamicData/Cache/ChangeAwareCache.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -136,7 +136,7 @@ public void Clone(IChangeSet changes) } /// - public Kernel.Optional Lookup(TKey key) => _data.Lookup(key); + public Optional Lookup(TKey key) => _data.Lookup(key); /// /// Raises an evaluate change for the specified keys. diff --git a/src/DynamicData/Cache/IGrouping.cs b/src/DynamicData/Cache/IGrouping.cs index 6efb30e84..4d17531ac 100644 --- a/src/DynamicData/Cache/IGrouping.cs +++ b/src/DynamicData/Cache/IGrouping.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -50,5 +50,5 @@ public interface IGrouping /// /// The key. /// The value that is looked up. - Kernel.Optional Lookup(TKey key); + Optional Lookup(TKey key); } diff --git a/src/DynamicData/Cache/IntermediateCache.cs b/src/DynamicData/Cache/IntermediateCache.cs index 533e4568e..4494449a5 100644 --- a/src/DynamicData/Cache/IntermediateCache.cs +++ b/src/DynamicData/Cache/IntermediateCache.cs @@ -64,7 +64,7 @@ public IObservable> Connect(Func? predi public void Edit(Action> updateAction) => _innerCache.UpdateFromIntermediate(updateAction); /// - public Kernel.Optional Lookup(TKey key) => _innerCache.Lookup(key); + public Optional Lookup(TKey key) => _innerCache.Lookup(key); /// public IObservable> Preview(Func? predicate = null) diff --git a/src/DynamicData/Cache/Internal/AbstractFilter.cs b/src/DynamicData/Cache/Internal/AbstractFilter.cs index ba9f6ea61..882dcd9d9 100644 --- a/src/DynamicData/Cache/Internal/AbstractFilter.cs +++ b/src/DynamicData/Cache/Internal/AbstractFilter.cs @@ -23,7 +23,7 @@ public IChangeSet Refresh(IEnumerable { // this is an internal method only so we can be sure there are no duplicate keys in the result // (therefore safe to parallelise) - Kernel.Optional> Factory(KeyValuePair kv) + Optional> Factory(KeyValuePair kv) { var existing = _cache.Lookup(kv.Key); var matches = Filter(kv.Value); @@ -40,7 +40,7 @@ Kernel.Optional> Factory(KeyValuePair kv) return new Change(ChangeReason.Remove, kv.Key, kv.Value, existing); } - return Optional.None>(); + return Optional>.None; } var result = Refresh(items, Factory); @@ -57,7 +57,7 @@ public IChangeSet Update(IChangeSet updates) protected abstract IEnumerable GetChangesWithFilter(ChangeSet updates); - protected abstract IEnumerable> Refresh(IEnumerable> items, Func, Kernel.Optional>> factory); + protected abstract IEnumerable> Refresh(IEnumerable> items, Func, Optional>> factory); private ChangeSet ProcessResult(IEnumerable source) { diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index 7db27f721..34d4eb033 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs @@ -44,7 +44,7 @@ public AnonymousObservableCache(IObservableCache cache) public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => _cache.Connect(predicate, suppressEmptyChangeSets); - public Kernel.Optional Lookup(TKey key) => _cache.Lookup(key); + public Optional Lookup(TKey key) => _cache.Lookup(key); public IObservable> Preview(Func? predicate = null) => _cache.Preview(predicate); diff --git a/src/DynamicData/Cache/Internal/AnonymousQuery.cs b/src/DynamicData/Cache/Internal/AnonymousQuery.cs index 071d99d33..f83fd2018 100644 --- a/src/DynamicData/Cache/Internal/AnonymousQuery.cs +++ b/src/DynamicData/Cache/Internal/AnonymousQuery.cs @@ -18,5 +18,5 @@ internal sealed class AnonymousQuery(Cache cache) public IEnumerable> KeyValues => _cache.KeyValues; - public Kernel.Optional Lookup(TKey key) => _cache.Lookup(key); + public Optional Lookup(TKey key) => _cache.Lookup(key); } diff --git a/src/DynamicData/Cache/Internal/Cache.cs b/src/DynamicData/Cache/Internal/Cache.cs index a7d9554d4..3336b7d1e 100644 --- a/src/DynamicData/Cache/Internal/Cache.cs +++ b/src/DynamicData/Cache/Internal/Cache.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -57,7 +57,7 @@ public void Clone(IChangeSet changes) } } - public Kernel.Optional Lookup(TKey key) => _data.Lookup(key); + public Optional Lookup(TKey key) => _data.Lookup(key); /// /// Sends a signal for operators to recalculate it's state. diff --git a/src/DynamicData/Cache/Internal/CacheUpdater.cs b/src/DynamicData/Cache/Internal/CacheUpdater.cs index 7cad46bb3..3e69a3330 100644 --- a/src/DynamicData/Cache/Internal/CacheUpdater.cs +++ b/src/DynamicData/Cache/Internal/CacheUpdater.cs @@ -200,13 +200,13 @@ public void Load(IEnumerable items) AddOrUpdate(items); } - public Kernel.Optional Lookup(TKey key) + public Optional Lookup(TKey key) { var item = _cache.Lookup(key); - return item.HasValue ? item.Value : Optional.None(); + return item.HasValue ? item.Value : Optional.None; } - public Kernel.Optional Lookup(TObject item) + public Optional Lookup(TObject item) { if (_keySelector is null) { diff --git a/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs b/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs index 0deba2273..f0d804f13 100644 --- a/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs +++ b/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -141,7 +141,7 @@ private void OnItemRemoved(ChangeSetCache[] sourceCaches, TObject } } - private void OnItemUpdated(ChangeSetCache[] sources, TObject item, TKey key, in Kernel.Optional prev) + private void OnItemUpdated(ChangeSetCache[] sources, TObject item, TKey key, in Optional prev) { var cached = _resultCache.Lookup(key); @@ -219,7 +219,7 @@ private void ForceEvaluate(ChangeSetCache[] sources, TKey key) UpdateToBestValue(sources, key, cached); } - private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key, in Kernel.Optional current) + private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key, in Optional current) { // Determine which value should be the one seen downstream var candidate = LookupBestValue(sources, key); @@ -248,11 +248,11 @@ private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key return true; } - private Kernel.Optional LookupBestValue(ChangeSetCache[] sources, TKey key) + private Optional LookupBestValue(ChangeSetCache[] sources, TKey key) { if (sources.Length == 0) { - return Optional.None(); + return Optional.None; } var values = sources.Select(s => s.Cache.Lookup(key)).Where(opt => opt.HasValue); diff --git a/src/DynamicData/Cache/Internal/DynamicGrouper.cs b/src/DynamicData/Cache/Internal/DynamicGrouper.cs index 55738bd69..ede740ddc 100644 --- a/src/DynamicData/Cache/Internal/DynamicGrouper.cs +++ b/src/DynamicData/Cache/Internal/DynamicGrouper.cs @@ -178,7 +178,7 @@ public void Dispose() _groupCache.Items.ForEach(group => (group as ManagedGroup)?.Dispose()); } - private static void PerformGroupRefresh(TKey key, in Kernel.Optional> optionalGroup, SuspendTracker? suspendTracker = null) + private static void PerformGroupRefresh(TKey key, in Optional> optionalGroup, SuspendTracker? suspendTracker = null) { if (optionalGroup.HasValue) { @@ -191,10 +191,10 @@ private static void PerformGroupRefresh(TKey key, in Kernel.Optional> LookupGroup(TKey key) => + private Optional> LookupGroup(TKey key) => _groupKeys.Lookup(key).Convert(LookupGroup); - private Kernel.Optional> LookupGroup(TGroupKey groupKey) => + private Optional> LookupGroup(TGroupKey groupKey) => _groupCache.Lookup(groupKey).Convert(static grp => (grp as ManagedGroup)!); private ManagedGroup GetOrAddGroup(TGroupKey groupKey) => diff --git a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs index 4d9344ee1..2966a446b 100644 --- a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs +++ b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs @@ -4,11 +4,11 @@ namespace DynamicData.Cache.Internal; -internal sealed class EditDiffChangeSetOptional(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) +internal sealed class EditDiffChangeSetOptional(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) where TObject : notnull where TKey : notnull { - private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); private readonly IEqualityComparer _equalityComparer = equalityComparer ?? EqualityComparer.Default; @@ -16,7 +16,7 @@ internal sealed class EditDiffChangeSetOptional(IObservable> Run() => Observable.Create>(observer => { - var previous = Optional.None(); + var previous = Optional.None; return _source.Synchronize().Subscribe( nextValue => diff --git a/src/DynamicData/Cache/Internal/FullJoin.cs b/src/DynamicData/Cache/Internal/FullJoin.cs index 3a5018a7a..5666930aa 100644 --- a/src/DynamicData/Cache/Internal/FullJoin.cs +++ b/src/DynamicData/Cache/Internal/FullJoin.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class FullJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, Kernel.Optional, TDestination> resultSelector) +internal sealed class FullJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +13,7 @@ internal sealed class FullJoin { private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, Kernel.Optional, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, Optional, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); @@ -56,7 +56,7 @@ public IObservable> Run() => Observable.Creat else { // update with no left value - joinedCache.AddOrUpdate(_resultSelector(change.Key, Kernel.Optional.None, rightLookup), change.Key); + joinedCache.AddOrUpdate(_resultSelector(change.Key, Optional.None, rightLookup), change.Key); } break; @@ -98,7 +98,7 @@ public IObservable> Run() => Observable.Creat else { // update with no right value - joinedCache.AddOrUpdate(_resultSelector(change.Key, left, Kernel.Optional.None), change.Key); + joinedCache.AddOrUpdate(_resultSelector(change.Key, left, Optional.None), change.Key); } } diff --git a/src/DynamicData/Cache/Internal/FullJoinMany.cs b/src/DynamicData/Cache/Internal/FullJoinMany.cs index 23e498b0e..28ae5a008 100644 --- a/src/DynamicData/Cache/Internal/FullJoinMany.cs +++ b/src/DynamicData/Cache/Internal/FullJoinMany.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class FullJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) +internal sealed class FullJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +13,7 @@ internal sealed class FullJoinMany> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); From 17ead0fd7f48f632f0cc168870907f9f4d6e7da1 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sat, 20 Jun 2026 17:37:04 +0100 Subject: [PATCH 10/36] Use Optional and add null guards Replace usages of Kernel.Optional with Optional across cache and internal components (joins, transforms, lookups, observers, and node/cache implementations). Add source.ThrowArgumentNullExceptionIfNull checks in SortAndBind and StartWithEmpty extension overloads to validate inputs. Remove obsolete Internal/ObservableEx.cs. These changes standardize the optional type and improve argument validation. --- src/DynamicData/Cache/IObservableCache.cs | 2 +- src/DynamicData/Cache/IQuery.cs | 2 +- .../Cache/Internal/ImmutableGroup.cs | 4 +- src/DynamicData/Cache/Internal/LeftJoin.cs | 10 ++-- .../Cache/Internal/LockFreeObservableCache.cs | 2 +- .../Cache/Internal/ObservableWithValue.cs | 2 +- .../Cache/Internal/ReaderWriter.cs | 2 +- src/DynamicData/Cache/Internal/RightJoin.cs | 6 +-- .../Cache/Internal/RightJoinMany.cs | 4 +- src/DynamicData/Cache/Internal/SizeLimiter.cs | 4 +- .../Cache/Internal/ToObservableOptional.cs | 8 +-- src/DynamicData/Cache/Internal/Transform.cs | 2 +- .../Cache/Internal/TransformAsync.cs | 6 +-- .../Cache/Internal/TransformImmutable.cs | 2 +- .../Internal/TransformWithForcedTransform.cs | 2 +- src/DynamicData/Cache/Node.cs | 4 +- src/DynamicData/Cache/ObservableCache.cs | 2 +- .../Cache/ObservableCacheEx.EditDiff.cs | 2 +- .../Cache/ObservableCacheEx.FullJoin.cs | 4 +- .../Cache/ObservableCacheEx.FullJoinMany.cs | 4 +- .../Cache/ObservableCacheEx.LeftJoin.cs | 4 +- .../Cache/ObservableCacheEx.RightJoin.cs | 4 +- .../Cache/ObservableCacheEx.RightJoinMany.cs | 4 +- .../Cache/ObservableCacheEx.SortAndBind.cs | 10 +++- .../Cache/ObservableCacheEx.StartWithEmpty.cs | 49 ++++++++++++++++--- .../ObservableCacheEx.ToObservableOptional.cs | 8 +-- .../Cache/ObservableCacheEx.Transform.cs | 6 +-- .../Cache/ObservableCacheEx.TransformAsync.cs | 20 ++++---- .../Cache/ObservableCacheEx.TransformSafe.cs | 16 +++--- .../ObservableCacheEx.TransformSafeAsync.cs | 4 +- src/DynamicData/Cache/SourceCache.cs | 2 +- .../Cache/Tests/ChangeSetAggregator.cs | 4 ++ .../Tests/DistinctChangeSetAggregator.cs | 2 + .../Cache/Tests/GroupChangeSetAggregator.cs | 2 + .../Cache/Tests/PagedChangeSetAggregator.cs | 2 + .../Cache/Tests/SortedChangeSetAggregator.cs | 2 + .../Cache/Tests/VirtualChangeSetAggregator.cs | 2 + src/DynamicData/Internal/Notification.cs | 10 ++-- src/DynamicData/Internal/ObservableEx.cs | 25 ---------- 39 files changed, 140 insertions(+), 110 deletions(-) delete mode 100644 src/DynamicData/Internal/ObservableEx.cs diff --git a/src/DynamicData/Cache/IObservableCache.cs b/src/DynamicData/Cache/IObservableCache.cs index 907350a51..8897962a6 100644 --- a/src/DynamicData/Cache/IObservableCache.cs +++ b/src/DynamicData/Cache/IObservableCache.cs @@ -42,5 +42,5 @@ public interface IObservableCache : IConnectableCache /// The key. /// An optional with the looked up value. - Kernel.Optional Lookup(TKey key); + Optional Lookup(TKey key); } diff --git a/src/DynamicData/Cache/IQuery.cs b/src/DynamicData/Cache/IQuery.cs index 8dd4937e4..4f071c272 100644 --- a/src/DynamicData/Cache/IQuery.cs +++ b/src/DynamicData/Cache/IQuery.cs @@ -44,5 +44,5 @@ public interface IQuery /// /// The key. /// The looked up value. - Kernel.Optional Lookup(TKey key); + Optional Lookup(TKey key); } diff --git a/src/DynamicData/Cache/Internal/ImmutableGroup.cs b/src/DynamicData/Cache/Internal/ImmutableGroup.cs index 26f07e0a8..816ed6846 100644 --- a/src/DynamicData/Cache/Internal/ImmutableGroup.cs +++ b/src/DynamicData/Cache/Internal/ImmutableGroup.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -46,7 +46,7 @@ public bool Equals(ImmutableGroup? other) public override int GetHashCode() => EqualityComparer.Default.GetHashCode(Key); - public Kernel.Optional Lookup(TKey key) => _cache.Lookup(key); + public Optional Lookup(TKey key) => _cache.Lookup(key); public override string ToString() => $"Grouping for: {Key} ({Count} items)"; } diff --git a/src/DynamicData/Cache/Internal/LeftJoin.cs b/src/DynamicData/Cache/Internal/LeftJoin.cs index 6fd38d1aa..29216d14d 100644 --- a/src/DynamicData/Cache/Internal/LeftJoin.cs +++ b/src/DynamicData/Cache/Internal/LeftJoin.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class LeftJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) +internal sealed class LeftJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +13,7 @@ internal sealed class LeftJoin { private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); @@ -89,7 +89,7 @@ public IObservable> Run() => Observable.Creat { var priorLeft = leftCache.Lookup(priorForeignKey); if (priorLeft.HasValue) - joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, Kernel.Optional.None), priorForeignKey); + joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, Optional.None), priorForeignKey); } if (left.HasValue) @@ -102,7 +102,7 @@ public IObservable> Run() => Observable.Creat case ChangeReason.Remove: if (left.HasValue) - joined.AddOrUpdate(_resultSelector(foreignKey, left.Value, Kernel.Optional.None), foreignKey); + joined.AddOrUpdate(_resultSelector(foreignKey, left.Value, Optional.None), foreignKey); rightForeignKeysByKey.Remove(change.Key); @@ -115,7 +115,7 @@ public IObservable> Run() => Observable.Creat { var priorLeft = leftCache.Lookup(priorForeignKey); if (priorLeft.HasValue) - joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, Kernel.Optional.None), priorForeignKey); + joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, Optional.None), priorForeignKey); if (left.HasValue) joined.AddOrUpdate(_resultSelector(foreignKey, left.Value, right), foreignKey); diff --git a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs index b68aa99f9..9391c6925 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs @@ -137,7 +137,7 @@ public void Edit(Action> editAction) /// /// Fast indexed lookup. /// - public Kernel.Optional Lookup(TKey key) => _innerCache.Lookup(key); + public Optional Lookup(TKey key) => _innerCache.Lookup(key); /// public IObservable> Preview(Func? predicate = null) => predicate is null ? _changesPreview : _changesPreview.Filter(predicate); diff --git a/src/DynamicData/Cache/Internal/ObservableWithValue.cs b/src/DynamicData/Cache/Internal/ObservableWithValue.cs index aaca8525d..59baa2bd6 100644 --- a/src/DynamicData/Cache/Internal/ObservableWithValue.cs +++ b/src/DynamicData/Cache/Internal/ObservableWithValue.cs @@ -15,7 +15,7 @@ public ObservableWithValue(TObject item, IObservable source) public TObject Item { get; } - public Kernel.Optional LatestValue { get; private set; } = Kernel.Optional.None; + public Optional LatestValue { get; private set; } = Optional.None; public IObservable Observable { get; } } diff --git a/src/DynamicData/Cache/Internal/ReaderWriter.cs b/src/DynamicData/Cache/Internal/ReaderWriter.cs index 93128a796..b50b07df0 100644 --- a/src/DynamicData/Cache/Internal/ReaderWriter.cs +++ b/src/DynamicData/Cache/Internal/ReaderWriter.cs @@ -83,7 +83,7 @@ public ChangeSet GetInitialUpdates(Func? filter = } } - public Kernel.Optional Lookup(TKey key) + public Optional Lookup(TKey key) { lock (_locker) { diff --git a/src/DynamicData/Cache/Internal/RightJoin.cs b/src/DynamicData/Cache/Internal/RightJoin.cs index 90655b173..a77a42e94 100644 --- a/src/DynamicData/Cache/Internal/RightJoin.cs +++ b/src/DynamicData/Cache/Internal/RightJoin.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class RightJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) +internal sealed class RightJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +13,7 @@ internal sealed class RightJoin> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, TRight, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, TRight, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); @@ -110,7 +110,7 @@ public IObservable> Run() => Observable.Crea case ChangeReason.Remove: if (right.HasValue) { - joinedCache.AddOrUpdate(_resultSelector(right.Value.key, Kernel.Optional.None, right.Value.item), right.Value.key); + joinedCache.AddOrUpdate(_resultSelector(right.Value.key, Optional.None, right.Value.item), right.Value.key); } break; diff --git a/src/DynamicData/Cache/Internal/RightJoinMany.cs b/src/DynamicData/Cache/Internal/RightJoinMany.cs index 6b947f3ee..825d71a90 100644 --- a/src/DynamicData/Cache/Internal/RightJoinMany.cs +++ b/src/DynamicData/Cache/Internal/RightJoinMany.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class RightJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) +internal sealed class RightJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +13,7 @@ internal sealed class RightJoinMany> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); diff --git a/src/DynamicData/Cache/Internal/SizeLimiter.cs b/src/DynamicData/Cache/Internal/SizeLimiter.cs index 8fb673df7..a1522fc93 100644 --- a/src/DynamicData/Cache/Internal/SizeLimiter.cs +++ b/src/DynamicData/Cache/Internal/SizeLimiter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -22,7 +22,7 @@ public IChangeSet Change(IChangeSet, } var notifications = _cache.CaptureChanges(); - var changed = notifications.Select(update => new Change(update.Reason, update.Key, update.Current.Value, update.Previous.HasValue ? update.Previous.Value.Value : Kernel.Optional.None)); + var changed = notifications.Select(update => new Change(update.Reason, update.Key, update.Current.Value, update.Previous.HasValue ? update.Previous.Value.Value : Optional.None)); return new ChangeSet(changed); } diff --git a/src/DynamicData/Cache/Internal/ToObservableOptional.cs b/src/DynamicData/Cache/Internal/ToObservableOptional.cs index 8af6c6030..5aa4296a0 100644 --- a/src/DynamicData/Cache/Internal/ToObservableOptional.cs +++ b/src/DynamicData/Cache/Internal/ToObservableOptional.cs @@ -12,9 +12,9 @@ internal sealed class ToObservableOptional(IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); private readonly TKey _key = key; - public IObservable> Run() => Observable.Create>(observer => + public IObservable> Run() => Observable.Create>(observer => { - var lastValue = Optional.None(); + var lastValue = Optional.None; return _source.Subscribe( changes => lastValue = EmitChanges(changes, observer, lastValue), @@ -22,7 +22,7 @@ internal sealed class ToObservableOptional(IObservable EmitChanges(IChangeSet changes, IObserver> observer, Kernel.Optional lastValue) + private Optional EmitChanges(IChangeSet changes, IObserver> observer, Optional lastValue) { foreach (var change in changes.ToConcreteType()) { @@ -35,7 +35,7 @@ private Kernel.Optional EmitChanges(IChangeSet changes, // Remove is None, everything else is the current value var emitValue = change switch { - { Reason: ChangeReason.Remove } => Optional.None(), + { Reason: ChangeReason.Remove } => Optional.None, _ => Optional.Some(change.Current), }; diff --git a/src/DynamicData/Cache/Internal/Transform.cs b/src/DynamicData/Cache/Internal/Transform.cs index 056d53386..b3b55f4bd 100644 --- a/src/DynamicData/Cache/Internal/Transform.cs +++ b/src/DynamicData/Cache/Internal/Transform.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class Transform(IObservable> source, Func, TKey, TDestination> transformFactory, Action>? exceptionCallback = null, bool transformOnRefresh = false) +internal sealed class Transform(IObservable> source, Func, TKey, TDestination> transformFactory, Action>? exceptionCallback = null, bool transformOnRefresh = false) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/Internal/TransformAsync.cs b/src/DynamicData/Cache/Internal/TransformAsync.cs index bf28f2818..213c1b72e 100644 --- a/src/DynamicData/Cache/Internal/TransformAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformAsync.cs @@ -6,7 +6,7 @@ namespace DynamicData.Cache.Internal; internal class TransformAsync( IObservable> source, - Func, TKey, Task> transformFactory, + Func, TKey, Task> transformFactory, Action>? exceptionCallback, IObservable>? forceTransform = null, int? maximumConcurrency = null, @@ -146,7 +146,7 @@ public TransformResult(in Change change, in TransformedItemContai public TransformResult(in Change change) { Change = change; - Container = Kernel.Optional.None; + Container = Optional.None; Success = true; Key = change.Key; } @@ -161,7 +161,7 @@ public TransformResult(in Change change, Exception error) public Change Change { get; } - public Kernel.Optional Container { get; } + public Optional Container { get; } public Exception? Error { get; } diff --git a/src/DynamicData/Cache/Internal/TransformImmutable.cs b/src/DynamicData/Cache/Internal/TransformImmutable.cs index fd2d71cca..c494cd16c 100644 --- a/src/DynamicData/Cache/Internal/TransformImmutable.cs +++ b/src/DynamicData/Cache/Internal/TransformImmutable.cs @@ -37,7 +37,7 @@ public IObservable> Run() current: _transformFactory.Invoke(change.Current), previous: change.Previous.HasValue ? _transformFactory.Invoke(change.Previous.Value) - : Optional.None(), + : Optional.None, currentIndex: change.CurrentIndex, previousIndex: change.PreviousIndex)); } diff --git a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs index 11a00358c..50c900b75 100644 --- a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs +++ b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs @@ -4,7 +4,7 @@ namespace DynamicData.Cache.Internal; -internal sealed class TransformWithForcedTransform(IObservable> source, Func, TKey, TDestination> transformFactory, IObservable> forceTransform, Action>? exceptionCallback = null) +internal sealed class TransformWithForcedTransform(IObservable> source, Func, TKey, TDestination> transformFactory, IObservable> forceTransform, Action>? exceptionCallback = null) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/Node.cs b/src/DynamicData/Cache/Node.cs index 11e3d4cd2..19d72e51e 100644 --- a/src/DynamicData/Cache/Node.cs +++ b/src/DynamicData/Cache/Node.cs @@ -37,7 +37,7 @@ public Node(TObject item, TKey key) /// The item. /// The key. /// The parent. - public Node(TObject item, TKey key, in Kernel.Optional> parent) + public Node(TObject item, TKey key, in Optional> parent) { Item = item ?? throw new ArgumentNullException(nameof(item)); Key = key; @@ -91,7 +91,7 @@ public int Depth /// /// Gets the parent if it has one. /// - public Kernel.Optional> Parent { get; internal set; } + public Optional> Parent { get; internal set; } /// /// Determines whether the specified objects are equal. diff --git a/src/DynamicData/Cache/ObservableCache.cs b/src/DynamicData/Cache/ObservableCache.cs index 23f40c5f8..2da160a00 100644 --- a/src/DynamicData/Cache/ObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCache.cs @@ -121,7 +121,7 @@ public IObservable> Connect(Func? predi public void Dispose() => _cleanUp.Dispose(); - public Kernel.Optional Lookup(TKey key) => _readerWriter.Lookup(key); + public Optional Lookup(TKey key) => _readerWriter.Lookup(key); public IObservable> Preview(Func? predicate = null) => predicate is null ? _changesPreview : _changesPreview.Filter(predicate); diff --git a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs index 861f2f510..abf5a0cff 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs @@ -115,7 +115,7 @@ public static IObservable> EditDiff(thi /// /// /// or is . - public static IObservable> EditDiff(this IObservable> source, Func keySelector, IEqualityComparer? equalityComparer = null) + public static IObservable> EditDiff(this IObservable> source, Func keySelector, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs index 20e357601..9a8a83cde 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs @@ -19,7 +19,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left and right values into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, Kernel.Optional, TDestination> resultSelector) + public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -77,7 +77,7 @@ public static IObservable> FullJoin /// /// - public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, Kernel.Optional, TDestination> resultSelector) + public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs index 760fd80d5..f5da307fb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs @@ -19,7 +19,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left value and the right group into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -78,7 +78,7 @@ public static IObservable> FullJoinMany /// /// - public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs index d23204d43..60cb091ae 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs @@ -19,7 +19,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the left value and the optional right into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) + public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -77,7 +77,7 @@ public static IObservable> LeftJoin /// /// - public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) + public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs index 73b5dc814..2e7c00975 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs @@ -19,7 +19,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left and right values into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) + public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -77,7 +77,7 @@ public static IObservable> RightJoin /// /// - public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) + public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs index e2ce6441b..b01283931 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs @@ -19,7 +19,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left value and the right group into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -78,7 +78,7 @@ public static IObservable> RightJoinMany /// /// - public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs index f1d35345a..3c8b5840d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs @@ -230,8 +230,12 @@ public static partial class ObservableCacheEx IComparer comparer, SortAndBindOptions options) where TObject : notnull - where TKey : notnull => - new SortAndBind(source, comparer, options, targetList).Run(); + where TKey : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + + return new SortAndBind(source, comparer, options, targetList).Run(); + } /// public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( @@ -320,6 +324,8 @@ public static partial class ObservableCacheEx where TObject : notnull where TKey : notnull { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + // allow options to set initial capacity for efficiency var observableCollection = options.InitialCapacity > 0 ? new ObservableCollectionExtended(new List(options.InitialCapacity)) diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs index c7005e3df..fa7fbea65 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs @@ -24,7 +24,12 @@ public static partial class ObservableCacheEx /// public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull - where TKey : notnull => source.StartWith(ChangeSet.Empty); + where TKey : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + + return source.StartWith(ChangeSet.Empty); + } /// /// The source to prepend an empty changeset to. @@ -32,7 +37,12 @@ public static IObservable> StartWithEmptyOverload for . public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull - where TKey : notnull => source.StartWith(SortedChangeSet.Empty); + where TKey : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + + return source.StartWith(SortedChangeSet.Empty); + } /// /// The source to prepend an empty changeset to. @@ -40,7 +50,12 @@ public static IObservable> StartWithEmptyOverload for . public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull - where TKey : notnull => source.StartWith(VirtualChangeSet.Empty); + where TKey : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + + return source.StartWith(VirtualChangeSet.Empty); + } /// /// The source to prepend an empty changeset to. @@ -48,7 +63,12 @@ public static IObservable> StartWithEmptyOverload for . public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull - where TKey : notnull => source.StartWith(PagedChangeSet.Empty); + where TKey : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + + return source.StartWith(PagedChangeSet.Empty); + } /// /// The type of the object. @@ -60,7 +80,12 @@ public static IObservable> StartWithEmpty> StartWithEmpty(this IObservable> source) where TObject : notnull where TKey : notnull - where TGroupKey : notnull => source.StartWith(GroupChangeSet.Empty); + where TGroupKey : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + + return source.StartWith(GroupChangeSet.Empty); + } /// /// The type of the object. @@ -72,12 +97,22 @@ public static IObservable> StartWithEm public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull where TKey : notnull - where TGroupKey : notnull => source.StartWith(ImmutableGroupChangeSet.Empty); + where TGroupKey : notnull + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + + return source.StartWith(ImmutableGroupChangeSet.Empty); + } /// /// The type of the item. /// The source of to prepend an empty changeset to. /// An observable that emits an empty collection first, then all source collections. /// Overload for . - public static IObservable> StartWithEmpty(this IObservable> source) => source.StartWith(ReadOnlyCollectionLight.Empty); + public static IObservable> StartWithEmpty(this IObservable> source) + { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + + return source.StartWith(ReadOnlyCollectionLight.Empty); + } } diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs index 592d9bdaf..a8956930f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs @@ -40,7 +40,7 @@ public static partial class ObservableCacheEx /// is . /// /// - public static IObservable> ToObservableOptional(this IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) + public static IObservable> ToObservableOptional(this IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { @@ -63,7 +63,7 @@ public static partial class ObservableCacheEx /// /// Worth noting: Uses lock-based coordination. If the key exists synchronously on Connect(), the initial None may or may not be emitted depending on timing. /// - public static IObservable> ToObservableOptional(this IObservable> source, TKey key, bool initialOptionalWhenMissing, IEqualityComparer? equalityComparer = null) + public static IObservable> ToObservableOptional(this IObservable> source, TKey key, bool initialOptionalWhenMissing, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { @@ -75,8 +75,8 @@ public static partial class ObservableCacheEx return source.ToObservableOptional(key, equalityComparer) .Do(_ => seenValue = true) .Merge(Signal.Lazy(() => seenValue - ? Observable.Empty>() - : Observable.Return(Optional.None()))); + ? Observable.Empty>() + : Observable.Return(Optional.None))); }); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs index 3f3ca9971..1770d0d5d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs @@ -42,7 +42,7 @@ public static IObservable> Transform /// This overload accepts a bool transformOnRefresh flag. When , Refresh changes cause re-transformation (emitted as Update). - public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, bool transformOnRefresh) + public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, bool transformOnRefresh) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -117,7 +117,7 @@ public static IObservable> Transform /// /// or is . - public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable>? forceTransform = null) + public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -155,7 +155,7 @@ public static IObservable> Transform /// This overload accepts of to force re-transformation of ALL items when the observable emits. - public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable forceTransform) + public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs index c15762075..60a9be37d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs @@ -13,7 +13,7 @@ namespace DynamicData; /// public static partial class ObservableCacheEx { - /// + /// /// This overload takes a simpler factory that receives only the current item. /// [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] @@ -28,7 +28,7 @@ public static IObservable> TransformAsync transformFactory(current), forceTransform); } - /// + /// /// This overload takes a factory that receives the current item and key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func> transformFactory, IObservable>? forceTransform = null) @@ -43,14 +43,14 @@ public static IObservable> TransformAsync - /// Async version of . + /// Async version of . /// Projects each item using an async factory that returns . /// /// The type of the transformed items. /// The type of the source items. /// The type of the key. /// The source to transform asynchronously. - /// The async function that produces a from the current source item, the previous source item (if any), and the key. + /// The async function that produces a from the current source item, the previous source item (if any), and the key. /// An observable that, when it emits a predicate, re-transforms all items for which the predicate returns . Re-transformed items are emitted as changes. If , no forced re-transforms occur. /// An observable changeset of transformed items. /// @@ -70,13 +70,13 @@ public static IObservable> TransformAsyncWorth noting: Transforms are batched per changeset (all tasks must complete before the next changeset is processed). Completion waits for in-flight transforms. Remove does NOT cancel in-flight transforms for the removed key. /// /// Factory exceptions propagate as . Use - /// + /// /// to catch factory errors without terminating the stream. /// /// /// or is . [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, IObservable>? forceTransform = null) + public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -87,7 +87,7 @@ public static IObservable> TransformAsync(source, transformFactory, null, forceTransform).Run(); } - /// + /// /// This overload accepts to control concurrency and Refresh handling. The factory receives only the current item. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func> transformFactory, TransformAsyncOptions options) @@ -101,7 +101,7 @@ public static IObservable> TransformAsync transformFactory(current), options); } - /// + /// /// This overload accepts to control concurrency and Refresh handling. The factory receives the current item and key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func> transformFactory, TransformAsyncOptions options) @@ -115,10 +115,10 @@ public static IObservable> TransformAsync transformFactory(current, key), options); } - /// + /// /// This overload accepts to control concurrency and Refresh handling. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, TransformAsyncOptions options) + public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, TransformAsyncOptions options) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs index 3311061ee..79fa372d2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs @@ -27,7 +27,7 @@ public static IObservable> TransformSafe transformFactory(current), errorHandler, forceTransform.ForForced()); } - /// + /// /// This overload accepts a factory that receives the current item and key. public static IObservable> TransformSafe(this IObservable> source, Func transformFactory, Action> errorHandler, IObservable>? forceTransform = null) where TDestination : notnull @@ -49,20 +49,20 @@ public static IObservable> TransformSafeThe type of the source items. /// The type of the key. /// The source to transform with error handling. - /// The that produces a from the current source item, the previous source item (if any), and the key. + /// The that produces a from the current source item, the previous source item (if any), and the key. /// A callback invoked when throws. Receives an containing the exception and the faulting item. The item is skipped and the stream continues. /// An optional that, when it emits a predicate, re-transforms all items for which the predicate returns . If , no forced re-transforms occur. /// An observable changeset of transformed items. /// /// - /// Behaves identically to + /// Behaves identically to /// except that factory exceptions are routed to instead of propagating as . /// Source-level errors (i.e. the source observable itself erroring) still propagate normally. /// /// Worth noting: Factory exceptions are caught per-item; the faulting item is skipped and reported to the error handler while the stream continues. Source-level errors still terminate the stream. /// /// , , or is . - public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) + public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -78,14 +78,14 @@ public static IObservable> TransformSafe(source, transformFactory, errorHandler).Run(); } - /// + /// /// This overload accepts of to force re-transformation of ALL items. The factory receives only the current item. public static IObservable> TransformSafe(this IObservable> source, Func transformFactory, Action> errorHandler, IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull => source.TransformSafe((cur, _, _) => transformFactory(cur), errorHandler, forceTransform.ForForced()); - /// + /// /// This overload accepts of to force re-transformation of ALL items. The factory receives the current item and key. public static IObservable> TransformSafe(this IObservable> source, Func transformFactory, Action> errorHandler, IObservable forceTransform) where TDestination : notnull @@ -99,9 +99,9 @@ public static IObservable> TransformSafe transformFactory(cur, key), errorHandler, forceTransform.ForForced()); } - /// + /// /// This overload accepts of to force re-transformation of ALL items. - public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable forceTransform) + public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs index 3a9815e4d..386cf7a1a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs @@ -58,7 +58,7 @@ public static IObservable> TransformSafeAsyncCombines the async execution model of with the error-safe behavior of . /// , , or is . [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) + public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -103,7 +103,7 @@ public static IObservable> TransformSafeAsync /// This overload accepts to control concurrency and Refresh handling. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, TransformAsyncOptions options) + public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, TransformAsyncOptions options) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/SourceCache.cs b/src/DynamicData/Cache/SourceCache.cs index cf41d6cba..5d281579c 100644 --- a/src/DynamicData/Cache/SourceCache.cs +++ b/src/DynamicData/Cache/SourceCache.cs @@ -54,7 +54,7 @@ public sealed class SourceCache(Func keySelector) public void Edit(Action> updateAction) => _innerCache.UpdateFromSource(updateAction); /// - public Kernel.Optional Lookup(TKey key) => _innerCache.Lookup(key); + public Optional Lookup(TKey key) => _innerCache.Lookup(key); /// public IObservable> Preview(Func? predicate = null) => _innerCache.Preview(predicate); diff --git a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs index af847f556..7215b6591 100644 --- a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs @@ -24,6 +24,8 @@ public sealed class ChangeSetAggregator : IDisposable /// The source. public ChangeSetAggregator(IObservable> source) { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + var published = source.Publish(); Data = published.AsObservableCache(); @@ -105,6 +107,8 @@ public sealed class ChangeSetAggregator : IDisposable /// The source. public ChangeSetAggregator(IObservable> source) { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + var published = source.Publish(); Data = published.AsObservableCache(); diff --git a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs index 301359c0f..348f772ac 100644 --- a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs @@ -24,6 +24,8 @@ public class DistinctChangeSetAggregator : IDisposable /// The source. public DistinctChangeSetAggregator(IObservable> source) { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + var published = source.Publish(); var error = published.Subscribe(_ => { }, ex => Error = ex); diff --git a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs index f3050ae0d..973b613fb 100644 --- a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs @@ -27,6 +27,8 @@ public class GroupChangeSetAggregator : IDisposable /// The source. public GroupChangeSetAggregator(IObservable> source) { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + var published = source.Publish(); Data = published.AsObservableCache(); diff --git a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs index cf19a49c5..00ece04d9 100644 --- a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs @@ -26,6 +26,8 @@ public class PagedChangeSetAggregator : IDisposable /// The source. public PagedChangeSetAggregator(IObservable> source) { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + var published = source.Publish(); var error = published.Subscribe(_ => { }, ex => Error = ex); diff --git a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs index 86a2b3a29..a1c856881 100644 --- a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs @@ -26,6 +26,8 @@ public class SortedChangeSetAggregator : IDisposable /// The source. public SortedChangeSetAggregator(IObservable> source) { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + var published = source.Publish(); var error = published.Subscribe(_ => { }, ex => Error = ex); diff --git a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs index efca69ba6..74d6028c3 100644 --- a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs @@ -26,6 +26,8 @@ public class VirtualChangeSetAggregator : IDisposable /// The source. public VirtualChangeSetAggregator(IObservable> source) { + source.ThrowArgumentNullExceptionIfNull(nameof(source)); + var published = source.Publish(); var error = published.Subscribe(_ => { }, ex => Error = ex); diff --git a/src/DynamicData/Internal/Notification.cs b/src/DynamicData/Internal/Notification.cs index 77c512380..192f48833 100644 --- a/src/DynamicData/Internal/Notification.cs +++ b/src/DynamicData/Internal/Notification.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. @@ -13,10 +13,10 @@ namespace DynamicData.Internal; internal readonly struct Notification where T : notnull { - private readonly Kernel.Optional _value; + private readonly Optional _value; private readonly Exception? _error; - private Notification(Kernel.Optional value, Exception? error) + private Notification(Optional value, Exception? error) { _value = value; _error = error; @@ -29,11 +29,11 @@ private Notification(Kernel.Optional value, Exception? error) public static Notification CreateError(Exception error) { error.ThrowArgumentNullExceptionIfNull(nameof(error)); - return new(Optional.None(), error); + return new(Optional.None, error); } /// Creates an OnCompleted notification (terminal). - public static Notification CreateCompleted() => new(Optional.None(), null); + public static Notification CreateCompleted() => new(Optional.None, null); /// Gets whether this is an OnError notification. public bool IsError => _error is not null; diff --git a/src/DynamicData/Internal/ObservableEx.cs b/src/DynamicData/Internal/ObservableEx.cs deleted file mode 100644 index f45a3032f..000000000 --- a/src/DynamicData/Internal/ObservableEx.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -namespace DynamicData.Internal; - -internal static class ObservableEx -{ - public static IDisposable SubscribeSafe(this IObservable observable, Action onNext, Action onError, Action onCompleted) => - observable.SubscribeSafe(Observer.Create(onNext, onError, onCompleted)); - - public static IDisposable SubscribeSafe(this IObservable observable, Action onNext, Action onError) => - observable.SubscribeSafe(Observer.Create(onNext, onError)); - - public static IDisposable SubscribeSafe(this IObservable observable, Action onError, Action onCompleted) => - observable.SubscribeSafe(Observer.Create(Stub.Ignore, onError, onCompleted)); - - public static IDisposable SubscribeSafe(this IObservable observable, Action onError) => - observable.SubscribeSafe(Observer.Create(Stub.Ignore, onError)); - - private static class Stub - { - public static readonly Action Ignore = static _ => { }; - } -} From 5bad5f06d57c8e660c30161bd662e8a57c8aaa53 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sat, 20 Jun 2026 19:32:33 +0100 Subject: [PATCH 11/36] Guard SourceList and MergeMany against disposal Add disposal guards and race-condition handling across core list operations and tests. In SourceList: introduce _isDisposed flag, short-circuit subscription/count observables when disposed, throw ObjectDisposedException for edits after disposal, and wrap Preview to check disposal before subscribing. In MergeMany: extract SubscribeChild to centralize subscription logic, handle ObjectDisposedException from the observable selector, and ensure the subscription counter is finalized. Tests updated to wait for expected results (WaitForResultContentsAsync/ResultContentsMatch) and to avoid collection-modification issues by copying item collections to arrays before disposing items. --- .../List/MergeManyChangeSetsCacheFixture.cs | 27 ++++++++++- .../List/MergeManyChangeSetsListFixture.cs | 3 +- src/DynamicData/List/Internal/MergeMany.cs | 24 +++++++--- src/DynamicData/List/SourceList.cs | 45 ++++++++++++++++++- 4 files changed, 90 insertions(+), 9 deletions(-) diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs index 47b18ffc0..7bc398a33 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs @@ -108,6 +108,7 @@ IObservable AddRemovePrices(Market market, int priceCount, int para while (adding); // Verify the results + await WaitForResultContentsAsync(_marketListResults, priceResults, TimeSpan.FromSeconds(5)); CheckResultContents(_marketListResults, priceResults); } @@ -826,11 +827,33 @@ private void CheckResultContents(ChangeSetAggregator marketResults, Cha priceResults.Data.Items.Count.Should().Be(expectedPrices.Count); } + private async Task WaitForResultContentsAsync(ChangeSetAggregator marketResults, ChangeSetAggregator priceResults, TimeSpan timeout) + { + var deadline = DateTimeOffset.UtcNow + timeout; + while (!ResultContentsMatch(marketResults, priceResults) && DateTimeOffset.UtcNow < deadline) + { + await Task.Delay(TimeSpan.FromMilliseconds(10)); + } + } + + private bool ResultContentsMatch(ChangeSetAggregator marketResults, ChangeSetAggregator priceResults) + { + var expectedMarkets = _marketList.Items.ToList(); + var expectedPrices = expectedMarkets.SelectMany(market => ((Market)market).PricesCache.Items).ToList(); + var actualMarkets = marketResults.Data.Items; + var actualPrices = priceResults.Data.Items; + + return actualMarkets.Count == expectedMarkets.Count && + actualPrices.Count == expectedPrices.Count && + expectedMarkets.All(actualMarkets.Contains) && + expectedPrices.All(actualPrices.Contains); + } + private void DisposeMarkets() { - _marketList.Items.ForEach(m => (m as IDisposable)?.Dispose()); + var markets = _marketList.Items.ToArray(); + markets.ForEach(m => (m as IDisposable)?.Dispose()); _marketList.Dispose(); - _marketList.Clear(); } private decimal GetRandomPrice() => MarketPrice.RandomPrice(_randomizer, BasePrice, PriceOffset); diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs index 1db956692..c22a436f5 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs @@ -530,9 +530,10 @@ private static void CheckResultContents(IEnumerable owners, ChangeS public void Dispose() { - _animalOwners.Items.ForEach(owner => owner.Dispose()); + var owners = _animalOwners.Items.ToArray(); _animalOwnerResults.Dispose(); _animalResults.Dispose(); + owners.ForEach(owner => owner.Dispose()); _animalOwners.Dispose(); } } diff --git a/src/DynamicData/List/Internal/MergeMany.cs b/src/DynamicData/List/Internal/MergeMany.cs index 04f78f86b..164fe52d8 100644 --- a/src/DynamicData/List/Internal/MergeMany.cs +++ b/src/DynamicData/List/Internal/MergeMany.cs @@ -17,16 +17,30 @@ public IObservable Run() => Observable.Create( var counter = new SubscriptionCounter(); var locker = InternalEx.NewLock(); var disposable = _source.Concat(counter.DeferCleanup) - .SubscribeMany(t => - { - counter.Added(); - return _observableSelector(t).Synchronize(locker).Finally(() => counter.Finally()).Subscribe(observer.OnNext, _ => { }, () => { }); - }) + .SubscribeMany(t => SubscribeChild(t, locker, counter, observer)) .Subscribe(_ => { }, observer.OnError, observer.OnCompleted); return new CompositeDisposable(disposable, counter); }); +#if NET9_0_OR_GREATER + private IDisposable SubscribeChild(T item, Lock locker, SubscriptionCounter counter, IObserver observer) +#else + private IDisposable SubscribeChild(T item, object locker, SubscriptionCounter counter, IObserver observer) +#endif + { + counter.Added(); + try + { + return _observableSelector(item).Synchronize(locker).Finally(counter.Finally).Subscribe(observer.OnNext, _ => { }, () => { }); + } + catch (ObjectDisposedException) + { + counter.Finally(); + return Disposable.Empty; + } + } + private sealed class SubscriptionCounter : IDisposable { private readonly Signal> _subject = new(); diff --git a/src/DynamicData/List/SourceList.cs b/src/DynamicData/List/SourceList.cs index 6b0e64f6e..eefaf67f8 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.cs @@ -31,6 +31,8 @@ public sealed class SourceList : ISourceList private int _editLevel; + private bool _isDisposed; + /// /// Initializes a new instance of the class. /// @@ -61,6 +63,13 @@ public SourceList(IObservable>? source = null) { lock (_locker) { + if (_isDisposed) + { + observer.OnNext(_readerWriter.Count); + observer.OnCompleted(); + return Disposable.Empty; + } + var source = _countChanged.Value.StartWith(_readerWriter.Count).DistinctUntilChanged(); return source.SubscribeSafe(observer); } @@ -86,6 +95,12 @@ public IObservable> Connect(Func? predicate = null) }); } + if (_isDisposed) + { + observer.OnCompleted(); + return Disposable.Empty; + } + var source = _changes.Finally(observer.OnCompleted); return source.SubscribeSafe(observer); @@ -103,6 +118,16 @@ public IObservable> Connect(Func? predicate = null) /// public void Dispose() { + lock (_locker) + { + if (_isDisposed) + { + return; + } + + _isDisposed = true; + } + _cleanUp.Dispose(); _changesPreview.Dispose(); _changes.Dispose(); @@ -119,6 +144,11 @@ public void Edit(Action> updateAction) lock (_locker) { + if (_isDisposed) + { + throw new ObjectDisposedException(nameof(SourceList)); + } + IChangeSet? changes = null; _editLevel++; @@ -144,7 +174,20 @@ public void Edit(Action> updateAction) /// public IObservable> Preview(Func? predicate = null) { - IObservable> observable = _changesPreview; + var observable = Observable.Create>( + observer => + { + lock (_locker) + { + if (_isDisposed) + { + observer.OnCompleted(); + return Disposable.Empty; + } + + return _changesPreview.SubscribeSafe(observer); + } + }); if (predicate is not null) { From 7178ed7c9dc9eb8c6ce12006f1951f966b74cb5a Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sat, 20 Jun 2026 19:40:16 +0100 Subject: [PATCH 12/36] Add script to rewrite reactive sources Add a PowerShell script (RewriteDynamicDataReactiveSources.ps1) that generates Reactive-specific source files under GeneratedReactiveSources by transforming namespaces/usings and mapping Signal/Optional/scope/disposable/operators to ReactiveUI.Primitives/Observable equivalents. Update DynamicData.csproj to reference ReactiveUI.Primitives items and aliases and exclude Internal\ObservableEx.cs and Internal\ReactiveCompatibility.cs from compilation. Replace .Synchronize(...) with .SynchronizeObject(...) in several internal files to match the ReactiveUI.Primitives API. --- .../RewriteDynamicDataReactiveSources.ps1 | 113 ++++++++++++++++++ .../Cache/Internal/ExpireAfter.ForSource.cs | 2 +- .../Cache/Internal/ExpireAfter.ForStream.cs | 2 +- src/DynamicData/DynamicData.csproj | 7 ++ src/DynamicData/List/Internal/DisposeMany.cs | 2 +- 5 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 diff --git a/src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 b/src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 new file mode 100644 index 000000000..389d1a5b1 --- /dev/null +++ b/src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 @@ -0,0 +1,113 @@ +param( + [Parameter(Mandatory = $true)] + [string]$SourceRoot, + [Parameter(Mandatory = $true)] + [string]$OutputRoot +) + +$ErrorActionPreference = 'Stop' + +$sourceRootPath = (Resolve-Path $SourceRoot).Path +$outputRootPath = [IO.Path]::GetFullPath($OutputRoot) +$mutex = New-Object System.Threading.Mutex($false, 'Local\DynamicDataReactiveSourceRewrite') +$mutexHeld = $false + +function Get-SourceFile { + param([Parameter(Mandatory = $true)][string]$Path) + + Get-ChildItem -LiteralPath $Path -File -Filter '*.cs' + + Get-ChildItem -LiteralPath $Path -Directory | + Where-Object { $_.Name -ne 'bin' -and $_.Name -ne 'obj' } | + ForEach-Object { Get-SourceFile -Path $_.FullName } +} + +function Write-GeneratedSource { + param( + [Parameter(Mandatory = $true)][string]$Path, + [Parameter(Mandatory = $true)][string]$Text + ) + + for ($attempt = 0; $attempt -lt 5; $attempt++) { + try { + [IO.File]::WriteAllText($Path, $Text) + return + } + catch { + if ($attempt -eq 4) { + throw + } + + Start-Sleep -Milliseconds (50 * ($attempt + 1)) + } + } +} + +try { + $mutexHeld = $mutex.WaitOne([TimeSpan]::FromMinutes(5)) + if (-not $mutexHeld) { + throw "Timed out waiting for DynamicData.Reactive source rewrite lock." + } + + if ((Split-Path -Leaf $outputRootPath) -ne 'GeneratedReactiveSources') { + throw "Refusing to clean unexpected DynamicData.Reactive generated source directory '$outputRootPath'." + } + + if (Test-Path -LiteralPath $outputRootPath) { + Remove-Item -LiteralPath $outputRootPath -Recurse -Force + } + + New-Item -ItemType Directory -Force -Path $outputRootPath | Out-Null + + Get-SourceFile -Path $sourceRootPath | + Where-Object { + $_.FullName -notlike '*\Internal\ObservableEx.cs' -and + $_.FullName -notlike '*\Internal\ReactiveCompatibility.cs' + } | + ForEach-Object { + $relative = $_.FullName.Substring($sourceRootPath.Length).TrimStart('\', '/') + $destination = Join-Path $outputRootPath $relative + $destinationDirectory = Split-Path -Parent $destination + New-Item -ItemType Directory -Force -Path $destinationDirectory | Out-Null + + $text = Get-Content -LiteralPath $_.FullName -Raw + $text = [regex]::Replace($text, '\bnamespace DynamicData(?=[\s.;{])', 'namespace DynamicData.Reactive') + $text = [regex]::Replace($text, '\busing DynamicData(?=[.;])', 'using DynamicData.Reactive') + $text = [regex]::Replace($text, '\bOptional<', 'ReactiveUI.Primitives.Optional<') + $text = [regex]::Replace($text, '\bOptional\.', 'ReactiveUI.Primitives.Optional.') + $text = $text.Replace('Signal.Lazy', 'Observable.Defer') + $text = $text.Replace('Signal.After', 'Observable.Timer') + $text = $text.Replace('Signal.FromAsync', 'Observable.FromAsync') + $text = $text.Replace('Signal.Create', 'Observable.Create') + $text = $text.Replace('.SubscribeSafe(observer.OnError, observer.OnCompleted)', '.Subscribe(_ => { }, observer.OnError, observer.OnCompleted)') + $text = $text.Replace('.SubscribeSafe(', '.Subscribe(') + $text = $text.Replace('.SynchronizeObject(', '.Synchronize(') + $text = $text.Replace('.Map(', '.Select(') + $text = $text.Replace('.Tap(', '.Do(') + $text = $text.Replace('.Keep(', '.Where(') + $text = $text.Replace('Scope.Create', 'Disposable.Create') + $text = $text.Replace('Scope.Empty', 'Disposable.Empty') + $text = $text.Replace('MultipleDisposable', 'CompositeDisposable') + $text = $text.Replace('OnceDisposable', 'SingleAssignmentDisposable') + $text = $text.Replace('SwapDisposable', 'SerialDisposable') + $text = $text.Replace('ReplaySignal<', 'ReplaySubject<') + $text = $text.Replace('BehaviorSignal<', 'BehaviorSubject<') + $text = $text.Replace('StateSignal<', 'BehaviorSubject<') + $text = $text.Replace('ISignal<', 'ISubject<') + $text = [regex]::Replace($text, '\bSignal<', 'Subject<') + + Write-GeneratedSource -Path $destination -Text $text + } +} +catch { + [Console]::Error.WriteLine($_.Exception.Message) + [Console]::Error.WriteLine($_.ScriptStackTrace) + exit 1 +} +finally { + if ($mutexHeld) { + $mutex.ReleaseMutex() + } + + $mutex.Dispose() +} diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs index 355b15ea9..9d667a0ce 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs @@ -71,7 +71,7 @@ protected SubscriptionBase( .Connect() // It's important to set this flag outside the context of a lock, because it'll be read outside of lock as well. .Finally(() => _hasSourceCompleted = true) - .Synchronize(SynchronizationGate) + .SynchronizeObject(SynchronizationGate) .SubscribeSafe( onNext: OnSourceNext, onError: OnSourceError, diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs index b65e7c1fd..ecb4f829d 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -63,7 +63,7 @@ protected SubscriptionBase( _proposedExpirationsQueue = []; _sourceSubscription = source - .Synchronize(SynchronizationGate) + .SynchronizeObject(SynchronizationGate) .SubscribeSafe( onNext: OnSourceNext, onError: OnSourceError, diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index 35d365e31..f166cec6b 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -27,12 +27,17 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int + + + + + @@ -44,6 +49,8 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int + + ObservableCacheEx.cs diff --git a/src/DynamicData/List/Internal/DisposeMany.cs b/src/DynamicData/List/Internal/DisposeMany.cs index 87cd29477..76afb3e5b 100644 --- a/src/DynamicData/List/Internal/DisposeMany.cs +++ b/src/DynamicData/List/Internal/DisposeMany.cs @@ -14,7 +14,7 @@ public IObservable> Run() var cachedItems = new List(); var sourceSubscription = source - .Synchronize(cachedItems) + .SynchronizeObject(cachedItems) .SubscribeSafe(Observer.Create>( onNext: changeSet => { From 3f4df68567407a3e6011a7f3fdf506854239dcc1 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sat, 20 Jun 2026 20:25:42 +0100 Subject: [PATCH 13/36] Migrate DynamicData to local ReactiveUI.Primitives refs --- ...115_IsDockerContainer.dotnetUserLevelCache | 1 + ...5.26302.115_MachineId.dotnetUserLevelCache | 1 + .../.dotnet/MachineId.v1.dotnetUserLevelCache | 1 + .../microsoft.net.workloads.workloadset.json | 20 +++++++++++++++++++ .../AdvertisedManifestFeatureBand.txt | 1 + .../workloadVersion.txt | 1 + ...k-status-11.0.100-preview.5.26302.115.json | 1 + src/DynamicData/DynamicData.csproj | 6 +++++- 8 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .dotnet-home/.dotnet/11.0.100-preview.5.26302.115_IsDockerContainer.dotnetUserLevelCache create mode 100644 .dotnet-home/.dotnet/11.0.100-preview.5.26302.115_MachineId.dotnetUserLevelCache create mode 100644 .dotnet-home/.dotnet/MachineId.v1.dotnetUserLevelCache create mode 100644 .dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/11.0.100-preview.5.26309.3/microsoft.net.workloads.workloadset.json create mode 100644 .dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/AdvertisedManifestFeatureBand.txt create mode 100644 .dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/workloadVersion.txt create mode 100644 .dotnet-home/.dotnet/sdk-vulnerability-cache/sdk-status-11.0.100-preview.5.26302.115.json diff --git a/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_IsDockerContainer.dotnetUserLevelCache b/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_IsDockerContainer.dotnetUserLevelCache new file mode 100644 index 000000000..c1f22fbc2 --- /dev/null +++ b/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_IsDockerContainer.dotnetUserLevelCache @@ -0,0 +1 @@ +False \ No newline at end of file diff --git a/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_MachineId.dotnetUserLevelCache b/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_MachineId.dotnetUserLevelCache new file mode 100644 index 000000000..0baed2bd8 --- /dev/null +++ b/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_MachineId.dotnetUserLevelCache @@ -0,0 +1 @@ +984b63c32a109babbbd54209ab0b823ca1b1b8dd756674064adb85c6571b202d \ No newline at end of file diff --git a/.dotnet-home/.dotnet/MachineId.v1.dotnetUserLevelCache b/.dotnet-home/.dotnet/MachineId.v1.dotnetUserLevelCache new file mode 100644 index 000000000..0baed2bd8 --- /dev/null +++ b/.dotnet-home/.dotnet/MachineId.v1.dotnetUserLevelCache @@ -0,0 +1 @@ +984b63c32a109babbbd54209ab0b823ca1b1b8dd756674064adb85c6571b202d \ No newline at end of file diff --git a/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/11.0.100-preview.5.26309.3/microsoft.net.workloads.workloadset.json b/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/11.0.100-preview.5.26309.3/microsoft.net.workloads.workloadset.json new file mode 100644 index 000000000..22cb8d9a7 --- /dev/null +++ b/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/11.0.100-preview.5.26309.3/microsoft.net.workloads.workloadset.json @@ -0,0 +1,20 @@ +{ + "Microsoft.NET.Workload.Emscripten.Current": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Workload.Emscripten.net6": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Workload.Emscripten.net7": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Workload.Emscripten.net8": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Workload.Emscripten.net9": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Workload.Emscripten.net10": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Sdk.Android": "36.99.0-preview.5.308/11.0.100-preview.5", + "Microsoft.NET.Sdk.iOS": "26.5.11546-net11-p5/11.0.100-preview.5", + "Microsoft.NET.Sdk.MacCatalyst": "26.5.11546-net11-p5/11.0.100-preview.5", + "Microsoft.NET.Sdk.macOS": "26.5.11546-net11-p5/11.0.100-preview.5", + "Microsoft.NET.Sdk.Maui": "11.0.0-preview.5.26304.4/11.0.100-preview.5", + "Microsoft.NET.Sdk.tvOS": "26.5.11546-net11-p5/11.0.100-preview.5", + "Microsoft.NET.Workload.Mono.ToolChain.Current": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Workload.Mono.ToolChain.net6": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Workload.Mono.ToolChain.net7": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Workload.Mono.ToolChain.net8": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Workload.Mono.ToolChain.net9": "11.0.100-preview.5.26302.115/11.0.100-preview.5", + "Microsoft.NET.Workload.Mono.ToolChain.net10": "11.0.100-preview.5.26302.115/11.0.100-preview.5" +} diff --git a/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/AdvertisedManifestFeatureBand.txt b/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/AdvertisedManifestFeatureBand.txt new file mode 100644 index 000000000..41ecfdb2e --- /dev/null +++ b/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/AdvertisedManifestFeatureBand.txt @@ -0,0 +1 @@ +11.0.100-preview.5 \ No newline at end of file diff --git a/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/workloadVersion.txt b/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/workloadVersion.txt new file mode 100644 index 000000000..4d35a57f0 --- /dev/null +++ b/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/workloadVersion.txt @@ -0,0 +1 @@ +11.0.100-preview.5.26309.3 \ No newline at end of file diff --git a/.dotnet-home/.dotnet/sdk-vulnerability-cache/sdk-status-11.0.100-preview.5.26302.115.json b/.dotnet-home/.dotnet/sdk-vulnerability-cache/sdk-status-11.0.100-preview.5.26302.115.json new file mode 100644 index 000000000..c9d1114cf --- /dev/null +++ b/.dotnet-home/.dotnet/sdk-vulnerability-cache/sdk-status-11.0.100-preview.5.26302.115.json @@ -0,0 +1 @@ +{"IsEol":false,"EolDate":null,"Cves":[],"LatestSdkVersion":null,"FeatureBandDiscontinued":false,"HasVulnerabilities":false} \ No newline at end of file diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index f166cec6b..712ca20cf 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -11,9 +11,13 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int true - + + + + From 18e7dbcd93cb9d13d61210f309869f1f778ecfee Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 09:04:20 +0100 Subject: [PATCH 14/36] Enable net8 AOT analyzers; update ReactiveUI deps Add AOT/trim analyzers for net8+ in Directory.Build.props (IsAotCompatible, EnableAotAnalyzer, EnableTrimAnalyzer). Remove per-project IsAotCompatible settings and replace local ReactiveUI.Primitives project references with PackageReference entries (v5.5.0) in DynamicData and DynamicData.Reactive. Add .dotnet-home/ to .gitignore and delete several .dotnet-home cached SDK/workload/vulnerability files. --- ...115_IsDockerContainer.dotnetUserLevelCache | 1 - ...5.26302.115_MachineId.dotnetUserLevelCache | 1 - .../.dotnet/MachineId.v1.dotnetUserLevelCache | 1 - .../microsoft.net.workloads.workloadset.json | 20 ------------------- .../AdvertisedManifestFeatureBand.txt | 1 - .../workloadVersion.txt | 1 - ...k-status-11.0.100-preview.5.26302.115.json | 1 - .gitignore | 2 ++ src/Directory.Build.props | 7 +++++++ .../DynamicData.Reactive.csproj | 9 ++------- src/DynamicData/DynamicData.csproj | 9 ++------- 11 files changed, 13 insertions(+), 40 deletions(-) delete mode 100644 .dotnet-home/.dotnet/11.0.100-preview.5.26302.115_IsDockerContainer.dotnetUserLevelCache delete mode 100644 .dotnet-home/.dotnet/11.0.100-preview.5.26302.115_MachineId.dotnetUserLevelCache delete mode 100644 .dotnet-home/.dotnet/MachineId.v1.dotnetUserLevelCache delete mode 100644 .dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/11.0.100-preview.5.26309.3/microsoft.net.workloads.workloadset.json delete mode 100644 .dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/AdvertisedManifestFeatureBand.txt delete mode 100644 .dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/workloadVersion.txt delete mode 100644 .dotnet-home/.dotnet/sdk-vulnerability-cache/sdk-status-11.0.100-preview.5.26302.115.json diff --git a/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_IsDockerContainer.dotnetUserLevelCache b/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_IsDockerContainer.dotnetUserLevelCache deleted file mode 100644 index c1f22fbc2..000000000 --- a/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_IsDockerContainer.dotnetUserLevelCache +++ /dev/null @@ -1 +0,0 @@ -False \ No newline at end of file diff --git a/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_MachineId.dotnetUserLevelCache b/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_MachineId.dotnetUserLevelCache deleted file mode 100644 index 0baed2bd8..000000000 --- a/.dotnet-home/.dotnet/11.0.100-preview.5.26302.115_MachineId.dotnetUserLevelCache +++ /dev/null @@ -1 +0,0 @@ -984b63c32a109babbbd54209ab0b823ca1b1b8dd756674064adb85c6571b202d \ No newline at end of file diff --git a/.dotnet-home/.dotnet/MachineId.v1.dotnetUserLevelCache b/.dotnet-home/.dotnet/MachineId.v1.dotnetUserLevelCache deleted file mode 100644 index 0baed2bd8..000000000 --- a/.dotnet-home/.dotnet/MachineId.v1.dotnetUserLevelCache +++ /dev/null @@ -1 +0,0 @@ -984b63c32a109babbbd54209ab0b823ca1b1b8dd756674064adb85c6571b202d \ No newline at end of file diff --git a/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/11.0.100-preview.5.26309.3/microsoft.net.workloads.workloadset.json b/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/11.0.100-preview.5.26309.3/microsoft.net.workloads.workloadset.json deleted file mode 100644 index 22cb8d9a7..000000000 --- a/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/11.0.100-preview.5.26309.3/microsoft.net.workloads.workloadset.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "Microsoft.NET.Workload.Emscripten.Current": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Workload.Emscripten.net6": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Workload.Emscripten.net7": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Workload.Emscripten.net8": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Workload.Emscripten.net9": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Workload.Emscripten.net10": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Sdk.Android": "36.99.0-preview.5.308/11.0.100-preview.5", - "Microsoft.NET.Sdk.iOS": "26.5.11546-net11-p5/11.0.100-preview.5", - "Microsoft.NET.Sdk.MacCatalyst": "26.5.11546-net11-p5/11.0.100-preview.5", - "Microsoft.NET.Sdk.macOS": "26.5.11546-net11-p5/11.0.100-preview.5", - "Microsoft.NET.Sdk.Maui": "11.0.0-preview.5.26304.4/11.0.100-preview.5", - "Microsoft.NET.Sdk.tvOS": "26.5.11546-net11-p5/11.0.100-preview.5", - "Microsoft.NET.Workload.Mono.ToolChain.Current": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Workload.Mono.ToolChain.net6": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Workload.Mono.ToolChain.net7": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Workload.Mono.ToolChain.net8": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Workload.Mono.ToolChain.net9": "11.0.100-preview.5.26302.115/11.0.100-preview.5", - "Microsoft.NET.Workload.Mono.ToolChain.net10": "11.0.100-preview.5.26302.115/11.0.100-preview.5" -} diff --git a/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/AdvertisedManifestFeatureBand.txt b/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/AdvertisedManifestFeatureBand.txt deleted file mode 100644 index 41ecfdb2e..000000000 --- a/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/AdvertisedManifestFeatureBand.txt +++ /dev/null @@ -1 +0,0 @@ -11.0.100-preview.5 \ No newline at end of file diff --git a/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/workloadVersion.txt b/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/workloadVersion.txt deleted file mode 100644 index 4d35a57f0..000000000 --- a/.dotnet-home/.dotnet/sdk-advertising/11.0.100-preview.5/microsoft.net.workloads/workloadVersion.txt +++ /dev/null @@ -1 +0,0 @@ -11.0.100-preview.5.26309.3 \ No newline at end of file diff --git a/.dotnet-home/.dotnet/sdk-vulnerability-cache/sdk-status-11.0.100-preview.5.26302.115.json b/.dotnet-home/.dotnet/sdk-vulnerability-cache/sdk-status-11.0.100-preview.5.26302.115.json deleted file mode 100644 index c9d1114cf..000000000 --- a/.dotnet-home/.dotnet/sdk-vulnerability-cache/sdk-status-11.0.100-preview.5.26302.115.json +++ /dev/null @@ -1 +0,0 @@ -{"IsEol":false,"EolDate":null,"Cves":[],"LatestSdkVersion":null,"FeatureBandDiscontinued":false,"HasVulnerabilities":false} \ No newline at end of file diff --git a/.gitignore b/.gitignore index cc0cf38bc..d4768f880 100644 --- a/.gitignore +++ b/.gitignore @@ -369,3 +369,5 @@ src/*.Tests/API/ApiApprovalTests.*.received.txt # JetBrains .idea/ + +.dotnet-home/ \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index ea3784f00..8771263c9 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -42,6 +42,13 @@ + + + true + true + true + + diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index 8dc9082a4..1a625bca9 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -8,17 +8,12 @@ Linq extensions enable dynamic filtering, sorting, grouping, transforms, binding, pagination, data virtualisation, expiration, disposal management plus more. net462;net472;net48;net481;net8.0;net9.0;net10.0;net11.0 - true true - - - + + diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index 712ca20cf..2cdcab430 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -7,17 +7,12 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int Linq extensions enable dynamic filtering, sorting, grouping, transforms, binding, pagination, data virtualisation, expiration, disposal management plus more. net462;net472;net48;net481;net8.0;net9.0;net10.0;net11.0 - true true - - - + + From 4ab89c6aac99f460dc6daeaa7a110bc383c740e6 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 09:42:09 +0100 Subject: [PATCH 15/36] Remove redundant usings, centralize imports Clean up: removed many redundant/unused using directives across benchmark and test source files. Common benchmark imports were centralized into DynamicData.Benchmarks.csproj via entries (e.g. System.Collections.ObjectModel, System.Collections.Immutable, BenchmarkDotNet.* and DynamicData.Binding) to reduce duplication and compiler warnings. Also removed unused test usings (FluentAssertions, Xunit, etc.) where they were not required. --- .../Cache/DeliveryQueueBenchmarks.cs | 4 ---- src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs | 2 -- src/DynamicData.Benchmarks/Cache/EditDiff.cs | 2 -- .../Cache/ExpireAfter_Cache_ForSource.cs | 6 +----- .../Cache/ExpireAfter_Cache_ForStream.cs | 4 ---- src/DynamicData.Benchmarks/Cache/FilterImmutable.cs | 2 -- .../Cache/Filter_Cache_WithPredicateState.cs | 4 ---- src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs | 4 ---- src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs | 3 --- src/DynamicData.Benchmarks/Cache/SourceCache.cs | 3 --- src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs | 2 -- src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs | 2 -- .../Cache/ToObservableChangeSet_Cache.cs | 3 --- src/DynamicData.Benchmarks/Cache/TransformImmutable.cs | 2 -- src/DynamicData.Benchmarks/Cache/TransformMany.cs | 2 -- src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj | 6 ++++++ src/DynamicData.Benchmarks/List/DisposeMany_List.cs | 2 -- src/DynamicData.Benchmarks/List/ExpireAfter_List.cs | 6 +----- .../List/Filter_List_Static_RandomizedBoundedEdits.cs | 2 -- .../List/Filter_List_Static_RandomizedUnboundedEdits.cs | 2 -- .../List/Filter_List_WithPredicateState.cs | 4 ---- src/DynamicData.Benchmarks/List/GroupAdd.cs | 3 --- src/DynamicData.Benchmarks/List/GroupRemove.cs | 3 --- src/DynamicData.Benchmarks/List/SourceList.cs | 3 --- .../List/ToObservableChangeSet_List.cs | 3 --- .../AggregationTests/AggregationFixture.cs | 2 -- src/DynamicData.Tests/AggregationTests/AverageFixture.cs | 2 -- src/DynamicData.Tests/AggregationTests/MaxFixture.cs | 2 -- src/DynamicData.Tests/AggregationTests/MinFixture.cs | 2 -- .../AggregationTests/SumFixture.ForCache.cs | 7 ------- .../AggregationTests/SumFixture.ForList.cs | 8 -------- src/DynamicData.Tests/AutoRefreshFilter.cs | 3 --- .../Binding/AvaloniaDictionaryFixture.cs | 4 ---- .../Binding/BindingLIstBindListFixture.cs | 4 ---- .../Binding/BindingListBindCacheFixture.cs | 4 ---- .../Binding/BindingListBindCacheSortedFixture.cs | 4 ---- .../Binding/BindingListToChangeSetFixture.cs | 4 ---- .../Binding/DeeplyNestedNotifyPropertyChangedFixture.cs | 2 -- .../Binding/IObservableListBindCacheFixture.cs | 2 -- .../Binding/IObservableListBindCacheSortedFixture.cs | 2 -- .../Binding/IObservableListBindListFixture.cs | 4 ---- .../Binding/NotifyPropertyChangedExFixture.cs | 5 +---- .../Binding/ObservableCollectionBindCacheFixture.cs | 5 ----- .../Binding/ObservableCollectionBindCacheSortedFixture.cs | 5 ----- .../Binding/ObservableCollectionBindListFixture.cs | 2 -- .../ObservableCollectionExtendedToChangeSetFixture.cs | 4 ---- .../Binding/ObservableCollectionToChangeSetFixture.cs | 5 ----- .../ReadOnlyObservableCollectionToChangeSetFixture.cs | 5 ----- .../Binding/ReadonlyCollectionBindCacheFixture.cs | 3 --- .../Binding/WhenPropertyChangedBehaviorFixture.cs | 4 ---- .../Binding/WhenPropertyChangedRaceFixture.cs | 4 ---- src/DynamicData.Tests/Cache/AndFixture.cs | 2 -- .../Cache/AsyncDisposeManyFixture.IntegrationTests.cs | 2 -- .../Cache/AsyncDisposeManyFixture.UnitTests.cs | 2 -- src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs | 2 -- .../Cache/AutoRefreshFixture.WithPropertyAccessor.cs | 2 -- .../Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs | 2 -- src/DynamicData.Tests/Cache/AutoRefreshFixture.cs | 4 +--- .../Cache/AutoRefreshOnObservableFixture.Base.cs | 2 -- .../Cache/AutoRefreshOnObservableFixture.WithKey.cs | 2 -- .../Cache/AutoRefreshOnObservableFixture.WithoutKey.cs | 2 -- src/DynamicData.Tests/Cache/BatchFixture.cs | 2 -- src/DynamicData.Tests/Cache/BatchIfFixture.cs | 2 -- src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs | 2 -- src/DynamicData.Tests/Cache/BufferInitialFixture.cs | 2 -- .../Cache/CrossCacheDeadlockStressTest.cs | 2 -- src/DynamicData.Tests/Cache/DeadlockTortureTest.cs | 2 -- src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs | 2 -- src/DynamicData.Tests/Cache/DisposeManyFixture.cs | 2 -- src/DynamicData.Tests/Cache/DistinctFixture.cs | 2 -- src/DynamicData.Tests/Cache/DynamicAndFixture.cs | 2 -- src/DynamicData.Tests/Cache/DynamicExceptFixture.cs | 2 -- src/DynamicData.Tests/Cache/DynamicOrFixture.cs | 2 -- src/DynamicData.Tests/Cache/DynamicXorFixture.cs | 2 -- src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs | 2 -- .../Cache/EditDiffChangeSetOptionalFixture.cs | 2 -- src/DynamicData.Tests/Cache/EditDiffFixture.cs | 2 -- src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs | 1 - src/DynamicData.Tests/Cache/ExceptFixture.cs | 2 -- .../Cache/ExpireAfterFixture.ForSource.cs | 1 - .../Cache/ExpireAfterFixture.ForStream.cs | 1 - src/DynamicData.Tests/Cache/FilterFixture.Base.cs | 2 -- .../FilterFixture.DynamicPredicate.IntegrationTests.cs | 1 - .../Cache/FilterFixture.DynamicPredicate.UnitTests.cs | 2 -- ...ure.DynamicPredicateAndReFiltering.IntegrationTests.cs | 1 - ...terFixture.DynamicPredicateAndReFiltering.UnitTests.cs | 2 -- ...ilterFixture.DynamicPredicateState.IntegrationTests.cs | 1 - .../FilterFixture.DynamicPredicateState.UnitTests.cs | 2 -- src/DynamicData.Tests/Cache/FilterFixture.Static.cs | 2 -- src/DynamicData.Tests/Cache/FilterImmutableFixture.cs | 2 -- src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs | 4 +--- src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs | 1 - src/DynamicData.Tests/Cache/FilterParallelFixture.cs | 2 -- src/DynamicData.Tests/Cache/ForEachChangeFixture.cs | 2 -- src/DynamicData.Tests/Cache/FromAsyncFixture.cs | 2 -- src/DynamicData.Tests/Cache/FullJoinFixture.cs | 4 ---- src/DynamicData.Tests/Cache/FullJoinManyFixture.cs | 2 -- src/DynamicData.Tests/Cache/GroupControllerFixture.cs | 2 -- .../Cache/GroupControllerForFilteredItemsFixture.cs | 2 -- src/DynamicData.Tests/Cache/GroupFixture.cs | 4 ---- src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs | 2 -- src/DynamicData.Tests/Cache/GroupImmutableFixture.cs | 2 -- src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs | 1 - src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs | 1 - src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs | 1 - .../Cache/GroupOnPropertyWithImmutableStateFixture.cs | 2 -- src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs | 2 -- src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs | 2 -- src/DynamicData.Tests/Cache/InnerJoinFixture.cs | 2 -- src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs | 2 -- src/DynamicData.Tests/Cache/LeftJoinFixture.cs | 2 -- src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs | 2 -- src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs | 1 - .../Cache/MergeManyChangeSetsCacheFixture.cs | 1 - .../Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs | 1 - .../Cache/MergeManyChangeSetsListFixture.cs | 1 - src/DynamicData.Tests/Cache/MergeManyFixture.cs | 2 -- src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs | 2 -- .../Cache/MergeManyWithKeyOverloadFixture.cs | 2 -- src/DynamicData.Tests/Cache/MonitorStatusFixture.cs | 2 -- src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs | 4 ---- src/DynamicData.Tests/Cache/OfTypeFixture.cs | 1 - src/DynamicData.Tests/Cache/OnItemFixture.cs | 3 --- src/DynamicData.Tests/Cache/OrFixture.cs | 2 -- src/DynamicData.Tests/Cache/PageFixture.cs | 2 -- src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs | 2 -- src/DynamicData.Tests/Cache/RefCountFixture.cs | 2 -- src/DynamicData.Tests/Cache/RightJoinFixture.cs | 2 -- src/DynamicData.Tests/Cache/RightJoinManyFixture.cs | 2 -- src/DynamicData.Tests/Cache/SizeLimitFixture.cs | 2 -- src/DynamicData.Tests/Cache/SortAndBindFixture.cs | 4 ---- .../Cache/SortAndBindObservableFixture.cs | 1 - src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs | 1 - src/DynamicData.Tests/Cache/SortAndPageFixture.cs | 1 - .../Cache/SortAndVirtualizeAndBindFixture.cs | 1 - src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs | 1 - src/DynamicData.Tests/Cache/SortFixture.cs | 6 ------ .../Cache/SortObservableFixtureFixture.cs | 2 -- src/DynamicData.Tests/Cache/SourceCacheFixture.cs | 2 -- src/DynamicData.Tests/Cache/SubscribeManyFixture.cs | 2 -- .../Cache/SuspendNotificationsFixture.cs | 1 - src/DynamicData.Tests/Cache/SwitchFixture.cs | 2 -- ...ToObservableChangeSetFixture.Items.IntegrationTests.cs | 2 -- .../Cache/ToObservableChangeSetFixture.Items.UnitTests.cs | 2 -- ...servableChangeSetFixture.Sequences.IntegrationTests.cs | 2 -- .../ToObservableChangeSetFixture.Sequences.UnitTests.cs | 2 -- .../Cache/ToObservableOptionalFixture.cs | 1 - src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs | 2 -- src/DynamicData.Tests/Cache/TransformAsyncFixture.cs | 2 -- src/DynamicData.Tests/Cache/TransformFixture.cs | 2 -- src/DynamicData.Tests/Cache/TransformFixtureParallel.cs | 2 -- src/DynamicData.Tests/Cache/TransformImmutableFixture.cs | 2 -- src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs | 2 -- src/DynamicData.Tests/Cache/TransformManyFixture.cs | 2 -- .../Cache/TransformManyObservableCacheFixture.cs | 3 --- .../Cache/TransformManyRefreshFixture.cs | 2 -- src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs | 2 -- .../Cache/TransformOnObservableFixture.cs | 2 -- src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs | 1 - src/DynamicData.Tests/Cache/TransformSafeFixture.cs | 2 -- .../Cache/TransformSafeParallelFixture.cs | 2 -- src/DynamicData.Tests/Cache/TransformTreeFixture.cs | 2 -- .../Cache/TransformTreeWithRefreshFixture.cs | 2 -- .../Cache/TransformWithInlineUpdateFixture.cs | 2 -- src/DynamicData.Tests/Cache/TrueForAllFixture.cs | 2 -- src/DynamicData.Tests/Cache/TrueForAnyFixture.cs | 2 -- src/DynamicData.Tests/Cache/WatchFixture.cs | 2 -- src/DynamicData.Tests/Cache/WatcherFixture.cs | 6 ------ src/DynamicData.Tests/Cache/XorFixture.cs | 2 -- src/DynamicData.Tests/Domain/AnimalOwner.cs | 1 - src/DynamicData.Tests/DynamicData.Tests.csproj | 5 +++++ src/DynamicData.Tests/EnumerableExFixtures.cs | 2 -- src/DynamicData.Tests/Internal/BitsetFixture.cs | 2 -- .../Internal/CacheParentSubscriptionFixture.cs | 2 -- src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs | 1 - src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs | 2 -- src/DynamicData.Tests/Internal/NotificationFixture.cs | 2 -- .../Internal/SharedDeliveryQueueFixture.cs | 1 - src/DynamicData.Tests/Internal/SwappableLockFixture.cs | 2 -- src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs | 2 -- src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs | 1 - src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs | 2 -- src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs | 2 -- src/DynamicData.Tests/Kernal/KeyValueFixture.cs | 2 -- src/DynamicData.Tests/Kernal/OptionFixture.cs | 2 -- src/DynamicData.Tests/Kernal/OptionObservableFixture.cs | 2 -- src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs | 2 -- src/DynamicData.Tests/Kernal/UpdateFixture.cs | 2 -- src/DynamicData.Tests/List/AndFixture.cs | 2 -- src/DynamicData.Tests/List/AutoRefreshFixture.cs | 2 -- src/DynamicData.Tests/List/BatchFixture.cs | 2 -- src/DynamicData.Tests/List/BatchIfFixture.cs | 2 -- src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs | 2 -- src/DynamicData.Tests/List/BufferFixture.cs | 2 -- src/DynamicData.Tests/List/BufferInitialFixture.cs | 2 -- src/DynamicData.Tests/List/CastFixture.cs | 4 +--- src/DynamicData.Tests/List/ChangeAwareListFixture.cs | 2 -- src/DynamicData.Tests/List/ChangeSetFixture.cs | 2 -- src/DynamicData.Tests/List/CloneChangesFixture.cs | 4 ---- src/DynamicData.Tests/List/CloneFixture.cs | 6 +----- src/DynamicData.Tests/List/CreationFixtures.cs | 2 -- src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs | 2 -- src/DynamicData.Tests/List/DisposeManyFixture.cs | 2 -- src/DynamicData.Tests/List/DistinctValuesFixture.cs | 2 -- src/DynamicData.Tests/List/DynamicAndFixture.cs | 2 -- src/DynamicData.Tests/List/DynamicExceptFixture.cs | 2 -- src/DynamicData.Tests/List/DynamicOrFixture.cs | 2 -- src/DynamicData.Tests/List/DynamicXOrFixture.cs | 2 -- src/DynamicData.Tests/List/EditDiffFixture.cs | 2 -- src/DynamicData.Tests/List/ExceptFixture.cs | 2 -- src/DynamicData.Tests/List/ExpireAfterFixture.cs | 1 - .../List/FilterControllerFixtureWithClearAndReplace.cs | 2 -- .../List/FilterControllerFixtureWithDiffSet.cs | 2 -- src/DynamicData.Tests/List/FilterFixture.Base.cs | 2 -- src/DynamicData.Tests/List/FilterFixture.Static.cs | 2 -- .../List/FilterFixture.WithPredicateState.cs | 1 - src/DynamicData.Tests/List/FilterOnObservableFixture.cs | 2 -- src/DynamicData.Tests/List/FilterOnPropertyFixture.cs | 2 -- src/DynamicData.Tests/List/FilterWithObservable.cs | 2 -- src/DynamicData.Tests/List/ForEachChangeFixture.cs | 2 -- src/DynamicData.Tests/List/FromAsyncFixture.cs | 2 -- src/DynamicData.Tests/List/GroupImmutableFixture.cs | 2 -- src/DynamicData.Tests/List/GroupOnFixture.cs | 2 -- src/DynamicData.Tests/List/GroupOnPropertyFixture.cs | 2 -- .../List/GroupOnPropertyWithImmutableStateFixture.cs | 2 -- src/DynamicData.Tests/List/MergeChangeSetsFixture.cs | 1 - .../List/MergeManyChangeSetsCacheFixture.cs | 1 - src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs | 2 -- .../List/MergeManyChangeSetsListFixture.cs | 1 - src/DynamicData.Tests/List/MergeManyFixture.cs | 2 -- src/DynamicData.Tests/List/OnItemAddedFixture.cs | 2 -- src/DynamicData.Tests/List/OnItemRefreshedFixture.cs | 2 -- src/DynamicData.Tests/List/OnItemRemovedFixture.cs | 2 -- src/DynamicData.Tests/List/OrFixture.cs | 4 +--- src/DynamicData.Tests/List/PageFixture.cs | 2 -- src/DynamicData.Tests/List/QueryWhenChangedFixture.cs | 2 -- .../List/RecursiveTransformManyFixture.cs | 2 -- src/DynamicData.Tests/List/RefCountFixture.cs | 2 -- src/DynamicData.Tests/List/RemoveManyFixture.cs | 2 -- src/DynamicData.Tests/List/ReverseFixture.cs | 4 +--- src/DynamicData.Tests/List/SelectFixture.cs | 2 -- src/DynamicData.Tests/List/SizeLimitFixture.cs | 2 -- src/DynamicData.Tests/List/SortFixture.cs | 2 -- src/DynamicData.Tests/List/SortMutableFixture.cs | 2 -- src/DynamicData.Tests/List/SortPrimitiveFixture.cs | 2 -- src/DynamicData.Tests/List/SourceListFixture.cs | 2 -- src/DynamicData.Tests/List/SubscribeManyFixture.cs | 2 -- src/DynamicData.Tests/List/SwitchFixture.cs | 2 -- src/DynamicData.Tests/List/ToCollectionFixture.cs | 2 -- ...ToObservableChangeSetFixture.Items.IntegrationTests.cs | 2 -- .../List/ToObservableChangeSetFixture.Items.UnitTests.cs | 2 -- ...servableChangeSetFixture.Sequences.IntegrationTests.cs | 2 -- .../ToObservableChangeSetFixture.Sequences.UnitTests.cs | 2 -- src/DynamicData.Tests/List/TransformAsyncFixture.cs | 1 - src/DynamicData.Tests/List/TransformFixture.cs | 2 -- src/DynamicData.Tests/List/TransformManyFixture.cs | 4 ---- .../List/TransformManyObservableCollectionFixture.cs | 6 +----- .../List/TransformManyProjectionFixture.cs | 6 +----- src/DynamicData.Tests/List/TransformManyRefreshFixture.cs | 2 -- src/DynamicData.Tests/List/VirtualisationFixture.cs | 2 -- src/DynamicData.Tests/List/XOrFixture.cs | 2 -- src/DynamicData.Tests/ObservableCollectionExFixture.cs | 4 ---- .../Utilities/CacheChangeSetAssertions.cs | 4 +--- .../Utilities/CacheItemRecordingObserverAssertions.cs | 4 +--- .../Utilities/ListChangeSetAssertions.cs | 4 +--- src/DynamicData.Tests/Utilities/ObservableExtensions.cs | 2 -- src/DynamicData.Tests/Utilities/TestSourceCache.cs | 2 -- 267 files changed, 25 insertions(+), 606 deletions(-) diff --git a/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs b/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs index 707985d11..35795043a 100644 --- a/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs +++ b/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs @@ -2,10 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using BenchmarkDotNet.Attributes; - -using DynamicData.Binding; - namespace DynamicData.Benchmarks.Cache; /// diff --git a/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs b/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs index 39d0fe666..fc1b34c15 100644 --- a/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.Cache { [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Cache/EditDiff.cs b/src/DynamicData.Benchmarks/Cache/EditDiff.cs index 4a27a847e..a3f408df8 100644 --- a/src/DynamicData.Benchmarks/Cache/EditDiff.cs +++ b/src/DynamicData.Benchmarks/Cache/EditDiff.cs @@ -1,5 +1,3 @@ -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs index 5e7815bdf..ff3e3699f 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs @@ -1,8 +1,4 @@ -using System.Collections.Immutable; - -using BenchmarkDotNet.Attributes; - -using Bogus; +using Bogus; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs index 125ab48d2..f7703de96 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs @@ -1,7 +1,3 @@ -using System.Collections.Immutable; - -using BenchmarkDotNet.Attributes; - using Bogus; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs index d264c0b5d..1faf82f25 100644 --- a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs @@ -1,5 +1,3 @@ -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs index e032853ae..e5bc6797e 100644 --- a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs @@ -1,7 +1,3 @@ -using System.Collections.Immutable; - -using BenchmarkDotNet.Attributes; - using Bogus; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs index 52a0a9eda..cbf4340bb 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs @@ -1,7 +1,3 @@ -using BenchmarkDotNet.Attributes; -using DynamicData.Binding; -using System.Collections.ObjectModel; - namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs index 358b73e62..8d13605c0 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs @@ -1,6 +1,3 @@ -using BenchmarkDotNet.Attributes; -using DynamicData.Binding; - namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Cache/SourceCache.cs b/src/DynamicData.Benchmarks/Cache/SourceCache.cs index 3b2929067..567f88803 100644 --- a/src/DynamicData.Benchmarks/Cache/SourceCache.cs +++ b/src/DynamicData.Benchmarks/Cache/SourceCache.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; - namespace DynamicData.Benchmarks.Cache { public class BenchmarkItem diff --git a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs index 050465648..34161c08f 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs @@ -1,5 +1,3 @@ -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs index c0814bacd..a0179332e 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs @@ -1,5 +1,3 @@ -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs index 3a1fa4e1c..d90164cf7 100644 --- a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs @@ -1,6 +1,3 @@ -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Columns; - namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs index 4239419e7..d6d6a29b7 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs @@ -1,5 +1,3 @@ -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Cache/TransformMany.cs b/src/DynamicData.Benchmarks/Cache/TransformMany.cs index b484344f9..5de8d8524 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformMany.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformMany.cs @@ -1,5 +1,3 @@ -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj index 3ebc5ebae..e7c24464d 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -23,6 +23,12 @@ + + + + + + diff --git a/src/DynamicData.Benchmarks/List/DisposeMany_List.cs b/src/DynamicData.Benchmarks/List/DisposeMany_List.cs index 112022cf8..100d8dbf6 100644 --- a/src/DynamicData.Benchmarks/List/DisposeMany_List.cs +++ b/src/DynamicData.Benchmarks/List/DisposeMany_List.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.List { [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs b/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs index 7da1b6697..1a68f00d4 100644 --- a/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs +++ b/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs @@ -1,8 +1,4 @@ -using System.Collections.Immutable; - -using BenchmarkDotNet.Attributes; - -using Bogus; +using Bogus; namespace DynamicData.Benchmarks.List; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs index 3239b40cf..d20b7bb30 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs @@ -1,6 +1,4 @@ -using System.Collections.Immutable; using System.Reflection; -using BenchmarkDotNet.Attributes; using Bogus; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs index c086c11d3..8691e2d22 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs @@ -1,6 +1,4 @@ -using System.Collections.Immutable; using System.Reflection; -using BenchmarkDotNet.Attributes; using Bogus; diff --git a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs index 2bce4940d..846e20006 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs @@ -1,7 +1,3 @@ -using System.Collections.Immutable; - -using BenchmarkDotNet.Attributes; - using Bogus; namespace DynamicData.Benchmarks.List; diff --git a/src/DynamicData.Benchmarks/List/GroupAdd.cs b/src/DynamicData.Benchmarks/List/GroupAdd.cs index 025658282..0037925eb 100644 --- a/src/DynamicData.Benchmarks/List/GroupAdd.cs +++ b/src/DynamicData.Benchmarks/List/GroupAdd.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; - namespace DynamicData.Benchmarks.List { [SimpleJob(RuntimeMoniker.NetCoreApp31)] diff --git a/src/DynamicData.Benchmarks/List/GroupRemove.cs b/src/DynamicData.Benchmarks/List/GroupRemove.cs index 1d0befcd1..dee140d07 100644 --- a/src/DynamicData.Benchmarks/List/GroupRemove.cs +++ b/src/DynamicData.Benchmarks/List/GroupRemove.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; - namespace DynamicData.Benchmarks.List { [SimpleJob(RuntimeMoniker.NetCoreApp31)] diff --git a/src/DynamicData.Benchmarks/List/SourceList.cs b/src/DynamicData.Benchmarks/List/SourceList.cs index 26c0fe05d..1c29970e5 100644 --- a/src/DynamicData.Benchmarks/List/SourceList.cs +++ b/src/DynamicData.Benchmarks/List/SourceList.cs @@ -2,9 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; - namespace DynamicData.Benchmarks.List { [SimpleJob(RuntimeMoniker.NetCoreApp31)] diff --git a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs index de61f0c28..799ed91d4 100644 --- a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs +++ b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs @@ -1,6 +1,3 @@ -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Columns; - namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] diff --git a/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs b/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs index 04456afbf..0ca8f138d 100644 --- a/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs @@ -2,8 +2,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.AggregationTests; public class AggregationFixture : IDisposable diff --git a/src/DynamicData.Tests/AggregationTests/AverageFixture.cs b/src/DynamicData.Tests/AggregationTests/AverageFixture.cs index 1121228fa..c9a13db95 100644 --- a/src/DynamicData.Tests/AggregationTests/AverageFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/AverageFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Aggregation; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.AggregationTests; public class AverageFixture : IDisposable diff --git a/src/DynamicData.Tests/AggregationTests/MaxFixture.cs b/src/DynamicData.Tests/AggregationTests/MaxFixture.cs index bcfbcfa2e..64035e685 100644 --- a/src/DynamicData.Tests/AggregationTests/MaxFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/MaxFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Aggregation; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.AggregationTests; public class MaxFixture : IDisposable diff --git a/src/DynamicData.Tests/AggregationTests/MinFixture.cs b/src/DynamicData.Tests/AggregationTests/MinFixture.cs index fd698998c..a8e82d842 100644 --- a/src/DynamicData.Tests/AggregationTests/MinFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/MinFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Aggregation; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.AggregationTests; public class MinFixture : IDisposable diff --git a/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs b/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs index 078a8f1b0..35907e32f 100644 --- a/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs +++ b/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs @@ -1,12 +1,5 @@ -using System; - using DynamicData.Aggregation; using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/SumFixture.ForList.cs b/src/DynamicData.Tests/AggregationTests/SumFixture.ForList.cs index 9e9108602..2b2d27f14 100644 --- a/src/DynamicData.Tests/AggregationTests/SumFixture.ForList.cs +++ b/src/DynamicData.Tests/AggregationTests/SumFixture.ForList.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; - using DynamicData.Aggregation; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AutoRefreshFilter.cs b/src/DynamicData.Tests/AutoRefreshFilter.cs index 52193a1ab..9734cc07b 100644 --- a/src/DynamicData.Tests/AutoRefreshFilter.cs +++ b/src/DynamicData.Tests/AutoRefreshFilter.cs @@ -1,7 +1,4 @@ -using System.Collections.ObjectModel; -using System.ComponentModel; using DynamicData.Binding; -using FluentAssertions; namespace DynamicData.Tests; diff --git a/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs b/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs index daceaf39d..43904f417 100644 --- a/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs +++ b/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs @@ -1,11 +1,7 @@ -using System.Collections; -using System.Collections.Specialized; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Binding; diff --git a/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs b/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs index 28e5549f7..b0bb334d1 100644 --- a/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs @@ -1,11 +1,7 @@ #if SUPPORTS_BINDINGLIST -using System.ComponentModel; - using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Binding { public class BindingLIstBindListFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs b/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs index 2dd593227..c51a13565 100644 --- a/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs @@ -1,11 +1,7 @@ #if SUPPORTS_BINDINGLIST -using System.ComponentModel; - using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Binding { public class BindingListCacheFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs index 0c12b0ea2..ee56e96d5 100644 --- a/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs @@ -1,12 +1,8 @@ #if SUPPORTS_BINDINGLIST -using System.ComponentModel; - using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Binding { public class BindingListBindCacheSortedFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs index f5e496996..c50271424 100644 --- a/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs @@ -1,9 +1,5 @@ -using System.ComponentModel; - using DynamicData.Binding; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class BindingListToChangeSetFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs index 922ad531a..1cf0ff9e0 100644 --- a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs +++ b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs @@ -2,8 +2,6 @@ using DynamicData.Binding; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class DeeplyNestedNotifyPropertyChangedFixture diff --git a/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs index b2437bc6e..41f40cd4d 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class IObservableListBindCacheFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs index cbc8bdf58..b371bf934 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class IObservableListBindCacheSortedFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs index 83f132e06..3b1749158 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs @@ -1,10 +1,6 @@ -using System.Collections.ObjectModel; -using System.Collections.Specialized; using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class IObservableListBindListFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs b/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs index 97dfb4eb5..6f84694c9 100644 --- a/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs +++ b/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs @@ -1,11 +1,8 @@ -using System.ComponentModel; -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class NotifyPropertyChangedExFixture diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs index a548d5b39..fe66bba0c 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs @@ -1,11 +1,6 @@ -using System.Collections.ObjectModel; -using System.Collections.Specialized; - using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class ObservableCollectionBindCacheFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs index 66d8abfc6..63581b13f 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs @@ -1,11 +1,6 @@ -using System.Collections.ObjectModel; -using System.Collections.Specialized; - using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class ObservableCollectionBindCacheSortedFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs index c47157427..9062dfcdb 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class ObservableCollectionBindListFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs index 62e6aee50..f94cf5527 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs @@ -1,9 +1,5 @@ -using System.Collections.ObjectModel; - using DynamicData.Binding; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class ObservableCollectionExtendedToChangeSetFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs index 6dd2153b9..701b0bec3 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs @@ -1,10 +1,5 @@ -using System.Collections.ObjectModel; -using System.Collections.Specialized; - using DynamicData.Binding; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class ObservableCollectionToChangeSetFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs b/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs index 0effe981b..39c154dd3 100644 --- a/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs @@ -1,10 +1,5 @@ -using System.Collections.ObjectModel; -using System.Collections.Specialized; - using DynamicData.Binding; -using FluentAssertions; - namespace DynamicData.Tests.Binding; public class ReadOnlyObservableCollectionToChangeSetFixture : IDisposable diff --git a/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs b/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs index b1a283432..d68514ab2 100644 --- a/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs @@ -1,8 +1,5 @@ -using System.Collections.ObjectModel; -using System.Collections.Specialized; using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Binding; diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs index 8f004155a..2a50aa139 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedBehaviorFixture.cs @@ -2,12 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; - using DynamicData.Binding; -using FluentAssertions; - namespace DynamicData.Tests.Binding; /// diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs index 499cb0374..9d9bcbd28 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs @@ -2,12 +2,8 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using System.ComponentModel; - using DynamicData.Binding; -using FluentAssertions; - namespace DynamicData.Tests.Binding; /// diff --git a/src/DynamicData.Tests/Cache/AndFixture.cs b/src/DynamicData.Tests/Cache/AndFixture.cs index 0861bef8b..79e4a0d89 100644 --- a/src/DynamicData.Tests/Cache/AndFixture.cs +++ b/src/DynamicData.Tests/Cache/AndFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class AndFixture : AndFixtureBase diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs index 9c97e862c..4d31b75d0 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs @@ -1,7 +1,5 @@ using DynamicData.Kernel; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class AsyncDisposeManyFixture diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs index 420c86039..c4ceff774 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs @@ -1,7 +1,5 @@ using DynamicData.Cache.Internal; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class AsyncDisposeManyFixture diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs index 1cb0c57cf..e4daedcac 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class AutoRefreshFixture diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs index 60290ea9d..febeb74f8 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs @@ -1,7 +1,5 @@ using System.Linq.Expressions; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class AutoRefreshFixture diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs index 817619897..a0d7b3e67 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class AutoRefreshFixture diff --git a/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs b/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs index be5b936a3..e0422d6f7 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.cs @@ -1,6 +1,4 @@ -using System.ComponentModel; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class AutoRefreshFixture { diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs index 8fa55bd38..190f1e1d6 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class AutoRefreshOnObservableFixture diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs index 0ea85b187..2fc259bb8 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class AutoRefreshOnObservableFixture diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs index 21321ca43..585c2f8e4 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class AutoRefreshOnObservableFixture diff --git a/src/DynamicData.Tests/Cache/BatchFixture.cs b/src/DynamicData.Tests/Cache/BatchFixture.cs index c08f6219c..e750f639d 100644 --- a/src/DynamicData.Tests/Cache/BatchFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class BatchFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/BatchIfFixture.cs b/src/DynamicData.Tests/Cache/BatchIfFixture.cs index ca430f2e4..c6e50dec1 100644 --- a/src/DynamicData.Tests/Cache/BatchIfFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class BatchIfFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs index 69e7d393c..64f28e246 100644 --- a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class BatchIfWithTimeoutFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/BufferInitialFixture.cs b/src/DynamicData.Tests/Cache/BufferInitialFixture.cs index fd82bde5c..656643b7c 100644 --- a/src/DynamicData.Tests/Cache/BufferInitialFixture.cs +++ b/src/DynamicData.Tests/Cache/BufferInitialFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class BufferInitialFixture diff --git a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs index 4758ebe37..9bb1fb427 100644 --- a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs +++ b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs @@ -6,8 +6,6 @@ using DynamicData.Binding; -using FluentAssertions; - namespace DynamicData.Tests.Cache; /// diff --git a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs index da64ba7a5..cdf7edc62 100644 --- a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs +++ b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs @@ -5,8 +5,6 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; /// diff --git a/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs b/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs index 490011ea7..1961f4f2c 100644 --- a/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs +++ b/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class DeferAnsdSkipFixture diff --git a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs index e19d671e5..c78b21433 100644 --- a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public sealed class DisposeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/DistinctFixture.cs b/src/DynamicData.Tests/Cache/DistinctFixture.cs index 91b1dc838..9f34eba0f 100644 --- a/src/DynamicData.Tests/Cache/DistinctFixture.cs +++ b/src/DynamicData.Tests/Cache/DistinctFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class DistinctFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/DynamicAndFixture.cs b/src/DynamicData.Tests/Cache/DynamicAndFixture.cs index 5b3e34bb9..01a8e8617 100644 --- a/src/DynamicData.Tests/Cache/DynamicAndFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicAndFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class DynamicAndFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs b/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs index 30478a420..ad08a3681 100644 --- a/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class DynamicExceptFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/DynamicOrFixture.cs b/src/DynamicData.Tests/Cache/DynamicOrFixture.cs index 70e4142b3..04533075d 100644 --- a/src/DynamicData.Tests/Cache/DynamicOrFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicOrFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class DynamicOrFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/DynamicXorFixture.cs b/src/DynamicData.Tests/Cache/DynamicXorFixture.cs index 6900562df..d32723a43 100644 --- a/src/DynamicData.Tests/Cache/DynamicXorFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicXorFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class DynamicXorFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs index a732b2505..3f17c9516 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class EditDiffChangeSetFixture diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs index e62e89266..c55b2def6 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs @@ -1,6 +1,4 @@ -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/EditDiffFixture.cs b/src/DynamicData.Tests/Cache/EditDiffFixture.cs index c92b8e0ff..54451a1ff 100644 --- a/src/DynamicData.Tests/Cache/EditDiffFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class EditDiffFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs b/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs index e0acc195b..0162dfd54 100644 --- a/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs +++ b/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs @@ -1,5 +1,4 @@ using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ExceptFixture.cs b/src/DynamicData.Tests/Cache/ExceptFixture.cs index 7ed527cf7..a7b68e912 100644 --- a/src/DynamicData.Tests/Cache/ExceptFixture.cs +++ b/src/DynamicData.Tests/Cache/ExceptFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class ExceptFixture : ExceptFixtureBase diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs index a5108a6e9..a5305a17d 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs @@ -1,7 +1,6 @@ using System.Diagnostics; using Bogus; -using FluentAssertions; using Xunit.Abstractions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs index f552fe50b..6de32c806 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs @@ -1,7 +1,6 @@ using System.Diagnostics; using Bogus; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs index b25cac251..5d8ae9492 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class FilterFixture diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs index efe13a797..02736c192 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs @@ -1,5 +1,4 @@ using Bogus; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs index ed10a3d7a..be1cad062 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class FilterFixture diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs index 884842d03..5202453d1 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs @@ -1,5 +1,4 @@ using Bogus; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs index 0b8c496d1..a50f5ad61 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class FilterFixture diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs index 9f9f3f3ef..60c098f04 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs @@ -1,5 +1,4 @@ using Bogus; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs index ec0576f96..1c053daa4 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class FilterFixture diff --git a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs index efdc508eb..f97ca1c5a 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class FilterFixture diff --git a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs index 495b0ea99..8ddbaec7d 100644 --- a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public sealed class FilterImmutableFixture diff --git a/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs b/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs index edbd7684f..197c6395b 100644 --- a/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs @@ -1,6 +1,4 @@ -using FluentAssertions; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; /// /// See https://github.com/reactivemarbles/DynamicData/issues/400 diff --git a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs index 83d02b589..7c67774f6 100644 --- a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs @@ -1,6 +1,5 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/FilterParallelFixture.cs b/src/DynamicData.Tests/Cache/FilterParallelFixture.cs index f7a0788b3..28f560efc 100644 --- a/src/DynamicData.Tests/Cache/FilterParallelFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterParallelFixture.cs @@ -1,8 +1,6 @@ using DynamicData.PLinq; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class FilterParallelFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs b/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs index c33ec9d17..3c36c1404 100644 --- a/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs +++ b/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class ForEachChangeFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs index 1ff5d53c2..07429e250 100644 --- a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class FromAsyncFixture diff --git a/src/DynamicData.Tests/Cache/FullJoinFixture.cs b/src/DynamicData.Tests/Cache/FullJoinFixture.cs index 5f60d6633..4a5a72d3d 100644 --- a/src/DynamicData.Tests/Cache/FullJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/FullJoinFixture.cs @@ -1,7 +1,3 @@ -using DynamicData.Kernel; - -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class FullJoinFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs b/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs index a2c2004e8..3577eaa2f 100644 --- a/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class FullJoinManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs index 1ddaa9882..9fcf881ad 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class GroupControllerFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs index 5a8dc8205..137f0ea48 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class GroupControllerForFilteredItemsFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupFixture.cs b/src/DynamicData.Tests/Cache/GroupFixture.cs index 8a1de9adf..940f7e9e1 100644 --- a/src/DynamicData.Tests/Cache/GroupFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupFixture.cs @@ -1,9 +1,5 @@ -using System.Collections.ObjectModel; - using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class GroupFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs b/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs index a31488da8..b7a7177f6 100644 --- a/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class GroupFromDistinctFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs b/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs index f9395cfe7..f1acdfd90 100644 --- a/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class GroupImmutableFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs index 44142fdd4..6eb66df47 100644 --- a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs @@ -1,7 +1,6 @@ using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; using Person = DynamicData.Tests.Domain.Person; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs index 7878440f2..cb7881a46 100644 --- a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs @@ -2,7 +2,6 @@ using DynamicData.Binding; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; using Person = DynamicData.Tests.Domain.Person; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs b/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs index de6107e80..609263f17 100644 --- a/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs @@ -1,6 +1,5 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs b/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs index 523b4832d..8411c2eb3 100644 --- a/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class GroupOnPropertyWithImmutableStateFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs b/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs index f43a2e60f..6af361809 100644 --- a/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class IgnoreUpdateFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs b/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs index b48f291e4..ead2a0d13 100644 --- a/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class IncludeUpdateFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs index 6bfc292e6..8d7b3895a 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class InnerJoinFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs b/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs index 25decc1cb..dd822d7aa 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class InnerJoinManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/LeftJoinFixture.cs b/src/DynamicData.Tests/Cache/LeftJoinFixture.cs index 8f0dd2242..074f7bbed 100644 --- a/src/DynamicData.Tests/Cache/LeftJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/LeftJoinFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Kernel; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class LeftJoinFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs b/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs index 5ab8cf8c2..b7ab8f226 100644 --- a/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class LeftJoinManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs b/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs index 6f8de9e96..727cac4ab 100644 --- a/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs @@ -1,6 +1,5 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs index 148af77d9..288782ea0 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs @@ -1,7 +1,6 @@ using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs index b5ece67cd..8cba09ed5 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs @@ -1,7 +1,6 @@ using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs index 3e7b34018..dd0899245 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs @@ -1,7 +1,6 @@ using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/MergeManyFixture.cs b/src/DynamicData.Tests/Cache/MergeManyFixture.cs index b4fdcbc03..c16cf06c0 100644 --- a/src/DynamicData.Tests/Cache/MergeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class MergeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs index ac620ede8..86c9979a9 100644 --- a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class MergeManyItemsFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs index a79b069e6..3f15416e5 100644 --- a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class MergeManyWithKeyOverloadFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs index 6171dfe7a..280875e6b 100644 --- a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs +++ b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Kernel; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class MonitorStatusFixture diff --git a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs index 29e10c887..8f88f8571 100644 --- a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs @@ -1,9 +1,5 @@ -using System.ComponentModel; - using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class ObservableChangeSetFixture diff --git a/src/DynamicData.Tests/Cache/OfTypeFixture.cs b/src/DynamicData.Tests/Cache/OfTypeFixture.cs index 2353f2c0f..37098e472 100644 --- a/src/DynamicData.Tests/Cache/OfTypeFixture.cs +++ b/src/DynamicData.Tests/Cache/OfTypeFixture.cs @@ -1,6 +1,5 @@ using Bogus; using DynamicData.Tests.Domain; -using FluentAssertions; using Xunit.Abstractions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/OnItemFixture.cs b/src/DynamicData.Tests/Cache/OnItemFixture.cs index d3b5efea2..2e6639ed6 100644 --- a/src/DynamicData.Tests/Cache/OnItemFixture.cs +++ b/src/DynamicData.Tests/Cache/OnItemFixture.cs @@ -1,8 +1,5 @@ -using System.Collections.ObjectModel; -using System.ComponentModel; using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/OrFixture.cs b/src/DynamicData.Tests/Cache/OrFixture.cs index 4b5f1bc63..add8e2358 100644 --- a/src/DynamicData.Tests/Cache/OrFixture.cs +++ b/src/DynamicData.Tests/Cache/OrFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class OrFixture : OrFixtureBase diff --git a/src/DynamicData.Tests/Cache/PageFixture.cs b/src/DynamicData.Tests/Cache/PageFixture.cs index da66ca64c..be343fd5a 100644 --- a/src/DynamicData.Tests/Cache/PageFixture.cs +++ b/src/DynamicData.Tests/Cache/PageFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class PageFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs b/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs index 4c1736af0..58feecef5 100644 --- a/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs +++ b/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class QueryWhenChangedFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/RefCountFixture.cs b/src/DynamicData.Tests/Cache/RefCountFixture.cs index 82117f2eb..73c54790a 100644 --- a/src/DynamicData.Tests/Cache/RefCountFixture.cs +++ b/src/DynamicData.Tests/Cache/RefCountFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class RefCountFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/RightJoinFixture.cs b/src/DynamicData.Tests/Cache/RightJoinFixture.cs index 7c34624a1..e2117db7f 100644 --- a/src/DynamicData.Tests/Cache/RightJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Kernel; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class RightJoinFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs b/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs index 2cbf2c1f1..cd211f8c0 100644 --- a/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class RightJoinManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SizeLimitFixture.cs b/src/DynamicData.Tests/Cache/SizeLimitFixture.cs index 89ea1c9b9..8be9ab701 100644 --- a/src/DynamicData.Tests/Cache/SizeLimitFixture.cs +++ b/src/DynamicData.Tests/Cache/SizeLimitFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class SizeLimitFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs index 2fc9e8851..fc6c8491d 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs @@ -1,9 +1,5 @@ -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs index d684666b0..97638d119 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs @@ -1,6 +1,5 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs index c2ed47247..4e3d206a1 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs @@ -1,6 +1,5 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs index 4c44eb7a4..71c872993 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs @@ -1,6 +1,5 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs index 19c660ae5..b367c2e17 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs @@ -1,6 +1,5 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs index 0a9846f52..8b58cee45 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs @@ -1,6 +1,5 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SortFixture.cs b/src/DynamicData.Tests/Cache/SortFixture.cs index 6e9c8366c..c15914836 100644 --- a/src/DynamicData.Tests/Cache/SortFixture.cs +++ b/src/DynamicData.Tests/Cache/SortFixture.cs @@ -1,13 +1,7 @@ -#region - using DynamicData.Binding; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - -#endregion - namespace DynamicData.Tests.Cache; public class SortFixtureWithReorder : IDisposable diff --git a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs index 3c9cc8e92..6f8d61fe7 100644 --- a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs +++ b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class SortObservableFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SourceCacheFixture.cs b/src/DynamicData.Tests/Cache/SourceCacheFixture.cs index 2c6a994ff..fa88d6f01 100644 --- a/src/DynamicData.Tests/Cache/SourceCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/SourceCacheFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class SourceCacheFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs b/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs index 3f9ab50fc..513c955a6 100644 --- a/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class SubscribeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs index db4caf6d4..a81ef9340 100644 --- a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs +++ b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs @@ -1,5 +1,4 @@ using DynamicData.Kernel; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/SwitchFixture.cs b/src/DynamicData.Tests/Cache/SwitchFixture.cs index bccb35717..589cfeea4 100644 --- a/src/DynamicData.Tests/Cache/SwitchFixture.cs +++ b/src/DynamicData.Tests/Cache/SwitchFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class SwitchFixture diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 21af540f6..0c9893e8d 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs index 92de88ee6..254ebbea3 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index ca189eef1..4949bc486 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs index 27a256f6b..1e8e2e443 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture diff --git a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs index 54a9dcd3c..4ca357412 100644 --- a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs @@ -1,5 +1,4 @@ using System.Diagnostics.CodeAnalysis; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs b/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs index 6bf6cfd4d..53cb6c84b 100644 --- a/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs +++ b/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class ToSortedCollectionFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs index 57774c593..92b64e4d5 100644 --- a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs @@ -1,7 +1,5 @@ -using System.Collections.ObjectModel; using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/TransformFixture.cs b/src/DynamicData.Tests/Cache/TransformFixture.cs index 23ff66c09..79374df37 100644 --- a/src/DynamicData.Tests/Cache/TransformFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformFixture diff --git a/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs b/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs index ddfa21db9..53de7438f 100644 --- a/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs +++ b/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs @@ -1,8 +1,6 @@ using DynamicData.PLinq; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformFixtureParallel : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs index 7cf8bad72..2a5623569 100644 --- a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public sealed class TransformImmutableFixture diff --git a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs index 5895fa910..d0caa8758 100644 --- a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs @@ -1,8 +1,6 @@ -using System.Collections.ObjectModel; using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/TransformManyFixture.cs b/src/DynamicData.Tests/Cache/TransformManyFixture.cs index 01f2aea91..f9c03954d 100644 --- a/src/DynamicData.Tests/Cache/TransformManyFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformManyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs b/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs index ae3c2a760..004898a2c 100644 --- a/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs @@ -1,9 +1,6 @@ -using System.Collections.ObjectModel; using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformManyObservableCollectionFixture diff --git a/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs b/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs index 15aa2bfe7..1daadcb3e 100644 --- a/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformManyRefreshFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs b/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs index 1e6bdaf05..c6912058c 100644 --- a/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformManySimpleFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs index 9d310729d..a19c0b715 100644 --- a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs @@ -2,8 +2,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformOnObservableFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs index 224011770..b3b2bffa1 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs @@ -1,6 +1,5 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/TransformSafeFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeFixture.cs index ca0a77c00..6483ea993 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformSafeFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs index c1778fea9..557e45e7a 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformSafeParallelFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs index d821d1cef..d46a151f1 100644 --- a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformTreeFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs b/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs index 2233d1b64..41c936083 100644 --- a/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Binding; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformTreeWithRefreshFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs b/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs index d9137c699..4af0db106 100644 --- a/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TransformWithInlineUpdateFixture diff --git a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs index b2781bab6..92299e74e 100644 --- a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TrueForAllFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs index 5e70a3c86..556acf6b4 100644 --- a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class TrueForAnyFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/WatchFixture.cs b/src/DynamicData.Tests/Cache/WatchFixture.cs index d2f6cc202..b2fc22345 100644 --- a/src/DynamicData.Tests/Cache/WatchFixture.cs +++ b/src/DynamicData.Tests/Cache/WatchFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class WatchFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/WatcherFixture.cs b/src/DynamicData.Tests/Cache/WatcherFixture.cs index 419029f87..a174c4028 100644 --- a/src/DynamicData.Tests/Cache/WatcherFixture.cs +++ b/src/DynamicData.Tests/Cache/WatcherFixture.cs @@ -1,12 +1,6 @@ -#region - using DynamicData.Experimental; using DynamicData.Tests.Domain; -using FluentAssertions; - -#endregion - namespace DynamicData.Tests.Cache; public class WatcherFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/XorFixture.cs b/src/DynamicData.Tests/Cache/XorFixture.cs index 1159996e2..047b9eed7 100644 --- a/src/DynamicData.Tests/Cache/XorFixture.cs +++ b/src/DynamicData.Tests/Cache/XorFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Cache; public class XOrFixture : XOrFixtureBase diff --git a/src/DynamicData.Tests/Domain/AnimalOwner.cs b/src/DynamicData.Tests/Domain/AnimalOwner.cs index cde56097c..fed1bf82b 100644 --- a/src/DynamicData.Tests/Domain/AnimalOwner.cs +++ b/src/DynamicData.Tests/Domain/AnimalOwner.cs @@ -1,4 +1,3 @@ -using System.Collections.ObjectModel; using DynamicData.Binding; namespace DynamicData.Tests.Domain; diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index 0e050574d..c8224b49a 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -26,8 +26,13 @@ + + + + + diff --git a/src/DynamicData.Tests/EnumerableExFixtures.cs b/src/DynamicData.Tests/EnumerableExFixtures.cs index d0d271dce..c6d46fd6e 100644 --- a/src/DynamicData.Tests/EnumerableExFixtures.cs +++ b/src/DynamicData.Tests/EnumerableExFixtures.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests; public class EnumerableExFixtures diff --git a/src/DynamicData.Tests/Internal/BitsetFixture.cs b/src/DynamicData.Tests/Internal/BitsetFixture.cs index 277f82e7c..2cb633bf2 100644 --- a/src/DynamicData.Tests/Internal/BitsetFixture.cs +++ b/src/DynamicData.Tests/Internal/BitsetFixture.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using FluentAssertions; - namespace DynamicData.Tests.Internal; public class BitsetFixture diff --git a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs index 47b8bf352..dc09beb4b 100644 --- a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs +++ b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs @@ -4,8 +4,6 @@ using Bogus; -using FluentAssertions; - namespace DynamicData.Tests.Internal; /// diff --git a/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs b/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs index 371e25b9c..32537540d 100644 --- a/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs +++ b/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs @@ -1,5 +1,4 @@ using System.Collections.Concurrent; -using FluentAssertions; namespace DynamicData.Tests.Internal; diff --git a/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs b/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs index 18a231a7e..32029cf40 100644 --- a/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs +++ b/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using FluentAssertions; - namespace DynamicData.Tests.Internal; public class KeyedDisposableFixture diff --git a/src/DynamicData.Tests/Internal/NotificationFixture.cs b/src/DynamicData.Tests/Internal/NotificationFixture.cs index 7b3da7b1b..5bc10eefd 100644 --- a/src/DynamicData.Tests/Internal/NotificationFixture.cs +++ b/src/DynamicData.Tests/Internal/NotificationFixture.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using FluentAssertions; - namespace DynamicData.Tests.Internal; public class NotificationFixture diff --git a/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs b/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs index dc358bebd..42fb3b23e 100644 --- a/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs +++ b/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Concurrent; -using FluentAssertions; namespace DynamicData.Tests.Internal; diff --git a/src/DynamicData.Tests/Internal/SwappableLockFixture.cs b/src/DynamicData.Tests/Internal/SwappableLockFixture.cs index 47f34133d..d4e8b0533 100644 --- a/src/DynamicData.Tests/Internal/SwappableLockFixture.cs +++ b/src/DynamicData.Tests/Internal/SwappableLockFixture.cs @@ -2,8 +2,6 @@ // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -using FluentAssertions; - namespace DynamicData.Tests.Internal; public sealed class SwappableLockFixture diff --git a/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs b/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs index 5ce83dc8f..e9d2c71e3 100644 --- a/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs +++ b/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs @@ -1,6 +1,4 @@ -using System.Collections.ObjectModel; using DynamicData.Binding; -using FluentAssertions; namespace DynamicData.Tests.Issues { diff --git a/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs b/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs index dc8c801bb..890d7601c 100644 --- a/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs +++ b/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs @@ -1,4 +1,3 @@ -using System.Collections.ObjectModel; using DynamicData.Binding; namespace DynamicData.Tests.Issues diff --git a/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs b/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs index 109031dd5..5cb886e77 100644 --- a/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs +++ b/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Cache.Internal; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Kernal; public class CacheUpdaterFixture diff --git a/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs b/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs index 4ff413cec..7b7410cdd 100644 --- a/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs +++ b/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Kernal; public class DistinctUpdateFixture diff --git a/src/DynamicData.Tests/Kernal/KeyValueFixture.cs b/src/DynamicData.Tests/Kernal/KeyValueFixture.cs index 4c11f17b2..fcfac36ad 100644 --- a/src/DynamicData.Tests/Kernal/KeyValueFixture.cs +++ b/src/DynamicData.Tests/Kernal/KeyValueFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Kernal; public class KeyValueFixture diff --git a/src/DynamicData.Tests/Kernal/OptionFixture.cs b/src/DynamicData.Tests/Kernal/OptionFixture.cs index 35e350855..63e251291 100644 --- a/src/DynamicData.Tests/Kernal/OptionFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionFixture.cs @@ -2,8 +2,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Kernal; public class OptionFixture diff --git a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs index 45ede3823..69b517430 100644 --- a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Kernel; -using FluentAssertions; - namespace DynamicData.Tests.Kernal; public class OptionObservableFixture diff --git a/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs b/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs index cb6ff2452..2dfbc47dd 100644 --- a/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs +++ b/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Cache.Internal; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Kernal; public class SourceUpdaterFixture diff --git a/src/DynamicData.Tests/Kernal/UpdateFixture.cs b/src/DynamicData.Tests/Kernal/UpdateFixture.cs index 5ae46c623..6bf136be0 100644 --- a/src/DynamicData.Tests/Kernal/UpdateFixture.cs +++ b/src/DynamicData.Tests/Kernal/UpdateFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.Kernal; public class UpdateFixture diff --git a/src/DynamicData.Tests/List/AndFixture.cs b/src/DynamicData.Tests/List/AndFixture.cs index e50a2738a..5aefaf48a 100644 --- a/src/DynamicData.Tests/List/AndFixture.cs +++ b/src/DynamicData.Tests/List/AndFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class AndFixture : AndFixtureBase diff --git a/src/DynamicData.Tests/List/AutoRefreshFixture.cs b/src/DynamicData.Tests/List/AutoRefreshFixture.cs index 6f739ee7b..ffe6e1925 100644 --- a/src/DynamicData.Tests/List/AutoRefreshFixture.cs +++ b/src/DynamicData.Tests/List/AutoRefreshFixture.cs @@ -2,8 +2,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class AutoRefreshFixture diff --git a/src/DynamicData.Tests/List/BatchFixture.cs b/src/DynamicData.Tests/List/BatchFixture.cs index 02112b680..aab59ecbf 100644 --- a/src/DynamicData.Tests/List/BatchFixture.cs +++ b/src/DynamicData.Tests/List/BatchFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class BatchFixture : IDisposable diff --git a/src/DynamicData.Tests/List/BatchIfFixture.cs b/src/DynamicData.Tests/List/BatchIfFixture.cs index 52c20c6ad..7847241b4 100644 --- a/src/DynamicData.Tests/List/BatchIfFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class BatchIfFixture : IDisposable diff --git a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs index 7d3c7de74..d47171388 100644 --- a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class BatchIfWithTimeOutFixture : IDisposable diff --git a/src/DynamicData.Tests/List/BufferFixture.cs b/src/DynamicData.Tests/List/BufferFixture.cs index cdeadca71..ce80cb19f 100644 --- a/src/DynamicData.Tests/List/BufferFixture.cs +++ b/src/DynamicData.Tests/List/BufferFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class BufferFixture : IDisposable diff --git a/src/DynamicData.Tests/List/BufferInitialFixture.cs b/src/DynamicData.Tests/List/BufferInitialFixture.cs index 71a49efb6..7fc18ec09 100644 --- a/src/DynamicData.Tests/List/BufferInitialFixture.cs +++ b/src/DynamicData.Tests/List/BufferInitialFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class BufferInitialFixture diff --git a/src/DynamicData.Tests/List/CastFixture.cs b/src/DynamicData.Tests/List/CastFixture.cs index f64f0c6ae..38b5d57e0 100644 --- a/src/DynamicData.Tests/List/CastFixture.cs +++ b/src/DynamicData.Tests/List/CastFixture.cs @@ -1,6 +1,4 @@ -using FluentAssertions; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class CastFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/ChangeAwareListFixture.cs b/src/DynamicData.Tests/List/ChangeAwareListFixture.cs index 6738ce704..209e932b4 100644 --- a/src/DynamicData.Tests/List/ChangeAwareListFixture.cs +++ b/src/DynamicData.Tests/List/ChangeAwareListFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Kernel; -using FluentAssertions; - namespace DynamicData.Tests.List; public class ChangeAwareListFixture diff --git a/src/DynamicData.Tests/List/ChangeSetFixture.cs b/src/DynamicData.Tests/List/ChangeSetFixture.cs index 65871c778..43246c806 100644 --- a/src/DynamicData.Tests/List/ChangeSetFixture.cs +++ b/src/DynamicData.Tests/List/ChangeSetFixture.cs @@ -1,6 +1,4 @@ using Bogus; - -using FluentAssertions; using Xunit.Abstractions; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/CloneChangesFixture.cs b/src/DynamicData.Tests/List/CloneChangesFixture.cs index 0df1a8ab1..e30a9c600 100644 --- a/src/DynamicData.Tests/List/CloneChangesFixture.cs +++ b/src/DynamicData.Tests/List/CloneChangesFixture.cs @@ -1,9 +1,5 @@ -using System.Collections.ObjectModel; - using DynamicData.Kernel; -using FluentAssertions; - namespace DynamicData.Tests.List; public class CloneChangesFixture diff --git a/src/DynamicData.Tests/List/CloneFixture.cs b/src/DynamicData.Tests/List/CloneFixture.cs index 2ff993d73..5126cd305 100644 --- a/src/DynamicData.Tests/List/CloneFixture.cs +++ b/src/DynamicData.Tests/List/CloneFixture.cs @@ -1,8 +1,4 @@ -using System.Collections.ObjectModel; - -using DynamicData.Tests.Domain; - -using FluentAssertions; +using DynamicData.Tests.Domain; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/CreationFixtures.cs b/src/DynamicData.Tests/List/CreationFixtures.cs index 11f9b86c0..f44f9b651 100644 --- a/src/DynamicData.Tests/List/CreationFixtures.cs +++ b/src/DynamicData.Tests/List/CreationFixtures.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class ListCreationFixtures diff --git a/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs b/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs index 511c6b2e8..d2e67588b 100644 --- a/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs +++ b/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class DeferAnsdSkipFixture diff --git a/src/DynamicData.Tests/List/DisposeManyFixture.cs b/src/DynamicData.Tests/List/DisposeManyFixture.cs index 5552cf913..9fb6a064e 100644 --- a/src/DynamicData.Tests/List/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/List/DisposeManyFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public sealed class DisposeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/DistinctValuesFixture.cs b/src/DynamicData.Tests/List/DistinctValuesFixture.cs index 8e4cb69b5..cb039e1b7 100644 --- a/src/DynamicData.Tests/List/DistinctValuesFixture.cs +++ b/src/DynamicData.Tests/List/DistinctValuesFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class DistinctValuesFixture : IDisposable diff --git a/src/DynamicData.Tests/List/DynamicAndFixture.cs b/src/DynamicData.Tests/List/DynamicAndFixture.cs index 4dd537e36..3d690a6eb 100644 --- a/src/DynamicData.Tests/List/DynamicAndFixture.cs +++ b/src/DynamicData.Tests/List/DynamicAndFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class DynamicAndFixture : IDisposable diff --git a/src/DynamicData.Tests/List/DynamicExceptFixture.cs b/src/DynamicData.Tests/List/DynamicExceptFixture.cs index a21f6ef56..efeb8f94e 100644 --- a/src/DynamicData.Tests/List/DynamicExceptFixture.cs +++ b/src/DynamicData.Tests/List/DynamicExceptFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class DynamicExceptFixture : IDisposable diff --git a/src/DynamicData.Tests/List/DynamicOrFixture.cs b/src/DynamicData.Tests/List/DynamicOrFixture.cs index 6c0c3573f..4099e7b3b 100644 --- a/src/DynamicData.Tests/List/DynamicOrFixture.cs +++ b/src/DynamicData.Tests/List/DynamicOrFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class DynamicOrRefreshFixture diff --git a/src/DynamicData.Tests/List/DynamicXOrFixture.cs b/src/DynamicData.Tests/List/DynamicXOrFixture.cs index 8ba52d4df..e407c6d6a 100644 --- a/src/DynamicData.Tests/List/DynamicXOrFixture.cs +++ b/src/DynamicData.Tests/List/DynamicXOrFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class DynamicXOrFixture : IDisposable diff --git a/src/DynamicData.Tests/List/EditDiffFixture.cs b/src/DynamicData.Tests/List/EditDiffFixture.cs index e111d479f..0ad08df4d 100644 --- a/src/DynamicData.Tests/List/EditDiffFixture.cs +++ b/src/DynamicData.Tests/List/EditDiffFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class EditDiffFixture : IDisposable diff --git a/src/DynamicData.Tests/List/ExceptFixture.cs b/src/DynamicData.Tests/List/ExceptFixture.cs index 5f449f19a..d12b303fd 100644 --- a/src/DynamicData.Tests/List/ExceptFixture.cs +++ b/src/DynamicData.Tests/List/ExceptFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class ExceptFixture : ExceptFixtureBase diff --git a/src/DynamicData.Tests/List/ExpireAfterFixture.cs b/src/DynamicData.Tests/List/ExpireAfterFixture.cs index 628fb9977..98a50686d 100644 --- a/src/DynamicData.Tests/List/ExpireAfterFixture.cs +++ b/src/DynamicData.Tests/List/ExpireAfterFixture.cs @@ -1,7 +1,6 @@ using System.Diagnostics; using Bogus; -using FluentAssertions; using Xunit.Abstractions; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs index 5e1f22562..33034b4f2 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class FilterControllerFixtureWithClearAndReplace : IDisposable diff --git a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs index 8b3c0a32d..49ed4a3d7 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class FilterControllerFixtureWithDiffSet : IDisposable diff --git a/src/DynamicData.Tests/List/FilterFixture.Base.cs b/src/DynamicData.Tests/List/FilterFixture.Base.cs index 6b5e3e3e9..0881f6cb9 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Base.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public static partial class FilterFixture diff --git a/src/DynamicData.Tests/List/FilterFixture.Static.cs b/src/DynamicData.Tests/List/FilterFixture.Static.cs index da66f03e6..47f13f793 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Static.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public static partial class FilterFixture diff --git a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs index 41ac9da99..ea8877618 100644 --- a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs +++ b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs @@ -1,5 +1,4 @@ using Bogus; -using FluentAssertions; using Xunit.Abstractions; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/FilterOnObservableFixture.cs b/src/DynamicData.Tests/List/FilterOnObservableFixture.cs index af6027c45..1f6edf46d 100644 --- a/src/DynamicData.Tests/List/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/List/FilterOnObservableFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; //TODO: To optimise this, we need to introduce replace range, or specify a buffer diff --git a/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs b/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs index 1eb73e62e..010f5f9af 100644 --- a/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs +++ b/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class FilterOnPropertyFixture diff --git a/src/DynamicData.Tests/List/FilterWithObservable.cs b/src/DynamicData.Tests/List/FilterWithObservable.cs index 31af66494..061151d04 100644 --- a/src/DynamicData.Tests/List/FilterWithObservable.cs +++ b/src/DynamicData.Tests/List/FilterWithObservable.cs @@ -1,8 +1,6 @@ using DynamicData.Aggregation; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class FilterWithObservable : IDisposable diff --git a/src/DynamicData.Tests/List/ForEachChangeFixture.cs b/src/DynamicData.Tests/List/ForEachChangeFixture.cs index 1923aca5f..891143069 100644 --- a/src/DynamicData.Tests/List/ForEachChangeFixture.cs +++ b/src/DynamicData.Tests/List/ForEachChangeFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class ForEachChangeFixture : IDisposable diff --git a/src/DynamicData.Tests/List/FromAsyncFixture.cs b/src/DynamicData.Tests/List/FromAsyncFixture.cs index 2b345e73c..52cf760c8 100644 --- a/src/DynamicData.Tests/List/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/List/FromAsyncFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class FromAsyncFixture diff --git a/src/DynamicData.Tests/List/GroupImmutableFixture.cs b/src/DynamicData.Tests/List/GroupImmutableFixture.cs index 5812bb7da..19047ab37 100644 --- a/src/DynamicData.Tests/List/GroupImmutableFixture.cs +++ b/src/DynamicData.Tests/List/GroupImmutableFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class GroupImmutableFixture : IDisposable diff --git a/src/DynamicData.Tests/List/GroupOnFixture.cs b/src/DynamicData.Tests/List/GroupOnFixture.cs index 317d290a3..abcaee0cb 100644 --- a/src/DynamicData.Tests/List/GroupOnFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class GroupOnFixture : IDisposable diff --git a/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs b/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs index 12bbbfbea..fa6e18d86 100644 --- a/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class GroupOnPropertyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs b/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs index d155d1a38..c2cd4a72c 100644 --- a/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class GroupOnPropertyWithImmutableStateFixture : IDisposable diff --git a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs index f58d02ed6..a5c03eef0 100644 --- a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs @@ -1,7 +1,6 @@ using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; using System.Collections.Concurrent; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs index 7bc398a33..dc0724306 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs @@ -1,7 +1,6 @@ using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs index 0a3c4fb22..befd01636 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class MergeManyChangeSetsFixture diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs index c22a436f5..cf53e0037 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs @@ -1,7 +1,6 @@ using Bogus; using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/MergeManyFixture.cs b/src/DynamicData.Tests/List/MergeManyFixture.cs index 662624dd8..f8d70c674 100644 --- a/src/DynamicData.Tests/List/MergeManyFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class MergeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/OnItemAddedFixture.cs b/src/DynamicData.Tests/List/OnItemAddedFixture.cs index 553ee8e25..7e7ab673c 100644 --- a/src/DynamicData.Tests/List/OnItemAddedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemAddedFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class OnItemAddedFixture diff --git a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs index 5d0b88dac..e3098aea5 100644 --- a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class OnItemRefreshedFixture diff --git a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs index 596fd38a8..84ed635d6 100644 --- a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class OnItemRemovedFixture diff --git a/src/DynamicData.Tests/List/OrFixture.cs b/src/DynamicData.Tests/List/OrFixture.cs index 8ea279a90..86c989da2 100644 --- a/src/DynamicData.Tests/List/OrFixture.cs +++ b/src/DynamicData.Tests/List/OrFixture.cs @@ -1,6 +1,4 @@ -using FluentAssertions; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class OrFixture : OrFixtureBase { diff --git a/src/DynamicData.Tests/List/PageFixture.cs b/src/DynamicData.Tests/List/PageFixture.cs index d4b418ee1..0bec20b9f 100644 --- a/src/DynamicData.Tests/List/PageFixture.cs +++ b/src/DynamicData.Tests/List/PageFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class PageFixture : IDisposable diff --git a/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs b/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs index 6a4222ea6..cee9f0dc5 100644 --- a/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs +++ b/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class QueryWhenChangedFixture : IDisposable diff --git a/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs b/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs index b5d725861..b950dd172 100644 --- a/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs +++ b/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class RecursiveTransformManyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/RefCountFixture.cs b/src/DynamicData.Tests/List/RefCountFixture.cs index a72d0d81b..2c9463ec6 100644 --- a/src/DynamicData.Tests/List/RefCountFixture.cs +++ b/src/DynamicData.Tests/List/RefCountFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class RefCountFixture : IDisposable diff --git a/src/DynamicData.Tests/List/RemoveManyFixture.cs b/src/DynamicData.Tests/List/RemoveManyFixture.cs index f359a0b22..fff714584 100644 --- a/src/DynamicData.Tests/List/RemoveManyFixture.cs +++ b/src/DynamicData.Tests/List/RemoveManyFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class RemoveManyFixture diff --git a/src/DynamicData.Tests/List/ReverseFixture.cs b/src/DynamicData.Tests/List/ReverseFixture.cs index ed6f9ddf0..dd3e87329 100644 --- a/src/DynamicData.Tests/List/ReverseFixture.cs +++ b/src/DynamicData.Tests/List/ReverseFixture.cs @@ -1,6 +1,4 @@ -using FluentAssertions; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class ReverseFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/SelectFixture.cs b/src/DynamicData.Tests/List/SelectFixture.cs index 781dc9aa7..d7899ef62 100644 --- a/src/DynamicData.Tests/List/SelectFixture.cs +++ b/src/DynamicData.Tests/List/SelectFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Alias; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class SelectFixture : IDisposable diff --git a/src/DynamicData.Tests/List/SizeLimitFixture.cs b/src/DynamicData.Tests/List/SizeLimitFixture.cs index db8376984..26f972b74 100644 --- a/src/DynamicData.Tests/List/SizeLimitFixture.cs +++ b/src/DynamicData.Tests/List/SizeLimitFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class SizeLimitFixture : IDisposable diff --git a/src/DynamicData.Tests/List/SortFixture.cs b/src/DynamicData.Tests/List/SortFixture.cs index 1edb414fe..232f5197d 100644 --- a/src/DynamicData.Tests/List/SortFixture.cs +++ b/src/DynamicData.Tests/List/SortFixture.cs @@ -1,8 +1,6 @@ using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class SortChangedFixture diff --git a/src/DynamicData.Tests/List/SortMutableFixture.cs b/src/DynamicData.Tests/List/SortMutableFixture.cs index d3b610d37..4686763d1 100644 --- a/src/DynamicData.Tests/List/SortMutableFixture.cs +++ b/src/DynamicData.Tests/List/SortMutableFixture.cs @@ -2,8 +2,6 @@ using DynamicData.Kernel; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class SortMutableFixture : IDisposable diff --git a/src/DynamicData.Tests/List/SortPrimitiveFixture.cs b/src/DynamicData.Tests/List/SortPrimitiveFixture.cs index 7fce7b389..6ddcb6297 100644 --- a/src/DynamicData.Tests/List/SortPrimitiveFixture.cs +++ b/src/DynamicData.Tests/List/SortPrimitiveFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Binding; -using FluentAssertions; - namespace DynamicData.Tests.List; public class SortPrimitiveFixture : IDisposable diff --git a/src/DynamicData.Tests/List/SourceListFixture.cs b/src/DynamicData.Tests/List/SourceListFixture.cs index b4d2138a3..6396e6f46 100644 --- a/src/DynamicData.Tests/List/SourceListFixture.cs +++ b/src/DynamicData.Tests/List/SourceListFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class SourceListFixture diff --git a/src/DynamicData.Tests/List/SubscribeManyFixture.cs b/src/DynamicData.Tests/List/SubscribeManyFixture.cs index 81936c649..75278af0e 100644 --- a/src/DynamicData.Tests/List/SubscribeManyFixture.cs +++ b/src/DynamicData.Tests/List/SubscribeManyFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class SubscribeManyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/SwitchFixture.cs b/src/DynamicData.Tests/List/SwitchFixture.cs index c0e7eb179..b9cfb0b05 100644 --- a/src/DynamicData.Tests/List/SwitchFixture.cs +++ b/src/DynamicData.Tests/List/SwitchFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class SwitchFixture : IDisposable diff --git a/src/DynamicData.Tests/List/ToCollectionFixture.cs b/src/DynamicData.Tests/List/ToCollectionFixture.cs index 6f1d283d1..e7cfed1fe 100644 --- a/src/DynamicData.Tests/List/ToCollectionFixture.cs +++ b/src/DynamicData.Tests/List/ToCollectionFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class ToCollectionFixture diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 991c50961..30a03d7c6 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs index b25ba4ade..44cb136e2 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 08ee5bf74..66200534d 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs index fb2a21f33..fc7f246f8 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture diff --git a/src/DynamicData.Tests/List/TransformAsyncFixture.cs b/src/DynamicData.Tests/List/TransformAsyncFixture.cs index 6c5212584..100b9e9f8 100755 --- a/src/DynamicData.Tests/List/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/List/TransformAsyncFixture.cs @@ -1,5 +1,4 @@ using DynamicData.Tests.Domain; -using FluentAssertions; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/TransformFixture.cs b/src/DynamicData.Tests/List/TransformFixture.cs index a5e7e3a7e..d3000eedf 100644 --- a/src/DynamicData.Tests/List/TransformFixture.cs +++ b/src/DynamicData.Tests/List/TransformFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class TransformFixture : IDisposable diff --git a/src/DynamicData.Tests/List/TransformManyFixture.cs b/src/DynamicData.Tests/List/TransformManyFixture.cs index 85429c207..d0eb2c86c 100644 --- a/src/DynamicData.Tests/List/TransformManyFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyFixture.cs @@ -1,9 +1,5 @@ -using System.Collections.ObjectModel; - using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class TransformManyFixture : IDisposable diff --git a/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs b/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs index 1a5b0a765..44390b73b 100644 --- a/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs @@ -1,8 +1,4 @@ -using System.Collections.ObjectModel; - -using DynamicData.Tests.Domain; - -using FluentAssertions; +using DynamicData.Tests.Domain; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs b/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs index eebef154f..db2dd9280 100644 --- a/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs @@ -1,8 +1,4 @@ -using System.Collections.ObjectModel; - -using DynamicData.Binding; - -using FluentAssertions; +using DynamicData.Binding; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs b/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs index e2dee4873..3107f9c01 100644 --- a/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class TransformManyRefreshFixture : IDisposable diff --git a/src/DynamicData.Tests/List/VirtualisationFixture.cs b/src/DynamicData.Tests/List/VirtualisationFixture.cs index 8699e857f..66cf6513d 100644 --- a/src/DynamicData.Tests/List/VirtualisationFixture.cs +++ b/src/DynamicData.Tests/List/VirtualisationFixture.cs @@ -1,7 +1,5 @@ using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests.List; public class VirtualisationFixture : IDisposable diff --git a/src/DynamicData.Tests/List/XOrFixture.cs b/src/DynamicData.Tests/List/XOrFixture.cs index 03a475f77..f22f68286 100644 --- a/src/DynamicData.Tests/List/XOrFixture.cs +++ b/src/DynamicData.Tests/List/XOrFixture.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.List; public class XOrFixture : XOrFixtureBase diff --git a/src/DynamicData.Tests/ObservableCollectionExFixture.cs b/src/DynamicData.Tests/ObservableCollectionExFixture.cs index bd46f394b..ea6bcc619 100644 --- a/src/DynamicData.Tests/ObservableCollectionExFixture.cs +++ b/src/DynamicData.Tests/ObservableCollectionExFixture.cs @@ -1,10 +1,6 @@ - -using System.Collections.ObjectModel; using DynamicData.Binding; using DynamicData.Tests.Domain; -using FluentAssertions; - namespace DynamicData.Tests; public class ObservableCollectionExFixture diff --git a/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs b/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs index 58a5f5760..a9148584b 100644 --- a/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs +++ b/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs @@ -1,6 +1,4 @@ -using FluentAssertions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public static class CacheChangeSetAssertions { diff --git a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserverAssertions.cs b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserverAssertions.cs index 6dfbfa047..caf8e91f8 100644 --- a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserverAssertions.cs +++ b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserverAssertions.cs @@ -1,6 +1,4 @@ -using FluentAssertions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public static class CacheItemRecordingObserverAssertions { diff --git a/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs b/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs index 608fbced0..22f14d758 100644 --- a/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs +++ b/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs @@ -1,6 +1,4 @@ -using FluentAssertions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public static class ListChangeSetAssertions { diff --git a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs index a38dc868d..1e5d49749 100644 --- a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs @@ -1,5 +1,3 @@ -using FluentAssertions; - namespace DynamicData.Tests.Utilities; internal static class ObservableExtensions diff --git a/src/DynamicData.Tests/Utilities/TestSourceCache.cs b/src/DynamicData.Tests/Utilities/TestSourceCache.cs index c816f39d4..62a89948b 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceCache.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceCache.cs @@ -1,5 +1,3 @@ -using DynamicData.Kernel; - namespace DynamicData.Tests.Utilities; public sealed class TestSourceCache From 2804c6c1728a6f88b715db01d9b2e02436ba8865 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 09:52:17 +0100 Subject: [PATCH 16/36] Use TaskPoolScheduler alias in code and csproj Replace references to TaskPoolSequencer with TaskPoolScheduler across tests and project files for consistent aliasing. Updated DynamicData.Reactive.csproj, DynamicData.Tests.csproj and DynamicData.csproj to include the TaskPoolScheduler Using alias, and updated usages in WhenPropertyChangedRaceFixture and multiple ToObservableChangeSetFixture integration tests to call TaskPoolScheduler.Default. --- src/DynamicData.Reactive/DynamicData.Reactive.csproj | 2 +- .../Binding/WhenPropertyChangedRaceFixture.cs | 4 ++-- .../ToObservableChangeSetFixture.Items.IntegrationTests.cs | 2 +- ...ToObservableChangeSetFixture.Sequences.IntegrationTests.cs | 2 +- src/DynamicData.Tests/DynamicData.Tests.csproj | 1 + .../ToObservableChangeSetFixture.Items.IntegrationTests.cs | 2 +- ...ToObservableChangeSetFixture.Sequences.IntegrationTests.cs | 2 +- src/DynamicData/DynamicData.csproj | 1 + 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index 1a625bca9..ed944f65d 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -34,7 +34,7 @@ - + diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs index 9d9bcbd28..e45103280 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs @@ -330,7 +330,7 @@ public async Task AutoRefreshThenFilter_DualSubscribers_AllItemsObserved() var items = Enumerable.Range(0, itemCount).Select(i => new KeyedActivable(i)).ToList(); using var mutator = cache.Connect() - .ObserveOn(TaskPoolSequencer.Default) + .ObserveOn(TaskPoolScheduler.Default) .Subscribe(changes => { foreach (var change in changes) @@ -343,7 +343,7 @@ public async Task AutoRefreshThenFilter_DualSubscribers_AllItemsObserved() }); using var results = cache.Connect() - .ObserveOn(TaskPoolSequencer.Default) + .ObserveOn(TaskPoolScheduler.Default) .AutoRefresh(x => x.Activated) .Filter(x => x.Activated) .AsAggregator(); diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 0c9893e8d..04c38dd75 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -18,7 +18,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), - SchedulerType.TaskPool => TaskPoolSequencer.Default, + SchedulerType.TaskPool => TaskPoolScheduler.Default, SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, _ => throw new ArgumentOutOfRangeException(nameof(SchedulerType)) }; diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 4949bc486..dcdaf5170 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -18,7 +18,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), - SchedulerType.TaskPool => TaskPoolSequencer.Default, + SchedulerType.TaskPool => TaskPoolScheduler.Default, SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, _ => throw new ArgumentOutOfRangeException(nameof(SchedulerType)) }; diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index c8224b49a..a0f64854a 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -44,6 +44,7 @@ + diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 30a03d7c6..4a5a3eb49 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -18,7 +18,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), - SchedulerType.TaskPool => TaskPoolSequencer.Default, + SchedulerType.TaskPool => TaskPoolScheduler.Default, SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, _ => throw new ArgumentOutOfRangeException(nameof(SchedulerType)) }; diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 66200534d..2c7f08518 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -18,7 +18,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), - SchedulerType.TaskPool => TaskPoolSequencer.Default, + SchedulerType.TaskPool => TaskPoolScheduler.Default, SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, _ => throw new ArgumentOutOfRangeException(nameof(schedulerType)) }; diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index 2cdcab430..9cb881a0a 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -39,6 +39,7 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int + From 49f72a76e950ea5ee10a076a24d32ec8d64979fe Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 11:47:24 +0100 Subject: [PATCH 17/36] Standardize null checks, add polyfills, update build props Replace ad-hoc ThrowArgumentNullExceptionIfNull calls with ArgumentExceptionHelper.ThrowIfNull across the codebase to centralize null-checking. Add a set of polyfill files and Task/attribute helpers to support older/newer target frameworks, and adjust DynamicData.Reactive.csproj to alias exception types for net4 vs newer frameworks. Update Directory.Build.props: set SolutionDir default, enable runtime-async for newer runtimes, reorganize analyzer/StyleCop configuration and restore the Lock alias ItemGroups. Remove ExceptionMixins.cs and tweak tests (e.g. use Signal instead of Subject in FilterImmutableFixture). These changes prepare the project for broader framework compatibility and unify argument validation behavior. --- src/Directory.Build.props | 34 ++++---- .../DynamicData.Reactive.csproj | 9 +++ .../Cache/FilterImmutableFixture.cs | 2 +- src/DynamicData/Aggregation/AggregationEx.cs | 20 ++--- src/DynamicData/Aggregation/AvgEx.cs | 20 ++--- src/DynamicData/Aggregation/CountEx.cs | 2 +- src/DynamicData/Aggregation/MaxEx.cs | 24 +++--- src/DynamicData/Aggregation/StdDevEx.cs | 20 ++--- src/DynamicData/Aggregation/SumEx.cs | 38 ++++----- src/DynamicData/Alias/ObservableCacheAlias.cs | 46 +++++------ src/DynamicData/Alias/ObservableListAlias.cs | 16 ++-- src/DynamicData/Binding/BindPaged.cs | 2 +- src/DynamicData/Binding/BindingListAdaptor.cs | 4 +- src/DynamicData/Binding/BindingListEx.cs | 12 +-- .../Binding/NotifyPropertyChangedEx.cs | 76 +++++++++--------- .../Binding/ObservableCollectionAdaptor.cs | 6 +- .../Binding/ObservableCollectionEx.cs | 14 ++-- .../Binding/ObservableCollectionExtended.cs | 8 +- .../Binding/SortedBindingListAdaptor.cs | 2 +- .../SortedObservableCollectionAdaptor.cs | 4 +- src/DynamicData/Cache/CacheChangeSetEx.cs | 4 +- src/DynamicData/Cache/ChangeAwareCache.cs | 6 +- src/DynamicData/Cache/IntermediateCache.cs | 2 +- .../Internal/AnonymousObservableCache.cs | 2 +- .../Cache/Internal/AsyncDisposeMany.cs | 4 +- src/DynamicData/Cache/Internal/Cache.cs | 2 +- .../Cache/Internal/CacheUpdater.cs | 26 +++--- .../Cache/Internal/DeferUntilLoaded.cs | 2 +- .../Cache/Internal/ExpireAfter.ForSource.cs | 4 +- .../Cache/Internal/ExpireAfter.ForStream.cs | 4 +- .../Cache/Internal/Filter.Dynamic.cs | 8 +- .../Cache/Internal/Filter.Static.cs | 4 +- src/DynamicData/Cache/Internal/LeftJoin.cs | 2 +- .../Cache/Internal/LockFreeObservableCache.cs | 2 +- src/DynamicData/Cache/Internal/MergeMany.cs | 2 +- .../Cache/Internal/QueryWhenChanged.cs | 2 +- .../Cache/Internal/ReaderWriter.cs | 6 +- src/DynamicData/Cache/Internal/RightJoin.cs | 2 +- .../Cache/Internal/SubscribeMany.cs | 2 +- .../Cache/Internal/ToObservableChangeSet.cs | 2 +- src/DynamicData/Cache/Internal/Transform.cs | 2 +- .../Cache/Internal/TransformAsync.cs | 4 +- .../Cache/Internal/TransformMany.cs | 6 +- .../Internal/TransformWithInlineUpdate.cs | 2 +- src/DynamicData/Cache/ObservableCache.cs | 8 +- .../Cache/ObservableCacheEx.Adapt.cs | 8 +- .../Cache/ObservableCacheEx.AddOrUpdate.cs | 19 +++-- .../Cache/ObservableCacheEx.And.cs | 10 +-- .../ObservableCacheEx.AsObservableCache.cs | 4 +- .../Cache/ObservableCacheEx.AutoRefresh.cs | 4 +- ...servableCacheEx.AutoRefreshOnObservable.cs | 4 +- .../Cache/ObservableCacheEx.Batch.cs | 2 +- .../Cache/ObservableCacheEx.BatchIf.cs | 4 +- .../Cache/ObservableCacheEx.Bind.cs | 40 +++++----- .../Cache/ObservableCacheEx.Cast.cs | 2 +- .../Cache/ObservableCacheEx.ChangeKey.cs | 8 +- .../Cache/ObservableCacheEx.Clear.cs | 6 +- .../Cache/ObservableCacheEx.Clone.cs | 4 +- .../Cache/ObservableCacheEx.Combine.cs | 10 +-- .../Cache/ObservableCacheEx.Convert.cs | 4 +- .../ObservableCacheEx.DeferUntilLoaded.cs | 4 +- .../Cache/ObservableCacheEx.DisposeMany.cs | 2 +- .../Cache/ObservableCacheEx.DistinctValues.cs | 4 +- .../Cache/ObservableCacheEx.EditDiff.cs | 20 ++--- .../ObservableCacheEx.EnsureUniqueKeys.cs | 2 +- .../Cache/ObservableCacheEx.Except.cs | 10 +-- .../ObservableCacheEx.FilterImmutable.cs | 4 +- .../ObservableCacheEx.FilterOnObservable.cs | 8 +- .../Cache/ObservableCacheEx.FinallySafe.cs | 4 +- .../Cache/ObservableCacheEx.Flatten.cs | 2 +- .../ObservableCacheEx.FlattenBufferResult.cs | 2 +- .../Cache/ObservableCacheEx.ForEachChange.cs | 4 +- .../Cache/ObservableCacheEx.FullJoin.cs | 16 ++-- .../Cache/ObservableCacheEx.FullJoinMany.cs | 16 ++-- .../Cache/ObservableCacheEx.Group.cs | 22 ++--- .../ObservableCacheEx.GroupOnObservable.cs | 6 +- .../ObservableCacheEx.GroupOnProperty.cs | 4 +- ...cheEx.GroupOnPropertyWithImmutableState.cs | 4 +- ...servableCacheEx.GroupWithImmutableState.cs | 4 +- .../ObservableCacheEx.IncludeUpdateWhen.cs | 4 +- .../Cache/ObservableCacheEx.InnerJoin.cs | 16 ++-- .../Cache/ObservableCacheEx.InnerJoinMany.cs | 16 ++-- .../Cache/ObservableCacheEx.InvokeEvaluate.cs | 2 +- .../Cache/ObservableCacheEx.LeftJoin.cs | 16 ++-- .../Cache/ObservableCacheEx.LeftJoinMany.cs | 16 ++-- .../Cache/ObservableCacheEx.LimitSizeTo.cs | 4 +- .../ObservableCacheEx.MergeChangeSets.cs | 80 +++++++++---------- .../Cache/ObservableCacheEx.MergeMany.cs | 8 +- .../ObservableCacheEx.MergeManyChangeSets.cs | 44 +++++----- .../Cache/ObservableCacheEx.MergeManyItems.cs | 8 +- .../Cache/ObservableCacheEx.NotEmpty.cs | 2 +- .../Cache/ObservableCacheEx.OfType.cs | 2 +- .../Cache/ObservableCacheEx.OnItemAdded.cs | 4 +- .../ObservableCacheEx.OnItemRefreshed.cs | 4 +- .../Cache/ObservableCacheEx.OnItemRemoved.cs | 4 +- .../Cache/ObservableCacheEx.OnItemUpdated.cs | 4 +- src/DynamicData/Cache/ObservableCacheEx.Or.cs | 10 +-- .../Cache/ObservableCacheEx.PopulateFrom.cs | 8 +- .../Cache/ObservableCacheEx.PopulateInto.cs | 12 +-- .../ObservableCacheEx.QueryWhenChanged.cs | 10 +-- .../Cache/ObservableCacheEx.RefCount.cs | 2 +- .../Cache/ObservableCacheEx.Refresh.cs | 6 +- .../Cache/ObservableCacheEx.Remove.cs | 12 +-- .../Cache/ObservableCacheEx.RemoveKey.cs | 4 +- .../Cache/ObservableCacheEx.RemoveKeys.cs | 2 +- .../Cache/ObservableCacheEx.RightJoin.cs | 16 ++-- .../Cache/ObservableCacheEx.RightJoinMany.cs | 16 ++-- .../Cache/ObservableCacheEx.SkipInitial.cs | 2 +- .../Cache/ObservableCacheEx.Sort.cs | 16 ++-- .../Cache/ObservableCacheEx.SortAndBind.cs | 4 +- .../Cache/ObservableCacheEx.StartWithEmpty.cs | 14 ++-- .../Cache/ObservableCacheEx.StartWithItem.cs | 4 +- .../Cache/ObservableCacheEx.SubscribeMany.cs | 8 +- .../Cache/ObservableCacheEx.Switch.cs | 4 +- ...ObservableCacheEx.ToObservableChangeSet.cs | 8 +- .../ObservableCacheEx.ToObservableOptional.cs | 6 +- .../Cache/ObservableCacheEx.Transform.cs | 36 ++++----- .../Cache/ObservableCacheEx.TransformAsync.cs | 24 +++--- .../ObservableCacheEx.TransformImmutable.cs | 4 +- .../ObservableCacheEx.TransformManyAsync.cs | 12 +-- ...bservableCacheEx.TransformManySafeAsync.cs | 18 ++--- ...ObservableCacheEx.TransformOnObservable.cs | 6 +- .../Cache/ObservableCacheEx.TransformSafe.cs | 30 +++---- .../ObservableCacheEx.TransformSafeAsync.cs | 36 ++++----- .../ObservableCacheEx.TransformToTree.cs | 4 +- ...rvableCacheEx.TransformWithInlineUpdate.cs | 28 +++---- ...ObservableCacheEx.TreatMovesAsRemoveAdd.cs | 2 +- .../Cache/ObservableCacheEx.TrueForAny.cs | 6 +- .../ObservableCacheEx.VirtualiseAndPage.cs | 38 ++++----- .../Cache/ObservableCacheEx.Watch.cs | 2 +- .../Cache/ObservableCacheEx.WatchValue.cs | 4 +- ...bservableCacheEx.WhenAnyPropertyChanged.cs | 2 +- .../ObservableCacheEx.WhenPropertyChanged.cs | 4 +- .../ObservableCacheEx.WhenValueChanged.cs | 4 +- .../ObservableCacheEx.WhereReasonsAre.cs | 4 +- .../ObservableCacheEx.WhereReasonsAreNot.cs | 4 +- .../Cache/ObservableCacheEx.Xor.cs | 10 +-- .../Cache/Tests/ChangeSetAggregator.cs | 4 +- .../Tests/DistinctChangeSetAggregator.cs | 2 +- .../Cache/Tests/GroupChangeSetAggregator.cs | 2 +- .../Cache/Tests/PagedChangeSetAggregator.cs | 2 +- .../Cache/Tests/SortedChangeSetAggregator.cs | 2 +- src/DynamicData/Cache/Tests/TestEx.cs | 10 +-- .../Cache/Tests/VirtualChangeSetAggregator.cs | 2 +- .../Diagnostics/DiagnosticOperators.cs | 4 +- src/DynamicData/DynamicData.csproj | 9 +++ src/DynamicData/EnumerableEx.cs | 6 +- .../Experimental/ExperimentalEx.cs | 2 +- src/DynamicData/GlobalConfig.cs | 2 +- .../Internal/CacheParentSubscription.cs | 4 +- src/DynamicData/Internal/ExceptionMixins.cs | 17 ---- src/DynamicData/Internal/Notification.cs | 2 +- src/DynamicData/Kernel/EnumerableEx.cs | 14 ++-- src/DynamicData/Kernel/InternalEx.cs | 17 ++-- src/DynamicData/Kernel/OptionElse.cs | 2 +- src/DynamicData/Kernel/OptionExtensions.cs | 26 +++--- .../Kernel/OptionObservableExtensions.cs | 39 +++++---- src/DynamicData/Kernel/ParallelEx.cs | 4 +- src/DynamicData/List/ChangeAwareList.cs | 4 +- src/DynamicData/List/ChangeSetEx.cs | 10 +-- .../List/Internal/AnonymousObservableList.cs | 2 +- src/DynamicData/List/Internal/ExpireAfter.cs | 4 +- .../List/Internal/Filter.Static.cs | 4 +- .../Internal/Filter.WithPredicateState.cs | 6 +- .../List/Internal/FilterOnObservable.cs | 6 +- src/DynamicData/List/Internal/FilterStatic.cs | 2 +- src/DynamicData/List/Internal/MergeMany.cs | 2 +- src/DynamicData/List/Internal/OnItemAdded.cs | 4 +- .../List/Internal/OnItemRefreshed.cs | 4 +- .../List/Internal/OnItemRemoved.cs | 4 +- src/DynamicData/List/Internal/ReaderWriter.cs | 10 +-- .../List/Internal/ReferenceCountTracker.cs | 4 +- .../List/Internal/ToObservableChangeSet.cs | 6 +- .../List/Internal/TransformAsync.cs | 6 +- .../List/Internal/TransformMany.cs | 6 +- src/DynamicData/List/Internal/Transformer.cs | 9 ++- src/DynamicData/List/ListEx.cs | 60 +++++++------- .../List/ObservableListEx.Adapt.cs | 4 +- .../List/ObservableListEx.AddKey.cs | 4 +- src/DynamicData/List/ObservableListEx.And.cs | 2 +- .../List/ObservableListEx.AsObservableList.cs | 4 +- .../List/ObservableListEx.AutoRefresh.cs | 6 +- ...bservableListEx.AutoRefreshOnObservable.cs | 4 +- src/DynamicData/List/ObservableListEx.Bind.cs | 16 ++-- .../List/ObservableListEx.BufferIf.cs | 8 +- src/DynamicData/List/ObservableListEx.Cast.cs | 7 +- .../List/ObservableListEx.CastToObject.cs | 2 +- .../List/ObservableListEx.Clone.cs | 2 +- .../List/ObservableListEx.Combine.cs | 12 +-- .../List/ObservableListEx.Convert.cs | 5 +- .../List/ObservableListEx.DeferUntilLoaded.cs | 4 +- .../List/ObservableListEx.DisposeMany.cs | 2 +- .../List/ObservableListEx.DistinctValues.cs | 5 +- .../List/ObservableListEx.Except.cs | 2 +- .../List/ObservableListEx.Filter.cs | 4 +- .../ObservableListEx.FilterOnObservable.cs | 2 +- .../List/ObservableListEx.FilterOnProperty.cs | 8 +- .../ObservableListEx.FlattenBufferResult.cs | 2 +- .../List/ObservableListEx.ForEachChange.cs | 5 +- .../ObservableListEx.ForEachItemChange.cs | 5 +- .../List/ObservableListEx.GroupOn.cs | 5 +- .../List/ObservableListEx.GroupOnProperty.cs | 5 +- ...istEx.GroupOnPropertyWithImmutableState.cs | 5 +- ...bservableListEx.GroupWithImmutableState.cs | 4 +- .../List/ObservableListEx.LimitSizeTo.cs | 2 +- .../List/ObservableListEx.MergeChangeSets.cs | 24 +++--- .../List/ObservableListEx.MergeMany.cs | 5 +- .../ObservableListEx.MergeManyChangeSets.cs | 10 +-- .../List/ObservableListEx.NotEmpty.cs | 2 +- .../List/ObservableListEx.OnItemAdded.cs | 2 +- .../List/ObservableListEx.OnItemRefreshed.cs | 2 +- .../List/ObservableListEx.OnItemRemoved.cs | 2 +- src/DynamicData/List/ObservableListEx.Or.cs | 2 +- src/DynamicData/List/ObservableListEx.Page.cs | 4 +- .../List/ObservableListEx.PopulateInto.cs | 4 +- .../List/ObservableListEx.QueryWhenChanged.cs | 6 +- .../List/ObservableListEx.RefCount.cs | 2 +- .../List/ObservableListEx.RemoveIndex.cs | 2 +- .../List/ObservableListEx.Reverse.cs | 2 +- .../List/ObservableListEx.SkipInitial.cs | 2 +- src/DynamicData/List/ObservableListEx.Sort.cs | 8 +- .../List/ObservableListEx.StartWithEmpty.cs | 2 +- .../List/ObservableListEx.SubscribeMany.cs | 4 +- .../List/ObservableListEx.Switch.cs | 4 +- src/DynamicData/List/ObservableListEx.Top.cs | 2 +- .../List/ObservableListEx.Transform.cs | 16 ++-- .../List/ObservableListEx.TransformAsync.cs | 16 ++-- .../List/ObservableListEx.TransformMany.cs | 4 +- .../List/ObservableListEx.Virtualise.cs | 5 +- ...ObservableListEx.WhenAnyPropertyChanged.cs | 2 +- .../ObservableListEx.WhenPropertyChanged.cs | 4 +- .../List/ObservableListEx.WhenValueChanged.cs | 4 +- .../List/ObservableListEx.WhereReasonsAre.cs | 4 +- .../ObservableListEx.WhereReasonsAreNot.cs | 4 +- src/DynamicData/List/ObservableListEx.Xor.cs | 2 +- src/DynamicData/List/SourceList.cs | 2 +- .../List/SourceListEditConvenienceEx.cs | 29 +++---- src/DynamicData/List/SourceListEx.cs | 4 +- .../List/Tests/ChangeSetAggregator.cs | 2 +- src/DynamicData/ObservableChangeSet.cs | 48 +++++------ .../Platforms/net45/ParallelOperators.cs | 28 +++---- .../Polyfills/AllowNullAttribute.cs | 14 ++++ .../Polyfills/ArgumentExceptionHelper.cs | 29 +++++++ .../ArgumentOutOfRangeExceptionHelper.cs | 78 ++++++++++++++++++ .../CallerArgumentExpressionAttribute.cs | 25 ++++++ .../CancellationTokenPolyfillExtensions.cs | 38 +++++++++ ...ncellationTokenSourcePolyfillExtensions.cs | 25 ++++++ .../CompilerFeatureRequiredAttribute.cs | 28 ++++--- src/DynamicData/Polyfills/IsExternalInit.cs | 17 +++- .../Polyfills/MemberNotNullWhenAttribute.cs | 33 ++++++++ src/DynamicData/Polyfills/NotNullAttribute.cs | 15 ++++ .../Polyfills/NotNullWhenAttribute.cs | 23 ++++++ .../Polyfills/RequiredMemberAttribute.cs | 18 +++-- .../Polyfills/SetsRequiredMembersAttribute.cs | 14 ++++ .../Polyfills/TaskCompletionSource.cs | 48 +++++++++++ .../Polyfills/TaskPolyfillExtensions.cs | 73 +++++++++++++++++ 256 files changed, 1524 insertions(+), 1092 deletions(-) delete mode 100644 src/DynamicData/Internal/ExceptionMixins.cs create mode 100644 src/DynamicData/Polyfills/AllowNullAttribute.cs create mode 100644 src/DynamicData/Polyfills/ArgumentExceptionHelper.cs create mode 100644 src/DynamicData/Polyfills/ArgumentOutOfRangeExceptionHelper.cs create mode 100644 src/DynamicData/Polyfills/CallerArgumentExpressionAttribute.cs create mode 100644 src/DynamicData/Polyfills/CancellationTokenPolyfillExtensions.cs create mode 100644 src/DynamicData/Polyfills/CancellationTokenSourcePolyfillExtensions.cs create mode 100644 src/DynamicData/Polyfills/MemberNotNullWhenAttribute.cs create mode 100644 src/DynamicData/Polyfills/NotNullAttribute.cs create mode 100644 src/DynamicData/Polyfills/NotNullWhenAttribute.cs create mode 100644 src/DynamicData/Polyfills/SetsRequiredMembersAttribute.cs create mode 100644 src/DynamicData/Polyfills/TaskCompletionSource.cs create mode 100644 src/DynamicData/Polyfills/TaskPolyfillExtensions.cs diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 8771263c9..416c25b75 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -42,6 +42,10 @@ + + $(MSBuildThisFileDirectory) + + true @@ -49,14 +53,9 @@ true - - - - - - - + + $(Features);runtime-async=on + @@ -66,22 +65,23 @@ - - - $(MSBuildThisFileDirectory) - - - - + - - + + + + + + + + diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index ed944f65d..9c73a97d1 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -53,4 +53,13 @@ + + + + + + + + + diff --git a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs index 8ddbaec7d..cba3f621d 100644 --- a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs @@ -355,7 +355,7 @@ public void Update_PreviousMatchedCurrentDoesNot_EmitsRemoveCarryingPreviousAsCu // Per Change contract, a Remove change carries the item that was removed in Current. // For an Update where Previous matched the predicate but Current does not, the item that // leaves the filtered view is Previous (it was downstream; Current never reached downstream). - using var source = new Subject>(); + using var source = new Signal>(); using var subscription = source .FilterImmutable(predicate: Item.Predicate) diff --git a/src/DynamicData/Aggregation/AggregationEx.cs b/src/DynamicData/Aggregation/AggregationEx.cs index 0e5597be3..f6006b569 100644 --- a/src/DynamicData/Aggregation/AggregationEx.cs +++ b/src/DynamicData/Aggregation/AggregationEx.cs @@ -20,7 +20,7 @@ public static IObservable> ForAggregation (IAggregateChangeSet)new AggregateEnumerator(changeSet)); } @@ -33,7 +33,7 @@ public static IObservable> ForAggregation> ForAggregation(this IObservable> source) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Select(changeSet => (IAggregateChangeSet)new AggregateEnumerator(changeSet)); } @@ -47,8 +47,8 @@ public static IObservable> ForAggregation( /// An observable which emits the value. public static IObservable InvalidateWhen(this IObservable source, IObservable invalidate) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - invalidate.ThrowArgumentNullExceptionIfNull(nameof(invalidate)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(invalidate); return invalidate.StartWith(Unit.Default).Select(_ => source).Switch().DistinctUntilChanged(); } @@ -63,8 +63,8 @@ public static IObservable InvalidateWhen(this IObservable source, IObse /// An observable which emits the value. public static IObservable InvalidateWhen(this IObservable source, IObservable invalidate) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - invalidate.ThrowArgumentNullExceptionIfNull(nameof(invalidate)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(invalidate); return invalidate.StartWith(default(TTrigger)).Select(_ => source).Switch().DistinctUntilChanged(); } @@ -115,10 +115,10 @@ internal static IObservable Accumulate(this IOb /// An observable with the accumulated value. internal static IObservable Accumulate(this IObservable> source, TResult seed, Func accessor, Func addAction, Func removeAction) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - accessor.ThrowArgumentNullExceptionIfNull(nameof(accessor)); - addAction.ThrowArgumentNullExceptionIfNull(nameof(addAction)); - removeAction.ThrowArgumentNullExceptionIfNull(nameof(removeAction)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(accessor); + ArgumentExceptionHelper.ThrowIfNull(addAction); + ArgumentExceptionHelper.ThrowIfNull(removeAction); return source.Scan(seed, (state, changes) => changes.Aggregate(state, (current, aggregateItem) => diff --git a/src/DynamicData/Aggregation/AvgEx.cs b/src/DynamicData/Aggregation/AvgEx.cs index fdda5c793..3c40cca1a 100644 --- a/src/DynamicData/Aggregation/AvgEx.cs +++ b/src/DynamicData/Aggregation/AvgEx.cs @@ -301,7 +301,7 @@ public static IObservable Avg(this IObservable> source, /// public static IObservable Avg(this IObservable> source, Func valueSelector, int emptyValue = 0) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / (double)values.Count); } @@ -327,7 +327,7 @@ public static IObservable Avg(this IObservable /// An observable of averages as a double value. public static IObservable Avg(this IObservable> source, Func valueSelector, long emptyValue = 0) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / (double)values.Count); } @@ -355,7 +355,7 @@ public static IObservable Avg(this IObservable /// public static IObservable Avg(this IObservable> source, Func valueSelector, double emptyValue = 0) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / (double)values.Count); } @@ -383,7 +383,7 @@ public static IObservable Avg(this IObservable /// public static IObservable Avg(this IObservable> source, Func valueSelector, decimal emptyValue = 0) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / values.Count); } @@ -409,7 +409,7 @@ public static IObservable Avg(this IObservable public static IObservable Avg(this IObservable> source, Func valueSelector, float emptyValue = 0) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.AvgCalc(valueSelector, emptyValue, (current, item) => new Avg(current.Count + 1, current.Sum + item), (current, item) => new Avg(current.Count - 1, current.Sum - item), values => values.Sum / values.Count); } @@ -427,11 +427,11 @@ public static IObservable Avg(this IObservable> private static IObservable AvgCalc(this IObservable> source, Func valueSelector, TResult fallbackValue, Func, TValue, Avg> addAction, Func, TValue, Avg> removeAction, Func, TResult> resultAction) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); - addAction.ThrowArgumentNullExceptionIfNull(nameof(addAction)); - removeAction.ThrowArgumentNullExceptionIfNull(nameof(removeAction)); - resultAction.ThrowArgumentNullExceptionIfNull(nameof(resultAction)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentExceptionHelper.ThrowIfNull(addAction); + ArgumentExceptionHelper.ThrowIfNull(removeAction); + ArgumentExceptionHelper.ThrowIfNull(resultAction); return source.Scan(default(Avg), (state, changes) => changes.Aggregate(state, (current, aggregateItem) => diff --git a/src/DynamicData/Aggregation/CountEx.cs b/src/DynamicData/Aggregation/CountEx.cs index 1b34c4666..8b199a1e8 100644 --- a/src/DynamicData/Aggregation/CountEx.cs +++ b/src/DynamicData/Aggregation/CountEx.cs @@ -37,7 +37,7 @@ public static IObservable Count(this IObservableAn observable which emits the count. public static IObservable Count(this IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Accumulate(0, _ => 1, (current, increment) => current + increment, (current, increment) => current - increment); } diff --git a/src/DynamicData/Aggregation/MaxEx.cs b/src/DynamicData/Aggregation/MaxEx.cs index 585f4b8b0..0795832da 100644 --- a/src/DynamicData/Aggregation/MaxEx.cs +++ b/src/DynamicData/Aggregation/MaxEx.cs @@ -31,8 +31,8 @@ public static IObservable Maximum(this IObservable { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Max, emptyValue); } @@ -54,8 +54,8 @@ public static IObservable Maximum(this IObserva where TKey : notnull where TResult : struct, IComparable { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Max, emptyValue); } @@ -73,8 +73,8 @@ public static IObservable Minimum(this IObservable { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Min, emptyValue); } @@ -96,8 +96,8 @@ public static IObservable Minimum(this IObserva where TKey : notnull where TResult : struct, IComparable { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Min, emptyValue); } @@ -105,8 +105,8 @@ public static IObservable Minimum(this IObserva private static IObservable Calculate(this IObservable> source, Func valueSelector, MaxOrMin maxOrMin, TResult emptyValue = default) where TResult : struct, IComparable { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Scan( default(TResult?), @@ -169,7 +169,7 @@ private static IObservable> ToChangesAndCollection where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Publish( shared => @@ -183,7 +183,7 @@ private static IObservable> ToChangesAndCollection private static IObservable> ToChangesAndCollection(this IObservable> source) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Publish( shared => diff --git a/src/DynamicData/Aggregation/StdDevEx.cs b/src/DynamicData/Aggregation/StdDevEx.cs index b7a9d3da9..8332e5851 100644 --- a/src/DynamicData/Aggregation/StdDevEx.cs +++ b/src/DynamicData/Aggregation/StdDevEx.cs @@ -139,7 +139,7 @@ public static IObservable StdDev(this IObservableAn observable which emits the standard deviation value. public static IObservable StdDev(this IObservable> source, Func valueSelector, int fallbackValue = 0) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.StdDevCalc(t => (long)valueSelector(t), fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); } @@ -153,7 +153,7 @@ public static IObservable StdDev(this IObservableAn observable which emits the standard deviation value. public static IObservable StdDev(this IObservable> source, Func valueSelector, long fallbackValue = 0) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); } @@ -167,7 +167,7 @@ public static IObservable StdDev(this IObservableAn observable which emits the standard deviation value. public static IObservable StdDev(this IObservable> source, Func valueSelector, decimal fallbackValue = 0M) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0M / (values.Count - 1))); } @@ -181,7 +181,7 @@ public static IObservable StdDev(this IObservableAn observable which emits the standard deviation value. public static IObservable StdDev(this IObservable> source, Func valueSelector, double fallbackValue = 0) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); } @@ -195,17 +195,17 @@ public static IObservable StdDev(this IObservableAn observable which emits the standard deviation value. public static IObservable StdDev(this IObservable> source, Func valueSelector, float fallbackValue = 0) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.StdDevCalc(valueSelector, fallbackValue, (current, item) => new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); } private static IObservable StdDevCalc(this IObservable> source, Func valueSelector, TResult fallbackValue, Func, TValue, StdDev> addAction, Func, TValue, StdDev> removeAction, Func, TResult> resultAction) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); - addAction.ThrowArgumentNullExceptionIfNull(nameof(addAction)); - removeAction.ThrowArgumentNullExceptionIfNull(nameof(removeAction)); - resultAction.ThrowArgumentNullExceptionIfNull(nameof(resultAction)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentExceptionHelper.ThrowIfNull(addAction); + ArgumentExceptionHelper.ThrowIfNull(removeAction); + ArgumentExceptionHelper.ThrowIfNull(resultAction); return source.Scan(default(StdDev), (state, changes) => changes.Aggregate(state, (current, aggregateItem) => diff --git a/src/DynamicData/Aggregation/SumEx.cs b/src/DynamicData/Aggregation/SumEx.cs index 65857e7b8..fdc31c486 100644 --- a/src/DynamicData/Aggregation/SumEx.cs +++ b/src/DynamicData/Aggregation/SumEx.cs @@ -238,8 +238,8 @@ public static IObservable Sum(this IObservable> source, /// An observable which emits the summed value. public static IObservable Sum(this IObservable> source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Accumulate(0, valueSelector, (current, value) => current + value, (current, value) => current - value); } @@ -253,7 +253,7 @@ public static IObservable Sum(this IObservable> s /// An observable which emits the summed value. public static IObservable Sum(this IObservable> source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Accumulate(0, t => valueSelector(t).GetValueOrDefault(), (current, value) => current + value, (current, value) => current - value); } @@ -266,8 +266,8 @@ public static IObservable Sum(this IObservable> s /// An observable which emits the summed value. public static IObservable Sum(this IObservable> source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Accumulate(0, valueSelector, (current, value) => current + value, (current, value) => current - value); } @@ -281,8 +281,8 @@ public static IObservable Sum(this IObservable> /// An observable which emits the summed value. public static IObservable Sum(this IObservable> source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Accumulate(0L, t => valueSelector(t).ValueOr(0), (current, value) => current + value, (current, value) => current - value); } @@ -296,8 +296,8 @@ public static IObservable Sum(this IObservable> /// An observable which emits the summed value. public static IObservable Sum(this IObservable> source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Accumulate(0, valueSelector, (current, value) => current + value, (current, value) => current - value); } @@ -311,8 +311,8 @@ public static IObservable Sum(this IObservable /// An observable which emits the summed value. public static IObservable Sum(this IObservable> source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Accumulate(0D, t => valueSelector(t).ValueOr(0), (current, value) => current + value, (current, value) => current - value); } @@ -326,8 +326,8 @@ public static IObservable Sum(this IObservable /// An observable which emits the summed value. public static IObservable Sum(this IObservable> source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Accumulate(0, valueSelector, (current, value) => current + value, (current, value) => current - value); } @@ -341,8 +341,8 @@ public static IObservable Sum(this IObservableAn observable which emits the summed value. public static IObservable Sum(this IObservable> source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Accumulate(0M, t => valueSelector(t).ValueOr(0), (current, value) => current + value, (current, value) => current - value); } @@ -356,8 +356,8 @@ public static IObservable Sum(this IObservableAn observable which emits the summed value. public static IObservable Sum(this IObservable> source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Accumulate(0, valueSelector, (current, value) => current + value, (current, value) => current - value); } @@ -371,8 +371,8 @@ public static IObservable Sum(this IObservable> /// An observable which emits the summed value. public static IObservable Sum(this IObservable> source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Accumulate(0F, t => valueSelector(t).ValueOr(0), (current, value) => current + value, (current, value) => current - value); } diff --git a/src/DynamicData/Alias/ObservableCacheAlias.cs b/src/DynamicData/Alias/ObservableCacheAlias.cs index 85687c02a..be0245b8e 100644 --- a/src/DynamicData/Alias/ObservableCacheAlias.cs +++ b/src/DynamicData/Alias/ObservableCacheAlias.cs @@ -29,9 +29,9 @@ public static IObservable> Select> Select> SelectSafe> SelectSafe> SelectSafe, TKey>> SelectTree> Where(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Filter(filter); } @@ -284,8 +284,8 @@ public static IObservable> Where(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - predicateChanged.ThrowArgumentNullExceptionIfNull(nameof(predicateChanged)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(predicateChanged); return source.Filter(predicateChanged); } @@ -303,9 +303,9 @@ public static IObservable> Where(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - predicateChanged.ThrowArgumentNullExceptionIfNull(nameof(predicateChanged)); - reapplyFilter.ThrowArgumentNullExceptionIfNull(nameof(reapplyFilter)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(predicateChanged); + ArgumentExceptionHelper.ThrowIfNull(reapplyFilter); return source.Filter(predicateChanged, reapplyFilter); } diff --git a/src/DynamicData/Alias/ObservableListAlias.cs b/src/DynamicData/Alias/ObservableListAlias.cs index ca7d9eb7b..90c66a672 100644 --- a/src/DynamicData/Alias/ObservableListAlias.cs +++ b/src/DynamicData/Alias/ObservableListAlias.cs @@ -26,8 +26,8 @@ public static IObservable> Select> SelectMany> SelectMany> Where(this IObservable> source, Func predicate) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(predicate); return source.Filter(predicate); } @@ -81,8 +81,8 @@ public static IObservable> Where(this IObservable public static IObservable> Where(this IObservable> source, IObservable> predicate) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(predicate); return source.Filter(predicate); } diff --git a/src/DynamicData/Binding/BindPaged.cs b/src/DynamicData/Binding/BindPaged.cs index fe51bdff5..f0aab5e1a 100644 --- a/src/DynamicData/Binding/BindPaged.cs +++ b/src/DynamicData/Binding/BindPaged.cs @@ -35,7 +35,7 @@ private IObservable> UseContextSortOptions() => { var shared = source.Publish(); - var subscriber = new OnceDisposable(); + var subscriber = new SingleAssignmentDisposable(); // I tried to make this work without subjects but had issues // making the comparedChanged observable to fire. Probably a deadlock diff --git a/src/DynamicData/Binding/BindingListAdaptor.cs b/src/DynamicData/Binding/BindingListAdaptor.cs index 86a1a20f0..84e9949bd 100644 --- a/src/DynamicData/Binding/BindingListAdaptor.cs +++ b/src/DynamicData/Binding/BindingListAdaptor.cs @@ -25,7 +25,7 @@ public class BindingListAdaptor<[DynamicallyAccessedMembers(DynamicallyAccessedM /// public void Adapt(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(changes); if (changes.TotalChanges - changes.Refreshes > refreshThreshold || !_loaded) { @@ -65,7 +65,7 @@ public class BindingListAdaptor<[DynamicallyAccessedMembers(DynamicallyAccessedM /// public void Adapt(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(changes); _cache.Clone(changes); if (changes.Count - changes.Refreshes > refreshThreshold || !_loaded) diff --git a/src/DynamicData/Binding/BindingListEx.cs b/src/DynamicData/Binding/BindingListEx.cs index 7720bba7d..9bf99754a 100644 --- a/src/DynamicData/Binding/BindingListEx.cs +++ b/src/DynamicData/Binding/BindingListEx.cs @@ -28,7 +28,7 @@ public static IObservable> ObserveCollectionC public static IObservable> ToObservableChangeSet<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this BindingList source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return ToObservableChangeSet, T>(source); } @@ -49,8 +49,8 @@ public static IObservable> ObserveCollectionC where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return ToObservableChangeSet, TObject>(source).AddKey(keySelector); } @@ -68,7 +68,7 @@ public static IObservable> ToObservableChangeSet(t where TCollection : IBindingList, IEnumerable where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return Observable.Create>( observer => @@ -131,8 +131,8 @@ public static IObservable> ToObservableChangeSet(t where T : notnull { // ** Copied from ListEx for binding list specific changes - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(changes); foreach (var item in changes) { diff --git a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs index 9836aee0b..ba2d32f46 100644 --- a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs +++ b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs @@ -21,7 +21,7 @@ public static class NotifyPropertyChangedEx public static IObservable WhenAnyPropertyChanged(this TObject source, params string[] propertiesToMonitor) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return Observable.FromEventPattern(handler => source.PropertyChanged += handler, handler => source.PropertyChanged -= handler).Where(x => propertiesToMonitor.Length == 0 || propertiesToMonitor.Contains(x.EventArgs.PropertyName!)).Select(_ => source); } @@ -43,9 +43,9 @@ public static class NotifyPropertyChangedEx public static IObservable WhenChanged(this TObject source, Expression> p1, Func resultSelector, Func? p1Fallback = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - p1.ThrowArgumentNullExceptionIfNull(nameof(p1)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(p1); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); return source.WhenChanged(p1, true, p1Fallback).Select(v => resultSelector(source, v)); } @@ -70,10 +70,10 @@ public static class NotifyPropertyChangedEx public static IObservable WhenChanged(this TObject source, Expression> p1, Expression> p2, Func resultSelector, Func? p1Fallback = null, Func? p2Fallback = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - p1.ThrowArgumentNullExceptionIfNull(nameof(p1)); - p2.ThrowArgumentNullExceptionIfNull(nameof(p2)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(p1); + ArgumentExceptionHelper.ThrowIfNull(p2); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); return source.WhenChanged(p1, true, p1Fallback).CombineLatest(source.WhenChanged(p2, true, p2Fallback), (v1, v2) => resultSelector(source, v1, v2)); } @@ -101,11 +101,11 @@ public static class NotifyPropertyChangedEx public static IObservable WhenChanged(this TObject source, Expression> p1, Expression> p2, Expression> p3, Func resultSelector, Func? p1Fallback = null, Func? p2Fallback = null, Func? p3Fallback = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - p1.ThrowArgumentNullExceptionIfNull(nameof(p1)); - p2.ThrowArgumentNullExceptionIfNull(nameof(p2)); - p3.ThrowArgumentNullExceptionIfNull(nameof(p3)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(p1); + ArgumentExceptionHelper.ThrowIfNull(p2); + ArgumentExceptionHelper.ThrowIfNull(p3); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); return source.WhenChanged(p1, true, p1Fallback).CombineLatest(source.WhenChanged(p2, true, p2Fallback), source.WhenChanged(p3, true, p3Fallback), (v1, v2, v3) => resultSelector(source, v1, v2, v3)); } @@ -136,12 +136,12 @@ public static class NotifyPropertyChangedEx public static IObservable WhenChanged(this TObject source, Expression> p1, Expression> p2, Expression> p3, Expression> p4, Func resultSelector, Func? p1Fallback = null, Func? p2Fallback = null, Func? p3Fallback = null, Func? p4Fallback = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - p1.ThrowArgumentNullExceptionIfNull(nameof(p1)); - p2.ThrowArgumentNullExceptionIfNull(nameof(p2)); - p3.ThrowArgumentNullExceptionIfNull(nameof(p3)); - p4.ThrowArgumentNullExceptionIfNull(nameof(p4)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(p1); + ArgumentExceptionHelper.ThrowIfNull(p2); + ArgumentExceptionHelper.ThrowIfNull(p3); + ArgumentExceptionHelper.ThrowIfNull(p4); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); return source.WhenChanged(p1, true, p1Fallback).CombineLatest(source.WhenChanged(p2, true, p2Fallback), source.WhenChanged(p3, true, p3Fallback), source.WhenChanged(p4, true, p4Fallback), (v1, v2, v3, v4) => resultSelector(source, v1, v2, v3, v4)); } @@ -175,13 +175,13 @@ public static class NotifyPropertyChangedEx public static IObservable WhenChanged(this TObject source, Expression> p1, Expression> p2, Expression> p3, Expression> p4, Expression> p5, Func resultSelector, Func? p1Fallback = null, Func? p2Fallback = null, Func? p3Fallback = null, Func? p4Fallback = null, Func? p5Fallback = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - p1.ThrowArgumentNullExceptionIfNull(nameof(p1)); - p2.ThrowArgumentNullExceptionIfNull(nameof(p2)); - p3.ThrowArgumentNullExceptionIfNull(nameof(p3)); - p4.ThrowArgumentNullExceptionIfNull(nameof(p4)); - p5.ThrowArgumentNullExceptionIfNull(nameof(p5)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(p1); + ArgumentExceptionHelper.ThrowIfNull(p2); + ArgumentExceptionHelper.ThrowIfNull(p3); + ArgumentExceptionHelper.ThrowIfNull(p4); + ArgumentExceptionHelper.ThrowIfNull(p5); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); return source.WhenChanged(p1, true, p1Fallback).CombineLatest(source.WhenChanged(p2, true, p2Fallback), source.WhenChanged(p3, true, p3Fallback), source.WhenChanged(p4, true, p4Fallback), source.WhenChanged(p5, true, p5Fallback), (v1, v2, v3, v4, v5) => resultSelector(source, v1, v2, v3, v4, v5)); } @@ -218,14 +218,14 @@ public static class NotifyPropertyChangedEx public static IObservable WhenChanged(this TObject source, Expression> p1, Expression> p2, Expression> p3, Expression> p4, Expression> p5, Expression> p6, Func resultSelector, Func? p1Fallback = null, Func? p2Fallback = null, Func? p3Fallback = null, Func? p4Fallback = null, Func? p5Fallback = null, Func? p6Fallback = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - p1.ThrowArgumentNullExceptionIfNull(nameof(p1)); - p2.ThrowArgumentNullExceptionIfNull(nameof(p2)); - p3.ThrowArgumentNullExceptionIfNull(nameof(p3)); - p4.ThrowArgumentNullExceptionIfNull(nameof(p4)); - p5.ThrowArgumentNullExceptionIfNull(nameof(p5)); - p6.ThrowArgumentNullExceptionIfNull(nameof(p6)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(p1); + ArgumentExceptionHelper.ThrowIfNull(p2); + ArgumentExceptionHelper.ThrowIfNull(p3); + ArgumentExceptionHelper.ThrowIfNull(p4); + ArgumentExceptionHelper.ThrowIfNull(p5); + ArgumentExceptionHelper.ThrowIfNull(p6); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); return source.WhenChanged(p1, true, p1Fallback).CombineLatest(source.WhenChanged(p2, true, p2Fallback), source.WhenChanged(p3, true, p3Fallback), source.WhenChanged(p4, true, p4Fallback), source.WhenChanged(p5, true, p5Fallback), source.WhenChanged(p6, true, p6Fallback), (v1, v2, v3, v4, v5, v6) => resultSelector(source, v1, v2, v3, v4, v5, v6)); } @@ -246,8 +246,8 @@ public static class NotifyPropertyChangedEx public static IObservable> WhenPropertyChanged(this TObject source, Expression> propertyAccessor, bool notifyOnInitialValue = true, Func? fallbackValue = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertyAccessor.ThrowArgumentNullExceptionIfNull(nameof(propertyAccessor)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(propertyAccessor); var cache = ObservablePropertyFactoryCache.Instance.GetFactory(propertyAccessor); return cache.Create(source, notifyOnInitialValue).Where(pv => !pv.UnobtainableValue || (pv.UnobtainableValue && fallbackValue is not null)); @@ -268,8 +268,8 @@ public static IObservable> WhenPropertyChanged public static IObservable WhenValueChanged(this TObject source, Expression> propertyAccessor, bool notifyOnInitialValue = true, Func? fallbackValue = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertyAccessor.ThrowArgumentNullExceptionIfNull(nameof(propertyAccessor)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(propertyAccessor); return source.WhenChanged(propertyAccessor, notifyOnInitialValue, fallbackValue); } diff --git a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs index 2f303e38b..f6370417d 100644 --- a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs @@ -54,7 +54,7 @@ public ObservableCollectionAdaptor(IObservableCollection collection, BindingO /// The changes. public void Adapt(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(changes); if (changes.TotalChanges - changes.Refreshes > refreshThreshold || (!_loaded && resetOnFirstTimeLoad)) { @@ -108,8 +108,8 @@ public ObservableCollectionAdaptor(BindingOptions options) /// The collection. public void Adapt(IChangeSet changes, IObservableCollection collection) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); - collection.ThrowArgumentNullExceptionIfNull(nameof(collection)); + ArgumentExceptionHelper.ThrowIfNull(changes); + ArgumentExceptionHelper.ThrowIfNull(collection); _cache.Clone(changes); diff --git a/src/DynamicData/Binding/ObservableCollectionEx.cs b/src/DynamicData/Binding/ObservableCollectionEx.cs index d8b496d3d..037ab82eb 100644 --- a/src/DynamicData/Binding/ObservableCollectionEx.cs +++ b/src/DynamicData/Binding/ObservableCollectionEx.cs @@ -29,7 +29,7 @@ public static class ObservableCollectionEx public static IObservable> ToObservableChangeSet(this ObservableCollection source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return ToObservableChangeSet, T>(source); } @@ -50,8 +50,8 @@ public static IObservable> ToObservableChangeSet, TObject>(source).AddKey(keySelector); } @@ -67,7 +67,7 @@ public static IObservable> ToObservableChangeSet> ToObservableChangeSet(this ReadOnlyObservableCollection source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return ToObservableChangeSet, T>(source); } @@ -88,8 +88,8 @@ public static IObservable> ToObservableChangeSet, TObject>(source).AddKey(keySelector); } @@ -108,7 +108,7 @@ public static IObservable> ToObservableChangeSet(t where TCollection : INotifyCollectionChanged, IEnumerable where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return Observable.Create>( observer => diff --git a/src/DynamicData/Binding/ObservableCollectionExtended.cs b/src/DynamicData/Binding/ObservableCollectionExtended.cs index 29837c62c..2802ccf8e 100644 --- a/src/DynamicData/Binding/ObservableCollectionExtended.cs +++ b/src/DynamicData/Binding/ObservableCollectionExtended.cs @@ -48,7 +48,7 @@ public ObservableCollectionExtended(IEnumerable collection) /// is null. public void AddRange(IEnumerable collection) { - collection.ThrowArgumentNullExceptionIfNull(nameof(collection)); + ArgumentExceptionHelper.ThrowIfNull(collection); foreach (var item in collection) { @@ -65,7 +65,7 @@ public void AddRange(IEnumerable collection) /// is less than 0.-or- is greater than Count. public void InsertRange(IEnumerable collection, int index) { - collection.ThrowArgumentNullExceptionIfNull(nameof(collection)); + ArgumentExceptionHelper.ThrowIfNull(collection); foreach (var item in collection) { @@ -79,7 +79,7 @@ public void InsertRange(IEnumerable collection, int index) /// The items. public void Load(IEnumerable items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(items); CheckReentrancy(); Clear(); @@ -161,7 +161,7 @@ protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) /// The instance containing the event data. protected override void OnPropertyChanged(PropertyChangedEventArgs e) { - e.ThrowArgumentNullExceptionIfNull(nameof(e)); + ArgumentExceptionHelper.ThrowIfNull(e); if (_suspendCount && e.PropertyName == "Count") { diff --git a/src/DynamicData/Binding/SortedBindingListAdaptor.cs b/src/DynamicData/Binding/SortedBindingListAdaptor.cs index 0733fc9a8..dad83e349 100644 --- a/src/DynamicData/Binding/SortedBindingListAdaptor.cs +++ b/src/DynamicData/Binding/SortedBindingListAdaptor.cs @@ -25,7 +25,7 @@ public class SortedBindingListAdaptor<[DynamicallyAccessedMembers(DynamicallyAcc /// public void Adapt(ISortedChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(changes); switch (changes.SortedItems.SortReason) { diff --git a/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs b/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs index 21c4c3e0c..cf4e428fc 100644 --- a/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs @@ -44,8 +44,8 @@ public SortedObservableCollectionAdaptor(BindingOptions options) /// The collection. public void Adapt(ISortedChangeSet changes, IObservableCollection collection) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); - collection.ThrowArgumentNullExceptionIfNull(nameof(collection)); + ArgumentExceptionHelper.ThrowIfNull(changes); + ArgumentExceptionHelper.ThrowIfNull(collection); switch (changes.SortedItems.SortReason) { diff --git a/src/DynamicData/Cache/CacheChangeSetEx.cs b/src/DynamicData/Cache/CacheChangeSetEx.cs index 2d03df512..bdd01b1c5 100644 --- a/src/DynamicData/Cache/CacheChangeSetEx.cs +++ b/src/DynamicData/Cache/CacheChangeSetEx.cs @@ -44,8 +44,8 @@ public static IChangeSet Transform new Change(change.Reason, change.Key, transformer(change.Current), change.Previous.Convert(transformer), change.CurrentIndex, change.PreviousIndex)); diff --git a/src/DynamicData/Cache/ChangeAwareCache.cs b/src/DynamicData/Cache/ChangeAwareCache.cs index 0fbfa969a..806c07e33 100644 --- a/src/DynamicData/Cache/ChangeAwareCache.cs +++ b/src/DynamicData/Cache/ChangeAwareCache.cs @@ -109,7 +109,7 @@ public void Clear() /// public void Clone(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(changes); foreach (var change in changes.ToConcreteType()) { @@ -144,7 +144,7 @@ public void Clone(IChangeSet changes) /// The keys to refresh. public void Refresh(IEnumerable keys) { - keys.ThrowArgumentNullExceptionIfNull(nameof(keys)); + ArgumentExceptionHelper.ThrowIfNull(keys); if (keys is IList list) { @@ -185,7 +185,7 @@ public void Refresh(TKey key) /// The keys. public void Remove(IEnumerable keys) { - keys.ThrowArgumentNullExceptionIfNull(nameof(keys)); + ArgumentExceptionHelper.ThrowIfNull(keys); if (keys is IList list) { diff --git a/src/DynamicData/Cache/IntermediateCache.cs b/src/DynamicData/Cache/IntermediateCache.cs index 4494449a5..fb67fb81b 100644 --- a/src/DynamicData/Cache/IntermediateCache.cs +++ b/src/DynamicData/Cache/IntermediateCache.cs @@ -28,7 +28,7 @@ public sealed class IntermediateCache : IIntermediateCachesource. public IntermediateCache(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); _innerCache = new ObservableCache(source); } diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index 34d4eb033..fb7b44c94 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs @@ -17,7 +17,7 @@ internal sealed class AnonymousObservableCache : IObservableCache public AnonymousObservableCache(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); _cache = new ObservableCache(source); diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index 8089b10b2..48a695d80 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs @@ -13,8 +13,8 @@ public static IObservable> Create( IObservable> source, Action> disposalsCompletedAccessor) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - disposalsCompletedAccessor.ThrowArgumentNullExceptionIfNull(nameof(disposalsCompletedAccessor)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(disposalsCompletedAccessor); return Observable .Create>(downstreamObserver => diff --git a/src/DynamicData/Cache/Internal/Cache.cs b/src/DynamicData/Cache/Internal/Cache.cs index 3336b7d1e..1cc599dc2 100644 --- a/src/DynamicData/Cache/Internal/Cache.cs +++ b/src/DynamicData/Cache/Internal/Cache.cs @@ -36,7 +36,7 @@ public Cache(int capacity = -1) => public void Clone(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(changes); foreach (var item in changes.ToConcreteType()) { diff --git a/src/DynamicData/Cache/Internal/CacheUpdater.cs b/src/DynamicData/Cache/Internal/CacheUpdater.cs index 3e69a3330..bf5b415e5 100644 --- a/src/DynamicData/Cache/Internal/CacheUpdater.cs +++ b/src/DynamicData/Cache/Internal/CacheUpdater.cs @@ -20,7 +20,7 @@ public CacheUpdater(ICache cache, Func? keySelecto public CacheUpdater(Dictionary data, Func? keySelector = null) { - data.ThrowArgumentNullExceptionIfNull(nameof(data)); + ArgumentExceptionHelper.ThrowIfNull(data); _cache = new Cache(data); _keySelector = keySelector; @@ -36,7 +36,7 @@ public CacheUpdater(Dictionary data, Func? keySele public void AddOrUpdate(IEnumerable items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(items); if (_keySelector is null) { @@ -62,12 +62,8 @@ public void AddOrUpdate(IEnumerable items) public void AddOrUpdate(IEnumerable items, IEqualityComparer comparer) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); - - if (comparer is null) - { - throw new ArgumentNullException(nameof(comparer)); - } + ArgumentExceptionHelper.ThrowIfNull(items); + ArgumentExceptionHelper.ThrowIfNull(comparer); if (_keySelector is null) { @@ -194,7 +190,7 @@ public IEnumerable> GetKeyValues(IEnumerable items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(items); Clear(); AddOrUpdate(items); @@ -221,7 +217,7 @@ public Optional Lookup(TObject item) public void Refresh(IEnumerable items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(items); if (items is IList list) { @@ -242,7 +238,7 @@ public void Refresh(IEnumerable items) public void Refresh(IEnumerable keys) { - keys.ThrowArgumentNullExceptionIfNull(nameof(keys)); + ArgumentExceptionHelper.ThrowIfNull(keys); if (keys is IList list) { @@ -276,7 +272,7 @@ public void Refresh(TObject item) public void Remove(IEnumerable items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(items); if (items is IList list) { @@ -297,7 +293,7 @@ public void Remove(IEnumerable items) public void Remove(IEnumerable keys) { - keys.ThrowArgumentNullExceptionIfNull(nameof(keys)); + ArgumentExceptionHelper.ThrowIfNull(keys); if (keys is IList list) { @@ -331,7 +327,7 @@ public void Remove(TObject item) public void Remove(IEnumerable> items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(items); if (items is IList list) { @@ -356,7 +352,7 @@ public void Remove(IEnumerable> items) public void RemoveKeys(IEnumerable keys) { - keys.ThrowArgumentNullExceptionIfNull(nameof(keys)); + ArgumentExceptionHelper.ThrowIfNull(keys); _cache.Remove(keys); } diff --git a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs index 9fe165f33..ca396c067 100644 --- a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs @@ -12,7 +12,7 @@ internal sealed class DeferUntilLoaded public DeferUntilLoaded(IObservableCache source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); _result = source.CountChanged.Where(count => count != 0).Take(1).Select(_ => new ChangeSet()).Concat(source.Connect()).NotEmpty(); } diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs index 9d667a0ce..f38c36f95 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs @@ -16,8 +16,8 @@ public static IObservable>> Create( TimeSpan? pollingInterval = null, IScheduler? scheduler = null) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - timeSelector.ThrowArgumentNullExceptionIfNull(nameof(timeSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(timeSelector); return Observable.Create>>(observer => (pollingInterval is { } pollingIntervalValue) ? new PollingSubscription( diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs index ecb4f829d..81a587ce6 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -16,8 +16,8 @@ public static IObservable> Create( TimeSpan? pollingInterval = null, IScheduler? scheduler = null) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - timeSelector.ThrowArgumentNullExceptionIfNull(nameof(timeSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(timeSelector); return Observable.Create>(observer => (pollingInterval is { } pollingIntervalValue) ? new PollingSubscription( diff --git a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs index 3a4446a19..976cd245a 100644 --- a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs @@ -17,10 +17,10 @@ public static IObservable> Create( IObservable reapplyFilter, bool suppressEmptyChangeSets) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - predicateState.ThrowArgumentNullExceptionIfNull(nameof(predicateState)); - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); - reapplyFilter.ThrowArgumentNullExceptionIfNull(nameof(reapplyFilter)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(predicateState); + ArgumentExceptionHelper.ThrowIfNull(predicate); + ArgumentExceptionHelper.ThrowIfNull(reapplyFilter); return Observable.Create>(downstreamObserver => new Subscription( downstreamObserver: downstreamObserver, diff --git a/src/DynamicData/Cache/Internal/Filter.Static.cs b/src/DynamicData/Cache/Internal/Filter.Static.cs index 3466f5ea2..2791affbb 100644 --- a/src/DynamicData/Cache/Internal/Filter.Static.cs +++ b/src/DynamicData/Cache/Internal/Filter.Static.cs @@ -15,8 +15,8 @@ public static IObservable> Create( Func filter, bool suppressEmptyChangeSets) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - filter.ThrowArgumentNullExceptionIfNull(nameof(filter)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(filter); return Observable.Create>(downstreamObserver => { diff --git a/src/DynamicData/Cache/Internal/LeftJoin.cs b/src/DynamicData/Cache/Internal/LeftJoin.cs index 29216d14d..55e39c2aa 100644 --- a/src/DynamicData/Cache/Internal/LeftJoin.cs +++ b/src/DynamicData/Cache/Internal/LeftJoin.cs @@ -144,7 +144,7 @@ public IObservable> Run() => Observable.Creat hasInitialized = true; - return new MultipleDisposable(observerSubscription, leftCache, rightCache, rightShareConnection, leftShare.Connect(), queue); + return new CompositeDisposable(observerSubscription, leftCache, rightCache, rightShareConnection, leftShare.Connect(), queue); } }); } diff --git a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs index 9391c6925..f5a362003 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs @@ -93,7 +93,7 @@ public LockFreeObservableCache() public IReadOnlyDictionary KeyValues => new Dictionary(_innerCache.GetDictionary()); /// - public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => Signal.Lazy( + public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => Observable.Defer( () => { var initial = InternalEx.Return(() => _innerCache.GetInitialUpdates(predicate)); diff --git a/src/DynamicData/Cache/Internal/MergeMany.cs b/src/DynamicData/Cache/Internal/MergeMany.cs index 192b799aa..762a4d1a3 100644 --- a/src/DynamicData/Cache/Internal/MergeMany.cs +++ b/src/DynamicData/Cache/Internal/MergeMany.cs @@ -20,7 +20,7 @@ public MergeMany(IObservable> source, Func> source, Func> observableSelector) { - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); _source = source ?? throw new ArgumentNullException(nameof(source)); _observableSelector = (t, _) => observableSelector(t); diff --git a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs index e8699904e..e5ea2ffdd 100644 --- a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs @@ -14,7 +14,7 @@ public IObservable> Run() { if (itemChangedTrigger is null) { - return Signal.Lazy(() => + return Observable.Defer(() => { return _source.Scan( (Cache?)null, diff --git a/src/DynamicData/Cache/Internal/ReaderWriter.cs b/src/DynamicData/Cache/Internal/ReaderWriter.cs index b50b07df0..feb53f96f 100644 --- a/src/DynamicData/Cache/Internal/ReaderWriter.cs +++ b/src/DynamicData/Cache/Internal/ReaderWriter.cs @@ -93,21 +93,21 @@ public Optional Lookup(TKey key) public ChangeSet Write(IChangeSet changes, Action>? previewHandler, bool collectChanges) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(changes); return DoUpdate(updater => updater.Clone(changes), previewHandler, collectChanges); } public ChangeSet Write(Action> updateAction, Action>? previewHandler, bool collectChanges) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentExceptionHelper.ThrowIfNull(updateAction); return DoUpdate(updateAction, previewHandler, collectChanges); } public ChangeSet Write(Action> updateAction, Action>? previewHandler, bool collectChanges) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentExceptionHelper.ThrowIfNull(updateAction); return DoUpdate(updateAction, previewHandler, collectChanges); } diff --git a/src/DynamicData/Cache/Internal/RightJoin.cs b/src/DynamicData/Cache/Internal/RightJoin.cs index a77a42e94..26bc89128 100644 --- a/src/DynamicData/Cache/Internal/RightJoin.cs +++ b/src/DynamicData/Cache/Internal/RightJoin.cs @@ -137,7 +137,7 @@ public IObservable> Run() => Observable.Crea hasInitialized = true; - return new MultipleDisposable(observerSubscription, leftCache, rightCache, rightShare.Connect(), queue); + return new CompositeDisposable(observerSubscription, leftCache, rightCache, rightShare.Connect(), queue); } }); } diff --git a/src/DynamicData/Cache/Internal/SubscribeMany.cs b/src/DynamicData/Cache/Internal/SubscribeMany.cs index 27a78b86e..54521db2c 100644 --- a/src/DynamicData/Cache/Internal/SubscribeMany.cs +++ b/src/DynamicData/Cache/Internal/SubscribeMany.cs @@ -14,7 +14,7 @@ internal sealed class SubscribeMany public SubscribeMany(IObservable> source, Func subscriptionFactory) { - subscriptionFactory.ThrowArgumentNullExceptionIfNull(nameof(subscriptionFactory)); + ArgumentExceptionHelper.ThrowIfNull(subscriptionFactory); _source = source ?? throw new ArgumentNullException(nameof(source)); _subscriptionFactory = (t, _) => subscriptionFactory(t); diff --git a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs index de4cf5665..bbdabfaa6 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -304,7 +304,7 @@ private void TryPublishDownstreamChanges() private readonly struct ScheduledExpiration { - public required OnceDisposable Cancellation { get; init; } + public required SingleAssignmentDisposable Cancellation { get; init; } public required Expiration Expiration { get; init; } } diff --git a/src/DynamicData/Cache/Internal/Transform.cs b/src/DynamicData/Cache/Internal/Transform.cs index b3b55f4bd..e0da30457 100644 --- a/src/DynamicData/Cache/Internal/Transform.cs +++ b/src/DynamicData/Cache/Internal/Transform.cs @@ -9,7 +9,7 @@ internal sealed class Transform(IObservable> Run() => Signal.Lazy(RunImpl); + public IObservable> Run() => Observable.Defer(RunImpl); private IObservable> RunImpl() => source.Scan( (ChangeAwareCache?)null, diff --git a/src/DynamicData/Cache/Internal/TransformAsync.cs b/src/DynamicData/Cache/Internal/TransformAsync.cs index 213c1b72e..efa251e05 100644 --- a/src/DynamicData/Cache/Internal/TransformAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformAsync.cs @@ -41,7 +41,7 @@ private IObservable> DoTransform(ChangeAwareCache var toTransform = cache.KeyValues.Where(kvp => shouldTransform(kvp.Value.Source, kvp.Key)).Select(kvp => new Change(ChangeReason.Update, kvp.Key, kvp.Value.Source, kvp.Value.Source)).ToArray(); - return toTransform.Select(change => Signal.Lazy(() => Transform(change).ToObservable())) + return toTransform.Select(change => Observable.Defer(() => Transform(change).ToObservable())) .Merge(maximumConcurrency ?? int.MaxValue) .ToArray() .Select(transformed => ProcessUpdates(cache, transformed)); @@ -50,7 +50,7 @@ private IObservable> DoTransform(ChangeAwareCache private IObservable> DoTransform( ChangeAwareCache cache, IChangeSet changes) { - return changes.Select(change => Signal.FromAsync(() => Transform(change))) + return changes.Select(change => Observable.FromAsync(() => Transform(change))) .Merge(maximumConcurrency ?? int.MaxValue) .ToArray() .Select(transformed => ProcessUpdates(cache, transformed)); diff --git a/src/DynamicData/Cache/Internal/TransformMany.cs b/src/DynamicData/Cache/Internal/TransformMany.cs index 710c93b5a..fcef94fcc 100644 --- a/src/DynamicData/Cache/Internal/TransformMany.cs +++ b/src/DynamicData/Cache/Internal/TransformMany.cs @@ -17,7 +17,7 @@ public TransformMany(IObservable> source, Func Signal.Lazy( + t => Observable.Defer( () => { var subsequentChanges = manySelector(t).ToObservableChangeSet(keySelector); @@ -37,7 +37,7 @@ public TransformMany(IObservable> source, Func Signal.Lazy( + t => Observable.Defer( () => { var subsequentChanges = manySelector(t).ToObservableChangeSet(keySelector); @@ -57,7 +57,7 @@ public TransformMany(IObservable> source, Func manySelector(x).Items, keySelector, - t => Signal.Lazy( + t => Observable.Defer( () => { var subsequentChanges = Observable.Create>(o => manySelector(t).Connect().Subscribe(o)); diff --git a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs index 16506d9fd..69c4c9169 100644 --- a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs @@ -13,7 +13,7 @@ internal sealed class TransformWithInlineUpdate(IOb where TSource : notnull where TKey : notnull { - public IObservable> Run() => Signal.Lazy(RunImpl); + public IObservable> Run() => Observable.Defer(RunImpl); private IObservable> RunImpl() => source.Scan( (ChangeAwareCache?)null, diff --git a/src/DynamicData/Cache/ObservableCache.cs b/src/DynamicData/Cache/ObservableCache.cs index 2da160a00..decbb3f33 100644 --- a/src/DynamicData/Cache/ObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCache.cs @@ -148,7 +148,7 @@ public IDisposable SuspendCount() lock (_locker) { _suspensionTracker.Value.SuspendCount(); - return Scope.Create(this, static cache => cache.ResumeCount()); + return Disposable.Create(this, static cache => cache.ResumeCount()); } } @@ -157,7 +157,7 @@ public IDisposable SuspendNotifications() lock (_locker) { _suspensionTracker.Value.SuspendNotifications(); - return Scope.Create(this, static cache => cache.ResumeNotifications()); + return Disposable.Create(this, static cache => cache.ResumeNotifications()); } } @@ -165,7 +165,7 @@ public IDisposable SuspendNotifications() internal void UpdateFromIntermediate(Action> updateAction) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentExceptionHelper.ThrowIfNull(updateAction); using var notifications = _notifications.AcquireLock(); @@ -192,7 +192,7 @@ internal void UpdateFromIntermediate(Action> update internal void UpdateFromSource(Action> updateAction) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentExceptionHelper.ThrowIfNull(updateAction); using var notifications = _notifications.AcquireLock(); diff --git a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs index d1363d578..4e808ec00 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs @@ -35,8 +35,8 @@ public static IObservable> Adapt(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - adaptor.ThrowArgumentNullExceptionIfNull(nameof(adaptor)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(adaptor); return source.Do(adaptor.Adapt); } @@ -49,8 +49,8 @@ public static IObservable> Adapt(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - adaptor.ThrowArgumentNullExceptionIfNull(nameof(adaptor)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(adaptor); return source.Do(adaptor.Adapt); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs index e4413ca0a..5447ac473 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs @@ -36,7 +36,8 @@ public static void AddOrUpdate(this ISourceCache s where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(item); source.Edit(updater => updater.AddOrUpdate(item)); } @@ -50,7 +51,9 @@ public static void AddOrUpdate(this ISourceCache s where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(item); + ArgumentExceptionHelper.ThrowIfNull(equalityComparer); source.Edit(updater => updater.AddOrUpdate(item, equalityComparer)); } @@ -63,7 +66,8 @@ public static void AddOrUpdate(this ISourceCache s where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); source.Edit(updater => updater.AddOrUpdate(items)); } @@ -77,7 +81,9 @@ public static void AddOrUpdate(this ISourceCache s where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); + ArgumentExceptionHelper.ThrowIfNull(equalityComparer); source.Edit(updater => updater.AddOrUpdate(items, equalityComparer)); } @@ -91,8 +97,9 @@ public static void AddOrUpdate(this IIntermediateCache updater.AddOrUpdate(item, key)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.And.cs b/src/DynamicData/Cache/ObservableCacheEx.And.cs index 49b068051..0913186c6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.And.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.And.cs @@ -28,7 +28,7 @@ public static IObservable> And(this IOb where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return others is null || others.Length == 0 ? throw new ArgumentNullException(nameof(others)) @@ -51,7 +51,7 @@ public static IObservable> And(this ICo where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.And); } @@ -68,7 +68,7 @@ public static IObservable> And(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.And); } @@ -85,7 +85,7 @@ public static IObservable> And(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.And); } @@ -102,7 +102,7 @@ public static IObservable> And(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.And); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs index f2ab9b21c..1bc978cae 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs @@ -26,7 +26,7 @@ public static IObservableCache AsObservableCache(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new AnonymousObservableCache(source); } @@ -54,7 +54,7 @@ public static IObservableCache AsObservableCache(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); if (applyLocking) { diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs index f903170c5..86b9b078c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs @@ -29,7 +29,7 @@ public static IObservable> AutoRefresh( where TObject : INotifyPropertyChanged where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.AutoRefreshOnObservable( (t, _) => @@ -61,7 +61,7 @@ public static IObservable> AutoRefresh diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs index d04918456..2f67555ef 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs @@ -47,8 +47,8 @@ public static IObservable> AutoRefreshOnObservable(source, reevaluator, changeSetBuffer, scheduler).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs index 7d6eec294..ad920316a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs @@ -43,7 +43,7 @@ public static IObservable> Batch(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Buffer(timeSpan, scheduler ?? GlobalConfig.DefaultScheduler).FlattenBufferResult(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs index e95ca23af..585e6d759 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs @@ -66,8 +66,8 @@ public static IObservable> BatchIf(this where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pauseIfTrueSelector.ThrowArgumentNullExceptionIfNull(nameof(pauseIfTrueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(pauseIfTrueSelector); return new BatchIf(source, pauseIfTrueSelector, timeOut, initialPauseState, scheduler: scheduler).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs index 13308decf..c7e8d979f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs @@ -28,7 +28,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); + ArgumentExceptionHelper.ThrowIfNull(destination); // if user has not specified different defaults, use system wide defaults instead. // This is a hack to retro fit system wide defaults which override the hard coded defaults above @@ -55,7 +55,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); + ArgumentExceptionHelper.ThrowIfNull(destination); return source?.Bind(destination, new ObservableCollectionAdaptor(options)) ?? throw new ArgumentNullException(nameof(source)); } @@ -74,9 +74,9 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); - updater.ThrowArgumentNullExceptionIfNull(nameof(updater)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(destination); + ArgumentExceptionHelper.ThrowIfNull(updater); return Observable.Create>( observer => @@ -102,7 +102,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var target = new ObservableCollectionExtended(); readOnlyObservableCollection = new ReadOnlyObservableCollection(target); @@ -125,7 +125,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); if (adaptor is not null) { @@ -158,8 +158,8 @@ public static IObservable> Bind(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(destination); return source.Bind(destination, DynamicDataOptions.Binding); } @@ -178,8 +178,8 @@ public static IObservable> Bind(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(destination); var updater = new SortedObservableCollectionAdaptor(options); return source.Bind(destination, updater); @@ -199,9 +199,9 @@ public static IObservable> Bind(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); - updater.ThrowArgumentNullExceptionIfNull(nameof(updater)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(destination); + ArgumentExceptionHelper.ThrowIfNull(updater); return Observable.Create>( observer => @@ -227,7 +227,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var target = new ObservableCollectionExtended(); var result = new ReadOnlyObservableCollection(target); @@ -252,7 +252,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); // if user has not specified different defaults, use system wide defaults instead. // This is a hack to retro fit system wide defaults which override the hard coded defaults above @@ -287,8 +287,8 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - bindingList.ThrowArgumentNullExceptionIfNull(nameof(bindingList)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(bindingList); return source.Adapt(new BindingListAdaptor(bindingList, resetThreshold)); } @@ -311,8 +311,8 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - bindingList.ThrowArgumentNullExceptionIfNull(nameof(bindingList)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(bindingList); return source.Adapt(new SortedBindingListAdaptor(bindingList, resetThreshold)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs index a79020179..571ca1fdc 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs @@ -39,7 +39,7 @@ public static IObservable> Cast(source, converter).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs index 0d656b1f7..91ddaffb4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs @@ -36,8 +36,8 @@ public static IObservable> ChangeKey @@ -57,8 +57,8 @@ public static IObservable> ChangeKey diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs index 3dce3dc01..59a49d9c6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs @@ -33,7 +33,7 @@ public static void Clear(this ISourceCache source) where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Clear()); } @@ -43,7 +43,7 @@ public static void Clear(this IIntermediateCache s where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Clear()); } @@ -53,7 +53,7 @@ public static void Clear(this LockFreeObservableCache updater.Clear()); } } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs index fe115da5c..7d612435b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs @@ -33,8 +33,8 @@ public static IObservable> Clone(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - target.ThrowArgumentNullExceptionIfNull(nameof(target)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(target); return source.Do( changes => diff --git a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs index 5b27f919e..c1218b714 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs @@ -17,7 +17,7 @@ private static IObservable> Combine(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return Observable.Create>( observer => @@ -32,7 +32,7 @@ private static IObservable> Combine(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return Observable.Create>( observer => @@ -47,7 +47,7 @@ private static IObservable> Combine(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new DynamicCombiner(source, type).Run(); } @@ -56,7 +56,7 @@ private static IObservable> Combine(thi where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return Observable.Create>( observer => @@ -93,7 +93,7 @@ private static IObservable> Combine(thi where TObject : notnull where TKey : notnull { - combineTarget.ThrowArgumentNullExceptionIfNull(nameof(combineTarget)); + ArgumentExceptionHelper.ThrowIfNull(combineTarget); return Observable.Create>( observer => diff --git a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs index 55c93f9d5..b8219669e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs @@ -26,8 +26,8 @@ public static IObservable> Convert diff --git a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs index b170a4a87..9bedb7017 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs @@ -29,7 +29,7 @@ public static IObservable> DeferUntilLoaded(source).Run(); } @@ -39,7 +39,7 @@ public static IObservable> DeferUntilLoaded(source).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs index 1becb08d6..baa2edd02 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs @@ -52,7 +52,7 @@ public static IObservable> DisposeMany( where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new DisposeMany(source).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs index d65ae0a5e..8b8c8c8bf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs @@ -33,8 +33,8 @@ public static IObservable> DistinctValues>(observer => new DistinctCalculator(source, valueSelector).Run().SubscribeSafe(observer)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs index abf5a0cff..cfd04cdb7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs @@ -25,9 +25,9 @@ public static void EditDiff(this ISourceCache sour where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - allItems.ThrowArgumentNullExceptionIfNull(nameof(allItems)); - equalityComparer.ThrowArgumentNullExceptionIfNull(nameof(equalityComparer)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(allItems); + ArgumentExceptionHelper.ThrowIfNull(equalityComparer); source.EditDiff(allItems, equalityComparer.Equals); } @@ -55,9 +55,9 @@ public static void EditDiff(this ISourceCache sour where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - allItems.ThrowArgumentNullExceptionIfNull(nameof(allItems)); - areItemsEqual.ThrowArgumentNullExceptionIfNull(nameof(areItemsEqual)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(allItems); + ArgumentExceptionHelper.ThrowIfNull(areItemsEqual); var editDiff = new EditDiff(source, areItemsEqual); editDiff.Edit(allItems); @@ -89,8 +89,8 @@ public static IObservable> EditDiff(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return new EditDiffChangeSet(source, keySelector, equalityComparer).Run(); } @@ -119,8 +119,8 @@ public static IObservable> EditDiff(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return new EditDiffChangeSetOptional(source, keySelector, equalityComparer).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs index 4a8ee9d7c..f4eebaddd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs @@ -35,7 +35,7 @@ public static IObservable> EnsureUniqueKeys(source).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Except.cs b/src/DynamicData/Cache/ObservableCacheEx.Except.cs index 8c71d717e..d443c10e0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Except.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Except.cs @@ -32,7 +32,7 @@ public static IObservable> Except(this where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); if (others is null || others.Length == 0) { @@ -59,7 +59,7 @@ public static IObservable> Except(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Except); } @@ -76,7 +76,7 @@ public static IObservable> Except(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Except); } @@ -93,7 +93,7 @@ public static IObservable> Except(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Except); } @@ -110,7 +110,7 @@ public static IObservable> Except(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Except); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs index 58be8eb75..5715fc7f9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs @@ -48,8 +48,8 @@ public static IObservable> FilterImmutable( predicate: predicate, diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs index e8673b43b..80c3bb083 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs @@ -61,8 +61,8 @@ public static IObservable> FilterOnObservable(source, filterFactory, buffer, scheduler).Run(); } @@ -75,8 +75,8 @@ public static IObservable> FilterOnObservable filterFactory(obj), buffer, scheduler); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs index c7e7eff67..3f71f42b4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs @@ -23,8 +23,8 @@ public static partial class ObservableCacheEx [Obsolete("This can cause unhandled exception issues so do not use")] public static IObservable FinallySafe(this IObservable source, Action finallyAction) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - finallyAction.ThrowArgumentNullExceptionIfNull(nameof(finallyAction)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(finallyAction); return new FinallySafe(source, finallyAction).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs index addb9a623..5c50fd8f1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs @@ -25,7 +25,7 @@ public static IObservable> Flatten(this IOb where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.SelectMany(changes => changes); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs index ad209b312..6ec036c50 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs @@ -24,7 +24,7 @@ public static IObservable> FlattenBufferResult x.Count != 0).Select(updates => new ChangeSet(updates.SelectMany(u => u))); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs index 38bc5f416..d68f56214 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs @@ -40,8 +40,8 @@ public static IObservable> ForEachChange changes.ForEach(action)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs index 9a8a83cde..079c3153c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs @@ -26,10 +26,10 @@ public static IObservable> FullJoin resultSelector(leftValue, rightValue)); } @@ -84,10 +84,10 @@ public static IObservable> FullJoin(left, right, rightKeySelector, resultSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs index f5da307fb..14a7cd5e6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs @@ -26,10 +26,10 @@ public static IObservable> FullJoinMany resultSelector(leftValue, rightValue)); } @@ -85,10 +85,10 @@ public static IObservable> FullJoinMany(left, right, rightKeySelector, resultSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Group.cs b/src/DynamicData/Cache/ObservableCacheEx.Group.cs index 11e37c307..251b89e0f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Group.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Group.cs @@ -32,9 +32,9 @@ public static IObservable> Group(source, groupSelector, resultGroupSource).Run(); } @@ -75,8 +75,8 @@ public static IObservable> Group(source, groupSelectorKey, null).Run(); } @@ -92,9 +92,9 @@ public static IObservable> Group(source, groupSelectorKey, regrouper).Run(); } @@ -131,8 +131,8 @@ public static IObservable> Group(source, groupSelectorKeyObservable, regrouper).Run(); } @@ -147,7 +147,7 @@ public static IObservable> Group), regrouper); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs index bdb7e1364..a725feff0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs @@ -65,8 +65,8 @@ public static IObservable> GroupOnObse where TKey : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - groupObservableSelector.ThrowArgumentNullExceptionIfNull(nameof(groupObservableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(groupObservableSelector); return new GroupOnObservable(source, groupObservableSelector).Run(); } @@ -85,7 +85,7 @@ public static IObservable> GroupOnObse where TKey : notnull where TGroupKey : notnull { - groupObservableSelector.ThrowArgumentNullExceptionIfNull(nameof(groupObservableSelector)); + ArgumentExceptionHelper.ThrowIfNull(groupObservableSelector); return source.GroupOnObservable(AdaptSelector>(groupObservableSelector)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs index 5dd0219b8..f11da7bab 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs @@ -31,8 +31,8 @@ public static IObservable> GroupOnProp where TKey : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertySelector.ThrowArgumentNullExceptionIfNull(nameof(propertySelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(propertySelector); return new GroupOnProperty(source, propertySelector, propertyChangedThrottle, scheduler).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs index f52a53ab3..19162ce83 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs @@ -31,8 +31,8 @@ public static IObservable> Gr where TKey : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertySelector.ThrowArgumentNullExceptionIfNull(nameof(propertySelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(propertySelector); return new GroupOnPropertyWithImmutableState(source, propertySelector, propertyChangedThrottle, scheduler).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs index f0252a108..7e2659683 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs @@ -46,8 +46,8 @@ public static IObservable> Gr where TKey : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - groupSelectorKey.ThrowArgumentNullExceptionIfNull(nameof(groupSelectorKey)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(groupSelectorKey); return new GroupOnImmutable(source, groupSelectorKey, regrouper).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs index 4542bcb04..f9ab45c77 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs @@ -24,8 +24,8 @@ public static IObservable> IncludeUpdateWhen diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs index f81234179..73ace3cf3 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs @@ -26,10 +26,10 @@ public static partial class ObservableCacheEx where TRightKey : notnull where TDestination : notnull { - left.ThrowArgumentNullExceptionIfNull(nameof(left)); - right.ThrowArgumentNullExceptionIfNull(nameof(right)); - rightKeySelector.ThrowArgumentNullExceptionIfNull(nameof(rightKeySelector)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(left); + ArgumentExceptionHelper.ThrowIfNull(right); + ArgumentExceptionHelper.ThrowIfNull(rightKeySelector); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); return left.InnerJoin(right, rightKeySelector, (_, leftValue, rightValue) => resultSelector(leftValue, rightValue)); } @@ -84,10 +84,10 @@ public static partial class ObservableCacheEx where TRightKey : notnull where TDestination : notnull { - left.ThrowArgumentNullExceptionIfNull(nameof(left)); - right.ThrowArgumentNullExceptionIfNull(nameof(right)); - rightKeySelector.ThrowArgumentNullExceptionIfNull(nameof(rightKeySelector)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(left); + ArgumentExceptionHelper.ThrowIfNull(right); + ArgumentExceptionHelper.ThrowIfNull(rightKeySelector); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); return new InnerJoin(left, right, rightKeySelector, resultSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs index 8b2e81479..89def0889 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs @@ -26,10 +26,10 @@ public static IObservable> InnerJoinMany resultSelector(leftValue, rightValue)); } @@ -84,10 +84,10 @@ public static IObservable> InnerJoinMany(left, right, rightKeySelector, resultSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs index d9f79c0ac..64f0455a0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs @@ -34,7 +34,7 @@ public static IObservable> InvokeEvaluate changes.Where(u => u.Reason == ChangeReason.Refresh).ForEach(u => u.Current.Evaluate())); } } diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs index 60cb091ae..d65e5f851 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs @@ -26,10 +26,10 @@ public static IObservable> LeftJoin resultSelector(leftValue, rightValue)); } @@ -84,10 +84,10 @@ public static IObservable> LeftJoin(left, right, rightKeySelector, resultSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs index e8c8e5ec8..ef46a0dc0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs @@ -26,10 +26,10 @@ public static IObservable> LeftJoinMany resultSelector(leftValue, rightValue)); } @@ -84,10 +84,10 @@ public static IObservable> LeftJoinMany(left, right, rightKeySelector, resultSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs index f68f19f6b..71348f773 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs @@ -37,7 +37,7 @@ public static IObservable> LimitSizeTo( where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); if (size <= 0) { @@ -63,7 +63,7 @@ public static IObservable>> LimitSizeTo< where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); if (sizeLimit <= 0) { diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs index abad73be3..efe8c71aa 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs @@ -64,7 +64,7 @@ public static IObservable> MergeChangeSets(source, equalityComparer: null, comparer: null).Run(); } @@ -84,8 +84,8 @@ public static IObservable> MergeChangeSets(source, equalityComparer: null, comparer).Run(); } @@ -105,8 +105,8 @@ public static IObservable> MergeChangeSets(source, equalityComparer, comparer: null).Run(); } @@ -126,9 +126,9 @@ public static IObservable> MergeChangeSets(source, equalityComparer, comparer).Run(); } @@ -149,8 +149,8 @@ public static IObservable> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets(source, equalityComparer: null, comparer: null, completable, scheduler).Run(); } @@ -367,8 +367,8 @@ public static IObservable> MergeChangeSets(source, equalityComparer: null, comparer, completable, scheduler).Run(); } @@ -390,8 +390,8 @@ public static IObservable> MergeChangeSets(source, equalityComparer, comparer: null, completable, scheduler).Run(); } @@ -413,9 +413,9 @@ public static IObservable> MergeChangeSets(source, equalityComparer, comparer, completable, scheduler).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs index 827094ec4..c74e70771 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs @@ -50,8 +50,8 @@ public static IObservable MergeMany(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return new MergeMany(source, observableSelector).Run(); } @@ -63,8 +63,8 @@ public static IObservable MergeMany(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return new MergeMany(source, observableSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs index e3f821dd8..18f98faa6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs @@ -34,7 +34,7 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), comparer); } @@ -58,9 +58,9 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); + ArgumentExceptionHelper.ThrowIfNull(comparer); return source.MergeManyChangeSets(observableSelector, equalityComparer: null, comparer: comparer); } @@ -85,8 +85,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), equalityComparer, comparer); } @@ -157,8 +157,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return new MergeManyCacheChangeSets(source, observableSelector, equalityComparer, comparer).Run(); } @@ -185,8 +185,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), sourceComparer, DefaultResortOnSourceRefresh, equalityComparer: null, childComparer); } @@ -233,8 +233,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), sourceComparer, resortOnSourceRefresh, equalityComparer: null, childComparer); } @@ -282,8 +282,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), sourceComparer, DefaultResortOnSourceRefresh, equalityComparer, childComparer); } @@ -331,8 +331,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), sourceComparer, resortOnSourceRefresh, equalityComparer, childComparer); } @@ -371,9 +371,9 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); - sourceComparer.ThrowArgumentNullExceptionIfNull(nameof(sourceComparer)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); + ArgumentExceptionHelper.ThrowIfNull(sourceComparer); return new MergeManyCacheChangeSetsSourceCompare(source, observableSelector, sourceComparer, equalityComparer, childComparer, resortOnSourceRefresh).Run(); } @@ -395,8 +395,8 @@ public static IObservable> MergeManyChangeSets(source, observableSelector, equalityComparer).Run(); } @@ -417,7 +417,7 @@ public static IObservable> MergeManyChangeSets observableSelector(obj), equalityComparer); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs index 8b9ac0929..bd68bfe6c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs @@ -29,8 +29,8 @@ public static IObservable> MergeManyItems(source, observableSelector).Run(); } @@ -42,8 +42,8 @@ public static IObservable> MergeManyItems(source, observableSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs index 7acee487b..58a6de047 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs @@ -24,7 +24,7 @@ public static IObservable> NotEmpty(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Where(changes => changes.Count != 0); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs index f1d3a6d0b..15ede32c9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs @@ -38,7 +38,7 @@ public static IObservable> OfType(source, suppressEmptyChangeSets).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs index eeedbfbef..2cd22da04 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs @@ -43,8 +43,8 @@ public static IObservable> OnItemAdded( where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - addAction.ThrowArgumentNullExceptionIfNull(nameof(addAction)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(addAction); return source.OnChangeAction(ChangeReason.Add, addAction); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs index 7079cf8dc..d5e6e881d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs @@ -41,8 +41,8 @@ public static IObservable> OnItemRefreshed> OnItemRemoved> OnItemUpdated change.Reason == ChangeReason.Update, change => updateAction(change.Current, change.Previous.Value, change.Key)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Or.cs b/src/DynamicData/Cache/ObservableCacheEx.Or.cs index 2e83d3c13..1b8e6501d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Or.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Or.cs @@ -44,7 +44,7 @@ public static IObservable> Or(this IObs where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); if (others is null || others.Length == 0) { @@ -61,7 +61,7 @@ public static IObservable> Or(this ICol where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Or); } @@ -78,7 +78,7 @@ public static IObservable> Or(this IObs where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Or); } @@ -95,7 +95,7 @@ public static IObservable> Or(this IObs where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Or); } @@ -112,7 +112,7 @@ public static IObservable> Or(this IObs where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Or); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs index beb7716f1..5ba18b14d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs @@ -29,8 +29,8 @@ public static IDisposable PopulateFrom(this ISourceCache(this ISourceCache(this IObservable destination.Edit(updater => updater.Clone(changes))); } @@ -57,8 +57,8 @@ public static IDisposable PopulateInto(this IObservable destination.Edit(updater => updater.Clone(changes))); } @@ -71,8 +71,8 @@ public static IDisposable PopulateInto(this IObservable destination.Edit(updater => updater.Clone(changes))); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs index 5450a338f..baa39444b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs @@ -35,8 +35,8 @@ public static IObservable QueryWhenChanged> QueryWhenChanged where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new QueryWhenChanged(source).Run(); } @@ -72,8 +72,8 @@ public static IObservable> QueryWhenChanged(source, itemChangedTrigger).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs index 475238b9f..fa93a996d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs @@ -26,7 +26,7 @@ public static IObservable> RefCount(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new RefCount(source).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs index 60eb3ac74..642def1ff 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs @@ -28,7 +28,7 @@ public static void Refresh(this ISourceCache sourc where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Refresh(item)); } @@ -45,7 +45,7 @@ public static void Refresh(this ISourceCache sourc where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Refresh(items)); } @@ -61,7 +61,7 @@ public static void Refresh(this ISourceCache sourc where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Refresh()); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs index 415acdb0d..80cc7435d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs @@ -29,7 +29,7 @@ public static void Remove(this ISourceCache source where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Remove(item)); } @@ -46,7 +46,7 @@ public static void Remove(this ISourceCache source where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Remove(key)); } @@ -64,7 +64,7 @@ public static void Remove(this ISourceCache source where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Remove(items)); } @@ -82,7 +82,7 @@ public static void Remove(this ISourceCache source where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Remove(keys)); } @@ -95,7 +95,7 @@ public static void Remove(this IIntermediateCache where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Remove(key)); } @@ -108,7 +108,7 @@ public static void Remove(this IIntermediateCache where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.Remove(keys)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs index 2ddf59a2d..93946ca1f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs @@ -27,7 +27,7 @@ public static IObservable> RemoveKey(this IOb where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Select( changes => @@ -49,7 +49,7 @@ public static void RemoveKey(this ISourceCache sou where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.RemoveKey(key)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs index 50f40f5cf..b0fe28095 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs @@ -23,7 +23,7 @@ public static void RemoveKeys(this ISourceCache so where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(updater => updater.RemoveKeys(keys)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs index 2e7c00975..11ff810da 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs @@ -26,10 +26,10 @@ public static IObservable> RightJoin resultSelector(leftValue, rightValue)); } @@ -84,10 +84,10 @@ public static IObservable> RightJoin(left, right, rightKeySelector, resultSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs index b01283931..7a0010015 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs @@ -26,10 +26,10 @@ public static IObservable> RightJoinMany resultSelector(leftValue, rightValue)); } @@ -85,10 +85,10 @@ public static IObservable> RightJoinMany(left, right, rightKeySelector, resultSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs index 35af96fad..d75013f9d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs @@ -26,7 +26,7 @@ public static IObservable> SkipInitial( where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.DeferUntilLoaded().Skip(1); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs index c197750ee..b5cd298f6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs @@ -34,8 +34,8 @@ public static IObservable> Sort(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(comparer); return new Sort(source, comparer, sortOptimisations, resetThreshold: resetThreshold).Run(); } @@ -55,8 +55,8 @@ public static IObservable> Sort(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - comparerObservable.ThrowArgumentNullExceptionIfNull(nameof(comparerObservable)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(comparerObservable); return new Sort(source, null, sortOptimisations, comparerObservable, resetThreshold: resetThreshold).Run(); } @@ -77,8 +77,8 @@ public static IObservable> Sort(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - comparerObservable.ThrowArgumentNullExceptionIfNull(nameof(comparerObservable)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(comparerObservable); return new Sort(source, null, sortOptimisations, comparerObservable, resorter, resetThreshold).Run(); } @@ -99,8 +99,8 @@ public static IObservable> Sort(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - resorter.ThrowArgumentNullExceptionIfNull(nameof(resorter)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(resorter); return new Sort(source, comparer, sortOptimisations, null, resorter, resetThreshold).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs index 3c8b5840d..a86559039 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs @@ -232,7 +232,7 @@ public static partial class ObservableCacheEx where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new SortAndBind(source, comparer, options, targetList).Run(); } @@ -324,7 +324,7 @@ public static partial class ObservableCacheEx where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); // allow options to set initial capacity for efficiency var observableCollection = options.InitialCapacity > 0 diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs index fa7fbea65..cc5c46ba6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs @@ -26,7 +26,7 @@ public static IObservable> StartWithEmpty.Empty); } @@ -39,7 +39,7 @@ public static IObservable> StartWithEmpty.Empty); } @@ -52,7 +52,7 @@ public static IObservable> StartWithEmpty.Empty); } @@ -65,7 +65,7 @@ public static IObservable> StartWithEmpty.Empty); } @@ -82,7 +82,7 @@ public static IObservable> StartWithEm where TKey : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.StartWith(GroupChangeSet.Empty); } @@ -99,7 +99,7 @@ public static IObservable> St where TKey : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.StartWith(ImmutableGroupChangeSet.Empty); } @@ -111,7 +111,7 @@ public static IObservable> St /// Overload for . public static IObservable> StartWithEmpty(this IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.StartWith(ReadOnlyCollectionLight.Empty); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs index 8e68f506d..8bf58234b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs @@ -19,7 +19,7 @@ public static IObservable> StartWithItem where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.StartWithItem(item, item.Key); } @@ -38,7 +38,7 @@ public static IObservable> StartWithItem(ChangeReason.Add, key, item); return source.StartWith(new ChangeSet { change }); diff --git a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs index c83429720..7c917fcf9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs @@ -51,8 +51,8 @@ public static IObservable> SubscribeMany(source, subscriptionFactory).Run(); } @@ -65,8 +65,8 @@ public static IObservable> SubscribeMany(source, subscriptionFactory).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs index 6a506f1d2..bfdf5223a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs @@ -20,7 +20,7 @@ public static IObservable> Switch(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Select(cache => cache.Connect()).Switch(); } @@ -41,7 +41,7 @@ public static IObservable> Switch(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return new Switch(sources).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs index df797f21d..19ade0fb5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs @@ -34,8 +34,8 @@ public static IObservable> ToObservableChangeSet.Create( source: source, @@ -68,8 +68,8 @@ public static IObservable> ToObservableChangeSet.Create( source: source, diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs index a8956930f..8b5aba702 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs @@ -44,7 +44,7 @@ public static IObservable> ToObservableOptional where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new ToObservableOptional(source, key, equalityComparer).Run(); } @@ -69,12 +69,12 @@ public static IObservable> ToObservableOptional { if (initialOptionalWhenMissing) { - return Signal.Lazy(() => + return Observable.Defer(() => { var seenValue = false; return source.ToObservableOptional(key, equalityComparer) .Do(_ => seenValue = true) - .Merge(Signal.Lazy(() => seenValue + .Merge(Observable.Defer(() => seenValue ? Observable.Empty>() : Observable.Return(Optional.None))); }); diff --git a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs index 1770d0d5d..038d58cce 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs @@ -21,8 +21,8 @@ public static IObservable> Transform transformFactory(current), transformOnRefresh); } @@ -34,8 +34,8 @@ public static IObservable> Transform transformFactory(current, key), transformOnRefresh); } @@ -47,8 +47,8 @@ public static IObservable> Transform(source, transformFactory, transformOnRefresh: transformOnRefresh).Run(); } @@ -60,8 +60,8 @@ public static IObservable> Transform transformFactory(current), forceTransform?.ForForced()); } @@ -73,8 +73,8 @@ public static IObservable> Transform transformFactory(current, key), forceTransform); } @@ -122,8 +122,8 @@ public static IObservable> Transform(source, transformFactory, forceTransform).Run(); @@ -146,9 +146,9 @@ public static IObservable> Transform transformFactory(cur, key), forceTransform.ForForced()); } @@ -160,9 +160,9 @@ public static IObservable> Transform()); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs index 60a9be37d..13e2d5c19 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs @@ -22,8 +22,8 @@ public static IObservable> TransformAsync transformFactory(current), forceTransform); } @@ -36,8 +36,8 @@ public static IObservable> TransformAsync transformFactory(current, key), forceTransform); } @@ -81,8 +81,8 @@ public static IObservable> TransformAsync(source, transformFactory, null, forceTransform).Run(); } @@ -95,8 +95,8 @@ public static IObservable> TransformAsync transformFactory(current), options); } @@ -109,8 +109,8 @@ public static IObservable> TransformAsync transformFactory(current, key), options); } @@ -123,8 +123,8 @@ public static IObservable> TransformAsync(source, transformFactory, null, null, options.MaximumConcurrency, options.TransformOnRefresh).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs index 386fc07f1..84eeb377b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs @@ -46,8 +46,8 @@ public static IObservable> TransformImmutable( source: source, diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs index aab6ab513..bb70fcad3 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs @@ -47,8 +47,8 @@ public static IObservable> TransformMa where TSource : notnull where TSourceKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(manySelector); return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer).Run(); } @@ -73,8 +73,8 @@ public static IObservable> TransformMa where TSourceKey : notnull where TCollection : INotifyCollectionChanged, IEnumerable { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(manySelector); return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer).Run(); } @@ -99,8 +99,8 @@ public static IObservable> TransformMa where TSource : notnull where TSourceKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(manySelector); return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector), equalityComparer, comparer).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs index 2789899e9..9522582f7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs @@ -39,9 +39,9 @@ public static IObservable> TransformMa where TSource : notnull where TSourceKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); - errorHandler.ThrowArgumentNullExceptionIfNull(nameof(errorHandler)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(manySelector); + ArgumentExceptionHelper.ThrowIfNull(errorHandler); return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer, errorHandler).Run(); } @@ -66,9 +66,9 @@ public static IObservable> TransformMa where TSourceKey : notnull where TCollection : INotifyCollectionChanged, IEnumerable { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); - errorHandler.ThrowArgumentNullExceptionIfNull(nameof(errorHandler)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(manySelector); + ArgumentExceptionHelper.ThrowIfNull(errorHandler); return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer, errorHandler).Run(); } @@ -93,9 +93,9 @@ public static IObservable> TransformMa where TSource : notnull where TSourceKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); - errorHandler.ThrowArgumentNullExceptionIfNull(nameof(errorHandler)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(manySelector); + ArgumentExceptionHelper.ThrowIfNull(errorHandler); return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector), equalityComparer, comparer, errorHandler).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs index 7a7b769be..c9258071f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs @@ -61,8 +61,8 @@ public static IObservable> TransformOnObservable< where TKey : notnull where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - transformFactory.ThrowArgumentNullExceptionIfNull(nameof(transformFactory)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(transformFactory); return new TransformOnObservable(source, transformFactory).Run(); } @@ -74,7 +74,7 @@ public static IObservable> TransformOnObservable< where TKey : notnull where TDestination : notnull { - transformFactory.ThrowArgumentNullExceptionIfNull(nameof(transformFactory)); + ArgumentExceptionHelper.ThrowIfNull(transformFactory); return source.TransformOnObservable((obj, _) => transformFactory(obj)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs index 79fa372d2..046f57aef 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs @@ -20,9 +20,9 @@ public static IObservable> TransformSafe transformFactory(current), errorHandler, forceTransform.ForForced()); } @@ -34,9 +34,9 @@ public static IObservable> TransformSafe transformFactory(current, key), errorHandler, forceTransform); } @@ -67,9 +67,9 @@ public static IObservable> TransformSafe(source, transformFactory, forceTransform, errorHandler).Run(); @@ -92,9 +92,9 @@ public static IObservable> TransformSafe transformFactory(cur, key), errorHandler, forceTransform.ForForced()); } @@ -106,9 +106,9 @@ public static IObservable> TransformSafe()); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs index 386cf7a1a..d5f7481ca 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs @@ -21,9 +21,9 @@ public static IObservable> TransformSafeAsync transformFactory(current), errorHandler, forceTransform); } @@ -36,9 +36,9 @@ public static IObservable> TransformSafeAsync transformFactory(current, key), errorHandler, forceTransform); } @@ -63,9 +63,9 @@ public static IObservable> TransformSafeAsync(source, transformFactory, errorHandler, forceTransform).Run(); } @@ -78,9 +78,9 @@ public static IObservable> TransformSafeAsync transformFactory(current), errorHandler, options); } @@ -93,9 +93,9 @@ public static IObservable> TransformSafeAsync transformFactory(current, key), errorHandler, options); } @@ -108,9 +108,9 @@ public static IObservable> TransformSafeAsync(source, transformFactory, errorHandler, null, options.MaximumConcurrency, options.TransformOnRefresh).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs index 9b94be268..48e5ec992 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs @@ -39,8 +39,8 @@ public static IObservable, TKey>> TransformToTree where TObject : class where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pivotOn.ThrowArgumentNullExceptionIfNull(nameof(pivotOn)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(pivotOn); return new TreeBuilder(source, pivotOn, predicateChanged).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs index cf2c48b58..eee143ada 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs @@ -20,9 +20,9 @@ public static IObservable> TransformWithInlineUpd where TSource : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - transformFactory.ThrowArgumentNullExceptionIfNull(nameof(transformFactory)); - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(transformFactory); + ArgumentExceptionHelper.ThrowIfNull(updateAction); return source.TransformWithInlineUpdate(transformFactory, updateAction, false); } @@ -34,9 +34,9 @@ public static IObservable> TransformWithInlineUpd where TSource : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - transformFactory.ThrowArgumentNullExceptionIfNull(nameof(transformFactory)); - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(transformFactory); + ArgumentExceptionHelper.ThrowIfNull(updateAction); return new TransformWithInlineUpdate(source, transformFactory, updateAction, transformOnRefresh: transformOnRefresh).Run(); } @@ -48,10 +48,10 @@ public static IObservable> TransformWithInlineUpd where TSource : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - transformFactory.ThrowArgumentNullExceptionIfNull(nameof(transformFactory)); - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); - errorHandler.ThrowArgumentNullExceptionIfNull(nameof(errorHandler)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(transformFactory); + ArgumentExceptionHelper.ThrowIfNull(updateAction); + ArgumentExceptionHelper.ThrowIfNull(errorHandler); return source.TransformWithInlineUpdate(transformFactory, updateAction, errorHandler, false); } @@ -89,10 +89,10 @@ public static IObservable> TransformWithInlineUpd where TSource : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - transformFactory.ThrowArgumentNullExceptionIfNull(nameof(transformFactory)); - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); - errorHandler.ThrowArgumentNullExceptionIfNull(nameof(errorHandler)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(transformFactory); + ArgumentExceptionHelper.ThrowIfNull(updateAction); + ArgumentExceptionHelper.ThrowIfNull(errorHandler); return new TransformWithInlineUpdate(source, transformFactory, updateAction, errorHandler, transformOnRefresh).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs index 3feeed90c..96c8b2427 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs @@ -22,7 +22,7 @@ public static IObservable> TreatMovesAsRemoveAdd where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); static IEnumerable> ReplaceMoves(IChangeSet items) { diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs index 2b3cefbf9..8cf74b6a6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs @@ -49,9 +49,9 @@ public static IObservable TrueForAny(this IObservab where TKey : notnull where TValue : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); - equalityCondition.ThrowArgumentNullExceptionIfNull(nameof(equalityCondition)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); + ArgumentExceptionHelper.ThrowIfNull(equalityCondition); return source.TrueFor(observableSelector, items => items.Any(o => o.LatestValue.HasValue && equalityCondition(o.LatestValue.Value))); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs index 1d3c9b087..806689cfe 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs @@ -29,8 +29,8 @@ public static IObservable>> So where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - virtualRequests.ThrowArgumentNullExceptionIfNull(nameof(virtualRequests)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(virtualRequests); return source.SortAndVirtualize(comparerChanged, virtualRequests, new SortAndVirtualizeOptions()); } @@ -73,8 +73,8 @@ public static IObservable>> So where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - virtualRequests.ThrowArgumentNullExceptionIfNull(nameof(virtualRequests)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(virtualRequests); return new SortAndVirtualize(source, comparer, virtualRequests, options).Run(); } @@ -117,8 +117,8 @@ public static IObservable>> So where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - virtualRequests.ThrowArgumentNullExceptionIfNull(nameof(virtualRequests)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(virtualRequests); return new SortAndVirtualize(source, comparerChanged, virtualRequests, options).Run(); } @@ -137,8 +137,8 @@ public static IObservable> Virtualise(source, virtualRequests).Run(); } @@ -167,8 +167,8 @@ public static IObservable>> To where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(comparer); if (size <= 0) { @@ -193,7 +193,7 @@ public static IObservable> Top(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); if (size <= 0) { @@ -221,8 +221,8 @@ public static IObservable>> SortA where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pageRequests.ThrowArgumentNullExceptionIfNull(nameof(pageRequests)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(pageRequests); return source.SortAndPage(comparerChanged, pageRequests, new SortAndPageOptions()); } @@ -264,8 +264,8 @@ public static IObservable>> SortA where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pageRequests.ThrowArgumentNullExceptionIfNull(nameof(pageRequests)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(pageRequests); return new SortAndPage(source, comparer, pageRequests, options).Run(); } @@ -307,8 +307,8 @@ public static IObservable>> SortA where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pageRequests.ThrowArgumentNullExceptionIfNull(nameof(pageRequests)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(pageRequests); return new SortAndPage(source, comparerChanged, pageRequests, options).Run(); } @@ -326,8 +326,8 @@ public static IObservable> Page(th where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pageRequests.ThrowArgumentNullExceptionIfNull(nameof(pageRequests)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(pageRequests); return new Page(source, pageRequests).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs index 71136ca2b..704cffd13 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs @@ -34,7 +34,7 @@ public static IObservable> Watch(this IObse where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.SelectMany(updates => updates).Where(update => update.Key.Equals(key)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs index f399ff44c..776499c67 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs @@ -41,7 +41,7 @@ public static IObservable WatchValue(this IObservableCac where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Watch(key).Select(u => u.Current); } @@ -54,7 +54,7 @@ public static IObservable WatchValue(this IObservable u.Current); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs index 2f27a25b4..a2b9d890a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs @@ -46,7 +46,7 @@ public static partial class ObservableCacheEx where TObject : INotifyPropertyChanged where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.MergeMany(t => t.WhenAnyPropertyChanged(propertiesToMonitor)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs index 1ae40457d..db42527b7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs @@ -45,8 +45,8 @@ public static IObservable> WhenPropertyChanged t.WhenPropertyChanged(propertyAccessor, notifyOnInitialValue)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs index 0318f1145..fde2aad8b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs @@ -48,8 +48,8 @@ public static partial class ObservableCacheEx where TObject : INotifyPropertyChanged where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertyAccessor.ThrowArgumentNullExceptionIfNull(nameof(propertyAccessor)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(propertyAccessor); return source.MergeMany(t => t.WhenChanged(propertyAccessor, notifyOnInitialValue)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs index f5de0d3d3..38d80bde9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs @@ -28,8 +28,8 @@ public static IObservable> WhereReasonsAre> WhereReasonsAreNot> Xor(this IOb where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); if (others is null || others.Length == 0) { @@ -62,7 +62,7 @@ public static IObservable> Xor(this ICo where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Xor); } @@ -79,7 +79,7 @@ public static IObservable> Xor(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Xor); } @@ -96,7 +96,7 @@ public static IObservable> Xor(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Xor); } @@ -113,7 +113,7 @@ public static IObservable> Xor(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Combine(CombineOperator.Xor); } diff --git a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs index 7215b6591..dac9063ec 100644 --- a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs @@ -24,7 +24,7 @@ public sealed class ChangeSetAggregator : IDisposable /// The source. public ChangeSetAggregator(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var published = source.Publish(); @@ -107,7 +107,7 @@ public sealed class ChangeSetAggregator : IDisposable /// The source. public ChangeSetAggregator(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs index 348f772ac..e83127735 100644 --- a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs @@ -24,7 +24,7 @@ public class DistinctChangeSetAggregator : IDisposable /// The source. public DistinctChangeSetAggregator(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs index 973b613fb..68e3838fd 100644 --- a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs @@ -27,7 +27,7 @@ public class GroupChangeSetAggregator : IDisposable /// The source. public GroupChangeSetAggregator(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs index 00ece04d9..94cde9eab 100644 --- a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs @@ -26,7 +26,7 @@ public class PagedChangeSetAggregator : IDisposable /// The source. public PagedChangeSetAggregator(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs index a1c856881..72ebb0727 100644 --- a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs @@ -26,7 +26,7 @@ public class SortedChangeSetAggregator : IDisposable /// The source. public SortedChangeSetAggregator(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Cache/Tests/TestEx.cs b/src/DynamicData/Cache/Tests/TestEx.cs index aada3066a..dd495f56d 100644 --- a/src/DynamicData/Cache/Tests/TestEx.cs +++ b/src/DynamicData/Cache/Tests/TestEx.cs @@ -43,7 +43,7 @@ public static ChangeSetAggregator AsAggregator AsAggregator(this IObservable> source) where TValue : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new DistinctChangeSetAggregator(source); } @@ -62,7 +62,7 @@ public static GroupChangeSetAggregator AsAggregator(source); } @@ -79,7 +79,7 @@ public static SortedChangeSetAggregator AsAggregator(source); } @@ -96,7 +96,7 @@ public static VirtualChangeSetAggregator AsAggregator(source); } @@ -112,7 +112,7 @@ public static PagedChangeSetAggregator AsAggregator(source); } diff --git a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs index 74d6028c3..0bcdf82bf 100644 --- a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs @@ -26,7 +26,7 @@ public class VirtualChangeSetAggregator : IDisposable /// The source. public VirtualChangeSetAggregator(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Diagnostics/DiagnosticOperators.cs b/src/DynamicData/Diagnostics/DiagnosticOperators.cs index 452e2f754..19720234d 100644 --- a/src/DynamicData/Diagnostics/DiagnosticOperators.cs +++ b/src/DynamicData/Diagnostics/DiagnosticOperators.cs @@ -21,7 +21,7 @@ public static IObservable CollectUpdateStats(this where TSource : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Scan( ChangeSummary.Empty, @@ -51,7 +51,7 @@ public static IObservable CollectUpdateStats(this public static IObservable CollectUpdateStats(this IObservable> source) where TSource : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Scan( ChangeSummary.Empty, diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index 9cb881a0a..5f4eeff5b 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -62,4 +62,13 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int + + + + + + + + + diff --git a/src/DynamicData/EnumerableEx.cs b/src/DynamicData/EnumerableEx.cs index 1ddcf09f3..298355f0f 100644 --- a/src/DynamicData/EnumerableEx.cs +++ b/src/DynamicData/EnumerableEx.cs @@ -26,8 +26,8 @@ public static IObservable> AsObservableChangeSet>( obs => @@ -56,7 +56,7 @@ public static IObservable> AsObservableChangeSet> AsObservableChangeSet(this IEnumerable source, bool completable = false) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return Observable.Create>( obs => diff --git a/src/DynamicData/Experimental/ExperimentalEx.cs b/src/DynamicData/Experimental/ExperimentalEx.cs index 8794b7265..b78d8a9ce 100644 --- a/src/DynamicData/Experimental/ExperimentalEx.cs +++ b/src/DynamicData/Experimental/ExperimentalEx.cs @@ -22,7 +22,7 @@ public static IWatcher AsWatcher(this IObservable< where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new Watcher(source, scheduler ?? GlobalConfig.DefaultScheduler); } diff --git a/src/DynamicData/GlobalConfig.cs b/src/DynamicData/GlobalConfig.cs index 6a46849fa..7aa192f97 100644 --- a/src/DynamicData/GlobalConfig.cs +++ b/src/DynamicData/GlobalConfig.cs @@ -6,5 +6,5 @@ namespace DynamicData; internal static class GlobalConfig { - public static IScheduler DefaultScheduler => TaskPoolSequencer.Default; + public static IScheduler DefaultScheduler => TaskPoolScheduler.Default; } diff --git a/src/DynamicData/Internal/CacheParentSubscription.cs b/src/DynamicData/Internal/CacheParentSubscription.cs index 76b4451ce..4a3371ee3 100644 --- a/src/DynamicData/Internal/CacheParentSubscription.cs +++ b/src/DynamicData/Internal/CacheParentSubscription.cs @@ -23,7 +23,7 @@ internal abstract class CacheParentSubscription _childSubscriptions = new(); - private readonly OnceDisposable _parentSubscription = new(); + private readonly SingleAssignmentDisposable _parentSubscription = new(); private readonly SharedDeliveryQueue _queue; private readonly IObserver _observer; private int _subscriptionCounter = 1; // Starts at 1 for the parent subscription @@ -60,7 +60,7 @@ protected void AddChildSubscription(IObservable observable, TKey parentK Interlocked.Increment(ref _subscriptionCounter); // Create a container for the Disposable and add to the KeyedDisposable - var disposableContainer = _childSubscriptions.Add(parentKey, new OnceDisposable()); + var disposableContainer = _childSubscriptions.Add(parentKey, new SingleAssignmentDisposable()); // Create the subscription // Will Dispose immediately if OnCompleted fires upon subscription because OnCompleted disposes the container diff --git a/src/DynamicData/Internal/ExceptionMixins.cs b/src/DynamicData/Internal/ExceptionMixins.cs deleted file mode 100644 index 7baad015f..000000000 --- a/src/DynamicData/Internal/ExceptionMixins.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -namespace DynamicData -{ - internal static class ExceptionMixins - { - public static void ThrowArgumentNullExceptionIfNull(this T? value, string name) - { - if (value is null) - { - throw new ArgumentNullException(name); - } - } - } -} diff --git a/src/DynamicData/Internal/Notification.cs b/src/DynamicData/Internal/Notification.cs index 192f48833..edddf158b 100644 --- a/src/DynamicData/Internal/Notification.cs +++ b/src/DynamicData/Internal/Notification.cs @@ -28,7 +28,7 @@ private Notification(Optional value, Exception? error) /// Creates an OnError notification (terminal). public static Notification CreateError(Exception error) { - error.ThrowArgumentNullExceptionIfNull(nameof(error)); + ArgumentExceptionHelper.ThrowIfNull(error); return new(Optional.None, error); } diff --git a/src/DynamicData/Kernel/EnumerableEx.cs b/src/DynamicData/Kernel/EnumerableEx.cs index afeca3d3e..05a051cce 100644 --- a/src/DynamicData/Kernel/EnumerableEx.cs +++ b/src/DynamicData/Kernel/EnumerableEx.cs @@ -17,7 +17,7 @@ public static class EnumerableEx /// The array of items. public static T[] AsArray(this IEnumerable source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source as T[] ?? source.ToArray(); } @@ -30,7 +30,7 @@ public static T[] AsArray(this IEnumerable source) /// The list. public static List AsList(this IEnumerable source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source as List ?? source.ToList(); } @@ -45,8 +45,8 @@ public static List AsList(this IEnumerable source) /// The enumerable of items. public static IEnumerable Duplicates(this IEnumerable source, Func valueSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.GroupBy(valueSelector).Where(group => group.Count() > 1).SelectMany(t => t); } @@ -73,9 +73,9 @@ public static IEnumerable Duplicates(this IEnumerable source, F /// A result as specified by the result selector. public static IEnumerable IndexOfMany(this IEnumerable source, IEnumerable itemsToFind, Func resultSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - itemsToFind.ThrowArgumentNullExceptionIfNull(nameof(itemsToFind)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(itemsToFind); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); var indexed = source.Select((element, index) => new { Element = element, Index = index }); return itemsToFind.Join(indexed, left => left, right => right.Element, (_, right) => right).Select(x => resultSelector(x.Element, x.Index)); diff --git a/src/DynamicData/Kernel/InternalEx.cs b/src/DynamicData/Kernel/InternalEx.cs index c395f08b2..0797834a9 100644 --- a/src/DynamicData/Kernel/InternalEx.cs +++ b/src/DynamicData/Kernel/InternalEx.cs @@ -26,8 +26,8 @@ public static class InternalEx public static IObservable RetryWithBackOff(this IObservable source, Func backOffStrategy) where TException : Exception { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - backOffStrategy.ThrowArgumentNullExceptionIfNull(nameof(backOffStrategy)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(backOffStrategy); IObservable Retry(int failureCount) => source.Catch( @@ -39,7 +39,7 @@ IObservable Retry(int failureCount) => return Observable.Throw(error); } - return Signal.After(delay.Value).SelectMany(Retry(failureCount + 1)); + return Observable.Timer(delay.Value).SelectMany(Retry(failureCount + 1)); }); return Retry(0); @@ -58,8 +58,8 @@ IObservable Retry(int failureCount) => /// A disposable that will stop the schedule. public static IDisposable ScheduleRecurringAction(this IScheduler scheduler, TimeSpan interval, Action action) { - scheduler.ThrowArgumentNullExceptionIfNull(nameof(scheduler)); - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentExceptionHelper.ThrowIfNull(scheduler); + ArgumentExceptionHelper.ThrowIfNull(action); var disposable = new SerialDisposable(); @@ -90,10 +90,9 @@ void ScheduleNext() => /// A disposable that will stop the schedule. public static IDisposable ScheduleRecurringAction(this IScheduler scheduler, Func interval, Action action) { - interval.ThrowArgumentNullExceptionIfNull(nameof(interval)); - - scheduler.ThrowArgumentNullExceptionIfNull(nameof(scheduler)); - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentExceptionHelper.ThrowIfNull(interval); + ArgumentExceptionHelper.ThrowIfNull(scheduler); + ArgumentExceptionHelper.ThrowIfNull(action); var disposable = new SerialDisposable(); diff --git a/src/DynamicData/Kernel/OptionElse.cs b/src/DynamicData/Kernel/OptionElse.cs index d644e62de..b6dc1952d 100644 --- a/src/DynamicData/Kernel/OptionElse.cs +++ b/src/DynamicData/Kernel/OptionElse.cs @@ -22,7 +22,7 @@ public sealed class OptionElse /// action. public void Else(Action action) { - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentExceptionHelper.ThrowIfNull(action); if (_shouldRunAction) { diff --git a/src/DynamicData/Kernel/OptionExtensions.cs b/src/DynamicData/Kernel/OptionExtensions.cs index 87af9886d..c03937701 100644 --- a/src/DynamicData/Kernel/OptionExtensions.cs +++ b/src/DynamicData/Kernel/OptionExtensions.cs @@ -22,7 +22,7 @@ public static Optional Convert(this in Opti where TSource : notnull where TDestination : notnull { - converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); + ArgumentExceptionHelper.ThrowIfNull(converter); return source.HasValue ? converter(source.Value) : Optional.None; } @@ -40,7 +40,7 @@ public static Optional Convert(this in Opti where TSource : notnull where TDestination : notnull { - converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); + ArgumentExceptionHelper.ThrowIfNull(converter); return source.HasValue ? converter(source.Value) : Optional.None; } @@ -62,8 +62,8 @@ public static Optional Convert(this in Opti public static TDestination? ConvertOr(this in Optional source, Func converter, Func fallbackConverter) where TSource : notnull { - converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); - fallbackConverter.ThrowArgumentNullExceptionIfNull(nameof(fallbackConverter)); + ArgumentExceptionHelper.ThrowIfNull(converter); + ArgumentExceptionHelper.ThrowIfNull(fallbackConverter); return source.HasValue ? converter(source.Value) : fallbackConverter(); } @@ -83,7 +83,7 @@ public static Optional Convert(this in Opti public static Optional OrElse(this in Optional source, Func> fallbackOperation) where T : notnull { - fallbackOperation.ThrowArgumentNullExceptionIfNull(nameof(fallbackOperation)); + ArgumentExceptionHelper.ThrowIfNull(fallbackOperation); return source.HasValue ? source : fallbackOperation(); } @@ -100,8 +100,8 @@ public static Optional OrElse(this in Optional source, Func public static Optional FirstOrOptional(this IEnumerable source, Func selector) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - selector.ThrowArgumentNullExceptionIfNull(nameof(selector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(selector); foreach (var item in source.Where(item => selector(item))) { @@ -126,7 +126,7 @@ public static OptionElse IfHasValue(this in Optional source, Action act return new OptionElse(); } - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentExceptionHelper.ThrowIfNull(action); action(source.Value); return OptionElse.NoAction; @@ -152,7 +152,7 @@ public static OptionElse IfHasValue(this Optional? source, Action actio return new OptionElse(); } - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentExceptionHelper.ThrowIfNull(action); action(source.Value.Value); return OptionElse.NoAction; @@ -171,7 +171,7 @@ public static OptionElse IfHasValue(this Optional? source, Action actio public static Optional Lookup(this IDictionary source, TKey key) where TValue : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var result = source.TryGetValue(key, out var contained); return result ? contained : Optional.None; @@ -187,7 +187,7 @@ public static Optional Lookup(this IDictionaryIf the item was removed. public static bool RemoveIfContained(this IDictionary source, TKey key) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.ContainsKey(key) && source.Remove(key); } @@ -223,7 +223,7 @@ public static T ValueOr(this T? source, T defaultValue) public static T ValueOr(this in Optional source, Func valueSelector) where T : notnull { - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.HasValue ? source.Value : valueSelector(); } @@ -256,7 +256,7 @@ public static T ValueOr(this in Optional source, Func valueSelector) public static T ValueOrThrow(this in Optional source, Func exceptionGenerator) where T : notnull { - exceptionGenerator.ThrowArgumentNullExceptionIfNull(nameof(exceptionGenerator)); + ArgumentExceptionHelper.ThrowIfNull(exceptionGenerator); if (source.HasValue && source.Value is not null) { diff --git a/src/DynamicData/Kernel/OptionObservableExtensions.cs b/src/DynamicData/Kernel/OptionObservableExtensions.cs index f221ddb26..10060142b 100644 --- a/src/DynamicData/Kernel/OptionObservableExtensions.cs +++ b/src/DynamicData/Kernel/OptionObservableExtensions.cs @@ -24,8 +24,8 @@ public static IObservable> Convert where TSource : notnull where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(converter); return source.Select(optional => optional.HasValue ? converter(optional.Value) : Optional.None); } @@ -45,8 +45,8 @@ public static IObservable> Convert where TSource : notnull where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(converter); return source.Select(optional => optional.HasValue ? converter(optional.Value) : Optional.None); } @@ -71,9 +71,9 @@ public static IObservable> Convert public static IObservable ConvertOr(this IObservable> source, Func converter, Func fallbackConverter) where TSource : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); - fallbackConverter.ThrowArgumentNullExceptionIfNull(nameof(fallbackConverter)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(converter); + ArgumentExceptionHelper.ThrowIfNull(fallbackConverter); return source.Select(optional => optional.HasValue ? converter(optional.Value) : fallbackConverter()); } @@ -94,8 +94,8 @@ public static IObservable> Convert public static IObservable> OrElse(this IObservable> source, Func> fallbackOperation) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - fallbackOperation.ThrowArgumentNullExceptionIfNull(nameof(fallbackOperation)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(fallbackOperation); return source.Select(optional => optional.HasValue ? optional : fallbackOperation()); } @@ -112,8 +112,8 @@ public static IObservable> OrElse(this IObservable> s public static IObservable> OnHasValue(this IObservable> source, Action action, Action? elseAction = null) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(action); return source.Do(optional => optional.IfHasValue(action).Else(() => elseAction?.Invoke())); } @@ -129,8 +129,8 @@ public static IObservable> OnHasValue(this IObservable> OnHasNoValue(this IObservable> source, Action action, Action? elseAction = null) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(action); return source.Do(optional => optional.IfHasValue(val => elseAction?.Invoke(val)).Else(action)); } @@ -146,7 +146,7 @@ public static IObservable> OnHasNoValue(this IObservable SelectValues(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Where(t => t.HasValue && t.Value is not null).Select(t => t.Value!); } @@ -164,8 +164,8 @@ public static IObservable SelectValues(this IObservable> sourc public static IObservable ValueOr(this IObservable> source, Func valueSelector) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return source.Select(optional => optional.HasValue ? optional.Value : valueSelector()); } @@ -180,7 +180,7 @@ public static IObservable ValueOr(this IObservable> source, Fu public static IObservable ValueOrDefault(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Select(optional => optional.ValueOrDefault()); } @@ -198,9 +198,8 @@ public static IObservable ValueOr(this IObservable> source, Fu public static IObservable ValueOrThrow(this IObservable> source, Func exceptionGenerator) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - - exceptionGenerator.ThrowArgumentNullExceptionIfNull(nameof(exceptionGenerator)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(exceptionGenerator); return Observable.Create(observer => source.Subscribe( diff --git a/src/DynamicData/Kernel/ParallelEx.cs b/src/DynamicData/Kernel/ParallelEx.cs index c5b1ff14d..1e23ed706 100644 --- a/src/DynamicData/Kernel/ParallelEx.cs +++ b/src/DynamicData/Kernel/ParallelEx.cs @@ -8,8 +8,8 @@ internal static class ParallelEx { public static async Task> SelectParallel(this IEnumerable source, Func> selector, int maximumThreads = 5) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - selector.ThrowArgumentNullExceptionIfNull(nameof(selector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(selector); var semaphore = new SemaphoreSlim(maximumThreads); var tasks = new List>(); diff --git a/src/DynamicData/List/ChangeAwareList.cs b/src/DynamicData/List/ChangeAwareList.cs index f96cc8a70..9e0f02d20 100644 --- a/src/DynamicData/List/ChangeAwareList.cs +++ b/src/DynamicData/List/ChangeAwareList.cs @@ -31,7 +31,7 @@ public ChangeAwareList(int capacity = -1) => /// The items to seed the change aware list with. public ChangeAwareList(IEnumerable items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(items); var list = items.ToList(); @@ -51,7 +51,7 @@ public ChangeAwareList(IEnumerable items) /// Should the list of changes also be copied over?. public ChangeAwareList(ChangeAwareList list, bool copyChanges) { - list.ThrowArgumentNullExceptionIfNull(nameof(list)); + ArgumentExceptionHelper.ThrowIfNull(list); _innerList = new List(list._innerList); diff --git a/src/DynamicData/List/ChangeSetEx.cs b/src/DynamicData/List/ChangeSetEx.cs index 7abe7c5fa..17fa61a4b 100644 --- a/src/DynamicData/List/ChangeSetEx.cs +++ b/src/DynamicData/List/ChangeSetEx.cs @@ -23,7 +23,7 @@ public static class ChangeSetEx public static IEnumerable> Flatten(this IChangeSet source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new ItemChangeEnumerator(source); } @@ -57,8 +57,8 @@ public static IChangeSet Transform(this ICh where TSource : notnull where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - transformer.ThrowArgumentNullExceptionIfNull(nameof(transformer)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(transformer); var changes = source.Select( change => @@ -83,7 +83,7 @@ public static IChangeSet Transform(this ICh public static IEnumerable> YieldWithoutIndex(this IEnumerable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new WithoutIndexEnumerator(source); } @@ -98,7 +98,7 @@ public static IEnumerable> YieldWithoutIndex(this IEnumerable> Unified(this IChangeSet source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new UnifiedChangeEnumerator(source); } diff --git a/src/DynamicData/List/Internal/AnonymousObservableList.cs b/src/DynamicData/List/Internal/AnonymousObservableList.cs index 86e4957b1..f53d44a01 100644 --- a/src/DynamicData/List/Internal/AnonymousObservableList.cs +++ b/src/DynamicData/List/Internal/AnonymousObservableList.cs @@ -16,7 +16,7 @@ internal sealed class AnonymousObservableList : IObservableList public AnonymousObservableList(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); _sourceList = new SourceList(source); _cleanUp = _sourceList; diff --git a/src/DynamicData/List/Internal/ExpireAfter.cs b/src/DynamicData/List/Internal/ExpireAfter.cs index 4d69f0e8b..23a68f654 100644 --- a/src/DynamicData/List/Internal/ExpireAfter.cs +++ b/src/DynamicData/List/Internal/ExpireAfter.cs @@ -13,8 +13,8 @@ public static IObservable> Create( TimeSpan? pollingInterval = null, IScheduler? scheduler = null) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - timeSelector.ThrowArgumentNullExceptionIfNull(nameof(timeSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(timeSelector); return Observable.Create>(observer => (pollingInterval is { } pollingIntervalValue) ? new PollingSubscription( diff --git a/src/DynamicData/List/Internal/Filter.Static.cs b/src/DynamicData/List/Internal/Filter.Static.cs index dfa23fe54..141e63521 100644 --- a/src/DynamicData/List/Internal/Filter.Static.cs +++ b/src/DynamicData/List/Internal/Filter.Static.cs @@ -14,8 +14,8 @@ public static IObservable> Create( Func predicate, bool suppressEmptyChangesets) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(predicate); return Observable.Create>(downstreamObserver => { diff --git a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs index 5d52a9602..0943e1fc3 100644 --- a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs +++ b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs @@ -16,9 +16,9 @@ public static IObservable> Create( ListFilterPolicy filterPolicy = ListFilterPolicy.CalculateDiff, bool suppressEmptyChangeSets = true) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - predicateState.ThrowArgumentNullExceptionIfNull(nameof(predicateState)); - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(predicateState); + ArgumentExceptionHelper.ThrowIfNull(predicate); if (!EnumEx.IsDefined(filterPolicy)) throw new ArgumentException($"Invalid {nameof(ListFilterPolicy)} value {filterPolicy}"); diff --git a/src/DynamicData/List/Internal/FilterOnObservable.cs b/src/DynamicData/List/Internal/FilterOnObservable.cs index 8fd8317d3..97214910c 100644 --- a/src/DynamicData/List/Internal/FilterOnObservable.cs +++ b/src/DynamicData/List/Internal/FilterOnObservable.cs @@ -45,9 +45,9 @@ public IObservable> Run() => Observable.Create IndexOfMany(IEnumerable source, IEnumerable itemsToFind, Func objectPropertyFunc, Func resultSelector) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - itemsToFind.ThrowArgumentNullExceptionIfNull(nameof(itemsToFind)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(itemsToFind); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); var indexed = source.Select((element, index) => new { Element = element, Index = index }); return itemsToFind.Join(indexed, objectPropertyFunc, right => objectPropertyFunc(right.Element), (left, right) => resultSelector(left, right.Index)); diff --git a/src/DynamicData/List/Internal/FilterStatic.cs b/src/DynamicData/List/Internal/FilterStatic.cs index a55eaf67f..bd69d9e00 100644 --- a/src/DynamicData/List/Internal/FilterStatic.cs +++ b/src/DynamicData/List/Internal/FilterStatic.cs @@ -11,7 +11,7 @@ internal sealed class FilterStatic(IObservable> source, Func> _source = source ?? throw new ArgumentNullException(nameof(source)); - public IObservable> Run() => Signal.Lazy(() => _source.Scan( + public IObservable> Run() => Observable.Defer(() => _source.Scan( new ChangeAwareList(), (state, changes) => { diff --git a/src/DynamicData/List/Internal/MergeMany.cs b/src/DynamicData/List/Internal/MergeMany.cs index 164fe52d8..647a324cb 100644 --- a/src/DynamicData/List/Internal/MergeMany.cs +++ b/src/DynamicData/List/Internal/MergeMany.cs @@ -46,7 +46,7 @@ private sealed class SubscriptionCounter : IDisposable private readonly Signal> _subject = new(); private int _subscriptionCount = 1; - public IObservable> DeferCleanup => Signal.Lazy(() => + public IObservable> DeferCleanup => Observable.Defer(() => { CheckCompleted(); return _subject.AsObservable(); diff --git a/src/DynamicData/List/Internal/OnItemAdded.cs b/src/DynamicData/List/Internal/OnItemAdded.cs index 1c9244786..34228f6e4 100644 --- a/src/DynamicData/List/Internal/OnItemAdded.cs +++ b/src/DynamicData/List/Internal/OnItemAdded.cs @@ -11,8 +11,8 @@ public static IObservable> Create( IObservable> source, Action addAction) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - addAction.ThrowArgumentNullExceptionIfNull(nameof(addAction)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(addAction); return source.Do(changeSet => { diff --git a/src/DynamicData/List/Internal/OnItemRefreshed.cs b/src/DynamicData/List/Internal/OnItemRefreshed.cs index 5b7b1d795..c159788e2 100644 --- a/src/DynamicData/List/Internal/OnItemRefreshed.cs +++ b/src/DynamicData/List/Internal/OnItemRefreshed.cs @@ -11,8 +11,8 @@ public static IObservable> Create( IObservable> source, Action refreshAction) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - refreshAction.ThrowArgumentNullExceptionIfNull(nameof(refreshAction)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(refreshAction); return source.Do(changeSet => { diff --git a/src/DynamicData/List/Internal/OnItemRemoved.cs b/src/DynamicData/List/Internal/OnItemRemoved.cs index f87fa0bbf..5b04bb125 100644 --- a/src/DynamicData/List/Internal/OnItemRemoved.cs +++ b/src/DynamicData/List/Internal/OnItemRemoved.cs @@ -12,8 +12,8 @@ public static IObservable> Create( Action removeAction, bool invokeOnUnsubscribe) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - removeAction.ThrowArgumentNullExceptionIfNull(nameof(removeAction)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(removeAction); var removalProcessor = source.Do(changeSet => { diff --git a/src/DynamicData/List/Internal/ReaderWriter.cs b/src/DynamicData/List/Internal/ReaderWriter.cs index fb02b6253..7241e58e5 100644 --- a/src/DynamicData/List/Internal/ReaderWriter.cs +++ b/src/DynamicData/List/Internal/ReaderWriter.cs @@ -39,7 +39,7 @@ public T[] Items public IChangeSet Write(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(changes); IChangeSet result; @@ -54,7 +54,7 @@ public IChangeSet Write(IChangeSet changes) public IChangeSet Write(Action> updateAction) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentExceptionHelper.ThrowIfNull(updateAction); IChangeSet result; @@ -78,7 +78,7 @@ public IChangeSet Write(Action> updateAction) /// The action to perform on the list. public void WriteNested(Action> updateAction) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentExceptionHelper.ThrowIfNull(updateAction); lock (_locker) { @@ -93,8 +93,8 @@ public void WriteNested(Action> updateAction) public IChangeSet WriteWithPreview(Action> updateAction, Action> previewHandler) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); - previewHandler.ThrowArgumentNullExceptionIfNull(nameof(previewHandler)); + ArgumentExceptionHelper.ThrowIfNull(updateAction); + ArgumentExceptionHelper.ThrowIfNull(previewHandler); IChangeSet result; diff --git a/src/DynamicData/List/Internal/ReferenceCountTracker.cs b/src/DynamicData/List/Internal/ReferenceCountTracker.cs index 6959b83eb..142cb83c1 100644 --- a/src/DynamicData/List/Internal/ReferenceCountTracker.cs +++ b/src/DynamicData/List/Internal/ReferenceCountTracker.cs @@ -24,7 +24,7 @@ internal sealed class ReferenceCountTracker /// The item to add. public bool Add(T item) { - item.ThrowArgumentNullExceptionIfNull(nameof(item)); + ArgumentExceptionHelper.ThrowIfNull(item); if (!ReferenceCounts.TryGetValue(item, out var currentCount)) { @@ -46,7 +46,7 @@ public bool Add(T item) /// The item to remove. public bool Remove(T item) { - item.ThrowArgumentNullExceptionIfNull(nameof(item)); + ArgumentExceptionHelper.ThrowIfNull(item); var currentCount = ReferenceCounts[item]; diff --git a/src/DynamicData/List/Internal/ToObservableChangeSet.cs b/src/DynamicData/List/Internal/ToObservableChangeSet.cs index c335b2393..3d9bb39b1 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -13,7 +13,7 @@ public static IObservable> Create( int limitSizeTo, IScheduler? scheduler) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return Observable.Create>(downstreamObserver => { @@ -39,7 +39,7 @@ public static IObservable> Create( int limitSizeTo, IScheduler? scheduler) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return Observable.Create>(downstreamObserver => new Subscription( downstreamObserver: downstreamObserver, @@ -338,7 +338,7 @@ private void TryPublishDownstreamChanges() private readonly struct ScheduledExpiration { - public required OnceDisposable Cancellation { get; init; } + public required SingleAssignmentDisposable Cancellation { get; init; } public required Expiration Expiration { get; init; } } diff --git a/src/DynamicData/List/Internal/TransformAsync.cs b/src/DynamicData/List/Internal/TransformAsync.cs index 7703dfb60..f13292c3b 100644 --- a/src/DynamicData/List/Internal/TransformAsync.cs +++ b/src/DynamicData/List/Internal/TransformAsync.cs @@ -18,7 +18,7 @@ public TransformAsync( Func, int, Task> factory, bool transformOnRefresh) { - factory.ThrowArgumentNullExceptionIfNull(nameof(factory)); + ArgumentExceptionHelper.ThrowIfNull(factory); _source = source ?? throw new ArgumentNullException(nameof(source)); _transformOnRefresh = transformOnRefresh; @@ -29,7 +29,7 @@ public TransformAsync( }; } - public IObservable> Run() => Signal.Lazy(RunImpl); + public IObservable> Run() => Observable.Defer(RunImpl); private IObservable> RunImpl() { @@ -61,7 +61,7 @@ private async Task Transform( ChangeAwareList.TransformedItemContainer> transformed, IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(changes); foreach (var item in changes) { diff --git a/src/DynamicData/List/Internal/TransformMany.cs b/src/DynamicData/List/Internal/TransformMany.cs index 406b389ba..0e4a44118 100644 --- a/src/DynamicData/List/Internal/TransformMany.cs +++ b/src/DynamicData/List/Internal/TransformMany.cs @@ -18,7 +18,7 @@ public TransformMany(IObservable> source, Func Signal.Lazy( + t => Observable.Defer( () => { var subsequentChanges = manySelector(t).ToObservableChangeSet(); @@ -38,7 +38,7 @@ public TransformMany(IObservable> source, Func Signal.Lazy( + t => Observable.Defer( () => { var subsequentChanges = manySelector(t).ToObservableChangeSet(); @@ -58,7 +58,7 @@ public TransformMany(IObservable> source, Func new ManySelectorFunc(s, x => manySelector(x).Items), equalityComparer, - t => Signal.Lazy( + t => Observable.Defer( () => { var subsequentChanges = manySelector(t).Connect(); diff --git a/src/DynamicData/List/Internal/Transformer.cs b/src/DynamicData/List/Internal/Transformer.cs index 8262c9598..d4307f11b 100644 --- a/src/DynamicData/List/Internal/Transformer.cs +++ b/src/DynamicData/List/Internal/Transformer.cs @@ -16,14 +16,15 @@ internal sealed class Transformer public Transformer(IObservable> source, Func, int, TDestination> factory, bool transformOnRefresh) { - factory.ThrowArgumentNullExceptionIfNull(nameof(factory)); + ArgumentExceptionHelper.ThrowIfNull(factory); + ArgumentExceptionHelper.ThrowIfNull(source); - _source = source ?? throw new ArgumentNullException(nameof(source)); + _source = source; _transformOnRefresh = transformOnRefresh; _containerFactory = (item, prev, index) => new TransformedItemContainer(item, factory(item, prev, index)); } - public IObservable> Run() => Signal.Lazy(RunImpl); + public IObservable> Run() => Observable.Defer(RunImpl); private IObservable> RunImpl() => _source.Scan(new ChangeAwareList(), (state, changes) => { @@ -38,7 +39,7 @@ private IObservable> RunImpl() => _source.Scan(new Chan private void Transform(ChangeAwareList transformed, IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(changes); foreach (var item in changes) { diff --git a/src/DynamicData/List/ListEx.cs b/src/DynamicData/List/ListEx.cs index 0c935a6e8..ab2dacb19 100644 --- a/src/DynamicData/List/ListEx.cs +++ b/src/DynamicData/List/ListEx.cs @@ -23,8 +23,8 @@ public static class ListEx /// public static void Add(this IList source, IEnumerable items) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); items.ForEach(source.Add); } @@ -38,8 +38,8 @@ public static void Add(this IList source, IEnumerable items) /// The index. public static void AddOrInsertRange(this IList source, IEnumerable items, int index) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); switch (source) { @@ -85,8 +85,8 @@ public static void AddOrInsertRange(this IList source, IEnumerable item /// public static void AddRange(this IList source, IEnumerable items) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); switch (source) { @@ -112,8 +112,8 @@ public static void AddRange(this IList source, IEnumerable items) /// The index. public static void AddRange(this IList source, IEnumerable items, int index) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); switch (source) { @@ -148,7 +148,7 @@ public static void AddRange(this IList source, IEnumerable items, int i /// The index of the specified value in the specified array, if value is found; otherwise, a negative number. public static int BinarySearch(this IList list, TItem value, IComparer comparer) { - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentExceptionHelper.ThrowIfNull(comparer); return list.BinarySearch(value, comparer.Compare); } @@ -165,8 +165,8 @@ public static int BinarySearch(this IList list, TItem value, IComp /// The index of the specified value in the specified array, if value is found; otherwise, a negative number. public static int BinarySearch(this IList list, TSearch value, Func comparer) { - list.ThrowArgumentNullExceptionIfNull(nameof(list)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentExceptionHelper.ThrowIfNull(list); + ArgumentExceptionHelper.ThrowIfNull(comparer); var lower = 0; var upper = list.Count - 1; @@ -236,8 +236,8 @@ public static void Clone(this IList source, IChangeSet changes, IEquali public static void Clone(this IList source, IEnumerable> changes, IEqualityComparer? equalityComparer) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(changes); foreach (var item in changes) { @@ -264,8 +264,8 @@ public static void Clone(this IList source, IEnumerable> changes /// The index. public static int IndexOf(this IEnumerable source, T item, IEqualityComparer equalityComparer) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - equalityComparer.ThrowArgumentNullExceptionIfNull(nameof(equalityComparer)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(equalityComparer); var i = 0; foreach (var candidate in source) @@ -309,8 +309,8 @@ public static Optional> IndexOfOptional(this IEnumerable /// public static void Remove(this IList source, IEnumerable items) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); items.ForEach(t => source.Remove(t)); } @@ -328,8 +328,8 @@ public static void RemoveMany(this IList source, IEnumerable itemsToRem across the source collection IndexOf lookups can result in very slow updates (especially for subsequent operators) */ - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - itemsToRemove.ThrowArgumentNullExceptionIfNull(nameof(itemsToRemove)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(itemsToRemove); var toRemoveArray = itemsToRemove.AsArray(); @@ -365,9 +365,9 @@ across the source collection IndexOf lookups can result in very slow updates /// items. public static void Replace(this IList source, T original, T replaceWith) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - original.ThrowArgumentNullExceptionIfNull(nameof(original)); - replaceWith.ThrowArgumentNullExceptionIfNull(nameof(replaceWith)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(original); + ArgumentExceptionHelper.ThrowIfNull(replaceWith); var index = source.IndexOf(original); if (index == -1) @@ -391,10 +391,10 @@ public static void Replace(this IList source, T original, T replaceWith) /// items. public static void Replace(this IList source, T original, T replaceWith, IEqualityComparer comparer) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - original.ThrowArgumentNullExceptionIfNull(nameof(original)); - replaceWith.ThrowArgumentNullExceptionIfNull(nameof(replaceWith)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(original); + ArgumentExceptionHelper.ThrowIfNull(replaceWith); + ArgumentExceptionHelper.ThrowIfNull(comparer); var index = source.IndexOf(original); if (index == -1) @@ -417,9 +417,9 @@ public static void Replace(this IList source, T original, T replaceWith, I /// The value to replace with. public static void ReplaceOrAdd(this IList source, T original, T replaceWith) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - original.ThrowArgumentNullExceptionIfNull(nameof(original)); - replaceWith.ThrowArgumentNullExceptionIfNull(nameof(replaceWith)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(original); + ArgumentExceptionHelper.ThrowIfNull(replaceWith); var index = source.IndexOf(original); if (index == -1) @@ -625,7 +625,7 @@ private static void Clone(this IList source, Change item, IEqualityComp /// Cannot remove range. private static void RemoveRange(this IList source, int index, int count) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); switch (source) { diff --git a/src/DynamicData/List/ObservableListEx.Adapt.cs b/src/DynamicData/List/ObservableListEx.Adapt.cs index 0980d532f..0fb2ec2bb 100644 --- a/src/DynamicData/List/ObservableListEx.Adapt.cs +++ b/src/DynamicData/List/ObservableListEx.Adapt.cs @@ -31,8 +31,8 @@ public static partial class ObservableListEx public static IObservable> Adapt(this IObservable> source, IChangeSetAdaptor adaptor) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - adaptor.ThrowArgumentNullExceptionIfNull(nameof(adaptor)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(adaptor); return Observable.Create>( observer => diff --git a/src/DynamicData/List/ObservableListEx.AddKey.cs b/src/DynamicData/List/ObservableListEx.AddKey.cs index eb1f2c34e..4f4ac4c1c 100644 --- a/src/DynamicData/List/ObservableListEx.AddKey.cs +++ b/src/DynamicData/List/ObservableListEx.AddKey.cs @@ -32,8 +32,8 @@ public static IObservable> AddKey(this where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return source.Select(changes => new ChangeSet(new AddKeyEnumerator(changes, keySelector))); } diff --git a/src/DynamicData/List/ObservableListEx.And.cs b/src/DynamicData/List/ObservableListEx.And.cs index 6ecb98a37..1ce7e2c3b 100644 --- a/src/DynamicData/List/ObservableListEx.And.cs +++ b/src/DynamicData/List/ObservableListEx.And.cs @@ -43,7 +43,7 @@ public static partial class ObservableListEx public static IObservable> And(this IObservable> source, params IObservable>[] others) where T : notnull { - others.ThrowArgumentNullExceptionIfNull(nameof(others)); + ArgumentExceptionHelper.ThrowIfNull(others); return source.Combine(CombineOperator.And, others); } diff --git a/src/DynamicData/List/ObservableListEx.AsObservableList.cs b/src/DynamicData/List/ObservableListEx.AsObservableList.cs index eb34f4945..487ef5b9d 100644 --- a/src/DynamicData/List/ObservableListEx.AsObservableList.cs +++ b/src/DynamicData/List/ObservableListEx.AsObservableList.cs @@ -22,7 +22,7 @@ public static partial class ObservableListEx public static IObservableList AsObservableList(this ISourceList source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new AnonymousObservableList(source); } @@ -46,7 +46,7 @@ public static IObservableList AsObservableList(this ISourceList source) public static IObservableList AsObservableList(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new AnonymousObservableList(source); } diff --git a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs index f698f12d7..382e9401a 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs @@ -47,7 +47,7 @@ public static partial class ObservableListEx public static IObservable> AutoRefresh(this IObservable> source, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.AutoRefreshOnObservable( t => @@ -72,8 +72,8 @@ public static IObservable> AutoRefresh(this IObserv public static IObservable> AutoRefresh(this IObservable> source, Expression> propertyAccessor, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertyAccessor.ThrowArgumentNullExceptionIfNull(nameof(propertyAccessor)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(propertyAccessor); return source.AutoRefreshOnObservable( t => diff --git a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs index 60e17e805..5866dde64 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs @@ -44,8 +44,8 @@ public static partial class ObservableListEx public static IObservable> AutoRefreshOnObservable(this IObservable> source, Func> reevaluator, TimeSpan? changeSetBuffer = null, IScheduler? scheduler = null) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - reevaluator.ThrowArgumentNullExceptionIfNull(nameof(reevaluator)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(reevaluator); return new AutoRefresh(source, reevaluator, changeSetBuffer, scheduler).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.Bind.cs b/src/DynamicData/List/ObservableListEx.Bind.cs index f5b69b9fe..c5424148c 100644 --- a/src/DynamicData/List/ObservableListEx.Bind.cs +++ b/src/DynamicData/List/ObservableListEx.Bind.cs @@ -46,8 +46,8 @@ public static partial class ObservableListEx public static IObservable> Bind(this IObservable> source, IObservableCollection targetCollection, int resetThreshold = BindingOptions.DefaultResetThreshold) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - targetCollection.ThrowArgumentNullExceptionIfNull(nameof(targetCollection)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(targetCollection); // if user has not specified different defaults, use system wide defaults instead. // This is a hack to retro fit system wide defaults which override the hard coded defaults above @@ -67,8 +67,8 @@ public static IObservable> Bind(this IObservable> public static IObservable> Bind(this IObservable> source, IObservableCollection targetCollection, BindingOptions options) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - targetCollection.ThrowArgumentNullExceptionIfNull(nameof(targetCollection)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(targetCollection); var adaptor = new ObservableCollectionAdaptor(targetCollection, options); return source.Adapt(adaptor); @@ -87,7 +87,7 @@ public static IObservable> Bind(this IObservable> public static IObservable> Bind(this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = BindingOptions.DefaultResetThreshold) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); // if user has not specified different defaults, use system wide defaults instead. // This is a hack to retro fit system wide defaults which override the hard coded defaults above @@ -112,7 +112,7 @@ public static IObservable> Bind(this IObservable> public static IObservable> Bind(this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, BindingOptions options) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var target = new ObservableCollectionExtended(); var result = new ReadOnlyObservableCollection(target); @@ -129,8 +129,8 @@ public static IObservable> Bind(this IObservable> public static IObservable> Bind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IObservable> source, BindingList bindingList, int resetThreshold = BindingOptions.DefaultResetThreshold) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - bindingList.ThrowArgumentNullExceptionIfNull(nameof(bindingList)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(bindingList); return source.Adapt(new BindingListAdaptor(bindingList, resetThreshold)); } diff --git a/src/DynamicData/List/ObservableListEx.BufferIf.cs b/src/DynamicData/List/ObservableListEx.BufferIf.cs index 0a0da052c..2cea59346 100644 --- a/src/DynamicData/List/ObservableListEx.BufferIf.cs +++ b/src/DynamicData/List/ObservableListEx.BufferIf.cs @@ -28,8 +28,8 @@ public static IObservable> BufferIf(this IObservable> BufferIf(this IObservable> source, IObservable pauseIfTrueSelector, bool initialPauseState, IScheduler? scheduler = null) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pauseIfTrueSelector.ThrowArgumentNullExceptionIfNull(nameof(pauseIfTrueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(pauseIfTrueSelector); return BufferIf(source, pauseIfTrueSelector, initialPauseState, null, scheduler); } @@ -73,8 +73,8 @@ public static IObservable> BufferIf(this IObservable> BufferIf(this IObservable> source, IObservable pauseIfTrueSelector, bool initialPauseState, TimeSpan? timeOut, IScheduler? scheduler = null) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pauseIfTrueSelector.ThrowArgumentNullExceptionIfNull(nameof(pauseIfTrueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(pauseIfTrueSelector); return new BufferIf(source, pauseIfTrueSelector, initialPauseState, timeOut, scheduler).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.Cast.cs b/src/DynamicData/List/ObservableListEx.Cast.cs index a9ec135db..e2a3ba0ca 100644 --- a/src/DynamicData/List/ObservableListEx.Cast.cs +++ b/src/DynamicData/List/ObservableListEx.Cast.cs @@ -22,7 +22,7 @@ public static partial class ObservableListEx public static IObservable> Cast(this IObservable> source) where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Select(changes => changes.Transform(t => (TDestination)t)); } @@ -43,9 +43,8 @@ public static IObservable> Cast( where TSource : notnull where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - - conversionFactory.ThrowArgumentNullExceptionIfNull(nameof(conversionFactory)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(conversionFactory); return source.Select(changes => changes.Transform(conversionFactory)); } diff --git a/src/DynamicData/List/ObservableListEx.CastToObject.cs b/src/DynamicData/List/ObservableListEx.CastToObject.cs index 374845a09..e31851138 100644 --- a/src/DynamicData/List/ObservableListEx.CastToObject.cs +++ b/src/DynamicData/List/ObservableListEx.CastToObject.cs @@ -20,7 +20,7 @@ public static partial class ObservableListEx public static IObservable> CastToObject(this IObservable> source) where T : class { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Select(changes => changes.Transform(t => (object)t)); } } diff --git a/src/DynamicData/List/ObservableListEx.Clone.cs b/src/DynamicData/List/ObservableListEx.Clone.cs index 2c00a2379..8300cf314 100644 --- a/src/DynamicData/List/ObservableListEx.Clone.cs +++ b/src/DynamicData/List/ObservableListEx.Clone.cs @@ -28,7 +28,7 @@ public static partial class ObservableListEx public static IObservable> Clone(this IObservable> source, IList target) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Do(target.Clone); } diff --git a/src/DynamicData/List/ObservableListEx.Combine.cs b/src/DynamicData/List/ObservableListEx.Combine.cs index dfc97525f..6068ae2d0 100644 --- a/src/DynamicData/List/ObservableListEx.Combine.cs +++ b/src/DynamicData/List/ObservableListEx.Combine.cs @@ -16,7 +16,7 @@ public static partial class ObservableListEx private static IObservable> Combine(this ICollection>> sources, CombineOperator type) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return new Combiner(sources, type).Run(); } @@ -24,8 +24,8 @@ private static IObservable> Combine(this ICollection> Combine(this IObservable> source, CombineOperator type, params IObservable>[] others) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - others.ThrowArgumentNullExceptionIfNull(nameof(others)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(others); if (others.Length == 0) { @@ -39,7 +39,7 @@ private static IObservable> Combine(this IObservable> Combine(this IObservableList> sources, CombineOperator type) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return Observable.Create>( observer => @@ -53,7 +53,7 @@ private static IObservable> Combine(this IObservableList> Combine(this IObservableList> sources, CombineOperator type) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return Observable.Create>( observer => @@ -67,7 +67,7 @@ private static IObservable> Combine(this IObservableList> Combine(this IObservableList>> sources, CombineOperator type) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return new DynamicCombiner(sources, type).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.Convert.cs b/src/DynamicData/List/ObservableListEx.Convert.cs index 87d52d047..df93d969a 100644 --- a/src/DynamicData/List/ObservableListEx.Convert.cs +++ b/src/DynamicData/List/ObservableListEx.Convert.cs @@ -24,9 +24,8 @@ public static IObservable> Convert changes.Transform(conversionFactory)); } diff --git a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs index 6c61d0726..77bee72bb 100644 --- a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs +++ b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs @@ -30,7 +30,7 @@ public static partial class ObservableListEx public static IObservable> DeferUntilLoaded(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new DeferUntilLoaded(source).Run(); } @@ -43,7 +43,7 @@ public static IObservable> DeferUntilLoaded(this IObservable> DeferUntilLoaded(this IObservableList source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Connect().DeferUntilLoaded(); } diff --git a/src/DynamicData/List/ObservableListEx.DisposeMany.cs b/src/DynamicData/List/ObservableListEx.DisposeMany.cs index fcf3ac185..1293b176d 100644 --- a/src/DynamicData/List/ObservableListEx.DisposeMany.cs +++ b/src/DynamicData/List/ObservableListEx.DisposeMany.cs @@ -42,7 +42,7 @@ public static partial class ObservableListEx public static IObservable> DisposeMany(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new DisposeMany(source).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.DistinctValues.cs b/src/DynamicData/List/ObservableListEx.DistinctValues.cs index 7eb8f8309..61869862b 100644 --- a/src/DynamicData/List/ObservableListEx.DistinctValues.cs +++ b/src/DynamicData/List/ObservableListEx.DistinctValues.cs @@ -40,9 +40,8 @@ public static IObservable> DistinctValues(th where TObject : notnull where TValue : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(valueSelector); return new Distinct(source, valueSelector).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.Except.cs b/src/DynamicData/List/ObservableListEx.Except.cs index d3fededaf..2ec6ace7a 100644 --- a/src/DynamicData/List/ObservableListEx.Except.cs +++ b/src/DynamicData/List/ObservableListEx.Except.cs @@ -46,7 +46,7 @@ public static partial class ObservableListEx public static IObservable> Except(this IObservable> source, params IObservable>[] others) where T : notnull { - others.ThrowArgumentNullExceptionIfNull(nameof(others)); + ArgumentExceptionHelper.ThrowIfNull(others); return source.Combine(CombineOperator.Except, others); } diff --git a/src/DynamicData/List/ObservableListEx.Filter.cs b/src/DynamicData/List/ObservableListEx.Filter.cs index f0686c9bb..27ae2778e 100644 --- a/src/DynamicData/List/ObservableListEx.Filter.cs +++ b/src/DynamicData/List/ObservableListEx.Filter.cs @@ -84,9 +84,9 @@ public static IObservable> Filter( public static IObservable> Filter(this IObservable> source, IObservable> predicate, ListFilterPolicy filterPolicy = ListFilterPolicy.CalculateDiff) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); + ArgumentExceptionHelper.ThrowIfNull(predicate); return new List.Internal.Filter.Dynamic(source, predicate, filterPolicy).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs index 7a8d87d6d..055e7a297 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs @@ -48,7 +48,7 @@ public static partial class ObservableListEx public static IObservable> FilterOnObservable(this IObservable> source, Func> objectFilterObservable, TimeSpan? propertyChangedThrottle = null, IScheduler? scheduler = null) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new FilterOnObservable(source, objectFilterObservable, propertyChangedThrottle, scheduler).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs index c5d6107d8..facf57802 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs @@ -33,11 +33,9 @@ public static partial class ObservableListEx public static IObservable> FilterOnProperty(this IObservable> source, Expression> propertySelector, Func predicate, TimeSpan? propertyChangedThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - - propertySelector.ThrowArgumentNullExceptionIfNull(nameof(propertySelector)); - - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(propertySelector); + ArgumentExceptionHelper.ThrowIfNull(predicate); return new FilterOnProperty(source, propertySelector, predicate, propertyChangedThrottle, scheduler).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs index c8f5bea69..19db72fa3 100644 --- a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs +++ b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs @@ -25,7 +25,7 @@ public static partial class ObservableListEx public static IObservable> FlattenBufferResult(this IObservable>> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Where(x => x.Count != 0).Select(updates => new ChangeSet(updates.SelectMany(u => u))); } } diff --git a/src/DynamicData/List/ObservableListEx.ForEachChange.cs b/src/DynamicData/List/ObservableListEx.ForEachChange.cs index 758486fa8..13d320f9f 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachChange.cs @@ -36,9 +36,8 @@ public static partial class ObservableListEx public static IObservable> ForEachChange(this IObservable> source, Action> action) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(action); return source.Do(changes => changes.ForEach(action)); } diff --git a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs index 8b521df3a..44f011604 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs @@ -29,9 +29,8 @@ public static partial class ObservableListEx public static IObservable> ForEachItemChange(this IObservable> source, Action> action) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(action); return source.Do(changes => changes.Flatten().ForEach(action)); } diff --git a/src/DynamicData/List/ObservableListEx.GroupOn.cs b/src/DynamicData/List/ObservableListEx.GroupOn.cs index cf852edc0..c5a0111f6 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOn.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOn.cs @@ -45,9 +45,8 @@ public static IObservable>> GroupOn(source, groupSelector, regrouper).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs index 70adaf90d..6b3eb5cf3 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs @@ -38,9 +38,8 @@ public static IObservable>> GroupOnProperty(source, propertySelector, propertyChangedThrottle, scheduler).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs index 58959aed5..aea1ac0c3 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs @@ -39,9 +39,8 @@ public static partial class ObservableListEx where TObject : INotifyPropertyChanged where TGroup : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - - propertySelector.ThrowArgumentNullExceptionIfNull(nameof(propertySelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(propertySelector); return new GroupOnPropertyWithImmutableState(source, propertySelector, propertyChangedThrottle, scheduler).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs index 5f617ca98..5a486c761 100644 --- a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs @@ -37,9 +37,9 @@ public static partial class ObservableListEx where TObject : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); - groupSelectorKey.ThrowArgumentNullExceptionIfNull(nameof(groupSelectorKey)); + ArgumentExceptionHelper.ThrowIfNull(groupSelectorKey); return new GroupOnImmutable(source, groupSelectorKey, regrouper).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs index 9d1b3a71d..4d60fa92c 100644 --- a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs +++ b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs @@ -36,7 +36,7 @@ public static partial class ObservableListEx public static IObservable> LimitSizeTo(this ISourceList source, int sizeLimit, IScheduler? scheduler = null) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); if (sizeLimit <= 0) { diff --git a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs index 0786c39cc..918211279 100644 --- a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs @@ -22,7 +22,7 @@ public static partial class ObservableListEx public static IObservable> MergeChangeSets(this IObservable>> source, IEqualityComparer? equalityComparer = null) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new MergeChangeSets(source, equalityComparer).Run(); } @@ -39,8 +39,8 @@ public static IObservable> MergeChangeSets(this IOb public static IObservable> MergeChangeSets(this IObservable> source, IObservable> other, IEqualityComparer? equalityComparer = null, IScheduler? scheduler = null, bool completable = true) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - other.ThrowArgumentNullExceptionIfNull(nameof(other)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(other); return new[] { source, other }.MergeChangeSets(equalityComparer, scheduler, completable); } @@ -57,8 +57,8 @@ public static IObservable> MergeChangeSets(this IOb public static IObservable> MergeChangeSets(this IObservable> source, IEnumerable>> others, IEqualityComparer? equalityComparer = null, IScheduler? scheduler = null, bool completable = true) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - others.ThrowArgumentNullExceptionIfNull(nameof(others)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(others); return source.EnumerateOne().Concat(others).MergeChangeSets(equalityComparer, scheduler, completable); } @@ -94,7 +94,7 @@ public static IObservable> MergeChangeSets(this IOb public static IObservable> MergeChangeSets(this IEnumerable>> source, IEqualityComparer? equalityComparer = null, IScheduler? scheduler = null, bool completable = true) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new MergeChangeSets(source, equalityComparer, completable, scheduler).Run(); } @@ -106,7 +106,7 @@ public static IObservable> MergeChangeSets(this IEn public static IObservable> MergeChangeSets(this IObservableList>> source, IEqualityComparer? equalityComparer = null) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Connect().MergeChangeSets(equalityComparer); } @@ -119,7 +119,7 @@ public static IObservable> MergeChangeSets(this IOb public static IObservable> MergeChangeSets(this IObservable>>> source, IEqualityComparer? equalityComparer = null) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.MergeManyChangeSets(static src => src, equalityComparer); } @@ -152,7 +152,7 @@ public static IObservable> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets src, equalityComparer, comparer); } diff --git a/src/DynamicData/List/ObservableListEx.MergeMany.cs b/src/DynamicData/List/ObservableListEx.MergeMany.cs index 00e6bdeae..64df39f3a 100644 --- a/src/DynamicData/List/ObservableListEx.MergeMany.cs +++ b/src/DynamicData/List/ObservableListEx.MergeMany.cs @@ -40,9 +40,8 @@ public static partial class ObservableListEx public static IObservable MergeMany(this IObservable> source, Func> observableSelector) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return new MergeMany(source, observableSelector).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs index b7706bc5e..4ca3546be 100644 --- a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs @@ -78,9 +78,9 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); + ArgumentExceptionHelper.ThrowIfNull(comparer); return source.MergeManyChangeSets(observableSelector, equalityComparer: null, comparer: comparer); } @@ -127,8 +127,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); return new MergeManyCacheChangeSets(source, observableSelector, equalityComparer, comparer).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.NotEmpty.cs b/src/DynamicData/List/ObservableListEx.NotEmpty.cs index 98fc762ec..f54269db8 100644 --- a/src/DynamicData/List/ObservableListEx.NotEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.NotEmpty.cs @@ -22,7 +22,7 @@ public static partial class ObservableListEx public static IObservable> NotEmpty(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Where(s => s.Count != 0); } diff --git a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs index d1aaa44a7..ab0b13466 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs @@ -40,7 +40,7 @@ public static IObservable> OnItemAdded( Action addAction) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return List.Internal.OnItemAdded.Create( source: source, addAction: addAction); diff --git a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs index a7ddad69a..07ef57caa 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs @@ -27,7 +27,7 @@ public static IObservable> OnItemRefreshed( Action refreshAction) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return List.Internal.OnItemRefreshed.Create( source: source, refreshAction: refreshAction); diff --git a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs index fe47fd544..aaab2ecbf 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs @@ -47,7 +47,7 @@ public static IObservable> OnItemRemoved( bool invokeOnUnsubscribe = true) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return List.Internal.OnItemRemoved.Create( source: source, removeAction: removeAction, diff --git a/src/DynamicData/List/ObservableListEx.Or.cs b/src/DynamicData/List/ObservableListEx.Or.cs index 5e9492a52..63e69abea 100644 --- a/src/DynamicData/List/ObservableListEx.Or.cs +++ b/src/DynamicData/List/ObservableListEx.Or.cs @@ -50,7 +50,7 @@ public static IObservable> Or(this ICollection> Or(this IObservable> source, params IObservable>[] others) where T : notnull { - others.ThrowArgumentNullExceptionIfNull(nameof(others)); + ArgumentExceptionHelper.ThrowIfNull(others); return source.Combine(CombineOperator.Or, others); } diff --git a/src/DynamicData/List/ObservableListEx.Page.cs b/src/DynamicData/List/ObservableListEx.Page.cs index 52d18ab0d..265115bbf 100644 --- a/src/DynamicData/List/ObservableListEx.Page.cs +++ b/src/DynamicData/List/ObservableListEx.Page.cs @@ -34,8 +34,8 @@ public static partial class ObservableListEx public static IObservable> Page(this IObservable> source, IObservable requests) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - requests.ThrowArgumentNullExceptionIfNull(nameof(requests)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(requests); return new Pager(source, requests).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.PopulateInto.cs b/src/DynamicData/List/ObservableListEx.PopulateInto.cs index 1334a6e5f..c10f7b967 100644 --- a/src/DynamicData/List/ObservableListEx.PopulateInto.cs +++ b/src/DynamicData/List/ObservableListEx.PopulateInto.cs @@ -29,8 +29,8 @@ public static partial class ObservableListEx public static IDisposable PopulateInto(this IObservable> source, ISourceList destination) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(destination); return source.Subscribe(changes => destination.Edit(updater => updater.Clone(changes))); } diff --git a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs index 45c70cdd1..bf0249e87 100644 --- a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs +++ b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs @@ -32,8 +32,8 @@ public static partial class ObservableListEx public static IObservable QueryWhenChanged(this IObservable> source, Func, TDestination> resultSelector) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - resultSelector.ThrowArgumentNullExceptionIfNull(nameof(resultSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(resultSelector); return source.QueryWhenChanged().Select(resultSelector); } @@ -56,7 +56,7 @@ public static IObservable QueryWhenChanged( public static IObservable> QueryWhenChanged(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new QueryWhenChanged(source).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.RefCount.cs b/src/DynamicData/List/ObservableListEx.RefCount.cs index c95d83d88..a46209a60 100644 --- a/src/DynamicData/List/ObservableListEx.RefCount.cs +++ b/src/DynamicData/List/ObservableListEx.RefCount.cs @@ -27,7 +27,7 @@ public static partial class ObservableListEx public static IObservable> RefCount(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new RefCount(source).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs index 3dac36f61..c19960333 100644 --- a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs +++ b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs @@ -24,7 +24,7 @@ public static partial class ObservableListEx public static IObservable> RemoveIndex(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Select(changes => new ChangeSet(changes.YieldWithoutIndex())); } diff --git a/src/DynamicData/List/ObservableListEx.Reverse.cs b/src/DynamicData/List/ObservableListEx.Reverse.cs index bde4734ee..3ef6da735 100644 --- a/src/DynamicData/List/ObservableListEx.Reverse.cs +++ b/src/DynamicData/List/ObservableListEx.Reverse.cs @@ -27,7 +27,7 @@ public static IObservable> Reverse(this IObservable(); - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.Select(changes => new ChangeSet(reverser.Reverse(changes))); } diff --git a/src/DynamicData/List/ObservableListEx.SkipInitial.cs b/src/DynamicData/List/ObservableListEx.SkipInitial.cs index 116af0c47..5cc0366bd 100644 --- a/src/DynamicData/List/ObservableListEx.SkipInitial.cs +++ b/src/DynamicData/List/ObservableListEx.SkipInitial.cs @@ -32,7 +32,7 @@ public static partial class ObservableListEx public static IObservable> SkipInitial(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.DeferUntilLoaded().Skip(1); } diff --git a/src/DynamicData/List/ObservableListEx.Sort.cs b/src/DynamicData/List/ObservableListEx.Sort.cs index aa0969339..0b6062d5e 100644 --- a/src/DynamicData/List/ObservableListEx.Sort.cs +++ b/src/DynamicData/List/ObservableListEx.Sort.cs @@ -48,8 +48,8 @@ public static partial class ObservableListEx public static IObservable> Sort(this IObservable> source, IComparer comparer, SortOptions options = SortOptions.None, IObservable? resort = null, IObservable>? comparerChanged = null, int resetThreshold = 50) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(comparer); return new Sort(source, comparer, options, resort, comparerChanged, resetThreshold).Run(); } @@ -69,8 +69,8 @@ public static IObservable> Sort(this IObservable> public static IObservable> Sort(this IObservable> source, IObservable> comparerChanged, SortOptions options = SortOptions.None, IObservable? resort = null, int resetThreshold = 50) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - comparerChanged.ThrowArgumentNullExceptionIfNull(nameof(comparerChanged)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(comparerChanged); return new Sort(source, null, options, resort, comparerChanged, resetThreshold).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs index 80854ec12..6f947e480 100644 --- a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs @@ -22,7 +22,7 @@ public static partial class ObservableListEx public static IObservable> StartWithEmpty(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.StartWith(ChangeSet.Empty); } diff --git a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs index 441b543a8..4455f357d 100644 --- a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs +++ b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs @@ -39,8 +39,8 @@ public static partial class ObservableListEx public static IObservable> SubscribeMany(this IObservable> source, Func subscriptionFactory) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - subscriptionFactory.ThrowArgumentNullExceptionIfNull(nameof(subscriptionFactory)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(subscriptionFactory); return new SubscribeMany(source, subscriptionFactory).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.Switch.cs b/src/DynamicData/List/ObservableListEx.Switch.cs index 625a006d4..03ecd304a 100644 --- a/src/DynamicData/List/ObservableListEx.Switch.cs +++ b/src/DynamicData/List/ObservableListEx.Switch.cs @@ -27,7 +27,7 @@ public static partial class ObservableListEx public static IObservable> Switch(this IObservable> sources) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return sources.Select(cache => cache.Connect()).Switch(); } @@ -50,7 +50,7 @@ public static IObservable> Switch(this IObservable> Switch(this IObservable>> sources) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentExceptionHelper.ThrowIfNull(sources); return new Switch(sources).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.Top.cs b/src/DynamicData/List/ObservableListEx.Top.cs index 6b97feaf1..0ff91536c 100644 --- a/src/DynamicData/List/ObservableListEx.Top.cs +++ b/src/DynamicData/List/ObservableListEx.Top.cs @@ -28,7 +28,7 @@ public static partial class ObservableListEx public static IObservable> Top(this IObservable> source, int numberOfItems) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); if (numberOfItems <= 0) { diff --git a/src/DynamicData/List/ObservableListEx.Transform.cs b/src/DynamicData/List/ObservableListEx.Transform.cs index cbdf471c3..82936c6fb 100644 --- a/src/DynamicData/List/ObservableListEx.Transform.cs +++ b/src/DynamicData/List/ObservableListEx.Transform.cs @@ -49,9 +49,9 @@ public static IObservable> Transform((t, _, _) => transformFactory(t), transformOnRefresh); } @@ -64,8 +64,8 @@ public static IObservable> Transform((t, _, idx) => transformFactory(t, idx), transformOnRefresh); } @@ -79,8 +79,8 @@ public static IObservable> Transform((t, previous, _) => transformFactory(t, previous), transformOnRefresh); } @@ -94,8 +94,8 @@ public static IObservable> Transform(source, transformFactory, transformOnRefresh).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.TransformAsync.cs b/src/DynamicData/List/ObservableListEx.TransformAsync.cs index a116edae7..ba8381ba5 100644 --- a/src/DynamicData/List/ObservableListEx.TransformAsync.cs +++ b/src/DynamicData/List/ObservableListEx.TransformAsync.cs @@ -47,8 +47,8 @@ public static IObservable> TransformAsync((t, _, _) => transformFactory(t), transformOnRefresh); } @@ -65,8 +65,8 @@ public static IObservable> TransformAsync((t, _, i) => transformFactory(t, i), transformOnRefresh); } @@ -83,8 +83,8 @@ public static IObservable> TransformAsync((t, d, _) => transformFactory(t, d), transformOnRefresh); } @@ -101,8 +101,8 @@ public static IObservable> TransformAsync(source, transformFactory, transformOnRefresh).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.TransformMany.cs b/src/DynamicData/List/ObservableListEx.TransformMany.cs index 9cf82eb82..4f6c170c0 100644 --- a/src/DynamicData/List/ObservableListEx.TransformMany.cs +++ b/src/DynamicData/List/ObservableListEx.TransformMany.cs @@ -39,8 +39,8 @@ public static IObservable> TransformMany(source, manySelector, equalityComparer).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.Virtualise.cs b/src/DynamicData/List/ObservableListEx.Virtualise.cs index 26797970d..aef6068f2 100644 --- a/src/DynamicData/List/ObservableListEx.Virtualise.cs +++ b/src/DynamicData/List/ObservableListEx.Virtualise.cs @@ -32,9 +32,8 @@ public static partial class ObservableListEx public static IObservable> Virtualise(this IObservable> source, IObservable requests) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - - requests.ThrowArgumentNullExceptionIfNull(nameof(requests)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(requests); return new Virtualiser(source, requests).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs index 3d7b201a4..5dfbd2cc3 100644 --- a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs @@ -33,7 +33,7 @@ public static partial class ObservableListEx public static IObservable WhenAnyPropertyChanged(this IObservable> source, params string[] propertiesToMonitor) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return source.MergeMany(t => t.WhenAnyPropertyChanged(propertiesToMonitor)); } diff --git a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs index 86cf11aa5..63564e8ca 100644 --- a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs @@ -34,8 +34,8 @@ public static partial class ObservableListEx public static IObservable> WhenPropertyChanged(this IObservable> source, Expression> propertyAccessor, bool notifyOnInitialValue = true) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertyAccessor.ThrowArgumentNullExceptionIfNull(nameof(propertyAccessor)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(propertyAccessor); var factory = propertyAccessor.GetFactory(); return source.MergeMany(t => factory(t, notifyOnInitialValue)); diff --git a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs index 4e2a0cdac..19d91440c 100644 --- a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs @@ -31,8 +31,8 @@ public static partial class ObservableListEx public static IObservable WhenValueChanged(this IObservable> source, Expression> propertyAccessor, bool notifyOnInitialValue = true) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertyAccessor.ThrowArgumentNullExceptionIfNull(nameof(propertyAccessor)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(propertyAccessor); var factory = propertyAccessor.GetFactory(); return source.MergeMany(t => factory(t, notifyOnInitialValue).Select(pv => pv.Value)); diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs index 30436682d..9afafa0e4 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs @@ -30,8 +30,8 @@ public static partial class ObservableListEx public static IObservable> WhereReasonsAre(this IObservable> source, params ListChangeReason[] reasons) where T : notnull { - reasons.ThrowArgumentNullExceptionIfNull(nameof(reasons)); - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(reasons); + ArgumentExceptionHelper.ThrowIfNull(source); if (reasons.Length == 0) { diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs index d0ff26314..98e8cced2 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs @@ -33,8 +33,8 @@ public static partial class ObservableListEx public static IObservable> WhereReasonsAreNot(this IObservable> source, params ListChangeReason[] reasons) where T : notnull { - reasons.ThrowArgumentNullExceptionIfNull(nameof(reasons)); - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(reasons); + ArgumentExceptionHelper.ThrowIfNull(source); if (reasons.Length == 0) { diff --git a/src/DynamicData/List/ObservableListEx.Xor.cs b/src/DynamicData/List/ObservableListEx.Xor.cs index d875e594f..253202a0e 100644 --- a/src/DynamicData/List/ObservableListEx.Xor.cs +++ b/src/DynamicData/List/ObservableListEx.Xor.cs @@ -43,7 +43,7 @@ public static partial class ObservableListEx public static IObservable> Xor(this IObservable> source, params IObservable>[] others) where T : notnull { - others.ThrowArgumentNullExceptionIfNull(nameof(others)); + ArgumentExceptionHelper.ThrowIfNull(others); return source.Combine(CombineOperator.Xor, others); } diff --git a/src/DynamicData/List/SourceList.cs b/src/DynamicData/List/SourceList.cs index eefaf67f8..2fa880162 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.cs @@ -140,7 +140,7 @@ public void Dispose() /// public void Edit(Action> updateAction) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentExceptionHelper.ThrowIfNull(updateAction); lock (_locker) { diff --git a/src/DynamicData/List/SourceListEditConvenienceEx.cs b/src/DynamicData/List/SourceListEditConvenienceEx.cs index 7c08529f8..4159d7f4f 100644 --- a/src/DynamicData/List/SourceListEditConvenienceEx.cs +++ b/src/DynamicData/List/SourceListEditConvenienceEx.cs @@ -21,7 +21,7 @@ public static class SourceListEditConvenienceEx public static void Add(this ISourceList source, T item) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => list.Add(item)); } @@ -35,7 +35,8 @@ public static void Add(this ISourceList source, T item) public static void AddRange(this ISourceList source, IEnumerable items) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); source.Edit(list => list.AddRange(items)); } @@ -48,7 +49,7 @@ public static void AddRange(this ISourceList source, IEnumerable items) public static void Clear(this ISourceList source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => list.Clear()); } @@ -64,8 +65,8 @@ public static void Clear(this ISourceList source) public static void EditDiff(this ISourceList source, IEnumerable allItems, IEqualityComparer? equalityComparer = null) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - allItems.ThrowArgumentNullExceptionIfNull(nameof(allItems)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(allItems); var editDiff = new EditDiff(source, equalityComparer); editDiff.Edit(allItems); @@ -81,7 +82,7 @@ public static void EditDiff(this ISourceList source, IEnumerable allIte public static void Insert(this ISourceList source, int index, T item) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => list.Insert(index, item)); } @@ -96,7 +97,7 @@ public static void Insert(this ISourceList source, int index, T item) public static void InsertRange(this ISourceList source, IEnumerable items, int index) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => list.AddRange(items, index)); } @@ -111,7 +112,7 @@ public static void InsertRange(this ISourceList source, IEnumerable ite public static void Move(this ISourceList source, int original, int destination) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => list.Move(original, destination)); } @@ -127,7 +128,7 @@ public static bool Remove(this ISourceList source, T item) where T : notnull { var removed = false; - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => removed = list.Remove(item)); return removed; @@ -142,7 +143,7 @@ public static bool Remove(this ISourceList source, T item) public static void RemoveAt(this ISourceList source, int index) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => list.RemoveAt(index)); } @@ -156,7 +157,7 @@ public static void RemoveAt(this ISourceList source, int index) public static void RemoveMany(this ISourceList source, IEnumerable itemsToRemove) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => list.RemoveMany(itemsToRemove)); } @@ -173,7 +174,7 @@ public static void RemoveMany(this ISourceList source, IEnumerable item public static void RemoveRange(this ISourceList source, int index, int count) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => list.RemoveRange(index, count)); } @@ -188,7 +189,7 @@ public static void RemoveRange(this ISourceList source, int index, int cou public static void Replace(this ISourceList source, T original, T destination) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => list.Replace(original, destination)); } @@ -203,7 +204,7 @@ public static void Replace(this ISourceList source, T original, T destinat public static void ReplaceAt(this ISourceList source, int index, T item) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); source.Edit(list => list[index] = item); } diff --git a/src/DynamicData/List/SourceListEx.cs b/src/DynamicData/List/SourceListEx.cs index 78ca4d971..78255cf29 100644 --- a/src/DynamicData/List/SourceListEx.cs +++ b/src/DynamicData/List/SourceListEx.cs @@ -23,8 +23,8 @@ public static IObservable> Cast( where TSource : notnull where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - conversionFactory.ThrowArgumentNullExceptionIfNull(nameof(conversionFactory)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(conversionFactory); return source.Connect().Cast(conversionFactory); } diff --git a/src/DynamicData/List/Tests/ChangeSetAggregator.cs b/src/DynamicData/List/Tests/ChangeSetAggregator.cs index 976964b17..7b9d5c7e0 100644 --- a/src/DynamicData/List/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/List/Tests/ChangeSetAggregator.cs @@ -22,7 +22,7 @@ public class ChangeSetAggregator : IDisposable /// The source. public ChangeSetAggregator(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/ObservableChangeSet.cs b/src/DynamicData/ObservableChangeSet.cs index f4f48c45a..5054dc556 100644 --- a/src/DynamicData/ObservableChangeSet.cs +++ b/src/DynamicData/ObservableChangeSet.cs @@ -21,8 +21,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return Create( cache => @@ -45,8 +45,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return Observable.Create>( observer => @@ -80,8 +80,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return Create(async (cache, _) => await subscribe(cache).ConfigureAwait(false), keySelector); } @@ -98,8 +98,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return Observable.Create>( async (observer, ct) => @@ -133,8 +133,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return Create((cache, _) => subscribe(cache), keySelector); } @@ -151,8 +151,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return Observable.Create>( async (observer, ct) => @@ -195,8 +195,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return Observable.Create>( async observer => @@ -229,8 +229,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); + ArgumentExceptionHelper.ThrowIfNull(keySelector); return Observable.Create>( async (observer, ct) => @@ -260,7 +260,7 @@ public static IObservable> Create(Func< public static IObservable> Create(Func, Action> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); return Create( list => @@ -279,7 +279,7 @@ public static IObservable> Create(Func, Action> public static IObservable> Create(Func, IDisposable> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); return Observable.Create>( observer => @@ -318,7 +318,7 @@ public static IObservable> Create(Func, IDisposa public static IObservable> Create(Func, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); return Create((list, _) => subscribe(list)); } @@ -332,7 +332,7 @@ public static IObservable> Create(Func, Task> Create(Func, CancellationToken, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); return Observable.Create>( async (observer, ct) => @@ -373,7 +373,7 @@ public static IObservable> Create(Func, Cancella public static IObservable> Create(Func, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); return Create(async (list, _) => await subscribe(list).ConfigureAwait(false)); } @@ -387,7 +387,7 @@ public static IObservable> Create(Func, Task> Create(Func, CancellationToken, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); return Observable.Create>( async (observer, ct) => @@ -427,7 +427,7 @@ public static IObservable> Create(Func, Cancella public static IObservable> Create(Func, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); return Observable.Create>( async observer => @@ -457,7 +457,7 @@ public static IObservable> Create(Func, Task> su public static IObservable> Create(Func, CancellationToken, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentExceptionHelper.ThrowIfNull(subscribe); return Observable.Create>( async (observer, ct) => diff --git a/src/DynamicData/Platforms/net45/ParallelOperators.cs b/src/DynamicData/Platforms/net45/ParallelOperators.cs index b79624fca..6cec2a8a7 100644 --- a/src/DynamicData/Platforms/net45/ParallelOperators.cs +++ b/src/DynamicData/Platforms/net45/ParallelOperators.cs @@ -26,7 +26,7 @@ public static IObservable> Filter(this where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentExceptionHelper.ThrowIfNull(source); return new PFilter(source, filter, parallelisationOptions).Run(); } @@ -50,9 +50,9 @@ public static IObservable> SubscribeMany(source, (t, _) => subscriptionFactory(t), parallelisationOptions).Run(); } @@ -76,9 +76,9 @@ public static IObservable> SubscribeMany(source, subscriptionFactory, parallelisationOptions).Run(); } @@ -103,9 +103,9 @@ public static IObservable> Transform(source, (t, _, k) => transformFactory(t, k), parallelisationOptions).Run(); } @@ -154,10 +154,10 @@ public static IObservable> TransformSafe(source, (t, _, _) => transformFactory(t), parallelisationOptions, errorHandler).Run(); } diff --git a/src/DynamicData/Polyfills/AllowNullAttribute.cs b/src/DynamicData/Polyfills/AllowNullAttribute.cs new file mode 100644 index 000000000..b14f9a67d --- /dev/null +++ b/src/DynamicData/Polyfills/AllowNullAttribute.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NETCOREAPP3_0_OR_GREATER && !NETSTANDARD2_1_OR_GREATER +namespace System.Diagnostics.CodeAnalysis; + +/// Specifies that is allowed as an input even if the corresponding type disallows it. +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)] +internal sealed class AllowNullAttribute : Attribute; +#endif diff --git a/src/DynamicData/Polyfills/ArgumentExceptionHelper.cs b/src/DynamicData/Polyfills/ArgumentExceptionHelper.cs new file mode 100644 index 000000000..6b50d4d5c --- /dev/null +++ b/src/DynamicData/Polyfills/ArgumentExceptionHelper.cs @@ -0,0 +1,29 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace DynamicData; + +/// +/// Polyfill for ArgumentNullException.ThrowIfNull on target frameworks (net462-net481) that predate it. +/// On net8.0 and later this type is not compiled; consuming projects alias the ArgumentExceptionHelper +/// identifier directly to so the call sites bind to the BCL method. +/// +[ExcludeFromCodeCoverage] +internal static class ArgumentExceptionHelper +{ + /// Throws an if is . + /// The reference type argument to validate as non-null. + /// The name of the parameter with which corresponds. + public static void ThrowIfNull( + [NotNull] object? argument, + [CallerArgumentExpression(nameof(argument))] string? paramName = null) + { + if (argument is not null) + { + return; + } + + throw new ArgumentNullException(paramName); + } +} diff --git a/src/DynamicData/Polyfills/ArgumentOutOfRangeExceptionHelper.cs b/src/DynamicData/Polyfills/ArgumentOutOfRangeExceptionHelper.cs new file mode 100644 index 000000000..20d9bfa90 --- /dev/null +++ b/src/DynamicData/Polyfills/ArgumentOutOfRangeExceptionHelper.cs @@ -0,0 +1,78 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace DynamicData; + +/// Polyfill for modern guard helpers on target frameworks that predate them. +[ExcludeFromCodeCoverage] +internal static class ArgumentOutOfRangeExceptionHelper +{ + /// Throws when is negative. + /// The value to validate. + /// The parameter name. + public static void ThrowIfNegative(int value, [CallerArgumentExpression(nameof(value))] string? paramName = null) + { + if (value >= 0) + { + return; + } + + throw new ArgumentOutOfRangeException(paramName, value, null); + } + + /// Throws when is negative or zero. + /// The value to validate. + /// The parameter name. + public static void ThrowIfNegativeOrZero(int value, [CallerArgumentExpression(nameof(value))] string? paramName = null) + { + if (value > 0) + { + return; + } + + throw new ArgumentOutOfRangeException(paramName, value, null); + } + + /// Throws when is less than . + /// The value to validate. + /// The lower bound. + /// The parameter name. + public static void ThrowIfLessThan(int value, int other, [CallerArgumentExpression(nameof(value))] string? paramName = null) + { + if (value >= other) + { + return; + } + + throw new ArgumentOutOfRangeException(paramName, value, null); + } + + /// Throws when is less than . + /// The value to validate. + /// The lower bound. + /// The parameter name. + public static void ThrowIfLessThan(TimeSpan value, TimeSpan other, [CallerArgumentExpression(nameof(value))] string? paramName = null) + { + if (value >= other) + { + return; + } + + throw new ArgumentOutOfRangeException(paramName, value, null); + } + + /// Throws when is less than or equal to . + /// The value to validate. + /// The lower bound. + /// The parameter name. + public static void ThrowIfLessThanOrEqual(TimeSpan value, TimeSpan other, [CallerArgumentExpression(nameof(value))] string? paramName = null) + { + if (value > other) + { + return; + } + + throw new ArgumentOutOfRangeException(paramName, value, null); + } +} diff --git a/src/DynamicData/Polyfills/CallerArgumentExpressionAttribute.cs b/src/DynamicData/Polyfills/CallerArgumentExpressionAttribute.cs new file mode 100644 index 000000000..c89d0cb23 --- /dev/null +++ b/src/DynamicData/Polyfills/CallerArgumentExpressionAttribute.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NET5_0_OR_GREATER +using System.Diagnostics; + +namespace System.Runtime.CompilerServices; + +/// Indicates that a parameter captures the expression passed for another parameter as a string. +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage(AttributeTargets.Parameter)] +internal sealed class CallerArgumentExpressionAttribute : Attribute +{ + /// Initializes a new instance of the class. + /// The name of the parameter whose expression should be captured. + public CallerArgumentExpressionAttribute(string parameterName) => + ParameterName = parameterName; + + /// Gets the name of the parameter whose expression should be captured. + public string ParameterName { get; } +} +#endif diff --git a/src/DynamicData/Polyfills/CancellationTokenPolyfillExtensions.cs b/src/DynamicData/Polyfills/CancellationTokenPolyfillExtensions.cs new file mode 100644 index 000000000..022699fc3 --- /dev/null +++ b/src/DynamicData/Polyfills/CancellationTokenPolyfillExtensions.cs @@ -0,0 +1,38 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NETCOREAPP3_0_OR_GREATER && !NETSTANDARD2_1_OR_GREATER +namespace System.Threading; + +/// Polyfill extensions for on frameworks without UnsafeRegister. +internal static class CancellationTokenPolyfillExtensions +{ + /// Polyfill registration operations for a cancellation token. + /// The cancellation token. + extension(CancellationToken token) + { + /// Registers a delegate that is invoked when the token is cancelled, without capturing the execution context. + /// The delegate to invoke on cancellation. + /// The state passed to . + /// A registration that can be disposed to remove the callback. + public CancellationTokenRegistration UnsafeRegister(Action callback, object? state) => + token.Register(callback, state, useSynchronizationContext: false); + + /// Registers a delegate that is invoked with the triggering token when the token is cancelled, without capturing the execution context. + /// The delegate to invoke on cancellation, receiving the state and the triggering token. + /// The state passed to . + /// A registration that can be disposed to remove the callback. + public CancellationTokenRegistration UnsafeRegister(Action callback, object? state) => + token.Register( + static boxed => + { + var (inner, innerState, innerToken) = ((Action Callback, object? State, CancellationToken Token))boxed!; + inner(innerState, innerToken); + }, + (callback, state, token), + useSynchronizationContext: false); + } +} +#endif diff --git a/src/DynamicData/Polyfills/CancellationTokenSourcePolyfillExtensions.cs b/src/DynamicData/Polyfills/CancellationTokenSourcePolyfillExtensions.cs new file mode 100644 index 000000000..519e74a12 --- /dev/null +++ b/src/DynamicData/Polyfills/CancellationTokenSourcePolyfillExtensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NET8_0_OR_GREATER +namespace System.Threading; + +/// Polyfill extensions for on frameworks without the .NET 8 async cancellation API. +internal static class CancellationTokenSourcePolyfillExtensions +{ + /// Polyfill operations for a cancellation token source. + /// The cancellation token source. + extension(CancellationTokenSource source) + { + /// Communicates a request for cancellation, completing synchronously (no asynchronous callback draining on this framework). + /// A completed task representing the cancellation request. + public Task CancelAsync() + { + source.Cancel(); + return Task.CompletedTask; + } + } +} +#endif diff --git a/src/DynamicData/Polyfills/CompilerFeatureRequiredAttribute.cs b/src/DynamicData/Polyfills/CompilerFeatureRequiredAttribute.cs index cdcff56c9..ee0ce6737 100644 --- a/src/DynamicData/Polyfills/CompilerFeatureRequiredAttribute.cs +++ b/src/DynamicData/Polyfills/CompilerFeatureRequiredAttribute.cs @@ -1,23 +1,31 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). #if !NET7_0_OR_GREATER +using System.Diagnostics; + namespace System.Runtime.CompilerServices; -// Allows use of the C#11 `required` keyword, internally within this library, when targeting frameworks older than .NET 7. +/// Indicates that compiler support for a particular feature is required for the location where it is applied. +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] -internal sealed class CompilerFeatureRequiredAttribute(string featureName) - : Attribute +internal sealed class CompilerFeatureRequiredAttribute : Attribute { - public const string RefStructs - = nameof(RefStructs); + /// The used for the ref structs C# feature. + public const string RefStructs = nameof(RefStructs); - public const string RequiredMembers - = nameof(RequiredMembers); + /// The used for the required members C# feature. + public const string RequiredMembers = nameof(RequiredMembers); - public string FeatureName { get; } = featureName; + /// Initializes a new instance of the class. + /// The name of the required compiler feature. + public CompilerFeatureRequiredAttribute(string featureName) => + FeatureName = featureName; - public bool IsOptional { get; init; } + /// Gets the name of the required compiler feature. + public string FeatureName { get; } } #endif diff --git a/src/DynamicData/Polyfills/IsExternalInit.cs b/src/DynamicData/Polyfills/IsExternalInit.cs index 4542c2eed..c36a21ddf 100644 --- a/src/DynamicData/Polyfills/IsExternalInit.cs +++ b/src/DynamicData/Polyfills/IsExternalInit.cs @@ -1,10 +1,19 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. -#if !NETCOREAPP +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NET5_0_OR_GREATER +using System.Diagnostics; + namespace System.Runtime.CompilerServices; -// Allows use of the C#11 `init` keyword, internally within this library, when targeting frameworks older than .NET 5. -internal sealed class IsExternalInit; +/// Reserved for the compiler to track metadata for -only members; not for use in source. +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[SuppressMessage( + "Design", + "SST1436:Add members to this type or remove it; an empty type is rarely intentional", + Justification = "Compiler-recognized marker type for init-only members; it must remain empty.")] +internal static class IsExternalInit; #endif diff --git a/src/DynamicData/Polyfills/MemberNotNullWhenAttribute.cs b/src/DynamicData/Polyfills/MemberNotNullWhenAttribute.cs new file mode 100644 index 000000000..1d8b3c08d --- /dev/null +++ b/src/DynamicData/Polyfills/MemberNotNullWhenAttribute.cs @@ -0,0 +1,33 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NET5_0_OR_GREATER +namespace System.Diagnostics.CodeAnalysis; + +/// Specifies that the listed members are not when the method returns the given value. +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage( + AttributeTargets.Method | AttributeTargets.Property, + Inherited = false, + AllowMultiple = true)] +internal sealed class MemberNotNullWhenAttribute : Attribute +{ + /// Initializes a new instance of the class. + /// The return value condition for which the members are not . + /// The field and property members that are promised to be not-. + public MemberNotNullWhenAttribute(bool returnValue, params string[] members) + { + ReturnValue = returnValue; + Members = members; + } + + /// Gets the return value condition for which the members are not . + public bool ReturnValue { get; } + + /// Gets the field and property member names that are promised to be not-. + public string[] Members { get; } +} +#endif diff --git a/src/DynamicData/Polyfills/NotNullAttribute.cs b/src/DynamicData/Polyfills/NotNullAttribute.cs new file mode 100644 index 000000000..9cce49350 --- /dev/null +++ b/src/DynamicData/Polyfills/NotNullAttribute.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NETCOREAPP3_0_OR_GREATER && !NETSTANDARD2_1_OR_GREATER +namespace System.Diagnostics.CodeAnalysis; + +/// Specifies that an output is not even if the corresponding type allows it. +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage( + AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)] +internal sealed class NotNullAttribute : Attribute; +#endif diff --git a/src/DynamicData/Polyfills/NotNullWhenAttribute.cs b/src/DynamicData/Polyfills/NotNullWhenAttribute.cs new file mode 100644 index 000000000..75bda35c3 --- /dev/null +++ b/src/DynamicData/Polyfills/NotNullWhenAttribute.cs @@ -0,0 +1,23 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NETCOREAPP3_0_OR_GREATER && !NETSTANDARD2_1_OR_GREATER +namespace System.Diagnostics.CodeAnalysis; + +/// Specifies that when a method returns , the parameter is not . +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage(AttributeTargets.Parameter)] +internal sealed class NotNullWhenAttribute : Attribute +{ + /// Initializes a new instance of the class. + /// The return value condition for which the parameter is not . + public NotNullWhenAttribute(bool returnValue) => + ReturnValue = returnValue; + + /// Gets the return value condition for which the parameter is not . + public bool ReturnValue { get; } +} +#endif diff --git a/src/DynamicData/Polyfills/RequiredMemberAttribute.cs b/src/DynamicData/Polyfills/RequiredMemberAttribute.cs index b1bbc836d..80ac1b32b 100644 --- a/src/DynamicData/Polyfills/RequiredMemberAttribute.cs +++ b/src/DynamicData/Polyfills/RequiredMemberAttribute.cs @@ -1,14 +1,22 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). #if !NET7_0_OR_GREATER -using System.ComponentModel; +using System.Diagnostics; namespace System.Runtime.CompilerServices; -// Allows use of the C#11 `required` keyword, internally within this library, when targeting frameworks older than .NET 7. -[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, Inherited = false)] -[EditorBrowsable(EditorBrowsableState.Never)] +/// Indicates that a type or member is required by the compiler and must be initialized. +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage( + AttributeTargets.Class | + AttributeTargets.Struct | + AttributeTargets.Field | + AttributeTargets.Property, + AllowMultiple = false, + Inherited = false)] internal sealed class RequiredMemberAttribute : Attribute; #endif diff --git a/src/DynamicData/Polyfills/SetsRequiredMembersAttribute.cs b/src/DynamicData/Polyfills/SetsRequiredMembersAttribute.cs new file mode 100644 index 000000000..a9f18d6b9 --- /dev/null +++ b/src/DynamicData/Polyfills/SetsRequiredMembersAttribute.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NET7_0_OR_GREATER +namespace System.Diagnostics.CodeAnalysis; + +/// Specifies that a constructor sets all required members, satisfying the compiler's required-member checks. +[ExcludeFromCodeCoverage] +[DebuggerNonUserCode] +[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] +internal sealed class SetsRequiredMembersAttribute : Attribute; +#endif diff --git a/src/DynamicData/Polyfills/TaskCompletionSource.cs b/src/DynamicData/Polyfills/TaskCompletionSource.cs new file mode 100644 index 000000000..314294ac2 --- /dev/null +++ b/src/DynamicData/Polyfills/TaskCompletionSource.cs @@ -0,0 +1,48 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NET5_0_OR_GREATER + +namespace System.Threading.Tasks; + +/// Polyfill for the non-generic introduced in .NET 5, backed by a . +[SuppressMessage("Performance", "CA1812", Justification = "Broadcast polyfill; not instantiated in every consuming leaf.")] +internal sealed class TaskCompletionSource +{ + /// The underlying generic completion source that backs this non-generic facade. + private readonly TaskCompletionSource _inner; + + /// Initializes a new instance of the class. + public TaskCompletionSource() => _inner = new(); + + /// Transitions the underlying task to the state. + public void SetResult() => _inner.SetResult(true); + + /// Attempts to transition the underlying task to the state. + /// if the operation was successful; otherwise . + public bool TrySetResult() => _inner.TrySetResult(true); + + /// Transitions the underlying task to the state with the specified exception. + /// The exception to bind to the task. + public void SetException(Exception exception) => _inner.SetException(exception); + + /// Attempts to transition the underlying task to the state with the specified exception. + /// The exception to bind to the task. + /// if the operation was successful; otherwise . + public bool TrySetException(Exception exception) => _inner.TrySetException(exception); + + /// Transitions the underlying task to the state. + public void SetCanceled() => _inner.TrySetCanceled(); + + /// Attempts to transition the underlying task to the state. + /// if the operation was successful; otherwise . + public bool TrySetCanceled() => _inner.TrySetCanceled(); + + /// Attempts to transition the underlying task to the state for the specified token. + /// The token associated with the cancellation. + /// if the operation was successful; otherwise . + public bool TrySetCanceled(CancellationToken cancellationToken) => _inner.TrySetCanceled(cancellationToken); +} +#endif diff --git a/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs b/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs new file mode 100644 index 000000000..554b8f1d3 --- /dev/null +++ b/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs @@ -0,0 +1,73 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// Polyfill implementation adapted from SimonCropp/Polyfill (https://github.com/SimonCropp/Polyfill). +#if !NET6_0_OR_GREATER +namespace System.Threading.Tasks; + +/// Polyfill extensions for on frameworks without the .NET 6 WaitAsync overloads. +internal static class TaskPolyfillExtensions +{ + /// Polyfill awaiting operations for a task. + /// The task to await. + extension(Task task) + { + /// Gets a task that completes with , or faults when the timeout elapses or the token is cancelled. + /// The timeout after which the returned task faults, or for no timeout. + /// A token that cancels the wait. + /// A task that mirrors subject to the timeout and cancellation. + public async Task WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) + { + await WaitForCompletionAsync(task, timeout, cancellationToken).ConfigureAwait(false); + await task.ConfigureAwait(false); + } + } + + /// Polyfill awaiting operations for a task that produces a result. + /// The task to await. + /// The task result type. + extension(Task task) + { + /// Gets a task that completes with the same result as , or faults when the timeout elapses or the token is cancelled. + /// The timeout after which the returned task faults, or for no timeout. + /// A token that cancels the wait. + /// A task that mirrors subject to the timeout and cancellation. + public async Task WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) + { + await WaitForCompletionAsync(task, timeout, cancellationToken).ConfigureAwait(false); + return await task.ConfigureAwait(false); + } + } + + /// Waits for the task to complete, timeout, or cancellation. + /// The task to observe. + /// The timeout after which the wait fails, or for no timeout. + /// A token that cancels the wait. + /// A task that completes when the wait condition is resolved. + private static async Task WaitForCompletionAsync(Task task, TimeSpan timeout, CancellationToken cancellationToken) + { + if (task.IsCompleted) + { + return; + } + + TaskCompletionSource signal = new(TaskCreationOptions.RunContinuationsAsynchronously); + using var linked = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + if (timeout != Timeout.InfiniteTimeSpan) + { + linked.CancelAfter(timeout); + } + + using (linked.Token.Register(static state => ((TaskCompletionSource)state!).TrySetResult(true), signal)) + { + var completed = await Task.WhenAny(task, signal.Task).ConfigureAwait(false); + if (completed != task) + { + cancellationToken.ThrowIfCancellationRequested(); + throw new TimeoutException(); + } + } + } +} +#endif From ddfebeaefe67e493b79857c81f6214ff10835550 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 11:54:54 +0100 Subject: [PATCH 18/36] Use TaskPoolScheduler.Default in tests Replace TaskPoolSequencer.Default with TaskPoolScheduler.Default in multiple test fixtures to run asynchronous stress operations on the TaskPool scheduler. Updated test files under src/DynamicData.Tests (Cache and List fixtures) to align with the scheduler API/name change and ensure consistent scheduling behavior during tests. --- src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs | 2 +- .../Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs | 2 +- src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs | 2 +- src/DynamicData.Tests/List/MergeChangeSetsFixture.cs | 2 +- src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs | 2 +- src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs index 288782ea0..874d890b8 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheFixture.cs @@ -85,7 +85,7 @@ IObservable AddRemovePrices(Market market, int priceCount, int para using var connect = merged.Connect(); // Start asynchrononously modifying the parent list and the child lists - using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolSequencer.Default) + using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolScheduler.Default) .Finally(() => adding = false) .Subscribe(); diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs index 8cba09ed5..6b8b56823 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs @@ -85,7 +85,7 @@ IObservable AddRemovePrices(Market market, int priceCount, int para using var connect = merged.Connect(); // Start asynchrononously modifying the parent list and the child lists - using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolSequencer.Default) + using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolScheduler.Default) .Finally(() => adding = false) .Subscribe(); diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs index dd0899245..d2b767cb4 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsListFixture.cs @@ -82,7 +82,7 @@ IObservable AddRemoveAnimals(AnimalOwner owner, int animalCount, int par using var connect = mergeAnimals.Connect(); // Start asynchrononously modifying the parent list and the child lists - using var addAnimals = AddRemoveAnimalsStress(ownerCount, animalCount, Environment.ProcessorCount, TaskPoolSequencer.Default) + using var addAnimals = AddRemoveAnimalsStress(ownerCount, animalCount, Environment.ProcessorCount, TaskPoolScheduler.Default) .Finally(() => addingAnimals = false) .Subscribe(); diff --git a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs index a5c03eef0..62191c640 100644 --- a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs @@ -73,7 +73,7 @@ IObservable AddRemoveAnimals(AnimalOwner owner, int animalCount, int par var addedOwners = new ConcurrentBag(); var addingAnimals = true; - var observableObservable = CreateStressObservable(ownerCount, animalCount, Environment.ProcessorCount, addedOwners, TaskPoolSequencer.Default) + var observableObservable = CreateStressObservable(ownerCount, animalCount, Environment.ProcessorCount, addedOwners, TaskPoolScheduler.Default) .Finally(() => addingAnimals = false) .Publish() .RefCount(); diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs index dc0724306..14adff0ac 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs @@ -83,7 +83,7 @@ IObservable AddRemovePrices(Market market, int priceCount, int para var adding = true; // Start asynchrononously modifying the parent list and the child lists - using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolSequencer.Default) + using var addingSub = AddRemoveStress(marketCount, priceCount, Environment.ProcessorCount, TaskPoolScheduler.Default) .Finally(() => adding = false) .Subscribe(); diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs index cf53e0037..de6ad188c 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs @@ -80,7 +80,7 @@ IObservable AddRemoveAnimals(AnimalOwner owner, int animalCount, int par var addingAnimals = true; // Start asynchrononously modifying the parent list and the child lists - using var addAnimals = AddRemoveAnimalsStress(ownerCount, animalCount, Environment.ProcessorCount, TaskPoolSequencer.Default) + using var addAnimals = AddRemoveAnimalsStress(ownerCount, animalCount, Environment.ProcessorCount, TaskPoolScheduler.Default) .Finally(() => addingAnimals = false) .Subscribe(); From e4e3b34c70cb095f9f913d26c54e44b0729b0ae4 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 12:00:25 +0100 Subject: [PATCH 19/36] Replace ThreadPoolSequencer with ThreadPoolScheduler Update test code and utilities to use ThreadPoolScheduler.Instance in place of ThreadPoolSequencer.Instance. Adjust DynamicData.Tests.csproj to import ThreadPoolSequencer as ThreadPoolScheduler and update NewThreadScheduler and various ExpireAfter/ToObservableChangeSet/InnerJoin tests to delegate to the new scheduler alias. This aligns the tests with the updated scheduler API and keeps compatibility in the reactive test helpers. --- .../Cache/ExpireAfterFixture.ForSource.cs | 4 ++-- .../Cache/ExpireAfterFixture.ForStream.cs | 4 ++-- .../Cache/InnerJoinFixtureRaceCondition.cs | 2 +- ...ToObservableChangeSetFixture.Items.IntegrationTests.cs | 2 +- ...servableChangeSetFixture.Sequences.IntegrationTests.cs | 2 +- src/DynamicData.Tests/DynamicData.Tests.csproj | 1 + src/DynamicData.Tests/List/ExpireAfterFixture.cs | 4 ++-- ...ToObservableChangeSetFixture.Items.IntegrationTests.cs | 2 +- ...servableChangeSetFixture.Sequences.IntegrationTests.cs | 2 +- .../Utilities/ReactiveTestCompatibility.cs | 8 ++++---- 10 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs index a5305a17d..17c05fc63 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs @@ -537,7 +537,7 @@ public async Task ThreadPoolSchedulerIsUsedWithoutPolling_ExpirationIsThreadSafe { using var source = new TestSourceCache(static item => item.Id); - var scheduler = ThreadPoolSequencer.Instance; + var scheduler = ThreadPoolScheduler.Instance; using var subscription = source .ExpireAfter( @@ -568,7 +568,7 @@ public async Task ThreadPoolSchedulerIsUsedWithPolling_ExpirationIsThreadSafe() { using var source = new TestSourceCache(static item => item.Id); - var scheduler = ThreadPoolSequencer.Instance; + var scheduler = ThreadPoolScheduler.Instance; using var subscription = source .ExpireAfter( diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs index 6de32c806..77e922049 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs @@ -755,7 +755,7 @@ public async Task ThreadPoolSchedulerIsUsedWithoutPolling_ExpirationIsThreadSafe { using var source = new Signal>(); - var scheduler = ThreadPoolSequencer.Instance; + var scheduler = ThreadPoolScheduler.Instance; using var subscription = source .ExpireAfter( @@ -785,7 +785,7 @@ public async Task ThreadPoolSchedulerIsUsedWithPolling_ExpirationIsThreadSafe() { using var source = new Signal>(); - var scheduler = ThreadPoolSequencer.Instance; + var scheduler = ThreadPoolScheduler.Instance; using var subscription = source .ExpireAfter( diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs index 95bac6209..15fbc0b06 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs @@ -53,7 +53,7 @@ public void LetsSeeWhetherWeCanRandomlyHitADifferentRaceCondition() IDisposable BeginGeneratingThings(SourceCache source, string namePrefix) // Generate items infinitely. The runtime of the test is limited by the .Subscribe() loop. - => Observable.Range(1, int.MaxValue, ThreadPoolSequencer.Instance) + => Observable.Range(1, int.MaxValue, ThreadPoolScheduler.Instance) .Subscribe(id => { source.AddOrUpdate(new Thing() diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 04c38dd75..5593efe06 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -19,7 +19,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), SchedulerType.TaskPool => TaskPoolScheduler.Default, - SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, + SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, _ => throw new ArgumentOutOfRangeException(nameof(SchedulerType)) }; diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index dcdaf5170..07c441e19 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -19,7 +19,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), SchedulerType.TaskPool => TaskPoolScheduler.Default, - SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, + SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, _ => throw new ArgumentOutOfRangeException(nameof(SchedulerType)) }; diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index a0f64854a..f2b66b7ac 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -45,6 +45,7 @@ + diff --git a/src/DynamicData.Tests/List/ExpireAfterFixture.cs b/src/DynamicData.Tests/List/ExpireAfterFixture.cs index 98a50686d..8cf9a3bc5 100644 --- a/src/DynamicData.Tests/List/ExpireAfterFixture.cs +++ b/src/DynamicData.Tests/List/ExpireAfterFixture.cs @@ -539,7 +539,7 @@ public async Task ThreadPoolSchedulerIsUsedWithoutPolling_ExpirationIsThreadSafe { using var source = new TestSourceList(); - var scheduler = ThreadPoolSequencer.Instance; + var scheduler = ThreadPoolScheduler.Instance; using var subscription = source .ExpireAfter( @@ -571,7 +571,7 @@ public async Task ThreadPoolSchedulerIsUsedWithPolling_ExpirationIsThreadSafe() { using var source = new TestSourceList(); - var scheduler = ThreadPoolSequencer.Instance; + var scheduler = ThreadPoolScheduler.Instance; using var subscription = source .ExpireAfter( diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 4a5a3eb49..5c45f321f 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -19,7 +19,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), SchedulerType.TaskPool => TaskPoolScheduler.Default, - SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, + SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, _ => throw new ArgumentOutOfRangeException(nameof(SchedulerType)) }; diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 2c7f08518..38c8613fe 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -19,7 +19,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( SchedulerType.Default => Sequencer.Default, SchedulerType.NewThread => new NewThreadScheduler(), SchedulerType.TaskPool => TaskPoolScheduler.Default, - SchedulerType.ThreadPool => ThreadPoolSequencer.Instance, + SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, _ => throw new ArgumentOutOfRangeException(nameof(schedulerType)) }; diff --git a/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs b/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs index cd8a51886..a337f0efc 100644 --- a/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs +++ b/src/DynamicData.Tests/Utilities/ReactiveTestCompatibility.cs @@ -55,13 +55,13 @@ public Recorded(long time, T value) public sealed class NewThreadScheduler : ISequencer { - public DateTimeOffset Now => ThreadPoolSequencer.Instance.Now; + public DateTimeOffset Now => ThreadPoolScheduler.Instance.Now; - public long Timestamp => ThreadPoolSequencer.Instance.Timestamp; + public long Timestamp => ThreadPoolScheduler.Instance.Timestamp; - public void Schedule(IWorkItem item) => ThreadPoolSequencer.Instance.Schedule(item); + public void Schedule(IWorkItem item) => ThreadPoolScheduler.Instance.Schedule(item); - public void Schedule(IWorkItem item, long dueTimestamp) => ThreadPoolSequencer.Instance.Schedule(item, dueTimestamp); + public void Schedule(IWorkItem item, long dueTimestamp) => ThreadPoolScheduler.Instance.Schedule(item, dueTimestamp); } public sealed class TestScheduler : ISequencer From 0a58896f1659a860b53b44de198f24daf041f332 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 12:12:58 +0100 Subject: [PATCH 20/36] Replace Signal.FromAsync with Observable Update FromAsync tests to use Observable.FromAsync instead of Signal.FromAsync in Cache and List fixtures (src/DynamicData.Tests/Cache/FromAsyncFixture.cs, src/DynamicData.Tests/List/FromAsyncFixture.cs). Remove automatic Signal->Observable replacement rules for Signal.Lazy, Signal.After, Signal.FromAsync and Signal.Create from RewriteDynamicDataReactiveSources.ps1 to avoid applying those transformations during automated rewrites. --- .../RewriteDynamicDataReactiveSources.ps1 | 4 ---- src/DynamicData.Tests/Cache/FromAsyncFixture.cs | 8 ++++---- src/DynamicData.Tests/List/FromAsyncFixture.cs | 6 +++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 b/src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 index 389d1a5b1..ed0e510a9 100644 --- a/src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 +++ b/src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 @@ -75,10 +75,6 @@ try { $text = [regex]::Replace($text, '\busing DynamicData(?=[.;])', 'using DynamicData.Reactive') $text = [regex]::Replace($text, '\bOptional<', 'ReactiveUI.Primitives.Optional<') $text = [regex]::Replace($text, '\bOptional\.', 'ReactiveUI.Primitives.Optional.') - $text = $text.Replace('Signal.Lazy', 'Observable.Defer') - $text = $text.Replace('Signal.After', 'Observable.Timer') - $text = $text.Replace('Signal.FromAsync', 'Observable.FromAsync') - $text = $text.Replace('Signal.Create', 'Observable.Create') $text = $text.Replace('.SubscribeSafe(observer.OnError, observer.OnCompleted)', '.Subscribe(_ => { }, observer.OnError, observer.OnCompleted)') $text = $text.Replace('.SubscribeSafe(', '.Subscribe(') $text = $text.Replace('.SynchronizeObject(', '.Synchronize(') diff --git a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs index 07429e250..8d2453fba 100644 --- a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs @@ -18,7 +18,7 @@ Task> Loader() return Task.FromResult(items); } - var data = Signal.FromAsync((Func>>)Loader).ToObservableChangeSet(p => p.Key).AsObservableCache(); + var data = Observable.FromAsync((Func>>)Loader).ToObservableChangeSet(p => p.Key).AsObservableCache(); data.Count.Should().Be(100); } @@ -34,7 +34,7 @@ Task> Loader() Exception? error = null; - var data = Signal.FromAsync((Func>>)Loader).ToObservableChangeSet(p => p.Key).Subscribe((changes) => { }, ex => error = ex); + var data = Observable.FromAsync((Func>>)Loader).ToObservableChangeSet(p => p.Key).Subscribe((changes) => { }, ex => error = ex); error.Should().NotBeNull(); } @@ -49,9 +49,9 @@ Task> Loader() Exception? error = null; - var data = Signal.FromAsync(Loader).ToObservableChangeSet(p => p.Key).Subscribe(changes => { }, ex => error = ex); + var data = Observable.FromAsync(Loader).ToObservableChangeSet(p => p.Key).Subscribe(changes => { }, ex => error = ex); - var data2 = Signal.FromAsync(Loader).ToObservableChangeSet(p => p.Key).AsObservableCache().Connect().Subscribe(changes => { }, ex => error = ex); + var data2 = Observable.FromAsync(Loader).ToObservableChangeSet(p => p.Key).AsObservableCache().Connect().Subscribe(changes => { }, ex => error = ex); //var subscribed = data.Connect() // diff --git a/src/DynamicData.Tests/List/FromAsyncFixture.cs b/src/DynamicData.Tests/List/FromAsyncFixture.cs index 52cf760c8..8b0d74893 100644 --- a/src/DynamicData.Tests/List/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/List/FromAsyncFixture.cs @@ -18,7 +18,7 @@ Task> Loader() return Task.FromResult(items); } - var data = Signal.FromAsync((Func>>)Loader).ToObservableChangeSet().AsObservableList(); + var data = Observable.FromAsync((Func>>)Loader).ToObservableChangeSet().AsObservableList(); data.Count.Should().Be(100); } @@ -34,7 +34,7 @@ Task> Loader() Exception? error = null; - var data = Signal.FromAsync((Func>>)Loader).ToObservableChangeSet().Subscribe((changes) => { }, ex => error = ex); + var data = Observable.FromAsync((Func>>)Loader).ToObservableChangeSet().Subscribe((changes) => { }, ex => error = ex); error.Should().NotBeNull(); } @@ -50,7 +50,7 @@ Task> Loader() Exception? error = null; - var data = Signal.FromAsync((Func>>)Loader).ToObservableChangeSet().AsObservableList(); + var data = Observable.FromAsync((Func>>)Loader).ToObservableChangeSet().AsObservableList(); var subscribed = data.Connect().Subscribe(changes => { }, ex => error = ex); From 3ce3a779ea98b59ab1c9831734189db11c027162 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 12:21:40 +0100 Subject: [PATCH 21/36] Rename Sequencer alias to Scheduler and update usages Replace the old Sequencer alias with Scheduler across project files and code. Updated csproj Using entries (DynamicData.Reactive, DynamicData, DynamicData.Tests) and all code references to use Scheduler.Default / Scheduler.Immediate / Scheduler.Normalize instead of Sequencer.*. Changes touch test fixtures, utilities, and internal ToObservableChangeSet implementations to align naming and fix alias/usage mismatches that would cause compilation errors. --- src/DynamicData.Reactive/DynamicData.Reactive.csproj | 2 +- src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs | 2 +- .../ToObservableChangeSetFixture.Items.IntegrationTests.cs | 2 +- .../ToObservableChangeSetFixture.Sequences.IntegrationTests.cs | 2 +- src/DynamicData.Tests/DynamicData.Tests.csproj | 1 + src/DynamicData.Tests/EnumerableIListFixture.cs | 2 +- .../List/ToObservableChangeSetFixture.Items.IntegrationTests.cs | 2 +- .../ToObservableChangeSetFixture.Sequences.IntegrationTests.cs | 2 +- src/DynamicData.Tests/Utilities/FakerExtensions.cs | 2 +- src/DynamicData.Tests/Utilities/ObservableEx.cs | 2 +- src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs | 2 +- src/DynamicData/Cache/Internal/ToObservableChangeSet.cs | 2 +- src/DynamicData/DynamicData.csproj | 1 + src/DynamicData/List/Internal/ToObservableChangeSet.cs | 2 +- 14 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index 9c73a97d1..d4a724117 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -33,7 +33,7 @@ - + diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs index 15fbc0b06..61bdbc577 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs @@ -11,7 +11,7 @@ public class InnerJoinFixtureRaceCondition [Fact] public void LetsSeeWhetherWeCanRandomlyHitARaceCondition() { - var ids = ObservableChangeSet.Create(sourceCache => { return Observable.Range(1, 1000000, Sequencer.Default).Subscribe(x => sourceCache.AddOrUpdate(x)); }, x => x); + var ids = ObservableChangeSet.Create(sourceCache => { return Observable.Range(1, 1000000, Scheduler.Default).Subscribe(x => sourceCache.AddOrUpdate(x)); }, x => x); var itemsCache = new SourceCache(x => x.Id); itemsCache.AddOrUpdate( diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 5593efe06..621014bc4 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -16,7 +16,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { IScheduler scheduler = schedulerType switch { - SchedulerType.Default => Sequencer.Default, + SchedulerType.Default => Scheduler.Default, SchedulerType.NewThread => new NewThreadScheduler(), SchedulerType.TaskPool => TaskPoolScheduler.Default, SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 07c441e19..5e98bd03a 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -16,7 +16,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { IScheduler scheduler = schedulerType switch { - SchedulerType.Default => Sequencer.Default, + SchedulerType.Default => Scheduler.Default, SchedulerType.NewThread => new NewThreadScheduler(), SchedulerType.TaskPool => TaskPoolScheduler.Default, SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index f2b66b7ac..4c043da54 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -44,6 +44,7 @@ + diff --git a/src/DynamicData.Tests/EnumerableIListFixture.cs b/src/DynamicData.Tests/EnumerableIListFixture.cs index f68dc42b4..f317455d3 100644 --- a/src/DynamicData.Tests/EnumerableIListFixture.cs +++ b/src/DynamicData.Tests/EnumerableIListFixture.cs @@ -44,7 +44,7 @@ public void ExceptionTests() var exSubject = new Signal(); object exceptionRecived = default!; - exSubject.ObserveOn(Sequencer.Immediate).Subscribe(ex => { exceptionRecived = ex; }); + exSubject.ObserveOn(Scheduler.Immediate).Subscribe(ex => { exceptionRecived = ex; }); exSubject.OnNext(new UnspecifiedIndexException()); Assert.IsType(exceptionRecived); diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 5c45f321f..ccb6b45a4 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -16,7 +16,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { IScheduler scheduler = schedulerType switch { - SchedulerType.Default => Sequencer.Default, + SchedulerType.Default => Scheduler.Default, SchedulerType.NewThread => new NewThreadScheduler(), SchedulerType.TaskPool => TaskPoolScheduler.Default, SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, diff --git a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs index 38c8613fe..f56f02469 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -16,7 +16,7 @@ public async Task MultipleSubscriptionsRunInParallel_SchedulerUsageIsThreadSafe( { IScheduler scheduler = schedulerType switch { - SchedulerType.Default => Sequencer.Default, + SchedulerType.Default => Scheduler.Default, SchedulerType.NewThread => new NewThreadScheduler(), SchedulerType.TaskPool => TaskPoolScheduler.Default, SchedulerType.ThreadPool => ThreadPoolScheduler.Instance, diff --git a/src/DynamicData.Tests/Utilities/FakerExtensions.cs b/src/DynamicData.Tests/Utilities/FakerExtensions.cs index 762781528..ca70fed85 100644 --- a/src/DynamicData.Tests/Utilities/FakerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/FakerExtensions.cs @@ -10,5 +10,5 @@ public static IObservable IntervalGenerate(this Faker faker, Randomizer public static IObservable IntervalGenerate(this Faker faker, TimeSpan period, IScheduler? scheduler = null) where T : class => - Observable.Interval(period, scheduler ?? Sequencer.Default).Select(_ => faker.Generate()); + Observable.Interval(period, scheduler ?? Scheduler.Default).Select(_ => faker.Generate()); } diff --git a/src/DynamicData.Tests/Utilities/ObservableEx.cs b/src/DynamicData.Tests/Utilities/ObservableEx.cs index d6b33927e..fdeb4ba65 100644 --- a/src/DynamicData.Tests/Utilities/ObservableEx.cs +++ b/src/DynamicData.Tests/Utilities/ObservableEx.cs @@ -29,6 +29,6 @@ IDisposable HandleNext(IScheduler _, long counter) return sch.Schedule(0, nextInterval(), HandleNext); } - return ScheduleFirst(scheduler ?? Sequencer.Default); + return ScheduleFirst(scheduler ?? Scheduler.Default); }); } diff --git a/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs b/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs index e433c4826..40ad4a30a 100644 --- a/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs +++ b/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs @@ -7,7 +7,7 @@ public static IObservable StressAddRemove(this IObservable item where T : notnull => items.Do(i => onAdd(i, state)) .SelectMany(item => getRemoveTimeout?.Invoke(item) is TimeSpan ts - ? Observable.Timer(ts, scheduler ?? Sequencer.Default) + ? Observable.Timer(ts, scheduler ?? Scheduler.Default) .Do(_ => onRemove(item, state)) .Select(_ => item) : Observable.Return(item)); diff --git a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs index bbdabfaa6..a0037ca02 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -184,7 +184,7 @@ private void OnSourceNext(IEnumerable upstreamItems) var lifetime = _expireAfter?.Invoke(item); if (lifetime is TimeSpan lifetimeValue) { - var expireAtTicks = (now + Sequencer.Normalize(lifetimeValue)).UtcTicks; + var expireAtTicks = (now + Scheduler.Normalize(lifetimeValue)).UtcTicks; var expireAt = new DateTimeOffset(ticks: expireAtTicks - (expireAtTicks % TimeSpan.TicksPerMillisecond), offset: TimeSpan.Zero); _expireAtsByKey[key] = expireAt; diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index 5f4eeff5b..b06452235 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -39,6 +39,7 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int + diff --git a/src/DynamicData/List/Internal/ToObservableChangeSet.cs b/src/DynamicData/List/Internal/ToObservableChangeSet.cs index 3d9bb39b1..7da1eb6b4 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -224,7 +224,7 @@ private void OnSourceNext(IEnumerable upstreamItems) var lifetime = _expireAfter?.Invoke(item); if (lifetime is TimeSpan lifetimeValue) { - var expireAtTicks = (now + Sequencer.Normalize(lifetimeValue)).UtcTicks; + var expireAtTicks = (now + Scheduler.Normalize(lifetimeValue)).UtcTicks; var expireAt = new DateTimeOffset(ticks: expireAtTicks - (expireAtTicks % TimeSpan.TicksPerMillisecond), offset: TimeSpan.Zero); var expiration = new Expiration() From 187d03e456c369c5fbc8a84965eb2a5e4cd48e5a Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 12:30:52 +0100 Subject: [PATCH 22/36] Use Observable.Interval/Return in test helper Replace custom Signal helpers with standard Rx operators in TransformOnObservableFixture.CreateChildObs. The test now uses Observable.Interval(...) and Observable.Return(...) to emit periodic formatted values for a fixed count and then the expected final value before completion, removing the dependency on Signal.Every/Signal.Emit. --- src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs index a19c0b715..a9010090e 100644 --- a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs @@ -81,10 +81,10 @@ public async Task ResultUpdatesOnFutureValues() // Create an observable that fires a wrong value on an interval a fixed number of times // then fires the expected value before completing IObservable CreateChildObs(Animal a, int id) => - Signal.Every(UpdateTime) + Observable.Interval(UpdateTime) .Select(n => $"{a.Name}-{id}-{n}") .Take(UpdateCount) - .Concat(Signal.Emit(a.Name)); + .Concat(Observable.Return(a.Name)); // Arrange var shared = _animalCache.Connect().TransformOnObservable(CreateChildObs).Publish(); From 02b087d0daf207382f281f55951ee36494464601 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 13:42:53 +0100 Subject: [PATCH 23/36] Replace null checks with ThrowIfNull helper Replace inline ArgumentNullException checks with ArgumentExceptionHelper.ThrowIfNull across multiple files for consistent null validation. Also made small related refactors: assign validated parameters after the helper call, switch AsyncDisposeMany gate from object to Lock, replace Map/Keep calls with Select/Where in GroupOn, and tidy constructors in MergeManyItems and ChangeAwareCache. Files changed include EnumerableEx, IObservableListEx, ChangeAwareCache, AbstractFilter, AnonymousObservableCache, AsyncDisposeMany, GroupOn, LockFreeObservableCache, MergeManyItems, ObservableCacheEx (two files) and AnonymousObservableList. --- src/DynamicData.Tests/Kernal/EnumerableEx.cs | 33 ++++--------------- src/DynamicData/Binding/IObservableListEx.cs | 15 ++------- src/DynamicData/Cache/ChangeAwareCache.cs | 4 ++- .../Cache/Internal/AbstractFilter.cs | 3 +- .../Internal/AnonymousObservableCache.cs | 3 +- .../Cache/Internal/AsyncDisposeMany.cs | 2 +- src/DynamicData/Cache/Internal/GroupOn.cs | 4 +-- .../Cache/Internal/LockFreeObservableCache.cs | 10 ++---- .../Cache/Internal/MergeManyItems.cs | 15 +++++---- .../ObservableCacheEx.IgnoreUpdateWhen.cs | 5 +-- .../Cache/ObservableCacheEx.UpdateIndex.cs | 5 +-- .../List/Internal/AnonymousObservableList.cs | 3 +- 12 files changed, 33 insertions(+), 69 deletions(-) diff --git a/src/DynamicData.Tests/Kernal/EnumerableEx.cs b/src/DynamicData.Tests/Kernal/EnumerableEx.cs index 8bc6d7f9e..1c837bf55 100644 --- a/src/DynamicData.Tests/Kernal/EnumerableEx.cs +++ b/src/DynamicData.Tests/Kernal/EnumerableEx.cs @@ -4,15 +4,8 @@ public static class EnumerableEx { public static IEnumerable CurrentNextZip(this IEnumerable source, Func selector) { - if (source is null) - { - throw new ArgumentNullException(nameof(source)); - } - - if (selector is null) - { - throw new ArgumentNullException(nameof(selector)); - } + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(selector); var enumerator = source.GetEnumerator(); if (enumerator.MoveNext()) @@ -32,15 +25,8 @@ public static IEnumerable CurrentNextZip(this IEnumerable PrevCurrentNextZip(this IEnumerable source, Func selector) { - if (source is null) - { - throw new ArgumentNullException(nameof(source)); - } - - if (selector is null) - { - throw new ArgumentNullException(nameof(selector)); - } + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(selector); var enumerator = source.GetEnumerator(); if (enumerator.MoveNext()) @@ -62,15 +48,8 @@ public static IEnumerable PrevCurrentNextZip(this IEnumerab public static IEnumerable PrevCurrentZip(this IEnumerable source, Func selector) { - if (source is null) - { - throw new ArgumentNullException(nameof(source)); - } - - if (selector is null) - { - throw new ArgumentNullException(nameof(selector)); - } + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(selector); var enumerator = source.GetEnumerator(); if (enumerator.MoveNext()) diff --git a/src/DynamicData/Binding/IObservableListEx.cs b/src/DynamicData/Binding/IObservableListEx.cs index c2e867029..9e119f3be 100644 --- a/src/DynamicData/Binding/IObservableListEx.cs +++ b/src/DynamicData/Binding/IObservableListEx.cs @@ -23,10 +23,7 @@ public static class IObservableListEx public static IObservable> BindToObservableList(this IObservable> source, out IObservableList observableList) where TObject : notnull { - if (source is null) - { - throw new ArgumentNullException(nameof(source)); - } + ArgumentExceptionHelper.ThrowIfNull(source); // Load our source list with the change set. // Each change set we need to convert to remove the key. @@ -55,10 +52,7 @@ public static IObservable> BindToObservableList> BindToObservableList< where TObject : notnull where TKey : notnull { - if (source is null) - { - throw new ArgumentNullException(nameof(source)); - } + ArgumentExceptionHelper.ThrowIfNull(source); // Load our source list with the change set. // Each change set we need to convert to remove the key. diff --git a/src/DynamicData/Cache/ChangeAwareCache.cs b/src/DynamicData/Cache/ChangeAwareCache.cs index 806c07e33..e5a5fe80e 100644 --- a/src/DynamicData/Cache/ChangeAwareCache.cs +++ b/src/DynamicData/Cache/ChangeAwareCache.cs @@ -44,7 +44,9 @@ public ChangeAwareCache(int capacity) /// Data to populate the cache with. public ChangeAwareCache(Dictionary data) { - _data = data ?? throw new ArgumentNullException(nameof(data)); + ArgumentExceptionHelper.ThrowIfNull(data); + + _data = data; _changes = []; } diff --git a/src/DynamicData/Cache/Internal/AbstractFilter.cs b/src/DynamicData/Cache/Internal/AbstractFilter.cs index 882dcd9d9..3e2b5ea2f 100644 --- a/src/DynamicData/Cache/Internal/AbstractFilter.cs +++ b/src/DynamicData/Cache/Internal/AbstractFilter.cs @@ -12,8 +12,9 @@ internal abstract class AbstractFilter : IFilter protected AbstractFilter(ChangeAwareCache cache, Func? filter) { - _cache = cache ?? throw new ArgumentNullException(nameof(cache)); + ArgumentExceptionHelper.ThrowIfNull(cache); + _cache = cache; Filter = filter ?? (_ => true); } diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index fb7b44c94..f4dbc53ad 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs @@ -26,8 +26,9 @@ public AnonymousObservableCache(IObservable> source) public AnonymousObservableCache(IObservableCache cache) { - _cache = cache ?? throw new ArgumentNullException(nameof(cache)); + ArgumentExceptionHelper.ThrowIfNull(cache); + _cache = cache; _cleanUp = Disposable.Empty; } diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index 48a695d80..e59488317 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs @@ -19,7 +19,7 @@ public static IObservable> Create( return Observable .Create>(downstreamObserver => { - var gate = new object(); + var gate = new Lock(); var itemsByKey = new Dictionary(); var disposalsCompleted = new ReplaySignal(1); var pendingAsyncDisposals = 0; diff --git a/src/DynamicData/Cache/Internal/GroupOn.cs b/src/DynamicData/Cache/Internal/GroupOn.cs index 1c5675482..98982946c 100644 --- a/src/DynamicData/Cache/Internal/GroupOn.cs +++ b/src/DynamicData/Cache/Internal/GroupOn.cs @@ -21,9 +21,9 @@ public IObservable> Run() => Observabl var queue = new SharedDeliveryQueue(); var grouper = new Grouper(_groupSelectorKey); - var groups = _source.SynchronizeSafe(queue).Finally(observer.OnCompleted).Map(grouper.Update).Keep(changes => changes.Count != 0); + var groups = _source.SynchronizeSafe(queue).Finally(observer.OnCompleted).Select(grouper.Update).Where(changes => changes.Count != 0); - var regroup = _regrouper.SynchronizeSafe(queue).Map(_ => grouper.Regroup()).Keep(changes => changes.Count != 0); + var regroup = _regrouper.SynchronizeSafe(queue).Select(_ => grouper.Regroup()).Where(changes => changes.Count != 0); var published = groups.Merge(regroup).Publish(); var subscriber = published.SubscribeSafe(observer); diff --git a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs index f5a362003..594325bb9 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs @@ -38,10 +38,7 @@ public sealed class LockFreeObservableCache : IObservableCacheThe source. public LockFreeObservableCache(IObservable> source) { - if (source is null) - { - throw new ArgumentNullException(nameof(source)); - } + ArgumentExceptionHelper.ThrowIfNull(source); _updater = new CacheUpdater(_innerCache); @@ -120,10 +117,7 @@ public IObservable> Connect(Func? predi /// The edit action. public void Edit(Action> editAction) { - if (editAction is null) - { - throw new ArgumentNullException(nameof(editAction)); - } + ArgumentExceptionHelper.ThrowIfNull(editAction); editAction(_updater); _changes.OnNext(_innerCache.CaptureChanges()); diff --git a/src/DynamicData/Cache/Internal/MergeManyItems.cs b/src/DynamicData/Cache/Internal/MergeManyItems.cs index b546e9d20..c815e4774 100644 --- a/src/DynamicData/Cache/Internal/MergeManyItems.cs +++ b/src/DynamicData/Cache/Internal/MergeManyItems.cs @@ -14,18 +14,19 @@ internal sealed class MergeManyItems public MergeManyItems(IObservable> source, Func> observableSelector) { - _source = source ?? throw new ArgumentNullException(nameof(source)); - _observableSelector = observableSelector ?? throw new ArgumentNullException(nameof(observableSelector)); + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); + + _source = source; + _observableSelector = observableSelector; } public MergeManyItems(IObservable> source, Func> observableSelector) { - if (observableSelector is null) - { - throw new ArgumentNullException(nameof(observableSelector)); - } + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(observableSelector); - _source = source ?? throw new ArgumentNullException(nameof(source)); + _source = source; _observableSelector = (t, _) => observableSelector(t); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs index c017227a9..6879aa463 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs @@ -24,10 +24,7 @@ public static IObservable> IgnoreUpdateWhen diff --git a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs index c99b03002..5f97c7d63 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs @@ -25,10 +25,7 @@ public static IObservable> UpdateIndex changes.SortedItems.Select((update, index) => new { update, index }).ForEach(u => u.update.Value.Index = u.index)); } diff --git a/src/DynamicData/List/Internal/AnonymousObservableList.cs b/src/DynamicData/List/Internal/AnonymousObservableList.cs index f53d44a01..4e5f7f6c9 100644 --- a/src/DynamicData/List/Internal/AnonymousObservableList.cs +++ b/src/DynamicData/List/Internal/AnonymousObservableList.cs @@ -24,7 +24,8 @@ public AnonymousObservableList(IObservable> source) public AnonymousObservableList(ISourceList sourceList) { - _sourceList = sourceList ?? throw new ArgumentNullException(nameof(sourceList)); + ArgumentExceptionHelper.ThrowIfNull(sourceList); + _sourceList = sourceList; _cleanUp = Disposable.Empty; } From 080d8bfbeb8575a652ab05997b522f056145c562 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 13:54:29 +0100 Subject: [PATCH 24/36] Add 11.0.x to CI matrix Include 11.0.x in the CI job matrix by adding it to the versions list in .github/workflows/ci-build.yml. This expands the tested runtime to cover 11.0.x; cache and dependency-path settings are unchanged. --- .github/workflows/ci-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 1b588dd07..38b1c189a 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -29,6 +29,7 @@ jobs: 8.0.x 9.0.x 10.0.x + 11.0.x cache: true cache-dependency-path: | **/Directory.Packages.props From 80e72ff8baac3b59ddec21a494ef2bc5153e9a22 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 15:52:35 +0100 Subject: [PATCH 25/36] Massive refactor across core modules Remove preprocessed reactive source files and apply widespread updates across Aggregation, Alias, Binding, Cache, List, Kernel, Internal, Experimental and related areas. Many implementations, interfaces and tests were adjusted for consistency, cleanup and maintainability; includes deletion of DynamicData.Reactive preprocessed files and broad code updates across the library. --- .../RewriteDynamicDataReactiveSources.ps1 | 109 - .../reactive-preprocessed.xml | 20024 ---------------- .../Aggregation/AggregateEnumerator.cs | 5 + src/DynamicData/Aggregation/AggregateItem.cs | 7 +- src/DynamicData/Aggregation/AggregateType.cs | 7 +- src/DynamicData/Aggregation/AggregationEx.cs | 5 + src/DynamicData/Aggregation/Avg.cs | 5 + src/DynamicData/Aggregation/AvgEx.cs | 5 + src/DynamicData/Aggregation/CountEx.cs | 5 + .../Aggregation/IAggregateChangeSet.cs | 5 + src/DynamicData/Aggregation/MaxEx.cs | 5 + src/DynamicData/Aggregation/StdDev.cs | 5 + src/DynamicData/Aggregation/StdDevEx.cs | 5 + src/DynamicData/Aggregation/SumEx.cs | 5 + src/DynamicData/Alias/ObservableCacheAlias.cs | 5 + src/DynamicData/Alias/ObservableListAlias.cs | 5 + .../Binding/AbstractNotifyPropertyChanged.cs | 5 + src/DynamicData/Binding/BindPaged.cs | 5 + src/DynamicData/Binding/BindVirtualized.cs | 5 + src/DynamicData/Binding/BindingListAdaptor.cs | 11 +- .../Binding/BindingListEventsSuspender.cs | 5 + src/DynamicData/Binding/BindingListEx.cs | 5 + src/DynamicData/Binding/BindingOptions.cs | 5 + src/DynamicData/Binding/ExpressionBuilder.cs | 5 + src/DynamicData/Binding/IEvaluateAware.cs | 5 + src/DynamicData/Binding/IIndexAware.cs | 7 +- .../INotifyCollectionChangedSuspender.cs | 5 + .../Binding/IObservableCollection.cs | 5 + .../Binding/IObservableCollectionAdaptor.cs | 5 + src/DynamicData/Binding/IObservableListEx.cs | 5 + .../ISortedObservableCollectionAdaptor.cs | 5 + .../Binding/NotifyPropertyChangedEx.cs | 5 + .../Binding/ObservableCollectionAdaptor.cs | 10 + .../Binding/ObservableCollectionEx.cs | 5 + .../Binding/ObservableCollectionExtended.cs | 5 + .../Binding/ObservablePropertyFactory.cs | 5 + .../Binding/ObservablePropertyFactoryCache.cs | 5 + .../Binding/ObservablePropertyPart.cs | 5 + src/DynamicData/Binding/PropertyValue.cs | 5 + src/DynamicData/Binding/SortAndBind.cs | 10 + src/DynamicData/Binding/SortAndBindOptions.cs | 5 + src/DynamicData/Binding/SortDirection.cs | 7 +- src/DynamicData/Binding/SortExpression.cs | 7 +- .../Binding/SortExpressionComparer.cs | 7 +- .../Binding/SortedBindingListAdaptor.cs | 6 +- .../SortedObservableCollectionAdaptor.cs | 5 + src/DynamicData/Cache/CacheChangeSetEx.cs | 7 +- src/DynamicData/Cache/Change.cs | 12 +- src/DynamicData/Cache/ChangeAwareCache.cs | 6 +- src/DynamicData/Cache/ChangeReason.cs | 6 +- src/DynamicData/Cache/ChangeSet.cs | 6 +- src/DynamicData/Cache/DistinctChangeSet.cs | 6 +- src/DynamicData/Cache/GroupChangeSet.cs | 6 +- src/DynamicData/Cache/ICache.cs | 4 + src/DynamicData/Cache/ICacheUpdater.cs | 4 + src/DynamicData/Cache/IChangeSet.cs | 6 +- src/DynamicData/Cache/IChangeSetAdaptor.cs | 6 +- src/DynamicData/Cache/IConnectableCache.cs | 4 + src/DynamicData/Cache/IDistinctChangeSet.cs | 6 +- src/DynamicData/Cache/IGroup.cs | 4 + src/DynamicData/Cache/IGroupChangeSet.cs | 6 +- src/DynamicData/Cache/IGrouping.cs | 6 +- .../Cache/IImmutableGroupChangeSet.cs | 7 +- src/DynamicData/Cache/IIntermediateCache.cs | 4 + src/DynamicData/Cache/IKey.cs | 5 + src/DynamicData/Cache/IKeyValue.cs | 5 + src/DynamicData/Cache/IKeyValueCollection.cs | 4 + src/DynamicData/Cache/IObservableCache.cs | 6 +- src/DynamicData/Cache/IPageRequest.cs | 5 + src/DynamicData/Cache/IPageResponse.cs | 5 + src/DynamicData/Cache/IPagedChangeSet.cs | 11 +- src/DynamicData/Cache/IQuery.cs | 6 +- src/DynamicData/Cache/ISortedChangeSet.cs | 5 + .../Cache/ISortedChangeSetAdaptor.cs | 7 +- src/DynamicData/Cache/ISourceCache.cs | 4 + src/DynamicData/Cache/ISourceUpdater.cs | 4 + src/DynamicData/Cache/IVirtualChangeSet.cs | 7 +- src/DynamicData/Cache/IVirtualRequest.cs | 7 +- src/DynamicData/Cache/IVirtualResponse.cs | 7 +- src/DynamicData/Cache/IndexedItem.cs | 4 + src/DynamicData/Cache/IntermediateCache.cs | 10 +- .../Cache/Internal/AbstractFilter.cs | 11 +- .../Internal/AnonymousObservableCache.cs | 7 +- .../Cache/Internal/AnonymousQuery.cs | 7 +- .../Cache/Internal/AsyncDisposeMany.cs | 5 + src/DynamicData/Cache/Internal/AutoRefresh.cs | 5 + src/DynamicData/Cache/Internal/BatchIf.cs | 5 + src/DynamicData/Cache/Internal/Cache.cs | 7 +- src/DynamicData/Cache/Internal/CacheEx.cs | 7 +- .../Cache/Internal/CacheUpdater.cs | 11 +- src/DynamicData/Cache/Internal/Cast.cs | 5 + .../Cache/Internal/ChangeSetCache.cs | 5 + .../Cache/Internal/ChangeSetMergeTracker.cs | 13 +- .../Cache/Internal/CombineOperator.cs | 7 +- src/DynamicData/Cache/Internal/Combiner.cs | 5 + .../Cache/Internal/DeferUntilLoaded.cs | 5 + .../Cache/Internal/DictionaryExtensions.cs | 7 +- src/DynamicData/Cache/Internal/DisposeMany.cs | 5 + .../Cache/Internal/DistinctCalculator.cs | 5 + .../Cache/Internal/DynamicCombiner.cs | 5 + .../Cache/Internal/DynamicGrouper.cs | 11 +- src/DynamicData/Cache/Internal/EditDiff.cs | 7 +- .../Cache/Internal/EditDiffChangeSet.cs | 7 +- .../Internal/EditDiffChangeSetOptional.cs | 11 +- .../Cache/Internal/ExpirableItem.cs | 7 +- .../Cache/Internal/ExpireAfter.ForSource.cs | 5 + .../Cache/Internal/ExpireAfter.ForStream.cs | 5 + .../Cache/Internal/Filter.Dynamic.cs | 5 + .../Cache/Internal/Filter.Static.cs | 5 + src/DynamicData/Cache/Internal/FilterEx.cs | 5 + .../Cache/Internal/FilterImmutable.cs | 5 + .../Cache/Internal/FilterOnObservable.cs | 5 + .../Cache/Internal/FilteredIndexCalculator.cs | 7 +- src/DynamicData/Cache/Internal/FinallySafe.cs | 5 + src/DynamicData/Cache/Internal/FullJoin.cs | 13 +- .../Cache/Internal/FullJoinMany.cs | 9 +- src/DynamicData/Cache/Internal/GroupOn.cs | 5 + .../Cache/Internal/GroupOnDynamic.cs | 5 + .../Cache/Internal/GroupOnImmutable.cs | 7 +- .../Cache/Internal/GroupOnObservable.cs | 5 + .../Cache/Internal/GroupOnProperty.cs | 5 + .../GroupOnPropertyWithImmutableState.cs | 5 + src/DynamicData/Cache/Internal/IFilter.cs | 7 +- .../Cache/Internal/IKeySelector.cs | 5 + .../Cache/Internal/ImmutableGroup.cs | 7 +- .../Cache/Internal/ImmutableGroupChangeSet.cs | 7 +- .../Cache/Internal/IndexAndNode.cs | 7 +- .../Cache/Internal/IndexCalculator.cs | 5 + src/DynamicData/Cache/Internal/InnerJoin.cs | 5 + .../Cache/Internal/InnerJoinMany.cs | 5 + src/DynamicData/Cache/Internal/KeyComparer.cs | 7 +- src/DynamicData/Cache/Internal/KeySelector.cs | 5 + .../Cache/Internal/KeySelectorException.cs | 5 + .../Cache/Internal/KeyValueCollection.cs | 5 + .../Cache/Internal/KeyValueComparer.cs | 7 +- src/DynamicData/Cache/Internal/LeftJoin.cs | 15 +- .../Cache/Internal/LeftJoinMany.cs | 5 + .../Cache/Internal/LockFreeObservableCache.cs | 7 +- .../Cache/Internal/ManagedGroup.cs | 5 + .../Cache/Internal/MergeChangeSets.cs | 5 + src/DynamicData/Cache/Internal/MergeMany.cs | 5 + .../Internal/MergeManyCacheChangeSets.cs | 5 + .../MergeManyCacheChangeSetsSourceCompare.cs | 5 + .../Cache/Internal/MergeManyItems.cs | 5 + .../Cache/Internal/MergeManyListChangeSets.cs | 10 + .../Cache/Internal/ObservableWithValue.cs | 7 +- src/DynamicData/Cache/Internal/OfType.cs | 7 +- .../Cache/Internal/OnBeingRemoved.cs | 5 + src/DynamicData/Cache/Internal/Page.cs | 5 + .../Cache/Internal/QueryWhenChanged.cs | 5 + .../Cache/Internal/ReaderWriter.cs | 7 +- src/DynamicData/Cache/Internal/RefCount.cs | 5 + .../Cache/Internal/RemoveKeyEnumerator.cs | 7 +- src/DynamicData/Cache/Internal/RightJoin.cs | 11 +- .../Cache/Internal/RightJoinMany.cs | 9 +- src/DynamicData/Cache/Internal/SizeExpirer.cs | 5 + src/DynamicData/Cache/Internal/SizeLimiter.cs | 7 +- src/DynamicData/Cache/Internal/Sort.cs | 5 + src/DynamicData/Cache/Internal/SortAndPage.cs | 10 + .../Cache/Internal/SortAndVirtualize.cs | 10 + .../Cache/Internal/SortExtensions.cs | 7 +- .../Internal/SortedKeyValueApplicator.cs | 12 +- .../Cache/Internal/SpecifiedGrouper.cs | 5 + .../Cache/Internal/StatusMonitor.cs | 5 + .../Cache/Internal/SubscribeMany.cs | 5 + src/DynamicData/Cache/Internal/Switch.cs | 5 + .../Cache/Internal/ToObservableChangeSet.cs | 5 + .../Cache/Internal/ToObservableOptional.cs | 15 +- src/DynamicData/Cache/Internal/Transform.cs | 7 +- .../Cache/Internal/TransformAsync.cs | 11 +- .../Cache/Internal/TransformImmutable.cs | 7 +- .../Cache/Internal/TransformMany.cs | 10 + .../Cache/Internal/TransformManyAsync.cs | 5 + .../Cache/Internal/TransformOnObservable.cs | 5 + .../Internal/TransformWithForcedTransform.cs | 7 +- .../Internal/TransformWithInlineUpdate.cs | 5 + src/DynamicData/Cache/Internal/TreeBuilder.cs | 5 + src/DynamicData/Cache/Internal/TrueFor.cs | 5 + .../Cache/Internal/UniquenessEnforcer.cs | 5 + src/DynamicData/Cache/Internal/Virtualise.cs | 5 + src/DynamicData/Cache/MissingKeyException.cs | 6 +- src/DynamicData/Cache/Node.cs | 8 +- src/DynamicData/Cache/ObservableCache.cs | 14 +- .../Cache/ObservableCacheEx.Adapt.cs | 10 + .../Cache/ObservableCacheEx.AdaptSelector.cs | 5 + .../Cache/ObservableCacheEx.AddOrUpdate.cs | 5 + .../Cache/ObservableCacheEx.And.cs | 10 + .../ObservableCacheEx.AsObservableCache.cs | 10 + .../ObservableCacheEx.AsyncDisposeMany.cs | 5 + .../Cache/ObservableCacheEx.AutoRefresh.cs | 9 + ...servableCacheEx.AutoRefreshOnObservable.cs | 10 + .../Cache/ObservableCacheEx.Batch.cs | 5 + .../Cache/ObservableCacheEx.BatchIf.cs | 10 + .../Cache/ObservableCacheEx.Bind.cs | 10 + .../Cache/ObservableCacheEx.BufferInitial.cs | 5 + .../Cache/ObservableCacheEx.Cast.cs | 10 + .../Cache/ObservableCacheEx.ChangeKey.cs | 5 + .../Cache/ObservableCacheEx.Clear.cs | 10 + .../Cache/ObservableCacheEx.Clone.cs | 5 + .../Cache/ObservableCacheEx.Combine.cs | 10 + .../Cache/ObservableCacheEx.Convert.cs | 5 + ...vableCacheEx.CreateChangeSetTransformer.cs | 9 + .../ObservableCacheEx.DeferUntilLoaded.cs | 10 + .../Cache/ObservableCacheEx.DisposeMany.cs | 10 + .../Cache/ObservableCacheEx.DistinctValues.cs | 10 + .../Cache/ObservableCacheEx.EditDiff.cs | 12 +- .../ObservableCacheEx.EnsureUniqueKeys.cs | 10 + .../Cache/ObservableCacheEx.Except.cs | 10 + .../Cache/ObservableCacheEx.ExpireAfter.cs | 5 + .../Cache/ObservableCacheEx.Filter.cs | 5 + .../ObservableCacheEx.FilterImmutable.cs | 10 + .../ObservableCacheEx.FilterOnObservable.cs | 10 + .../Cache/ObservableCacheEx.FinallySafe.cs | 10 + .../Cache/ObservableCacheEx.Flatten.cs | 5 + .../ObservableCacheEx.FlattenBufferResult.cs | 5 + .../Cache/ObservableCacheEx.ForEachChange.cs | 5 + .../Cache/ObservableCacheEx.ForForced.cs | 5 + .../Cache/ObservableCacheEx.FullJoin.cs | 22 +- .../Cache/ObservableCacheEx.FullJoinMany.cs | 16 +- .../Cache/ObservableCacheEx.Group.cs | 10 + .../ObservableCacheEx.GroupOnObservable.cs | 10 + .../ObservableCacheEx.GroupOnProperty.cs | 9 + ...cheEx.GroupOnPropertyWithImmutableState.cs | 9 + ...servableCacheEx.GroupWithImmutableState.cs | 10 + ...rvableCacheEx.IgnoreSameReferenceUpdate.cs | 5 + .../ObservableCacheEx.IgnoreUpdateWhen.cs | 5 + .../ObservableCacheEx.IncludeUpdateWhen.cs | 5 + .../Cache/ObservableCacheEx.InnerJoin.cs | 10 + .../Cache/ObservableCacheEx.InnerJoinMany.cs | 10 + .../Cache/ObservableCacheEx.InvokeEvaluate.cs | 10 + .../Cache/ObservableCacheEx.LeftJoin.cs | 16 +- .../Cache/ObservableCacheEx.LeftJoinMany.cs | 10 + .../Cache/ObservableCacheEx.LimitSizeTo.cs | 10 + .../ObservableCacheEx.MergeChangeSets.cs | 10 + .../Cache/ObservableCacheEx.MergeMany.cs | 10 + .../ObservableCacheEx.MergeManyChangeSets.cs | 10 + .../Cache/ObservableCacheEx.MergeManyItems.cs | 10 + .../Cache/ObservableCacheEx.MonitorStatus.cs | 10 + .../Cache/ObservableCacheEx.NotEmpty.cs | 5 + .../Cache/ObservableCacheEx.OfType.cs | 10 + .../Cache/ObservableCacheEx.OnChangeAction.cs | 5 + .../Cache/ObservableCacheEx.OnItemAdded.cs | 5 + .../ObservableCacheEx.OnItemRefreshed.cs | 5 + .../Cache/ObservableCacheEx.OnItemRemoved.cs | 10 + .../Cache/ObservableCacheEx.OnItemUpdated.cs | 5 + src/DynamicData/Cache/ObservableCacheEx.Or.cs | 10 + .../Cache/ObservableCacheEx.PopulateFrom.cs | 5 + .../Cache/ObservableCacheEx.PopulateInto.cs | 10 + .../ObservableCacheEx.QueryWhenChanged.cs | 14 + .../Cache/ObservableCacheEx.RefCount.cs | 10 + .../Cache/ObservableCacheEx.Refresh.cs | 5 + .../Cache/ObservableCacheEx.Remove.cs | 5 + .../Cache/ObservableCacheEx.RemoveKey.cs | 10 + .../Cache/ObservableCacheEx.RemoveKeys.cs | 5 + .../Cache/ObservableCacheEx.RightJoin.cs | 16 +- .../Cache/ObservableCacheEx.RightJoinMany.cs | 14 +- .../Cache/ObservableCacheEx.SkipInitial.cs | 5 + .../Cache/ObservableCacheEx.Sort.cs | 10 + .../Cache/ObservableCacheEx.SortAndBind.cs | 10 + .../Cache/ObservableCacheEx.SortBy.cs | 10 + .../Cache/ObservableCacheEx.StartWithEmpty.cs | 10 + .../Cache/ObservableCacheEx.StartWithItem.cs | 5 + .../Cache/ObservableCacheEx.SubscribeMany.cs | 10 + .../ObservableCacheEx.SuppressRefresh.cs | 5 + .../Cache/ObservableCacheEx.Switch.cs | 10 + .../Cache/ObservableCacheEx.ToCollection.cs | 5 + ...ObservableCacheEx.ToObservableChangeSet.cs | 5 + .../ObservableCacheEx.ToObservableOptional.cs | 30 +- .../ObservableCacheEx.ToSortedCollection.cs | 10 + .../Cache/ObservableCacheEx.Transform.cs | 16 +- .../Cache/ObservableCacheEx.TransformAsync.cs | 14 +- .../ObservableCacheEx.TransformImmutable.cs | 10 + .../Cache/ObservableCacheEx.TransformMany.cs | 10 + .../ObservableCacheEx.TransformManyAsync.cs | 9 + ...bservableCacheEx.TransformManySafeAsync.cs | 9 + ...ObservableCacheEx.TransformOnObservable.cs | 10 + .../Cache/ObservableCacheEx.TransformSafe.cs | 14 +- .../ObservableCacheEx.TransformSafeAsync.cs | 14 +- .../ObservableCacheEx.TransformToTree.cs | 10 + ...rvableCacheEx.TransformWithInlineUpdate.cs | 10 + ...ObservableCacheEx.TreatMovesAsRemoveAdd.cs | 5 + .../Cache/ObservableCacheEx.TrueFor.cs | 10 + .../Cache/ObservableCacheEx.TrueForAll.cs | 5 + .../Cache/ObservableCacheEx.TrueForAny.cs | 5 + .../Cache/ObservableCacheEx.UpdateIndex.cs | 10 + .../ObservableCacheEx.VirtualiseAndPage.cs | 10 + .../Cache/ObservableCacheEx.Watch.cs | 5 + .../Cache/ObservableCacheEx.WatchValue.cs | 7 +- ...bservableCacheEx.WhenAnyPropertyChanged.cs | 10 + .../ObservableCacheEx.WhenPropertyChanged.cs | 9 + .../ObservableCacheEx.WhenValueChanged.cs | 9 + .../ObservableCacheEx.WhereReasonsAre.cs | 5 + .../ObservableCacheEx.WhereReasonsAreNot.cs | 5 + .../Cache/ObservableCacheEx.Xor.cs | 10 + src/DynamicData/Cache/ObservableCacheEx.cs | 5 + src/DynamicData/Cache/PageContext.cs | 12 +- src/DynamicData/Cache/PageRequest.cs | 4 + src/DynamicData/Cache/PageResponse.cs | 9 + src/DynamicData/Cache/PagedChangeSet.cs | 13 + src/DynamicData/Cache/SortAndPageOptions.cs | 12 +- .../Cache/SortAndVirtualizeOptions.cs | 12 +- src/DynamicData/Cache/SortOptimisations.cs | 6 +- src/DynamicData/Cache/SortReason.cs | 7 +- src/DynamicData/Cache/SortedChangeSet.cs | 9 + src/DynamicData/Cache/SourceCache.cs | 10 +- src/DynamicData/Cache/SourceCacheEx.cs | 6 +- .../Cache/Tests/ChangeSetAggregator.cs | 10 + .../Tests/DistinctChangeSetAggregator.cs | 9 + .../Cache/Tests/GroupChangeSetAggregator.cs | 10 + .../Cache/Tests/PagedChangeSetAggregator.cs | 9 + .../Cache/Tests/SortedChangeSetAggregator.cs | 9 + src/DynamicData/Cache/Tests/TestEx.cs | 6 +- .../Cache/Tests/VirtualChangeSetAggregator.cs | 9 + .../Cache/TransformAsyncOptions.cs | 7 +- src/DynamicData/Cache/VirtualChangeSet.cs | 11 +- src/DynamicData/Cache/VirtualContext.cs | 7 +- src/DynamicData/Cache/VirtualRequest.cs | 6 +- src/DynamicData/Cache/VirtualResponse.cs | 6 +- src/DynamicData/Constants.cs | 7 +- .../Diagnostics/ChangeStatistics.cs | 7 +- src/DynamicData/Diagnostics/ChangeSummary.cs | 7 +- .../Diagnostics/DiagnosticOperators.cs | 5 + src/DynamicData/DynamicDataOptions.cs | 12 +- src/DynamicData/EnumerableEx.cs | 5 + .../Experimental/ExperimentalEx.cs | 5 + .../Experimental/ISubjectWithRefCount.cs | 5 + src/DynamicData/Experimental/IWatcher.cs | 7 +- .../Experimental/SubjectWithRefCount.cs | 5 + src/DynamicData/Experimental/Watcher.cs | 5 + src/DynamicData/GlobalConfig.cs | 5 + src/DynamicData/IChangeSet.cs | 7 +- src/DynamicData/Internal/Bitset.cs | 5 + .../Internal/CacheParentSubscription.cs | 5 + src/DynamicData/Internal/DeliveryQueue.cs | 7 +- src/DynamicData/Internal/KeyedDisposable.cs | 7 +- src/DynamicData/Internal/Notification.cs | 13 +- .../Internal/SharedDeliveryQueue.cs | 5 + src/DynamicData/Internal/SwappableLock.cs | 7 +- .../Internal/SynchronizeSafeExtensions.cs | 5 + src/DynamicData/Kernel/ConnectionStatus.cs | 5 + src/DynamicData/Kernel/EnumerableEx.cs | 5 + src/DynamicData/Kernel/EnumerableIList.cs | 6 +- src/DynamicData/Kernel/EnumeratorIList.cs | 6 +- src/DynamicData/Kernel/Error.cs | 7 +- src/DynamicData/Kernel/IEnumerableIList.cs | 6 +- src/DynamicData/Kernel/ISupportsCapacity.cs | 7 +- src/DynamicData/Kernel/InternalEx.cs | 5 + src/DynamicData/Kernel/ItemWithIndex.cs | 5 + src/DynamicData/Kernel/ItemWithValue.cs | 5 + src/DynamicData/Kernel/OptionElse.cs | 7 +- src/DynamicData/Kernel/OptionExtensions.cs | 43 +- .../Kernel/OptionObservableExtensions.cs | 35 +- src/DynamicData/Kernel/ParallelEx.cs | 7 +- .../Kernel/ReadOnlyCollectionLight.cs | 5 + .../Kernel/ReferenceEqualityComparer.cs | 5 + src/DynamicData/List/Change.cs | 10 +- src/DynamicData/List/ChangeAwareList.cs | 7 +- .../List/ChangeAwareListWithRefCounts.cs | 11 +- src/DynamicData/List/ChangeSet.cs | 4 + src/DynamicData/List/ChangeSetEx.cs | 13 + src/DynamicData/List/ChangeType.cs | 5 + src/DynamicData/List/IChangeSet.cs | 6 +- src/DynamicData/List/IChangeSetAdaptor.cs | 5 + src/DynamicData/List/IExtendedList.cs | 6 +- src/DynamicData/List/IGroup.cs | 5 + src/DynamicData/List/IGrouping.cs | 5 + src/DynamicData/List/IObservableList.cs | 4 + src/DynamicData/List/IPageChangeSet.cs | 9 + src/DynamicData/List/ISourceList.cs | 4 + src/DynamicData/List/IVirtualChangeSet.cs | 7 +- .../List/Internal/AnonymousObservableList.cs | 5 + src/DynamicData/List/Internal/AutoRefresh.cs | 5 + src/DynamicData/List/Internal/BufferIf.cs | 5 + .../List/Internal/ChangeSetMergeTracker.cs | 7 +- .../List/Internal/ClonedListChangeSet.cs | 5 + src/DynamicData/List/Internal/Combiner.cs | 10 + .../List/Internal/DeferUntilLoaded.cs | 5 + src/DynamicData/List/Internal/DisposeMany.cs | 5 + src/DynamicData/List/Internal/Distinct.cs | 5 + .../List/Internal/DynamicCombiner.cs | 10 + src/DynamicData/List/Internal/EditDiff.cs | 7 +- .../List/Internal/ExpirableItem.cs | 5 + src/DynamicData/List/Internal/ExpireAfter.cs | 5 + .../List/Internal/Filter.Dynamic.cs | 5 + .../List/Internal/Filter.Static.cs | 5 + .../Internal/Filter.WithPredicateState.cs | 5 + .../List/Internal/FilterOnObservable.cs | 5 + .../List/Internal/FilterOnProperty.cs | 5 + src/DynamicData/List/Internal/FilterStatic.cs | 5 + src/DynamicData/List/Internal/Group.cs | 5 + src/DynamicData/List/Internal/GroupOn.cs | 9 +- .../List/Internal/GroupOnImmutable.cs | 9 +- .../List/Internal/GroupOnProperty.cs | 5 + .../GroupOnPropertyWithImmutableState.cs | 5 + .../List/Internal/ImmutableGroup.cs | 5 + src/DynamicData/List/Internal/LimitSizeTo.cs | 5 + .../List/Internal/MergeChangeSets.cs | 5 + src/DynamicData/List/Internal/MergeMany.cs | 5 + .../List/Internal/MergeManyCacheChangeSets.cs | 10 + .../List/Internal/MergeManyListChangeSets.cs | 5 + src/DynamicData/List/Internal/OnItemAdded.cs | 5 + .../List/Internal/OnItemRefreshed.cs | 5 + .../List/Internal/OnItemRemoved.cs | 5 + src/DynamicData/List/Internal/Pager.cs | 5 + .../List/Internal/QueryWhenChanged.cs | 5 + src/DynamicData/List/Internal/ReaderWriter.cs | 5 + src/DynamicData/List/Internal/RefCount.cs | 5 + .../List/Internal/ReferenceCountTracker.cs | 7 +- src/DynamicData/List/Internal/Sort.cs | 5 + .../List/Internal/SubscribeMany.cs | 5 + src/DynamicData/List/Internal/Switch.cs | 5 + .../List/Internal/ToObservableChangeSet.cs | 5 + .../List/Internal/TransformAsync.cs | 21 +- .../List/Internal/TransformMany.cs | 10 + src/DynamicData/List/Internal/Transformer.cs | 21 +- .../List/Internal/UnifiedChange.cs | 11 +- src/DynamicData/List/Internal/Virtualiser.cs | 5 + src/DynamicData/List/ItemChange.cs | 10 +- src/DynamicData/List/Linq/AddKeyEnumerator.cs | 5 + .../List/Linq/ItemChangeEnumerator.cs | 5 + src/DynamicData/List/Linq/Reverser.cs | 7 +- .../List/Linq/UnifiedChangeEnumerator.cs | 10 + .../List/Linq/WithoutIndexEnumerator.cs | 5 + src/DynamicData/List/ListChangeReason.cs | 5 + src/DynamicData/List/ListEx.cs | 8 +- src/DynamicData/List/ListFilterPolicy.cs | 5 + .../List/ObservableListEx.Adapt.cs | 9 + .../List/ObservableListEx.AddKey.cs | 9 + src/DynamicData/List/ObservableListEx.And.cs | 9 + .../List/ObservableListEx.AsObservableList.cs | 9 + .../List/ObservableListEx.AutoRefresh.cs | 8 + ...bservableListEx.AutoRefreshOnObservable.cs | 9 + src/DynamicData/List/ObservableListEx.Bind.cs | 9 + .../List/ObservableListEx.BufferIf.cs | 9 + .../List/ObservableListEx.BufferInitial.cs | 4 + src/DynamicData/List/ObservableListEx.Cast.cs | 4 + .../List/ObservableListEx.CastToObject.cs | 4 + .../List/ObservableListEx.Clone.cs | 9 + .../List/ObservableListEx.Combine.cs | 13 + .../List/ObservableListEx.Convert.cs | 4 + .../List/ObservableListEx.DeferUntilLoaded.cs | 9 + .../List/ObservableListEx.DisposeMany.cs | 9 + .../List/ObservableListEx.DistinctValues.cs | 9 + .../List/ObservableListEx.Except.cs | 9 + .../List/ObservableListEx.ExpireAfter.cs | 4 + .../List/ObservableListEx.Filter.cs | 4 + .../ObservableListEx.FilterOnObservable.cs | 9 + .../List/ObservableListEx.FilterOnProperty.cs | 8 + .../ObservableListEx.FlattenBufferResult.cs | 4 + .../List/ObservableListEx.ForEachChange.cs | 4 + .../ObservableListEx.ForEachItemChange.cs | 4 + .../List/ObservableListEx.GroupOn.cs | 8 + .../List/ObservableListEx.GroupOnProperty.cs | 8 + ...istEx.GroupOnPropertyWithImmutableState.cs | 8 + ...bservableListEx.GroupWithImmutableState.cs | 8 + .../List/ObservableListEx.LimitSizeTo.cs | 9 + .../List/ObservableListEx.MergeChangeSets.cs | 9 + .../List/ObservableListEx.MergeMany.cs | 8 + .../ObservableListEx.MergeManyChangeSets.cs | 9 + .../List/ObservableListEx.NotEmpty.cs | 4 + .../List/ObservableListEx.OnItemAdded.cs | 4 + .../List/ObservableListEx.OnItemRefreshed.cs | 4 + .../List/ObservableListEx.OnItemRemoved.cs | 4 + src/DynamicData/List/ObservableListEx.Or.cs | 9 + src/DynamicData/List/ObservableListEx.Page.cs | 9 + .../List/ObservableListEx.PopulateInto.cs | 9 + .../List/ObservableListEx.QueryWhenChanged.cs | 13 + .../List/ObservableListEx.RefCount.cs | 9 + .../List/ObservableListEx.RemoveIndex.cs | 4 + .../List/ObservableListEx.Reverse.cs | 9 + .../List/ObservableListEx.SkipInitial.cs | 4 + src/DynamicData/List/ObservableListEx.Sort.cs | 13 + .../List/ObservableListEx.StartWithEmpty.cs | 4 + .../List/ObservableListEx.SubscribeMany.cs | 9 + .../List/ObservableListEx.SuppressRefresh.cs | 4 + .../List/ObservableListEx.Switch.cs | 9 + .../List/ObservableListEx.ToCollection.cs | 9 + .../ObservableListEx.ToObservableChangeSet.cs | 4 + .../ObservableListEx.ToSortedCollection.cs | 9 + src/DynamicData/List/ObservableListEx.Top.cs | 4 + .../List/ObservableListEx.Transform.cs | 13 +- .../List/ObservableListEx.TransformAsync.cs | 13 +- .../List/ObservableListEx.TransformMany.cs | 9 + .../List/ObservableListEx.Virtualise.cs | 9 + ...ObservableListEx.WhenAnyPropertyChanged.cs | 8 + .../ObservableListEx.WhenPropertyChanged.cs | 8 + .../List/ObservableListEx.WhenValueChanged.cs | 8 + .../List/ObservableListEx.WhereReasonsAre.cs | 4 + .../ObservableListEx.WhereReasonsAreNot.cs | 4 + src/DynamicData/List/ObservableListEx.Xor.cs | 9 + src/DynamicData/List/ObservableListEx.cs | 4 + src/DynamicData/List/PageChangeSet.cs | 9 + src/DynamicData/List/RangeChange.cs | 4 + src/DynamicData/List/SortException.cs | 4 + src/DynamicData/List/SortOptions.cs | 7 +- src/DynamicData/List/SourceList.cs | 9 + .../List/SourceListEditConvenienceEx.cs | 9 + src/DynamicData/List/SourceListEx.cs | 6 +- .../List/Tests/ChangeSetAggregator.cs | 4 + src/DynamicData/List/Tests/ListTextEx.cs | 6 +- .../List/UnspecifiedIndexException.cs | 4 + src/DynamicData/List/VirtualChangeSet.cs | 4 + src/DynamicData/ObservableChangeSet.cs | 5 + src/DynamicData/Platforms/net45/PFilter.cs | 11 +- .../Platforms/net45/PSubscribeMany.cs | 4 + src/DynamicData/Platforms/net45/PTransform.cs | 10 +- src/DynamicData/Platforms/net45/ParallelEx.cs | 4 + .../Platforms/net45/ParallelOperators.cs | 4 + .../Platforms/net45/ParallelType.cs | 4 + .../Platforms/net45/ParallelisationOptions.cs | 4 + .../Polyfills/ArgumentExceptionHelper.cs | 5 + .../ArgumentOutOfRangeExceptionHelper.cs | 5 + 512 files changed, 3447 insertions(+), 20393 deletions(-) delete mode 100644 src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 delete mode 100644 src/DynamicData.Reactive/reactive-preprocessed.xml diff --git a/src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 b/src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 deleted file mode 100644 index ed0e510a9..000000000 --- a/src/DynamicData.Reactive/RewriteDynamicDataReactiveSources.ps1 +++ /dev/null @@ -1,109 +0,0 @@ -param( - [Parameter(Mandatory = $true)] - [string]$SourceRoot, - [Parameter(Mandatory = $true)] - [string]$OutputRoot -) - -$ErrorActionPreference = 'Stop' - -$sourceRootPath = (Resolve-Path $SourceRoot).Path -$outputRootPath = [IO.Path]::GetFullPath($OutputRoot) -$mutex = New-Object System.Threading.Mutex($false, 'Local\DynamicDataReactiveSourceRewrite') -$mutexHeld = $false - -function Get-SourceFile { - param([Parameter(Mandatory = $true)][string]$Path) - - Get-ChildItem -LiteralPath $Path -File -Filter '*.cs' - - Get-ChildItem -LiteralPath $Path -Directory | - Where-Object { $_.Name -ne 'bin' -and $_.Name -ne 'obj' } | - ForEach-Object { Get-SourceFile -Path $_.FullName } -} - -function Write-GeneratedSource { - param( - [Parameter(Mandatory = $true)][string]$Path, - [Parameter(Mandatory = $true)][string]$Text - ) - - for ($attempt = 0; $attempt -lt 5; $attempt++) { - try { - [IO.File]::WriteAllText($Path, $Text) - return - } - catch { - if ($attempt -eq 4) { - throw - } - - Start-Sleep -Milliseconds (50 * ($attempt + 1)) - } - } -} - -try { - $mutexHeld = $mutex.WaitOne([TimeSpan]::FromMinutes(5)) - if (-not $mutexHeld) { - throw "Timed out waiting for DynamicData.Reactive source rewrite lock." - } - - if ((Split-Path -Leaf $outputRootPath) -ne 'GeneratedReactiveSources') { - throw "Refusing to clean unexpected DynamicData.Reactive generated source directory '$outputRootPath'." - } - - if (Test-Path -LiteralPath $outputRootPath) { - Remove-Item -LiteralPath $outputRootPath -Recurse -Force - } - - New-Item -ItemType Directory -Force -Path $outputRootPath | Out-Null - - Get-SourceFile -Path $sourceRootPath | - Where-Object { - $_.FullName -notlike '*\Internal\ObservableEx.cs' -and - $_.FullName -notlike '*\Internal\ReactiveCompatibility.cs' - } | - ForEach-Object { - $relative = $_.FullName.Substring($sourceRootPath.Length).TrimStart('\', '/') - $destination = Join-Path $outputRootPath $relative - $destinationDirectory = Split-Path -Parent $destination - New-Item -ItemType Directory -Force -Path $destinationDirectory | Out-Null - - $text = Get-Content -LiteralPath $_.FullName -Raw - $text = [regex]::Replace($text, '\bnamespace DynamicData(?=[\s.;{])', 'namespace DynamicData.Reactive') - $text = [regex]::Replace($text, '\busing DynamicData(?=[.;])', 'using DynamicData.Reactive') - $text = [regex]::Replace($text, '\bOptional<', 'ReactiveUI.Primitives.Optional<') - $text = [regex]::Replace($text, '\bOptional\.', 'ReactiveUI.Primitives.Optional.') - $text = $text.Replace('.SubscribeSafe(observer.OnError, observer.OnCompleted)', '.Subscribe(_ => { }, observer.OnError, observer.OnCompleted)') - $text = $text.Replace('.SubscribeSafe(', '.Subscribe(') - $text = $text.Replace('.SynchronizeObject(', '.Synchronize(') - $text = $text.Replace('.Map(', '.Select(') - $text = $text.Replace('.Tap(', '.Do(') - $text = $text.Replace('.Keep(', '.Where(') - $text = $text.Replace('Scope.Create', 'Disposable.Create') - $text = $text.Replace('Scope.Empty', 'Disposable.Empty') - $text = $text.Replace('MultipleDisposable', 'CompositeDisposable') - $text = $text.Replace('OnceDisposable', 'SingleAssignmentDisposable') - $text = $text.Replace('SwapDisposable', 'SerialDisposable') - $text = $text.Replace('ReplaySignal<', 'ReplaySubject<') - $text = $text.Replace('BehaviorSignal<', 'BehaviorSubject<') - $text = $text.Replace('StateSignal<', 'BehaviorSubject<') - $text = $text.Replace('ISignal<', 'ISubject<') - $text = [regex]::Replace($text, '\bSignal<', 'Subject<') - - Write-GeneratedSource -Path $destination -Text $text - } -} -catch { - [Console]::Error.WriteLine($_.Exception.Message) - [Console]::Error.WriteLine($_.ScriptStackTrace) - exit 1 -} -finally { - if ($mutexHeld) { - $mutex.ReleaseMutex() - } - - $mutex.Dispose() -} diff --git a/src/DynamicData.Reactive/reactive-preprocessed.xml b/src/DynamicData.Reactive/reactive-preprocessed.xml deleted file mode 100644 index 157602ff6..000000000 --- a/src/DynamicData.Reactive/reactive-preprocessed.xml +++ /dev/null @@ -1,20024 +0,0 @@ - - - - - - <_AfterSdkPublishDependsOn Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true'">AfterPublish - <_AfterSdkPublishDependsOn Condition="'$(UsingMicrosoftNETSdkWeb)' != 'true'">Publish - - - - - true - - true - $(CustomAfterDirectoryBuildProps);$(MSBuildThisFileDirectory)UseArtifactsOutputPath.props - - - $(ProjectExtensionsPathForSpecifiedProject) - - - - - $(MSBuildThisFileDirectory)..\..\..\Microsoft.NETCoreSdk.BundledVersions.props - - - - - - $([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)..\..\')) - $(MSBuildThisFileDirectory) - $([MSBuild]::EnsureTrailingSlash('$(NetCoreRoot)'))packs - $([MSBuild]::EnsureTrailingSlash('$(MSBuildThisFileDirectory)'))PrunePackageData - <_NetFrameworkHostedCompilersVersion>5.8.0-1.26302.115 - 11.0 - 11.0 - net11.0 - 11.0.0-preview.5.26302.115 - 2.1 - 2.1.0 - 11.0.0-preview.5.26302.115 - $(MSBuildThisFileDirectory)RuntimeIdentifierGraph.json - 11.0.100-preview.5.26302.115 - 11.0.100 - win-x64 - win-x64 - <_NETCoreSdkIsPreview>true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_KnownRuntimeIdentifierPlatforms Include="any;aot;freebsd;illumos;solaris;unix;any;aot;freebsd;openbsd;illumos;solaris;haiku;unix;any;aot;freebsd;openbsd;illumos;solaris;haiku;unix;any;aot;freebsd;openbsd;illumos;solaris;haiku;unix;any;aot;freebsd;openbsd;illumos;solaris;haiku;unix;any;aot;freebsd;openbsd;illumos;solaris;haiku;unix" /> - <_ExcludedKnownRuntimeIdentifierPlatforms Include="tizen.4.0.0;tizen.5.0.0;tizen.4.0.0;tizen.5.0.0;tizen.4.0.0;tizen.5.0.0;tizen.4.0.0;tizen.5.0.0;tizen.4.0.0;tizen.5.0.0;tizen.4.0.0;tizen.5.0.0" /> - - - - - - - - true - true - true - true - true - - - - <_DirectoryBuildPropsFile Condition="'$(_DirectoryBuildPropsFile)' == ''">Directory.Build.props - <_DirectoryBuildPropsBasePath Condition="'$(_DirectoryBuildPropsBasePath)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), '$(_DirectoryBuildPropsFile)')) - $([System.IO.Path]::Combine('$(_DirectoryBuildPropsBasePath)', '$(_DirectoryBuildPropsFile)')) - - - - - true - $(NoWarn);1591;1701;1702;1705;VSX1000;CA1510 - AnyCPU - enable - latest - $(MSBuildProjectName.Contains('Tests')) - $(MSBuildProjectName.Contains('Benchmarks')) - embedded - Roland Pheasant - Roland Pheasant - Copyright (c) Roland Pheasant 2011-$([System.DateTime]::Now.ToString(yyyy)) - MIT - https://github.com/reactiveui/DynamicData - DynamicData;Dynamic;Data;Rx;Reactive;Observable;Cache;Binding;ObservableCache;ObservableList;ObservableCollection;Collection;Linq - https://github.com/reactiveui/DynamicData/releases - https://github.com/reactiveui/DynamicData - git - logo.png - README.md - true - - true - - true - - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - CS8600;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8623;CS8624;CS8625;CS8626;CS8627;CS8628;CS8629;CS8630;CS8634;CS8766;CS8767 - enable - - - true - - - false - - - - - - - - - - - - $(MSBuildThisFileDirectory) - - - - - - - - - - - - - - - - - - - - - true - $(MSBuildProjectName) - - - $(ArtifactsPath)\obj\$(ArtifactsProjectName)\ - $(ArtifactsPath)\obj\ - - - - <_ArtifactsPathSetEarly>true - - - - - - obj\ - $(BaseIntermediateOutputPath)\ - <_InitialBaseIntermediateOutputPath>$(BaseIntermediateOutputPath) - $(BaseIntermediateOutputPath) - - $([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(MSBuildProjectExtensionsPath)')) - $(MSBuildProjectExtensionsPath)\ - - false - true - <_InitialMSBuildProjectExtensionsPath Condition=" '$(ImportProjectExtensionProps)' == 'true' ">$(MSBuildProjectExtensionsPath) - - - - True - NuGet - $(MSBuildThisFileDirectory)project.assets.json - $(UserProfile)\.nuget\packages\ - C:\Users\chris\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages - PackageReference - 7.0.0 - - - - - - - - - - - - - - - - None - MSBuildTargetCaching - - $(MSBuildThisFileDirectory)PrivateP2PCaching.proj - - - - - - <_MicrosoftSourceLinkCommonAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\Microsoft.SourceLink.Common.dll - <_MicrosoftSourceLinkCommonAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\core\Microsoft.SourceLink.Common.dll - - - - true - - true - - - - - - $(MSBuildThisFileDirectory)..\tools\net472\Microsoft.Build.Tasks.Git.dll - $(MSBuildThisFileDirectory)..\tools\core\Microsoft.Build.Tasks.Git.dll - - - - - - - - - - - - - $(MSBuildThisFileDirectory)Microsoft.NET.ILLink.targets - - true - $(MSBuildThisFileDirectory)..\tools\net\ILLink.Tasks.dll - $(MSBuildThisFileDirectory)..\tools\netframework\ILLink.Tasks.dll - $(MSBuildThisFileDirectory)Microsoft.NET.ILLink.Analyzers.props - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 - C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.net.illink.tasks\10.0.8 - - - C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 - C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.net.illink.tasks\11.0.0-preview.5.26302.115 - - - C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 - C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 - - - C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 - C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 - - - C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 - C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 - - - C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 - C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 - - - C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 - C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.net.illink.tasks\8.0.27 - - - C:\Users\chris\.nuget\packages\stylecop.analyzers.unstable\1.2.0.556 - C:\Users\chris\.nuget\packages\roslynator.analyzers\4.15.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.common\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.build.tasks.git\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.sourcelink.github\8.0.0 - C:\Users\chris\.nuget\packages\microsoft.net.illink.tasks\9.0.16 - - - - - - - $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.Before.$(MSBuildThisFile) - $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.After.$(MSBuildThisFile) - - - - - true - - - $(DefaultProjectConfiguration) - $(DefaultProjectPlatform) - - - WJProject - JavaScript - - - - - - - - $([MSBuild]::IsRunningFromVisualStudio()) - $([MSBuild]::GetToolsDirectory32())\..\..\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.props - $(MSBuildToolsPath)\NuGet.props - - - - - - true - - - - <_DirectoryPackagesPropsFile Condition="'$(_DirectoryPackagesPropsFile)' == ''">Directory.Packages.props - <_DirectoryPackagesPropsBasePath Condition="'$(_DirectoryPackagesPropsBasePath)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)', '$(_DirectoryPackagesPropsFile)')) - $([MSBuild]::NormalizePath('$(_DirectoryPackagesPropsBasePath)', '$(_DirectoryPackagesPropsFile)')) - - - - true - - - - true - true - true - true - true - true - true - true - true - true - true - true - true - - - - - - - true - - - - Debug;Release - AnyCPU - Debug - AnyCPU - - - - - true - - - - Library - 512 - prompt - $(MSBuildProjectName) - $(MSBuildProjectName.Replace(" ", "_")) - true - - - - true - false - - - true - - - - - <_PlatformWithoutConfigurationInference>$(Platform) - - - x64 - - - x86 - - - ARM - - - arm64 - - - - - {CandidateAssemblyFiles} - $(AssemblySearchPaths);{HintPathFromItem} - $(AssemblySearchPaths);{TargetFrameworkDirectory} - $(AssemblySearchPaths);{RawFileName} - - - None - portable - - false - - true - true - - PackageReference - $(AssemblySearchPaths) - false - false - false - false - false - false - - false - false - false - false - true - 1.0.3 - false - true - true - - - - <_ImplicitFileBasedProgramUserSecretsId Condition="'$(FileBasedProgram)' == 'true'">$(AssemblyName)-$([MSBuild]::StableStringHash($(MSBuildProjectFullPath.ToLowerInvariant()), 'Sha256')) - $(_ImplicitFileBasedProgramUserSecretsId) - - - - $(MSBuildThisFileDirectory)GenerateDeps\GenerateDeps.proj - - - - - - $(MSBuildThisFileDirectory)..\..\..\Microsoft.NETCoreSdk.BundledMSBuildInformation.props - - - - - 18.6.0 - 18.8.0 - <_MSBuildVersionMajorMinor>$([System.Version]::Parse('$(MSBuildVersion)').ToString(2)) - <_IsDisjointMSBuildVersion>$([MSBuild]::VersionLessThan('$(_MSBuildVersionMajorMinor)', '18.8')) - - - - - false - - - <__WindowsAppSdkDefaultImageIncludes>**/*.png;**/*.bmp;**/*.jpg;**/*.dds;**/*.tif;**/*.tga;**/*.gif - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <__DisableWorkloadResolverSentinelPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildBinPath)\DisableWorkloadResolver.sentinel - <__DisableWorkloadResolverSentinelPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildToolsPath32)\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\DisableWorkloadResolver.sentinel - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - false - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - true - - - - $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)')) - true - - - - - - - - - - - - - - - - - net10.0 - true - - - - - - - - - - - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v1.0" DisplayName=".NET Core 1.0" Alias="netcoreapp1.0" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v1.1" DisplayName=".NET Core 1.1" Alias="netcoreapp1.1" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v2.0" DisplayName=".NET Core 2.0" Alias="netcoreapp2.0" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v2.1" DisplayName=".NET Core 2.1" Alias="netcoreapp2.1" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v2.2" DisplayName=".NET Core 2.2" Alias="netcoreapp2.2" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v3.0" DisplayName=".NET Core 3.0" Alias="netcoreapp3.0" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v3.1" DisplayName=".NET Core 3.1" Alias="netcoreapp3.1" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v5.0" DisplayName=".NET 5.0" Alias="net5.0" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v6.0" DisplayName=".NET 6.0" Alias="net6.0" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v7.0" DisplayName=".NET 7.0" Alias="net7.0" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v8.0" DisplayName=".NET 8.0" Alias="net8.0" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v9.0" DisplayName=".NET 9.0" Alias="net9.0" /> - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v10.0" DisplayName=".NET 10.0" Alias="net10.0" /> - - <_NETCoreAppVersionsForDefines Include=".NETCoreApp,Version=v11.0" DisplayName=".NET 11.0" Alias="net11.0" /> - - - - - - - - - $([MSBuild]::Add($(NETCoreAppMaximumVersion), 1)).0 - 19.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_NormalizedWindowsSdkSupportedTargetPlatformVersion Include="@(WindowsSdkSupportedTargetPlatformVersion)"> - $([System.Text.RegularExpressions.Regex]::Replace(%(Identity), '^((\d+\.){3})1$', '${1}0')) - - - - - - - - - true - <_SourceLinkPropsImported>true - - - - - - - - - - - - - - 1701;1702 - - $(WarningsAsErrors);NU1605 - - - $(DefineConstants); - $(DefineConstants)TRACE - - - - - - - - - - - - - - - - - - - - - - - - - $(TargetsForTfmSpecificContentInPackage);_PackProjectToolValidation - - - - - - MSBuild:Compile - $(DefaultXamlRuntime) - Designer - - - MSBuild:Compile - $(DefaultXamlRuntime) - Designer - - - - - - - - - - - - - - - - - - <_WpfCommonNetFxReference Include="WindowsBase" /> - <_WpfCommonNetFxReference Include="PresentationCore" /> - <_WpfCommonNetFxReference Include="PresentationFramework" /> - <_WpfCommonNetFxReference Include="System.Xaml" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.0'"> - 4.0 - - <_WpfCommonNetFxReference Include="UIAutomationClient" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.0'" /> - <_WpfCommonNetFxReference Include="UIAutomationClientSideProviders" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.0'" /> - <_WpfCommonNetFxReference Include="UIAutomationProvider" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.0'" /> - <_WpfCommonNetFxReference Include="UIAutomationTypes" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.0'" /> - <_WpfCommonNetFxReference Include="System.Windows.Controls.Ribbon" Condition="'$(_TargetFrameworkVersionValue)' != '' And '$(_TargetFrameworkVersionValue)' >= '4.5'" /> - - - <_SDKImplicitReference Include="@(_WpfCommonNetFxReference)" Condition="'$(UseWPF)' == 'true'" /> - <_SDKImplicitReference Include="System.Windows.Forms" Condition="('$(UseWindowsForms)' == 'true') " /> - <_SDKImplicitReference Include="WindowsFormsIntegration" Condition=" ('$(UseWindowsForms)' == 'true') And ('$(UseWPF)' == 'true') " /> - - - - - - <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v1.0" /> - <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v1.1" /> - <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v2.0" /> - <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v2.1" /> - <_UnsupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v2.2" /> - - <_UnsupportedNETStandardTargetFramework Include="@(SupportedNETStandardTargetFramework)" /> - - <_UnsupportedNETFrameworkTargetFramework Include=".NETFramework,Version=v2.0" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - <_TargetFrameworkVersionValue>0.0 - <_WindowsDesktopSdkTargetFrameworkVersionFloor>3.0 - - - - - - - - Dynamic Data - - Bring the power of Rx to collections using Dynamic Data. - Dynamic Data is a comprehensive caching and data manipulation solution which introduces domain centric observable collections. - Linq extensions enable dynamic filtering, sorting, grouping, transforms, binding, pagination, data virtualisation, expiration, disposal management plus more. - - net462;net472;net48;net481;net8.0;net9.0;net10.0;net11.0 - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - <_IsExecutable Condition="'$(OutputType)' == 'Exe' or '$(OutputType)'=='WinExe'">true - - - $(_IsExecutable) - <_UsingDefaultForHasRuntimeOutput>true - - - - - 1.0.0 - $(VersionPrefix)-$(VersionSuffix) - $(VersionPrefix) - - - $(AssemblyName) - $(Authors) - $(AssemblyName) - $(AssemblyName) - - - - - Debug - AnyCPU - $(Platform) - - - - - - - true - <_PublishProfileDesignerFolder Condition="'$(AppDesignerFolder)' != ''">$(AppDesignerFolder) - <_PublishProfileDesignerFolder Condition="'$(_PublishProfileDesignerFolder)' == ''">Properties - <_PublishProfileRootFolder Condition="'$(_PublishProfileRootFolder)' == ''">$(MSBuildProjectDirectory)\$(_PublishProfileDesignerFolder)\PublishProfiles\ - $([System.IO.Path]::GetFileNameWithoutExtension($(PublishProfile))) - $(_PublishProfileRootFolder)$(PublishProfileName).pubxml - $(PublishProfileFullPath) - - false - - - - - - - - - - - - - $([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) - v$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)', 2)) - - - <_TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion.TrimStart('vV')) - - - - $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) - $([MSBuild]::GetTargetPlatformVersion('$(TargetFramework)', 4)) - - <_TargetPlatformVersionUsesCsWinRT3>false - <_TargetPlatformVersionUsesCsWinRT3 Condition="'$(TargetPlatformIdentifier)' == 'Windows' and '$(TargetPlatformVersion)' != '' and $([System.Version]::Parse('$(TargetPlatformVersion)').Revision) == 1">true - $([System.Version]::Parse('$(TargetPlatformVersion)').Major).$([System.Version]::Parse('$(TargetPlatformVersion)').Minor).$([System.Version]::Parse('$(TargetPlatformVersion)').Build).0 - $([MSBuild]::GetTargetPlatformVersion('$(TargetFramework)', 2)) - - $(TargetPlatformVersion) - - Windows - - - - <_UnsupportedTargetFrameworkError>true - - - - - - - - - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - v0.0 - - - _ - - - - - - - - - - true - - - - - - - - - - <_EnableDefaultWindowsPlatform>false - false - - - 2.1 - - - - - - - - - - - - - - <_ApplicableTargetPlatformVersion Include="@(SdkSupportedTargetPlatformVersion)" Condition="'@(SdkSupportedTargetPlatformVersion)' != '' and '%(SdkSupportedTargetPlatformVersion.DefineConstantsOnly)' != 'true'" RemoveMetadata="DefineConstantsOnly" /> - <_ValidTargetPlatformVersion Include="@(_ApplicableTargetPlatformVersion)" Condition="'@(_ApplicableTargetPlatformVersion)' != '' and $([MSBuild]::VersionEquals(%(Identity), $(TargetPlatformVersion)))" /> - - - @(_ValidTargetPlatformVersion->Distinct()) - - - - - true - <_ValidTargetPlatformVersions Condition="'@(_ApplicableTargetPlatformVersion)' != ''">@(_ApplicableTargetPlatformVersion, '%0a') - <_ValidTargetPlatformVersions Condition="'@(_ApplicableTargetPlatformVersion)' == ''">None - - - - - - - true - true - - - - - - - - - true - false - true - <_PlatformToAppendToOutputPath Condition="'$(AppendPlatformToOutputPath)' == 'true'">$(PlatformName)\ - - - - - - - - <_DefaultArtifactsPathPropsImported>true - - - - true - true - <_ArtifactsPathLocationType>ExplicitlySpecified - - - - - $(_DirectoryBuildPropsBasePath)\artifacts - true - <_ArtifactsPathLocationType>DirectoryBuildPropsFolder - - - - $(MSBuildProjectDirectory)\artifacts - <_ArtifactsPathLocationType>ProjectFolder - - - - <_CanonicalizedArtifactsPath Condition="'$(ArtifactsPath)' != ''">$([MSBuild]::EnsureTrailingSlash($([System.IO.Path]::GetFullPath('$(ArtifactsPath)')))) - - - - - - - $(MSBuildProjectName) - bin - publish - package - - true - - - $(Configuration.ToLowerInvariant()) - - $(ArtifactsPivots)_$(TargetFramework.ToLowerInvariant()) - - $(ArtifactsPivots)_$(RuntimeIdentifier.ToLowerInvariant()) - - - - $(ArtifactsPath)\$(ArtifactsBinOutputName)\$(ArtifactsProjectName)\ - $(ArtifactsPath)\obj\$(ArtifactsProjectName)\ - $(ArtifactsPath)\$(ArtifactsPublishOutputName)\$(ArtifactsProjectName)\$(ArtifactsPivots)\ - - - - $(ArtifactsPath)\$(ArtifactsBinOutputName)\ - $(ArtifactsPath)\obj\ - $(ArtifactsPath)\$(ArtifactsPublishOutputName)\$(ArtifactsPivots)\ - - - $(BaseOutputPath)$(ArtifactsPivots)\ - $(BaseIntermediateOutputPath)$(ArtifactsPivots)\ - - $(ArtifactsPath)\$(ArtifactsPackageOutputName)\$(Configuration.ToLowerInvariant())\ - - - bin\ - $(BaseOutputPath)\ - $(BaseOutputPath)$(_PlatformToAppendToOutputPath)$(Configuration)\ - $(OutputPath)\ - - - - obj\ - $(BaseIntermediateOutputPath)\ - $(BaseIntermediateOutputPath)$(_PlatformToAppendToOutputPath)$(Configuration)\ - $(IntermediateOutputPath)\ - - - - $(OutputPath) - - - - $(DefaultItemExcludes);$(OutputPath)/** - $(DefaultItemExcludes);$(IntermediateOutputPath)/** - - - $(DefaultItemExcludes);$(ArtifactsPath)/** - - $(DefaultItemExcludes);bin/**;obj/** - - - - $(OutputPath)$(TargetFramework.ToLowerInvariant())\ - - - $(IntermediateOutputPath)$(TargetFramework.ToLowerInvariant())\ - - - - - - - - - - - true - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_RuntimePackInWorkloadVersionCurrent>11.0.0-preview.5.26302.115 - <_RuntimePackInWorkloadVersion10>10.0.8 - <_RuntimePackInWorkloadVersion9>9.0.16 - <_RuntimePackInWorkloadVersion8>8.0.27 - <_RuntimePackInWorkloadVersion7>7.0.20 - <_RuntimePackInWorkloadVersion6>6.0.36 - true - - - - - true - true - true - true - true - - - - <_BrowserWorkloadNotSupportedForTFM Condition="$([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '6.0'))">true - <_BrowserWorkloadDisabled>$(_BrowserWorkloadNotSupportedForTFM) - <_UsingBlazorOrWasmSdk Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' or '$(UsingMicrosoftNETSdkWebAssembly)' == 'true'">true - - - $(WasmNativeWorkload11) - $(WasmNativeWorkload10) - $(WasmNativeWorkload9) - $(WasmNativeWorkload8) - $(WasmNativeWorkload7) - $(WasmNativeWorkload) - false - $(WasmNativeWorkloadAvailable) - - - - - - <_WasmNativeWorkloadNeeded Condition=" '$(WasmEnableSIMD)' == 'false' or '$(WasmEnableExceptionHandling)' == 'false' or '$(InvariantTimezone)' == 'true' or '$(WasmNativeStrip)' == 'false' or '$(WasmNativeDebugSymbols)' == 'true' or '$(WasmSingleFileBundle)' == 'false' or '$(EnableDiagnostics)' == 'true' or '$(WasmProfilers)' != '' or '$(RunAOTCompilation)' == 'true' or '$(WasmBuildNative)' == 'true' or '$(WasmGenerateAppBundle)' == 'true' or '$(EmccInitialHeapSize)' != '' or '$(EmccMaximumHeapSize)' != '' ">true - false - true - $(WasmNativeWorkloadAvailable) - - - - <_IsAndroidLibraryMode Condition="'$(RuntimeIdentifier)' == 'android-arm64' or '$(RuntimeIdentifier)' == 'android-arm' or '$(RuntimeIdentifier)' == 'android-x64' or '$(RuntimeIdentifier)' == 'android-x86'">true - <_IsAppleMobileLibraryMode Condition="'$(RuntimeIdentifier)' == 'ios-arm64' or '$(RuntimeIdentifier)' == 'iossimulator-arm64' or '$(RuntimeIdentifier)' == 'iossimulator-x64' or '$(RuntimeIdentifier)' == 'maccatalyst-arm64' or '$(RuntimeIdentifier)' == 'maccatalyst-x64' or '$(RuntimeIdentifier)' == 'tvos-arm64'">true - <_IsiOSLibraryMode Condition="'$(RuntimeIdentifier)' == 'ios-arm64' or '$(RuntimeIdentifier)' == 'iossimulator-arm64' or '$(RuntimeIdentifier)' == 'iossimulator-x64'">true - <_IsMacCatalystLibraryMode Condition="'$(RuntimeIdentifier)' == 'maccatalyst-arm64' or '$(RuntimeIdentifier)' == 'maccatalyst-x64'">true - <_IstvOSLibraryMode Condition="'$(RuntimeIdentifier)' == 'tvos-arm64'">true - - - true - - - <_MonoWorkloadTargetsMobile>true - - - false - true - - - - $(_RuntimePackInWorkloadVersionCurrent) - - - - - true - 1.0 - - - - - - - true - 1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersionCurrent) - - - - - %(RuntimePackRuntimeIdentifiers);wasi-wasm - $(_MonoWorkloadRuntimePackPackageVersion) - - Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** - - - $(_MonoWorkloadRuntimePackPackageVersion) - - - - - - true - - - <_NativeBuildNeeded Condition="'$(RunAOTCompilation)' == 'true'">true - WebAssembly workloads (required for AOT) are only supported for projects targeting net6.0+ - - - true - $(WasmNativeWorkload) - - - 10.0 - 11.0 - - - false - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_MonoWorkloadTargetsMobile>true - <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersion6) - - - - $(_MonoWorkloadRuntimePackPackageVersion) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_MonoWorkloadTargetsMobile>true - <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersion7) - - - - $(_MonoWorkloadRuntimePackPackageVersion) - - Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_MonoWorkloadTargetsMobile>true - <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersion8) - - - - - %(RuntimePackRuntimeIdentifiers);wasi-wasm - $(_MonoWorkloadRuntimePackPackageVersion) - - Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersion9) - - - - - %(RuntimePackRuntimeIdentifiers);wasi-wasm - $(_MonoWorkloadRuntimePackPackageVersion) - - Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** - - - $(_MonoWorkloadRuntimePackPackageVersion) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_MonoWorkloadRuntimePackPackageVersion>$(_RuntimePackInWorkloadVersion10) - <_KnownWebAssemblySdkPackVersion>$(_RuntimePackInWorkloadVersion10) - - - - - %(RuntimePackRuntimeIdentifiers);wasi-wasm - $(_MonoWorkloadRuntimePackPackageVersion) - - Microsoft.NETCore.App.Runtime.Mono.multithread.**RID** - - - $(_MonoWorkloadRuntimePackPackageVersion) - - - $(_KnownWebAssemblySdkPackVersion) - - - - - - - - - - - - - - - - - - - - <_ResolvedSuggestedWorkload Include="@(SuggestedWorkload)" /> - <_ResolvedSuggestedWorkload Include="@(SuggestedWorkloadFromReference)" /> - - - - - - - - - <_UsingDefaultRuntimeIdentifier>true - win7-x64 - win7-x86 - win-x64 - win-x86 - - - - true - - - - <_IsPublishing>true - - - - $(PublishSelfContained) - - - - true - - - $(NETCoreSdkPortableRuntimeIdentifier) - - - - true - - - $(NETCoreSdkPortableRuntimeIdentifier) - - - - $(RuntimeIdentifiers);$(PublishRuntimeIdentifier) - - - $(PublishRuntimeIdentifier) - - - <_UsingDefaultPlatformTarget>true - - - - - - - x86 - - - - - x64 - - - - - arm - - - - - arm64 - - - - - AnyCPU - - - - - - - <_SelfContainedWasSpecified Condition="'$(SelfContained)' != ''">true - - - - true - false - <_RuntimeIdentifierUsesAppHost Condition="$(RuntimeIdentifier.StartsWith('ios')) or $(RuntimeIdentifier.StartsWith('tvos')) or $(RuntimeIdentifier.StartsWith('maccatalyst')) or $(RuntimeIdentifier.StartsWith('android')) or $(RuntimeIdentifier.StartsWith('browser')) or $(RuntimeIdentifier.StartsWith('wasi')) or $(RuntimeIdentifier) == 'any'">false - <_RuntimeIdentifierUsesAppHost Condition="'$(_IsPublishing)' == 'true' and '$(PublishAot)' == 'true'">false - <_RuntimeIdentifierUsesAppHost Condition="'$(_RuntimeIdentifierUsesAppHost)' == ''">true - true - false - - - - $(NETCoreSdkRuntimeIdentifier) - win-x64 - win-x86 - win-arm - win-arm64 - - $(DefaultAppHostRuntimeIdentifier.Replace("arm64", "x64")) - - $(DefaultAppHostRuntimeIdentifier.Replace("arm64", "x64")) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - false - - - - - - - - - - - - - true - - - - - - - - true - - - - $(IntermediateOutputPath)$(RuntimeIdentifier)\ - $(OutputPath)$(RuntimeIdentifier)\ - - - - - - - - - - - - - - - - - true - true - - - - <_EolNetCoreTargetFrameworkVersions Include="1.0;1.1;2.0;2.1;2.2;3.0;3.1;5.0;6.0;7.0" /> - - - <_MinimumNonEolSupportedNetCoreTargetFramework>net8.0 - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - <_IsNETCoreOrNETStandard Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true - <_IsNETCoreOrNETStandard Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">true - - - - true - true - true - - - true - - - - true - - true - - .dll - - false - - - - $(PreserveCompilationContext) - - - - publish - - $(OutputPath)$(RuntimeIdentifier)\$(PublishDirName)\ - $(OutputPath)$(PublishDirName)\ - - - - - - <_NugetFallbackFolder>$(MSBuildThisFileDirectory)..\..\..\..\NuGetFallbackFolder - <_IsNETCore1x Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_TargetFrameworkVersionWithoutV)' < '2.0' ">true - <_WorkloadLibraryPacksFolder Condition="'$(_WorkloadLibraryPacksFolder)' == ''">$([MSBuild]::EnsureTrailingSlash('$(NetCoreRoot)'))library-packs - - - $(RestoreAdditionalProjectSources);$(_NugetFallbackFolder) - $(RestoreAdditionalProjectFallbackFoldersExcludes);$(_NugetFallbackFolder) - $(RestoreAdditionalProjectFallbackFolders);$(_NugetFallbackFolder) - - - $(RestoreAdditionalProjectSources);$(_WorkloadLibraryPacksFolder) - - - - <_SDKImplicitReference Include="System" /> - <_SDKImplicitReference Include="System.Data" /> - <_SDKImplicitReference Include="System.Drawing" /> - <_SDKImplicitReference Include="System.Xml" /> - - - <_SDKImplicitReference Include="System.Core" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' " /> - <_SDKImplicitReference Include="System.Runtime.Serialization" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' " /> - <_SDKImplicitReference Include="System.Xml.Linq" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' " /> - - <_SDKImplicitReference Include="System.Numerics" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.0' " /> - - <_SDKImplicitReference Include="System.IO.Compression.FileSystem" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.5' " /> - <_SDKImplicitReference Update="@(_SDKImplicitReference)" Pack="false" IsImplicitlyDefined="true" /> - - <_SDKImplicitReference Remove="@(Reference)" /> - - - - - - false - - - $(AssetTargetFallback);net461;net462;net47;net471;net472;net48;net481 - - - - - <_FrameworkIdentifierForImplicitDefine>$(TargetFrameworkIdentifier.Replace('.', '').ToUpperInvariant()) - <_FrameworkIdentifierForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0)) ">NET - $(_FrameworkIdentifierForImplicitDefine) - <_FrameworkIdentifierForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'">NET - <_FrameworkVersionForImplicitDefine>$(TargetFrameworkVersion.TrimStart('vV')) - <_FrameworkVersionForImplicitDefine>$(_FrameworkVersionForImplicitDefine.Replace('.', '_')) - <_FrameworkVersionForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'">$(_FrameworkVersionForImplicitDefine.Replace('_', '')) - $(_FrameworkIdentifierForImplicitDefine)$(_FrameworkVersionForImplicitDefine) - $(TargetFrameworkIdentifier.Replace('.', '').ToUpperInvariant()) - - - <_ImplicitDefineConstant Include="$(VersionlessImplicitFrameworkDefine)" /> - <_ImplicitDefineConstant Include="$(ImplicitFrameworkDefine)" /> - <_ImplicitDefineConstant Include="$(BackwardsCompatFrameworkDefine)" /> - - - - - - <_PlatformIdentifierForImplicitDefine>$(TargetPlatformIdentifier.ToUpperInvariant()) - <_PlatformVersionForImplicitDefine>$(EffectiveTargetPlatformVersion.Replace('.', '_')) - - - <_ImplicitDefineConstant Include="$(_PlatformIdentifierForImplicitDefine)" /> - <_ImplicitDefineConstant Include="$(_PlatformIdentifierForImplicitDefine)$(_PlatformVersionForImplicitDefine)" /> - - - - <_ImplicitDefineConstant Include="CSWINRT3_0" /> - - - - - - <_SupportedFrameworkVersions Include="@(_NETCoreAppVersionsForDefines->'%(Identity)'->TrimStart('.NETCoreApp,Version=v'))" Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' " /> - <_SupportedFrameworkVersions Include="@(SupportedNETFrameworkTargetFramework->'%(Identity)'->TrimStart('.NETFramework,Version=v'))" Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' " /> - <_SupportedFrameworkVersions Include="@(SupportedNETStandardTargetFramework->'%(Identity)'->TrimStart('.NETStandard,Version=v'))" Condition=" '$(TargetFrameworkIdentifier)' == '.NETStandard' " /> - <_CompatibleFrameworkVersions Include="@(_SupportedFrameworkVersions)" Condition=" $([MSBuild]::VersionLessThanOrEquals(%(Identity), $(TargetFrameworkVersion))) " /> - <_FormattedCompatibleFrameworkVersions Include="@(_CompatibleFrameworkVersions)" Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' or '$(TargetFrameworkIdentifier)' == '.NETStandard' " /> - <_FormattedCompatibleFrameworkVersions Include="@(_CompatibleFrameworkVersions->'%(Identity)'->Replace('.', ''))" Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' " /> - <_ImplicitDefineConstant Include="@(_FormattedCompatibleFrameworkVersions->'$(_FrameworkIdentifierForImplicitDefine)%(Identity)_OR_GREATER'->Replace('.', '_'))" Condition=" '$(TargetFrameworkIdentifier)' != '.NETCoreApp' or $([MSBuild]::VersionGreaterThanOrEquals(%(_FormattedCompatibleFrameworkVersions.Identity), 5.0)) " /> - <_ImplicitDefineConstant Include="@(_FormattedCompatibleFrameworkVersions->'NETCOREAPP%(Identity)_OR_GREATER'->Replace('.', '_'))" Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionLessThan(%(_FormattedCompatibleFrameworkVersions.Identity), 5.0)) " /> - - - - - - - <_SupportedPlatformCompatibleVersions Include="@(SdkSupportedTargetPlatformVersion)" Condition=" %(Identity) != '' and '%(SdkSupportedTargetPlatformVersion.NormalizedSupportedTargetPlatformVersion)' == '' and $([MSBuild]::VersionLessThanOrEquals(%(Identity), $(TargetPlatformVersion))) " /> - <_SupportedPlatformCompatibleVersions Include="@(SdkSupportedTargetPlatformVersion->'%(NormalizedSupportedTargetPlatformVersion)')" Condition=" '%(SdkSupportedTargetPlatformVersion.NormalizedSupportedTargetPlatformVersion)' != '' and $([MSBuild]::VersionLessThanOrEquals('%(SdkSupportedTargetPlatformVersion.NormalizedSupportedTargetPlatformVersion)', $(TargetPlatformVersion))) " /> - <_ImplicitDefineConstant Include="@(_SupportedPlatformCompatibleVersions->Distinct()->'$(TargetPlatformIdentifier.ToUpper())%(Identity)_OR_GREATER'->Replace('.', '_'))" /> - - - - - - <_DefineConstantsWithoutTrace Include="$(DefineConstants)" /> - <_DefineConstantsWithoutTrace Remove="TRACE" /> - - - @(_DefineConstantsWithoutTrace) - - - - - - $(DefineConstants);@(_ImplicitDefineConstant) - $(FinalDefineConstants),@(_ImplicitDefineConstant->'%(Identity)=-1', ',') - - - - - false - true - - - $(AssemblyName).xml - $(IntermediateOutputPath)$(AssemblyName).xml - - - - - - true - true - true - true - - - - - - - true - - - - - - - - - FrameworkPackage - - - - - - Core - - - - - - FrameworkPackage - - - - - - Framework - - - - - - - - - - - $(RoslynTargetsPath) - $(MSBuildThisFileDirectory)..\..\..\Roslyn\bincore - - - $(MSBuildThisFileDirectory)..\..\..\Roslyn - $(MSBuildThisFileDirectory)..\..\..\Roslyn\Microsoft.Build.Tasks.CodeAnalysis.dll - $(RoslynCoreAssembliesPath) - $(MSBuildThisFileDirectory)..\..\..\Roslyn\binfx - $(MSBuildThisFileDirectory)..\..\..\Roslyn\binfx\Microsoft.Build.Tasks.CodeAnalysis.Sdk.dll - $(MSBuildThisFileDirectory)..\..\..\Roslyn\Microsoft.CSharp.Core.targets - $(MSBuildThisFileDirectory)..\..\..\Roslyn\Microsoft.VisualBasic.Core.targets - - - - $(MSBuildToolsPath)\Microsoft.CSharp.targets - $(MSBuildToolsPath)\Microsoft.VisualBasic.targets - $(MSBuildThisFileDirectory)..\targets\Microsoft.NET.Sdk.FSharpTargetsShim.targets - - $(MSBuildToolsPath)\Microsoft.Common.targets - - - - - - - - $(MSBuildToolsPath)\Microsoft.CSharp.CrossTargeting.targets - - - - - $(MSBuildToolsPath)\Microsoft.CSharp.CurrentVersion.targets - - - - - - - - true - - - - - - true - true - true - true - - - - - $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.Before.Microsoft.CSharp.targets - $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.After.Microsoft.CSharp.targets - - - - .cs - C# - Managed - true - true - true - true - true - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Properties - - - - - File - - - BrowseObject - - - - - - - - - - - - - <_Temporary Remove="@(_Temporary)" /> - - - - - - - - - - - - - <_Temporary Remove="@(_Temporary)" /> - - - - - - - - - - - - - - true - - - - - - <_DebugSymbolsIntermediatePathTemporary Include="$(PdbFile)" /> - - <_DebugSymbolsIntermediatePath Include="@(_DebugSymbolsIntermediatePathTemporary->'%(RootDir)%(Directory)%(Filename).pdb')" /> - - - $(CoreCompileDependsOn);_ComputeNonExistentFileProperty;ResolveCodeAnalysisRuleSet - true - - - - - - $(NoWarn);1701;1702 - - - - $(NoWarn);2008 - - - - - - - - - $(AppConfig) - - $(IntermediateOutputPath)$(TargetName).compile.pdb - - - - false - - - - - - - true - - - - - - - - - - $(RoslynTargetsPath)\Microsoft.CSharp.Core.targets - - - - - - - <_BuildTasksDirectory>$(MSBuildThisFileDirectory) - <_BuildTasksDirectory Condition="Exists('$(RoslynTargetsPath)')">$(RoslynTargetsPath)\ - <_BuildTasksAssemblyName>Microsoft.Build.Tasks.CodeAnalysis - <_BuildTasksAssemblyName Condition="!Exists('$(_BuildTasksDirectory)$(_BuildTasksAssemblyName)') and Exists('$(_BuildTasksDirectory)Microsoft.Build.Tasks.CodeAnalysis.Sdk.dll')">Microsoft.Build.Tasks.CodeAnalysis.Sdk - - - - - - roslyn5.8 - - - - - - - - - - - - - - - - - false - - - - - - - - true - - - - - - - - <_SkipAnalyzers /> - <_ImplicitlySkipAnalyzers /> - - - - <_SkipAnalyzers>true - - - - <_ImplicitlySkipAnalyzers>true - <_SkipAnalyzers>true - run-nullable-analysis=never;$(Features) - - - - - - <_LastBuildWithSkipAnalyzers>$(IntermediateOutputPath)$(MSBuildProjectFile).BuildWithSkipAnalyzers - - - - - - - - - - - - - - <_AllDirectoriesAbove Include="@(Compile->GetPathsOfAllDirectoriesAbove())" Condition="'$(DiscoverEditorConfigFiles)' != 'false' or '$(DiscoverGlobalAnalyzerConfigFiles)' != 'false'" /> - - - - - - - - - - - - $(IntermediateOutputPath)$(MSBuildProjectName).GeneratedMSBuildEditorConfig.editorconfig - true - <_GeneratedEditorConfigHasItems Condition="'@(CompilerVisibleItemMetadata->Count())' != '0'">true - <_GeneratedEditorConfigShouldRun Condition="'$(GenerateMSBuildEditorConfigFile)' == 'true' and ('$(_GeneratedEditorConfigHasItems)' == 'true' or '@(CompilerVisibleProperty->Count())' != '0')">true - - - - - - <_GeneratedEditorConfigProperty Include="@(CompilerVisibleProperty)"> - $(%(CompilerVisibleProperty.Identity)) - - - <_GeneratedEditorConfigMetadata Include="@(%(CompilerVisibleItemMetadata.Identity))" Condition="'$(_GeneratedEditorConfigHasItems)' == 'true'"> - %(Identity) - %(CompilerVisibleItemMetadata.MetadataName) - - - - - - - - - - - true - - - - - <_MappedSourceRoot Remove="@(_MappedSourceRoot)" /> - - - - - - - - - - - - true - - - - - - - <_TopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"> - $([MSBuild]::ValueOrDefault('%(Identity)', '').Replace(',', ',,').Replace('=', '==')) - $([MSBuild]::ValueOrDefault('%(MappedPath)', '').Replace(',', ',,').Replace('=', '==')) - - - - - @(_TopLevelSourceRoot->'%(EscapedKey)=%(EscapedValue)', ','),$(PathMap) - - - - - - - - - - - false - - $(IntermediateOutputPath)/generated - - - - - - - - - - - - - <_MaxSupportedLangVersion Condition="('$(TargetFrameworkIdentifier)' != '.NETCoreApp' OR '$(_TargetFrameworkVersionWithoutV)' < '3.0') AND ('$(TargetFrameworkIdentifier)' != '.NETStandard' OR '$(_TargetFrameworkVersionWithoutV)' < '2.1')">7.3 - - <_MaxSupportedLangVersion Condition="(('$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_TargetFrameworkVersionWithoutV)' < '5.0') OR ('$(TargetFrameworkIdentifier)' == '.NETStandard' AND '$(_TargetFrameworkVersionWithoutV)' == '2.1')) AND '$(_MaxSupportedLangVersion)' == ''">8.0 - - <_MaxSupportedLangVersion Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_MaxSupportedLangVersion)' == ''">$([MSBuild]::Add(9, $([MSBuild]::Subtract($(_TargetFrameworkVersionWithoutV.Split('.')[0]), 5)))).0 - - <_MaxAvailableLangVersion>14.0 - <_MaxSupportedLangVersion Condition="'$(_MaxSupportedLangVersion)' != '' AND '$(_MaxSupportedLangVersion)' > '$(_MaxAvailableLangVersion)'">$(_MaxAvailableLangVersion) - $(_MaxSupportedLangVersion) - $(_MaxSupportedLangVersion) - - - - - - - - - $(NoWarn);1701;1702 - - - - $(NoWarn);2008 - - - - $(NoWarn);8002 - - - - $(AppConfig) - - $(IntermediateOutputPath)$(TargetName).compile.pdb - - - - - - - <_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" /> - - - - - - -langversion:$(LangVersion) - $(CommandLineArgsForDesignTimeEvaluation) -checksumalgorithm:$(ChecksumAlgorithm) - $(CommandLineArgsForDesignTimeEvaluation) -define:$(DefineConstants) - $(CommandLineArgsForDesignTimeEvaluation) -features:$(Features) - $(CommandLineArgsForDesignTimeEvaluation) -doc:"$(DocumentationFile)" - - - - - - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets - - - - - - $(MSBuildToolsPath)\Microsoft.Common.CurrentVersion.targets - - - - - - true - true - true - true - - - - - - - 10.0 - - - $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.Before.Microsoft.Common.targets - $(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.After.Microsoft.Common.targets - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\ReportingServices\Microsoft.ReportingServices.targets - - - - - Managed - - - - .NETFramework - v4.0 - - - - Any CPU,x86,x64,Itanium - Any CPU,x86,x64 - - - - - - - - $(SDK40ToolsPath) - - - - true - - - false - - - - - true - - true - - - $(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile) - $(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion) - - $(TargetFrameworkRootPath)$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion) - - $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries($(TargetFrameworkIdentifier), $(TargetFrameworkVersion), $(TargetFrameworkProfile), $(PlatformTarget), $(TargetFrameworkRootPath), $(TargetFrameworkFallbackSearchPaths))) - $(MSBuildFrameworkToolsPath) - - - Windows - 7.0 - $(TargetPlatformSdkRootOverride)\ - $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SDKs\Windows\v$(TargetPlatformVersion)', InstallationFolder, null, RegistryView.Registry32, RegistryView.Default)) - $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKLocation($(TargetPlatformIdentifier), $(TargetPlatformVersion))) - $(TargetPlatformSdkPath)Windows Metadata - $(TargetPlatformSdkPath)References\CommonConfiguration\Neutral - $(TargetPlatformSdkMetadataLocation) - true - $(WinDir)\System32\WinMetadata - $(TargetPlatformIdentifier),Version=$(TargetPlatformVersion) - $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKDisplayName($(TargetPlatformIdentifier), $(TargetPlatformVersion))) - - - - - <_OriginalPlatform>$(Platform) - - <_OriginalConfiguration>$(Configuration) - - <_OutputPathWasMissing Condition="'$(_OriginalPlatform)' != '' and '$(_OriginalConfiguration)' != '' and '$(OutputPath)' == ''">true - - true - - - AnyCPU - $(Platform) - Debug - $(Configuration) - bin\ - $(BaseOutputPath)\ - $(BaseOutputPath)$(Configuration)\ - $(BaseOutputPath)$(PlatformName)\$(Configuration)\ - $(OutputPath)\ - obj\ - $(BaseIntermediateOutputPath)\ - $(BaseIntermediateOutputPath)$(Configuration)\ - $(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\ - $(IntermediateOutputPath)\ - - - - $(TargetType) - library - exe - true - - <_DebugSymbolsProduced>false - <_DebugSymbolsProduced Condition="'$(DebugSymbols)'=='true'">true - <_DebugSymbolsProduced Condition="'$(DebugType)'=='none'">false - <_DebugSymbolsProduced Condition="'$(DebugType)'=='pdbonly'">true - <_DebugSymbolsProduced Condition="'$(DebugType)'=='full'">true - <_DebugSymbolsProduced Condition="'$(DebugType)'=='portable'">true - <_DebugSymbolsProduced Condition="'$(DebugType)'=='embedded'">false - <_DebugSymbolsProduced Condition="'$(ProduceOnlyReferenceAssembly)'=='true'">false - - <_DocumentationFileProduced>true - <_DocumentationFileProduced Condition="'$(DocumentationFile)'==''">false - - false - - - - - <_InvalidConfigurationMessageSeverity Condition=" '$(SkipInvalidConfigurations)' == 'true' ">Warning - <_InvalidConfigurationMessageSeverity Condition=" '$(SkipInvalidConfigurations)' != 'true' ">Error - - - - .exe - .exe - .exe - .dll - .netmodule - .winmdobj - - - - true - $(OutputPath) - - - $(OutDir)\ - $(MSBuildProjectName) - - - $(OutDir)$(ProjectName)\ - $(MSBuildProjectName) - $(RootNamespace) - $(AssemblyName) - - $(MSBuildProjectFile) - - $(MSBuildProjectExtension) - - $(TargetName).winmd - $(WinMDExpOutputWindowsMetadataFilename) - $(TargetName)$(TargetExt) - - - - - <_DeploymentPublishableProjectDefault Condition="'$(OutputType)'=='winexe' or '$(OutputType)'=='exe' or '$(OutputType)'=='appcontainerexe'">true - $(_DeploymentPublishableProjectDefault) - <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='library'">Native.$(AssemblyName).manifest - - <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='winexe'">$(TargetFileName).manifest - - <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='exe'">$(TargetFileName).manifest - - <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='appcontainerexe'">$(TargetFileName).manifest - - $(AssemblyName).application - - $(AssemblyName).xbap - - $(GenerateManifests) - <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='library'">Native.$(AssemblyName) - <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='winexe'">$(AssemblyName).exe - <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='exe'">$(AssemblyName).exe - <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='appcontainerexe'">$(AssemblyName).exe - <_DeploymentDeployManifestIdentity Condition="'$(HostInBrowser)' != 'true'">$(AssemblyName).application - <_DeploymentDeployManifestIdentity Condition="'$(HostInBrowser)' == 'true'">$(AssemblyName).xbap - <_DeploymentFileMappingExtension Condition="'$(MapFileExtensions)'=='true'">.deploy - <_DeploymentFileMappingExtension Condition="'$(MapFileExtensions)'!='true'" /> - <_DeploymentBuiltUpdateInterval Condition="'$(UpdatePeriodically)'=='true'">$(UpdateInterval) - <_DeploymentBuiltUpdateIntervalUnits Condition="'$(UpdatePeriodically)'=='true'">$(UpdateIntervalUnits) - <_DeploymentBuiltUpdateInterval Condition="'$(UpdatePeriodically)'!='true'">0 - <_DeploymentBuiltUpdateIntervalUnits Condition="'$(UpdatePeriodically)'!='true'">Days - <_DeploymentBuiltMinimumRequiredVersion Condition="'$(UpdateRequired)'=='true' and '$(Install)'=='true'">$(MinimumRequiredVersion) - <_DeploymentLauncherBased Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true - 100 - - - - * - $(UICulture) - - - - <_OutputPathItem Include="$(OutDir)" /> - <_UnmanagedRegistrationCache Include="$(BaseIntermediateOutputPath)$(MSBuildProjectFile).UnmanagedRegistration.cache" /> - <_ResolveComReferenceCache Include="$(IntermediateOutputPath)$(MSBuildProjectFile).ResolveComReference.cache" /> - - - - - $([MSBuild]::Escape($([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(OutDir)`))`)))) - - $(TargetDir)$(TargetFileName) - $([MSBuild]::NormalizePath($(TargetDir), 'ref', $(TargetFileName))) - $([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(IntermediateOutputPath), 'ref', $(TargetFileName))) - - $([MSBuild]::EnsureTrailingSlash($(MSBuildProjectDirectory))) - - $(ProjectDir)$(ProjectFileName) - - - - - - - - *Undefined* - *Undefined* - - *Undefined* - - *Undefined* - - *Undefined* - - *Undefined* - - - - true - - true - - - true - false - - - $(MSBuildProjectFile).FileListAbsolute.txt - - false - - true - true - <_ResolveReferenceDependencies Condition="'$(_ResolveReferenceDependencies)' == ''">false - <_GetChildProjectCopyToOutputDirectoryItems Condition="'$(_GetChildProjectCopyToOutputDirectoryItems)' == ''">true - false - false - - - <_GenerateBindingRedirectsIntermediateAppConfig>$(IntermediateOutputPath)$(TargetFileName).config - - - $(MSBuildProjectFile) - - $([MSBuild]::SubstringByAsciiChars($(MSBuildProjectFile), 0, 8)).$([MSBuild]::StableStringHash($(MSBuildProjectFile)).ToString("X8")) - $(MSBuildCopyMarkerName).Up2Date - - - - - - - - - - - - - - <_DebugSymbolsIntermediatePath Include="$(IntermediateOutputPath)$(TargetName).compile.pdb" Condition="'$(OutputType)' == 'winmdobj' and '@(_DebugSymbolsIntermediatePath)' == ''" /> - <_DebugSymbolsIntermediatePath Include="$(IntermediateOutputPath)$(TargetName).pdb" Condition="'$(OutputType)' != 'winmdobj' and '@(_DebugSymbolsIntermediatePath)' == ''" /> - <_DebugSymbolsOutputPath Include="@(_DebugSymbolsIntermediatePath->'$(OutDir)%(Filename)%(Extension)')" /> - - - $(IntermediateOutputPath)$(TargetName).pdb - <_WinMDDebugSymbolsOutputPath>$([System.IO.Path]::Combine('$(OutDir)', $([System.IO.Path]::GetFileName('$(WinMDExpOutputPdb)')))) - - - $(IntermediateOutputPath)$(TargetName).xml - <_WinMDDocFileOutputPath>$([System.IO.Path]::Combine('$(OutDir)', $([System.IO.Path]::GetFileName('$(WinMDOutputDocumentationFile)')))) - - - <_IntermediateWindowsMetadataPath>$(IntermediateOutputPath)$(WinMDExpOutputWindowsMetadataFilename) - <_WindowsMetadataOutputPath>$(OutDir)$(WinMDExpOutputWindowsMetadataFilename) - - - - <_SupportedArchitectures>amd64 arm64 - - - - <_DeploymentManifestEntryPoint Include="@(IntermediateAssembly)"> - $(TargetFileName) - - - - <_DeploymentManifestIconFile Include="$(ApplicationIcon)" Condition="Exists('$(ApplicationIcon)')"> - $(ApplicationIcon) - - - - $(_DeploymentTargetApplicationManifestFileName) - - - <_ApplicationManifestFinal Include="$(OutDir)$(_DeploymentTargetApplicationManifestFileName)"> - $(_DeploymentTargetApplicationManifestFileName) - - - - $(TargetDeployManifestFileName) - - - <_DeploymentIntermediateTrustInfoFile Include="$(IntermediateOutputPath)$(TargetName).TrustInfo.xml" Condition="'$(TargetZone)'!=''" /> - - - - <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(UpdateUrl) - <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(InstallUrl) - <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(PublishUrl) - <_DeploymentUrl Condition="!('$(UpdateUrl)'=='') and '$(Install)'=='false'" /> - <_DeploymentUrl Condition="'$(_DeploymentUrl)'!=''">$(_DeploymentUrl)$(TargetDeployManifestFileName) - - <_DeploymentUrl Condition="'$(UpdateUrl)'=='' and !('$(Install)'=='true' and '$(UpdateEnabled)'=='true')" /> - <_DeploymentUrl Condition="'$(ExcludeDeploymentUrl)'=='true'" /> - - - - <_DeploymentApplicationUrl Condition="'$(IsWebBootstrapper)'=='true'">$(InstallUrl) - <_DeploymentApplicationUrl Condition="'$(IsWebBootstrapper)'=='true' and '$(InstallUrl)'==''">$(PublishUrl) - <_DeploymentComponentsUrl Condition="'$(BootstrapperComponentsLocation)'=='Absolute'">$(BootstrapperComponentsUrl) - - - - $(PublishDir)\ - $([MSBuild]::EnsureTrailingSlash('$(OutputPath)'))app.publish\ - - - - $(PublishDir) - $(ClickOncePublishDir)\ - - - - - $(PlatformTarget) - - msil - amd64 - ia64 - x86 - arm - - - true - - - - $(Platform) - msil - amd64 - ia64 - x86 - arm - - None - $(PROCESSOR_ARCHITECTURE) - - - - CLR2 - CLR4 - CurrentRuntime - true - false - $(PlatformTarget) - x86 - x64 - CurrentArchitecture - - - - Client - - - - false - - - - - true - true - false - - - - AssemblyFoldersEx - Software\Microsoft\$(TargetFrameworkIdentifier) - Software\Microsoft\Microsoft SDKs\$(TargetPlatformIdentifier) - $([MSBuild]::GetToolsDirectory32())\AssemblyFolders.config - {AssemblyFoldersFromConfig:$(AssemblyFoldersConfigFile),$(TargetFrameworkVersion)}; - - - .winmd; - .dll; - .exe - - - - .pdb; - .xml; - .pri; - .dll.config; - .exe.config - - - Full - - - - {CandidateAssemblyFiles} - $(AssemblySearchPaths);$(ReferencePath) - $(AssemblySearchPaths);{HintPathFromItem} - $(AssemblySearchPaths);{TargetFrameworkDirectory} - $(AssemblySearchPaths);$(AssemblyFoldersConfigFileSearchPath) - $(AssemblySearchPaths);{Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)} - $(AssemblySearchPaths);{AssemblyFolders} - $(AssemblySearchPaths);{GAC} - $(AssemblySearchPaths);{RawFileName} - $(AssemblySearchPaths);$(OutDir) - - - - false - - - - $(MSBuildWarningsAsMessages);$(NoWarn) - $(WarningsAsErrors) - $(WarningsNotAsErrors) - - - - $(MSBuildThisFileDirectory)$(LangName)\ - - - - $(MSBuildThisFileDirectory)en-US\ - - - - - Project - - - BrowseObject - - - File - - - Invisible - - - File;BrowseObject - - - File;ProjectSubscriptionService - - - - $(DefineCommonItemSchemas) - - - - - ;BrowseObject - - - ProjectSubscriptionService;BrowseObject - - - - ;BrowseObject - - - ProjectSubscriptionService;BrowseObject - - - - ;BrowseObject - - - ProjectSubscriptionService;BrowseObject - - - - - - - - - Never - - - Never - - - Never - - - Never - - - - - - true - - - - - <_GlobalPropertiesToRemoveFromProjectReferences Condition="'$(PassOutputPathToReferencedProjects)'=='false'">$(_GlobalPropertiesToRemoveFromProjectReferences);OutputPath - - - - - - <_InvalidConfigurationMessageResourceName Condition=" '$(BuildingInsideVisualStudio)' == 'true' ">CommonSdk.InvalidConfigurationTextWhenBuildingInsideVisualStudio - <_InvalidConfigurationMessageResourceName Condition=" '$(BuildingInsideVisualStudio)' != 'true' ">CommonSdk.InvalidConfigurationTextWhenBuildingOutsideVisualStudio - - - - - - - - - - - x86 - - - - - - - - - - - - - BeforeBuild; - CoreBuild; - AfterBuild - - - - - - - - - - - BuildOnlySettings; - PrepareForBuild; - PreBuildEvent; - ResolveReferences; - PrepareResources; - ResolveKeySource; - Compile; - ExportWindowsMDFile; - UnmanagedUnregistration; - GenerateSerializationAssemblies; - CreateSatelliteAssemblies; - GenerateManifests; - GetTargetPath; - PrepareForRun; - UnmanagedRegistration; - IncrementalClean; - PostBuildEvent - - - - - - - - - <_ProjectDefaultTargets Condition="'$(MSBuildProjectDefaultTargets)' != ''">$(MSBuildProjectDefaultTargets) - <_ProjectDefaultTargets Condition="'$(MSBuildProjectDefaultTargets)' == ''">Build - - BeforeRebuild; - Clean; - $(_ProjectDefaultTargets); - AfterRebuild; - - - BeforeRebuild; - Clean; - Build; - AfterRebuild; - - - - - - - - - - Build - - - - - - - - - - - Build - - - - - - - - - - - Build - - - - - - - - - - - - - - - - - - - - - - - false - - - - true - - - - - - $(PrepareForBuildDependsOn);GetFrameworkPaths;GetReferenceAssemblyPaths;AssignLinkMetadata - - - - - $(TargetFileName).config - - - - - - - - - - - - - @(_TargetFramework40DirectoryItem) - @(_TargetFramework35DirectoryItem) - @(_TargetFramework30DirectoryItem) - @(_TargetFramework20DirectoryItem) - - @(_TargetFramework20DirectoryItem) - @(_TargetFramework40DirectoryItem) - @(_TargetedFrameworkDirectoryItem) - @(_TargetFrameworkSDKDirectoryItem) - - - - - - - - - - - - - - - - - - $(_TargetFrameworkDirectories);$(TargetFrameworkDirectory);$(WinFXAssemblyDirectory) - $(TargetFrameworkDirectory);$(TargetPlatformWinMDLocation) - - - - true - - - $(AssemblySearchPaths.Replace('{AssemblyFolders}', '').Split(';')) - - - - - - - $(TargetFrameworkDirectory);@(DesignTimeFacadeDirectories) - - - - - - - - - - - - - - - - - - - - - <_Temp Remove="@(_Temp)" /> - - - - - - - - - <_Temp Remove="@(_Temp)" /> - - - - - - - - - <_Temp Remove="@(_Temp)" /> - - - - - - - - - <_Temp Remove="@(_Temp)" /> - - - - - - - - - <_Temp Remove="@(_Temp)" /> - - - - - - - - - <_Temp Remove="@(_Temp)" /> - - - - - - - - - - - - - - - - - - $(PlatformTargetAsMSBuildArchitecture) - - - - $(TargetFrameworkAsMSBuildRuntime) - - CurrentRuntime - - - - - - - - - - BeforeResolveReferences; - AssignProjectConfiguration; - ResolveProjectReferences; - FindInvalidProjectReferences; - ResolveNativeReferences; - ResolveAssemblyReferences; - GenerateBindingRedirects; - GenerateBindingRedirectsUpdateAppConfig; - ResolveComReferences; - AfterResolveReferences - - - - - - - - - - - - false - - - - - - - true - true - false - - false - - true - - - - - - - - - - - <_ProjectReferenceWithConfiguration> - true - true - - - true - true - - - - - - - - - - - - - <_MSBuildProjectReference Include="@(ProjectReferenceWithConfiguration)" Condition="'$(BuildingInsideVisualStudio)'!='true' and '@(ProjectReferenceWithConfiguration)'!=''" /> - - - - <_MSBuildProjectReferenceExistent Include="@(_MSBuildProjectReference)" Condition="'$(_BuildNonexistentProjectsByDefault)' == 'true' or Exists('%(Identity)')" /> - <_MSBuildProjectReferenceNonexistent Include="@(_MSBuildProjectReference)" Condition="'$(_BuildNonexistentProjectsByDefault)' != 'true' and !Exists('%(Identity)')" /> - - - - - true - - - - - - <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SetPlatform)' != ''"> - true - - - - <_ProjectReferencePlatformPossibilities Include="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.SkipGetPlatformProperties)' != 'true'" /> - - - - - <_ProjectReferencePlatformPossibilities Condition="'$(MSBuildProjectExtension)' != '.vcxproj' and '$(MSBuildProjectExtension)' != '.nativeproj' and '%(_ProjectReferencePlatformPossibilities.IsVcxOrNativeProj)' == 'true'"> - - x86=Win32 - - - <_ProjectReferencePlatformPossibilities Condition="('$(MSBuildProjectExtension)' == '.vcxproj' or '$(MSBuildProjectExtension)' == '.nativeproj') and '%(_ProjectReferencePlatformPossibilities.IsVcxOrNativeProj)' != 'true'"> - Win32=x86 - - - - - - - - - - Platform=%(ProjectsWithNearestPlatform.NearestPlatform) - - - - %(ProjectsWithNearestPlatform.UndefineProperties);Platform - - <_MSBuildProjectReferenceExistent Remove="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.SkipGetPlatformProperties)' != 'true'" /> - <_MSBuildProjectReferenceExistent Include="@(ProjectsWithNearestPlatform)" /> - - - - - - - $(NuGetTargetMoniker) - $(TargetFrameworkMoniker) - - - - <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SkipGetTargetFrameworkProperties)' == '' and ('%(Extension)' == '.vcxproj' or '%(Extension)' == '.nativeproj')"> - - true - %(_MSBuildProjectReferenceExistent.UndefineProperties);TargetFramework - - - - - <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SetTargetFramework)' != ''"> - - true - - - - - - - - - - - - - <_ProjectReferenceTargetFrameworkPossibilitiesOriginalItemSpec Include="@(_ProjectReferenceTargetFrameworkPossibilities->'%(OriginalItemSpec)')" /> - <_ProjectReferenceTargetFrameworkPossibilities Remove="@(_ProjectReferenceTargetFrameworkPossibilities)" /> - <_ProjectReferenceTargetFrameworkPossibilities Include="@(_ProjectReferenceTargetFrameworkPossibilitiesOriginalItemSpec)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - TargetFramework=%(AnnotatedProjects.NearestTargetFramework) - - - - %(AnnotatedProjects.UndefineProperties);TargetFramework - - - - %(AnnotatedProjects.UndefineProperties);RuntimeIdentifier;SelfContained - - - <_MSBuildProjectReferenceExistent Remove="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.SkipGetTargetFrameworkProperties)' != 'true'" /> - <_MSBuildProjectReferenceExistent Include="@(AnnotatedProjects)" /> - - - - - - - - - <_ThisProjectBuildMetadata Include="$(MSBuildProjectFullPath)"> - @(_TargetFrameworkInfo) - @(_TargetFrameworkInfo->'%(TargetFrameworkMonikers)') - @(_TargetFrameworkInfo->'%(TargetPlatformMonikers)') - $(_AdditionalPropertiesFromProject) - true - @(_TargetFrameworkInfo->'%(IsRidAgnostic)') - - true - $(Platform) - $(Platforms) - - @(ProjectConfiguration->'%(Platform)'->Distinct()) - - - - - - <_AdditionalTargetFrameworkInfoPropertyWithValue Include="@(AdditionalTargetFrameworkInfoProperty)"> - $(%(AdditionalTargetFrameworkInfoProperty.Identity)) - - - - <_UseAttributeForTargetFrameworkInfoPropertyNames Condition="'$(_UseAttributeForTargetFrameworkInfoPropertyNames)' == ''">false - - - - - - <_TargetFrameworkInfo Include="$(TargetFramework)"> - $(TargetFramework) - $(TargetFrameworkMoniker) - $(TargetPlatformMoniker) - None - $(_AdditionalTargetFrameworkInfoProperties) - - $(IsRidAgnostic) - true - false - - - - - - - - - AssignProjectConfiguration; - _SplitProjectReferencesByFileExistence; - _GetProjectReferenceTargetFrameworkProperties; - _GetProjectReferencePlatformProperties - - - - - - - - - $(ProjectReferenceBuildTargets) - - - ProjectReference - - - - - - - - - - - - - - - - - - - <_ResolvedProjectReferencePaths Remove="@(_ResolvedProjectReferencePaths)" Condition="'%(_ResolvedProjectReferencePaths.ResolveableAssembly)' == 'false'" /> - - <_ResolvedProjectReferencePaths> - %(_ResolvedProjectReferencePaths.OriginalItemSpec) - - - - - <_NonExistentProjectReferenceSeverity Condition="'@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceNonexistent)' != '' and '$(ErrorOnMissingProjectReference)' != 'True'">Warning - <_NonExistentProjectReferenceSeverity Condition="'@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceNonexistent)' != '' and '$(ErrorOnMissingProjectReference)' == 'True'">Error - - - - - - - <_ProjectReferencesFromRAR Include="@(ReferencePath->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))"> - %(ReferencePath.ProjectReferenceOriginalItemSpec) - - - - - - - - - $(GetTargetPathDependsOn) - - - - - - $(TargetPlatformMoniker) - $(TargetPlatformIdentifier) - $(TargetFrameworkIdentifier) - $(TargetFrameworkVersion.TrimStart('vV')) - $(TargetRefPath) - @(CopyUpToDateMarker) - - - - - - - - %(_ApplicationManifestFinal.FullPath) - - - - - - - - - - - - - - - - - - ResolveProjectReferences; - FindInvalidProjectReferences; - GetFrameworkPaths; - GetReferenceAssemblyPaths; - PrepareForBuild; - ResolveSDKReferences; - ExpandSDKReferences; - - - - - <_ReferenceInstalledAssemblyDirectory Include="$(TargetFrameworkDirectory)" /> - <_ReferenceInstalledAssemblySubsets Include="$(TargetFrameworkSubset)" /> - - - - $(IntermediateOutputPath)$(MSBuildProjectFile).AssemblyReference.cache - - - false - - - - <_ResolveAssemblyReferencesApplicationConfigFileForExes Include="@(AppConfigWithTargetPath)" Condition="'$(AutoGenerateBindingRedirects)'=='true' or '$(AutoUnifyAssemblyReferences)'=='false'" /> - - - - <_FindDependencies Condition="'$(BuildingProject)' != 'true' and '$(_ResolveReferenceDependencies)' != 'true'">false - true - false - Warning - $(BuildingProject) - $(BuildingProject) - $(BuildingProject) - false - - - - - - true - - - - - - - - false - - - - false - true - - - - - - - - - - - - - - - - - - - - - - - %(FullPath) - - - %(ReferencePath.Identity) - - - - - - - - - - - - - - - <_NewGenerateBindingRedirectsIntermediateAppConfig Condition="Exists('$(_GenerateBindingRedirectsIntermediateAppConfig)')">true - $(_GenerateBindingRedirectsIntermediateAppConfig) - - - - - $(TargetFileName).config - - - - - - Software\Microsoft\Microsoft SDKs - $(LocalAppData)\Microsoft SDKs;$(MSBuildProgramFiles32)\Microsoft SDKs - - $(MSBuildProgramFiles32)\Microsoft SDKs\Windows Kits\10;$(WindowsKitsRoot) - - true - Windows - 8.1 - - false - WindowsPhoneApp - 8.1 - - - - - - - - - - - - - - - - - GetInstalledSDKLocations - - - - Debug - Retail - Retail - $(ProcessorArchitecture) - Neutral - - - true - - - - - - - - - - - - - - - - GetReferenceTargetPlatformMonikers - - - - - - - - <_ResolvedProjectReferencePaths Remove="@(InvalidProjectReferences)" /> - - - - - - - - - - - - - - ResolveSDKReferences - - - .winmd; - .dll - - - - - - - - - - - - - - - - false - false - false - $(TargetFrameworkSDKToolsDirectory) - true - - - - - - - - - - - - - - - <_ReferencesFromRAR Include="@(ReferencePath->WithMetadataValue('ReferenceSourceTarget', 'ResolveAssemblyReference'))" /> - - - - - {CandidateAssemblyFiles}; - $(ReferencePath); - {HintPathFromItem}; - {TargetFrameworkDirectory}; - {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)}; - {RawFileName}; - $(TargetDir) - - - - - - GetFrameworkPaths; - GetReferenceAssemblyPaths; - ResolveReferences - - - - - <_DesignTimeReferenceInstalledAssemblyDirectory Include="$(TargetFrameworkDirectory)" /> - - - $(IntermediateOutputPath)$(MSBuildProjectFile)DesignTimeResolveAssemblyReferences.cache - - - - {CandidateAssemblyFiles}; - $(ReferencePath); - {HintPathFromItem}; - {TargetFrameworkDirectory}; - {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)}; - {RawFileName}; - $(OutDir) - - - - false - false - false - false - false - true - false - - - <_DesignTimeReferenceAssemblies Include="$(DesignTimeReference)" /> - - - <_RARResolvedReferencePath Include="@(ReferencePath)" /> - - - - - - - - - - false - - - - $(IntermediateOutputPath) - - - - - $(PlatformTargetAsMSBuildArchitecture) - $(TargetFrameworkSDKToolsDirectory) - false - - - - - - - - - - - - - - - - - - - - - - - - - - - $(PrepareResourcesDependsOn); - PrepareResourceNames; - ResGen; - CompileLicxFiles - - - - - - - AssignTargetPaths; - SplitResourcesByCulture; - CreateManifestResourceNames; - CreateCustomManifestResourceNames - - - - - - - - - - <_Temporary Remove="@(_Temporary)" /> - - - - - - - - - - <_Temporary Remove="@(_Temporary)" /> - - - - - - - - - - - - - - - - - - - - false - false - - - - - - - <_LicxFile Include="@(EmbeddedResource)" Condition="'%(Extension)'=='.licx'" /> - - - Resx - - - Non-Resx - - - - - - - - - - - - - - - - Resx - - - Non-Resx - - - - - - - - - - - - <_MixedResourceWithNoCulture Remove="@(_MixedResourceWithNoCulture)" /> - <_MixedResourceWithCulture Remove="@(_MixedResourceWithCulture)" /> - - - - - - - - - - ResolveAssemblyReferences;SplitResourcesByCulture;BeforeResGen;CoreResGen;AfterResGen - FindReferenceAssembliesForReferences - true - false - - - - - - - - - - <_Temporary Remove="@(_Temporary)" /> - - - $(PlatformTargetAsMSBuildArchitecture) - $(TargetFrameworkSDKToolsDirectory) - - - - $(TargetFrameworkAsMSBuildRuntime) - - CurrentRuntime - - - - - - - - - - - - - - - - - - - - <_Temporary Remove="@(_Temporary)" /> - - - true - - - true - - - - true - - - true - - - - - - - - - - $(PlatformTargetAsMSBuildArchitecture) - - - - - - - - - - - - - - - - - - - - ResolveReferences; - ResolveKeySource; - SetWin32ManifestProperties; - _SetPreferNativeArm64Win32ManifestProperties; - FindReferenceAssembliesForReferences; - _GenerateCompileInputs; - BeforeCompile; - _TimeStampBeforeCompile; - _GenerateCompileDependencyCache; - CoreCompile; - _TimeStampAfterCompile; - AfterCompile; - - - - - - - - - - <_CoreCompileResourceInputs Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)' == 'false' and '%(EmbeddedResource.Type)' == 'Resx'" /> - <_CoreCompileResourceInputs Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)' == 'false' and '%(EmbeddedResource.Type)' == 'Non-Resx' " /> - - <_CoreCompileResourceInputs Include="@(ManifestResourceWithNoCulture)" Condition="'%(ManifestResourceWithNoCulture.EmittedForCompatibilityOnly)'==''"> - Resx - false - - <_CoreCompileResourceInputs Include="@(ManifestNonResxWithNoCultureOnDisk)" Condition="'%(ManifestNonResxWithNoCultureOnDisk.EmittedForCompatibilityOnly)'==''"> - Non-Resx - false - - - - - - - true - $([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)')) - - - true - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - <_AssemblyTimestampBeforeCompile>%(IntermediateAssembly.ModifiedTime) - - - - - - $(IntermediateOutputPath)$(MSBuildProjectFile).SuggestedBindingRedirects.cache - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_AssemblyTimestampAfterCompile>%(IntermediateAssembly.ModifiedTime) - - - - - - __NonExistentSubDir__\__NonExistentFile__ - - - - - <_SGenDllName>$(TargetName).XmlSerializers.dll - <_SGenDllCreated>false - <_SGenGenerateSerializationAssembliesConfig>$(GenerateSerializationAssemblies) - <_SGenGenerateSerializationAssembliesConfig Condition="'$(GenerateSerializationAssemblies)' == ''">Auto - <_SGenGenerateSerializationAssembliesConfig Condition="'$(ConfigurationName)'=='Debug' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto'">Off - true - false - true - - - - - $(PlatformTargetAsMSBuildArchitecture) - - - - - - - - - - $(CreateSatelliteAssembliesDependsOn); - _GenerateSatelliteAssemblyInputs; - ComputeIntermediateSatelliteAssemblies; - GenerateSatelliteAssemblies - - - - - - - - - - <_SatelliteAssemblyResourceInputs Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Resx'" /> - <_SatelliteAssemblyResourceInputs Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Non-Resx'" /> - - <_SatelliteAssemblyResourceInputs Include="@(ManifestResourceWithCulture)" Condition="'%(ManifestResourceWithCulture.EmittedForCompatibilityOnly)'==''"> - Resx - true - - <_SatelliteAssemblyResourceInputs Include="@(ManifestNonResxWithCultureOnDisk)" Condition="'%(ManifestNonResxWithCultureOnDisk.EmittedForCompatibilityOnly)'==''"> - Non-Resx - true - - - - - - - <_ALExeToolPath Condition="'$(_ALExeToolPath)' == ''">$(TargetFrameworkSDKToolsDirectory) - - - - - - - - - - CreateManifestResourceNames - - - - - - %(EmbeddedResource.Culture) - %(EmbeddedResource.Culture)\$(TargetName).resources.dll - - - - - - $(Win32Manifest) - - - - - - - <_DeploymentBaseManifest>$(ApplicationManifest) - <_DeploymentBaseManifest Condition="'$(_DeploymentBaseManifest)'==''">@(_DeploymentBaseManifestWithTargetPath) - - true - - - - - $(ApplicationManifest) - $(ApplicationManifest) - - - - - - - $(_FrameworkVersion40Path)\default.win32manifest - - - - - - - - - $(_Win32Manifest) - - - - - - - SetWin32ManifestProperties; - GenerateApplicationManifest; - GenerateDeploymentManifest - - - - - - <_DeploymentPublishFileOfTypeManifestEntryPoint Include="@(PublishFile)" Condition="'%(FileType)'=='ManifestEntryPoint'" /> - - - - - - - - - - - - - - - - - <_DeploymentCopyApplicationManifest>true - - - - - - <_DeploymentManifestTargetFrameworkMoniker>$(TargetFrameworkMoniker) - <_DeploymentManifestTargetFrameworkVersion>$(TargetFrameworkVersion) - - - - - - - - - - - - - - - - - - - <_DeploymentManifestTargetFrameworkVersion Condition="'$(DeploymentManifestTargetFrameworkVersionOverride)' == ''">v4.5 - <_DeploymentManifestTargetFrameworkVersion Condition="'$(DeploymentManifestTargetFrameworkVersionOverride)' != ''">$(DeploymentManifestTargetFrameworkVersionOverride) - <_DeploymentManifestTargetFrameworkMoniker>.NETFramework,Version=$(_DeploymentManifestTargetFrameworkVersion) - - - - - - - - - - - <_DeploymentManifestEntryPoint Remove="@(_DeploymentManifestEntryPoint)" /> - <_DeploymentManifestEntryPoint Include="@(_DeploymentManifestLauncherEntryPoint)" /> - - - - - - - - - - <_DeploymentManifestType>Native - - - - - - - <_DeploymentManifestVersion>@(_IntermediateAssemblyIdentity->'%(Version)') - - - - - - - <_SGenDllsRelatedToCurrentDll Include="@(_ReferenceSerializationAssemblyPaths->'%(FullPath)')" Condition="'%(Extension)' == '.dll'" /> - <_SGenDllsRelatedToCurrentDll Include="@(SerializationAssembly->'%(FullPath)')" Condition="'%(Extension)' == '.dll'" /> - - - <_CopyLocalFalseRefPaths Include="@(ReferencePath)" Condition="'%(CopyLocal)' == 'false'" /> - <_CopyLocalFalseRefPathsWithExclusion Include="@(_CopyLocalFalseRefPaths)" Exclude="@(ReferenceCopyLocalPaths);@(_NETStandardLibraryNETFrameworkLib)" /> - - - <_ClickOnceSatelliteAssemblies Include="@(IntermediateSatelliteAssembliesWithTargetPath);@(ReferenceSatellitePaths)" /> - - - - <_DeploymentReferencePaths Include="@(ReferenceCopyLocalPaths)" Condition="('%(Extension)' == '.dll' Or '%(Extension)' == '.exe' Or '%(Extension)' == '.md') and ('%(ReferenceCopyLocalPaths.CopyToPublishDirectory)' != 'false')"> - true - - <_DeploymentReferencePaths Include="@(_CopyLocalFalseRefPathsWithExclusion)" /> - - - - <_ManifestManagedReferences Include="@(_DeploymentReferencePaths);@(ReferenceDependencyPaths);@(_SGenDllsRelatedToCurrentDll);@(SerializationAssembly);@(ReferenceCOMWrappersToCopyLocal)" Exclude="@(_ClickOnceSatelliteAssemblies);@(_ReferenceScatterPaths);@(_ExcludedAssembliesFromManifestGeneration)" /> - - - - - <_ClickOnceRuntimeCopyLocalItems Include="@(RuntimeTargetsCopyLocalItems)" Condition="'%(RuntimeTargetsCopyLocalItems.CopyLocal)' == 'true'" /> - <_ClickOnceRuntimeCopyLocalItems Include="@(NativeCopyLocalItems)" Condition="'%(NativeCopyLocalItems.CopyLocal)' == 'true'" /> - <_ClickOnceRuntimeCopyLocalItems Remove="@(_DeploymentReferencePaths)" /> - - <_ClickOnceTransitiveContentItemsTemp Include="@(_TransitiveItemsToCopyToOutputDirectory->WithoutMetadataValue('CopyToPublishDirectory', 'Never')->'%(TargetPath)')" Condition="'$(PublishProtocol)' == 'ClickOnce'"> - %(Identity) - - <_ClickOnceTransitiveContentItems Include="@(_ClickOnceTransitiveContentItemsTemp->'%(SavedIdentity)')" Condition="'%(Identity)'=='@(PublishFile)' Or '%(Extension)'=='.exe' Or '%(Extension)'=='.dll'" /> - - <_ClickOnceContentItems Include="@(ContentWithTargetPath->WithoutMetadataValue('CopyToPublishDirectory', 'Never'))" /> - <_ClickOnceContentItems Include="@(_ClickOnceTransitiveContentItems)" /> - - - <_ClickOnceNoneItemsTemp Include="@(_NoneWithTargetPath->WithoutMetadataValue('CopyToPublishDirectory', 'Never')->'%(TargetPath)')" Condition="'$(PublishProtocol)'=='Clickonce' And ('%(_NoneWithTargetPath.CopyToOutputDirectory)'=='Always' or '%(_NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' or '%(_NoneWithTargetPath.CopyToOutputDirectory)'=='IfDifferent')"> - %(Identity) - - <_ClickOnceNoneItems Include="@(_ClickOnceNoneItemsTemp->'%(SavedIdentity)')" Condition="'%(Identity)'=='@(PublishFile)' Or '%(Extension)'=='.exe' Or '%(Extension)'=='.dll'" /> - <_ClickOnceFiles Include="@(_ClickOnceContentItems);@(_DeploymentManifestIconFile);@(AppConfigWithTargetPath);@(NetCoreRuntimeJsonFilesForClickOnce);@(_ClickOnceRuntimeCopyLocalItems);@(_ClickOnceNoneItems)" /> - - <_ClickOnceNoneItemsTemp Remove="@(_ClickOnceNoneItemsTemp)" /> - <_ClickOnceNoneItems Remove="@(_ClickOnceNoneItems)" /> - <_ClickOnceTransitiveContentItemsTemp Remove="@(_ClickOnceTransitiveContentItemsTemp)" /> - <_ClickOnceTransitiveContentItems Remove="@(_ClickOnceTransitiveContentItems)" /> - <_ClickOnceContentItems Remove="@(_ClickOnceContentItems)" /> - <_ClickOnceRuntimeCopyLocalItems Remove="@(_ClickOnceRuntimeCopyLocalItems)" /> - - - - <_ClickOnceFiles Include="$(PublishedSingleFilePath);@(_DeploymentManifestIconFile)" /> - <_ClickOnceFiles Include="@(_FilesExcludedFromBundle)" /> - - <_FileAssociationIcons Include="%(FileAssociation.DefaultIcon)" /> - <_ClickOnceFiles Include="@(ContentWithTargetPath)" Condition="'%(Identity)'=='@(_FileAssociationIcons)'" /> - - - - - - <_ManifestManagedReferences Remove="@(_ReadyToRunCompileList)" /> - <_ClickOnceFiles Remove="@(_ReadyToRunCompileList)" /> - <_ClickOnceFiles Include="@(_ReadyToRunFilesToPublish)" /> - <_ClickOnceTargetFile Include="@(_ReadyToRunFilesToPublish)" Condition="'%(Filename)%(Extension)' == '$(TargetFileName)'" /> - - - - - - - - - - - - - - - - - - - <_DeploymentManifestDependencies Include="@(_DeploymentManifestDependenciesUnfiltered)" Condition="!('%(_DeploymentManifestDependenciesUnfiltered.CopyLocal)' == 'false' And '%(_DeploymentManifestDependenciesUnfiltered.DependencyType)' != 'Install')" /> - - - <_DeploymentManifestType>ClickOnce - - - - <_DeploymentPlatformTarget Condition="'$(_DeploymentLauncherBased)' != 'true'">$(PlatformTarget) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - false - - - - - CopyFilesToOutputDirectory - - - - - - - false - false - - - - - false - false - false - - - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - false - - - - - - - - - - - - - - - - - <_TargetsThatPrepareProjectReferences>_SplitProjectReferencesByFileExistence - - true - <_TargetsThatPrepareProjectReferences Condition=" '$(MSBuildCopyContentTransitively)' == 'true' "> - AssignProjectConfiguration; - _SplitProjectReferencesByFileExistence - - - $(GetCopyToOutputDirectoryItemsDependsOn); - AssignTargetPaths; - $(_TargetsThatPrepareProjectReferences); - _GetProjectReferenceTargetFrameworkProperties; - _PopulateCommonStateForGetCopyToOutputDirectoryItems - - - <_RecursiveTargetForContentCopying>GetCopyToOutputDirectoryItems - - <_RecursiveTargetForContentCopying Condition=" '$(MSBuildCopyContentTransitively)' == 'false' ">_GetCopyToOutputDirectoryItemsFromThisProject - - - - - <_GCTODIKeepDuplicates>false - <_GCTODIKeepMetadata>CopyToOutputDirectory;TargetPath - - - - - - - - - - <_CopyToOutputDirectoryTransitiveItems KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always'" /> - <_CopyToOutputDirectoryTransitiveItems KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'" /> - <_CopyToOutputDirectoryTransitiveItems KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='IfDifferent'" /> - - - - <_AllChildProjectItemsWithTargetPath Remove="@(_AllChildProjectItemsWithTargetPath)" /> - - - - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='Always' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'!=''" /> - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'!=''" /> - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='IfDifferent' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'!=''" /> - - - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='Always' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'!=''" /> - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='PreserveNewest' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'!=''" /> - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='IfDifferent' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'!=''" /> - - - <_CompileItemsToCopy Include="@(Compile->'%(FullPath)')" Condition="('%(Compile.CopyToOutputDirectory)'=='Always' or '%(Compile.CopyToOutputDirectory)'=='PreserveNewest' or '%(Compile.CopyToOutputDirectory)'=='IfDifferent') AND '%(Compile.MSBuildSourceProjectFile)'!=''" /> - - - - - - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='Always'" /> - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'" /> - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='IfDifferent'" /> - - - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='Always' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'!=''" /> - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'!=''" /> - <_CopyToOutputDirectoryTransitiveItems KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='IfDifferent' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'!=''" /> - - - - - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='Always' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'==''" /> - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'==''" /> - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='IfDifferent' AND '%(ContentWithTargetPath.MSBuildSourceProjectFile)'==''" /> - - - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='Always' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'==''" /> - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='PreserveNewest' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'==''" /> - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='IfDifferent' AND '%(EmbeddedResource.MSBuildSourceProjectFile)'==''" /> - - - <_CompileItemsToCopy Include="@(Compile->'%(FullPath)')" Condition="('%(Compile.CopyToOutputDirectory)'=='Always' or '%(Compile.CopyToOutputDirectory)'=='PreserveNewest' or '%(Compile.CopyToOutputDirectory)'=='IfDifferent') AND '%(Compile.MSBuildSourceProjectFile)'==''" /> - - - - - - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='Always'" /> - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'" /> - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='IfDifferent'" /> - - - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='Always' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'==''" /> - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'==''" /> - <_ThisProjectItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='IfDifferent' AND '%(_NoneWithTargetPath.MSBuildSourceProjectFile)'==''" /> - - - - - - - - - - - - - <_TransitiveItemsToCopyToOutputDirectory Remove="@(_ThisProjectItemsToCopyToOutputDirectory)" MatchOnMetadata="TargetPath" MatchOnMetadataOptions="PathLike" /> - - - <_TransitiveItemsToCopyToOutputDirectoryAlways KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_TransitiveItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_TransitiveItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='Always'" /> - <_TransitiveItemsToCopyToOutputDirectoryPreserveNewest KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_TransitiveItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_TransitiveItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='PreserveNewest'" /> - <_TransitiveItemsToCopyToOutputDirectoryIfDifferent KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_TransitiveItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_TransitiveItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='IfDifferent'" /> - <_ThisProjectItemsToCopyToOutputDirectoryAlways KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_ThisProjectItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_ThisProjectItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='Always'" /> - <_ThisProjectItemsToCopyToOutputDirectoryPreserveNewest KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_ThisProjectItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_ThisProjectItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='PreserveNewest'" /> - <_ThisProjectItemsToCopyToOutputDirectoryIfDifferent KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_ThisProjectItemsToCopyToOutputDirectory->'%(FullPath)')" Condition="'%(_ThisProjectItemsToCopyToOutputDirectory.CopyToOutputDirectory)'=='IfDifferent'" /> - - <_SourceItemsToCopyToOutputDirectoryAlways Include="@(_TransitiveItemsToCopyToOutputDirectoryAlways);@(_ThisProjectItemsToCopyToOutputDirectoryAlways)" /> - <_SourceItemsToCopyToOutputDirectory Include="@(_TransitiveItemsToCopyToOutputDirectoryPreserveNewest);@(_ThisProjectItemsToCopyToOutputDirectoryPreserveNewest)" /> - <_SourceItemsToCopyToOutputDirectoryIfDifferent Include="@(_TransitiveItemsToCopyToOutputDirectoryIfDifferent);@(_ThisProjectItemsToCopyToOutputDirectoryIfDifferent)" /> - - - <_TransitiveItemsToCopyToOutputDirectoryAlways Remove="@(_TransitiveItemsToCopyToOutputDirectoryAlways)" /> - <_TransitiveItemsToCopyToOutputDirectoryPreserveNewest Remove="@(_TransitiveItemsToCopyToOutputDirectoryPreserveNewest)" /> - <_TransitiveItemsToCopyToOutputDirectoryIfDifferent Remove="@(_TransitiveItemsToCopyToOutputDirectoryIfDifferent)" /> - <_ThisProjectItemsToCopyToOutputDirectoryAlways Remove="@(_ThisProjectItemsToCopyToOutputDirectoryAlways)" /> - <_ThisProjectItemsToCopyToOutputDirectoryPreserveNewest Remove="@(_ThisProjectItemsToCopyToOutputDirectoryPreserveNewest)" /> - <_ThisProjectItemsToCopyToOutputDirectory Remove="@(_ThisProjectItemsToCopyToOutputDirectory)" /> - <_ThisProjectItemsToCopyToOutputDirectoryIfDifferent Remove="@(_ThisProjectItemsToCopyToOutputDirectoryIfDifferent)" /> - - - - - - - %(CopyToOutputDirectory) - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_DocumentationFileProduced Condition="!Exists('@(DocFileItem)')">false - - - - - - - <_DebugSymbolsProduced Condition="!Exists('@(_DebugSymbolsIntermediatePath)')">false - - - - - - - - - - <_SGenDllCreated Condition="Exists('$(IntermediateOutputPath)$(_SGenDllName)')">true - - - - - - - - - - - - - $(PlatformTargetAsMSBuildArchitecture) - - - - $(TargetFrameworkAsMSBuildRuntime) - - CurrentRuntime - - - - - - - - - - - - <_CleanOrphanFileWrites Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanCurrentFileWrites)" /> - - - - - - - - - - - - - - - - <_CleanRemainingFileWritesAfterIncrementalClean Include="@(_CleanPriorFileWrites);@(_CleanCurrentFileWrites)" Exclude="@(_CleanOrphanFilesDeleted)" /> - - - - - - - - - - - - - - - - - - - - - <_CleanPriorFileWrites Include="@(_CleanUnfilteredPriorFileWrites)" Exclude="@(_ResolveAssemblyReferenceResolvedFilesAbsolute)" /> - - - - false - - - - - - - - - - - - - - - - - - - - - - <_CleanCurrentFileWritesWithNoReferences Include="@(_CleanCurrentFileWritesInOutput);@(_CleanCurrentFileWritesInIntermediate)" Exclude="@(_ResolveAssemblyReferenceResolvedFilesAbsolute)" /> - - - - - - - - - - - BeforeClean; - UnmanagedUnregistration; - CoreClean; - CleanReferencedProjects; - CleanPublishFolder; - AfterClean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_CleanRemainingFileWritesAfterClean Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanPriorFileWritesDeleted)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CleanPublishFolder; - $(_RecursiveTargetForContentCopying); - _DeploymentGenerateTrustInfo; - $(DeploymentComputeClickOnceManifestInfoDependsOn) - - - - - - SetGenerateManifests; - Build; - PublishOnly - - - _DeploymentUnpublishable - - - - - - - - - - - - - true - - - - - - SetGenerateManifests; - PublishBuild; - BeforePublish; - GenerateManifests; - CopyFilesToOutputDirectory; - _CopyFilesToPublishFolder; - _DeploymentGenerateBootstrapper; - ResolveKeySource; - _DeploymentSignClickOnceDeployment; - AfterPublish - - - - - - - - - - - BuildOnlySettings; - PrepareForBuild; - ResolveReferences; - PrepareResources; - ResolveKeySource; - GenerateSerializationAssemblies; - CreateSatelliteAssemblies; - - - - - - - - - - - <_DeploymentApplicationFolderName>Application Files\$(AssemblyName)_$(_DeploymentApplicationVersionFragment) - <_DeploymentApplicationDir>$(ClickOncePublishDir)$(_DeploymentApplicationFolderName)\ - - - - false - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(TargetPath) - $(TargetFileName) - true - - - - - - true - $(TargetPath) - $(TargetFileName) - - - - - PrepareForBuild - true - - - - <_BuiltProjectOutputGroupOutputIntermediate Include="@(BuiltProjectOutputGroupKeyOutput)" /> - - - - <_BuiltProjectOutputGroupOutputIntermediate Include="$(AppConfig)" Condition="'$(AddAppConfigToBuildOutputs)'=='true'"> - $(TargetDir)$(TargetFileName).config - $(TargetFileName).config - - $(AppConfig) - - - - <_IsolatedComReference Include="@(COMReference)" Condition=" '%(COMReference.Isolated)' == 'true' " /> - <_IsolatedComReference Include="@(COMFileReference)" Condition=" '%(COMFileReference.Isolated)' == 'true' " /> - - - - <_BuiltProjectOutputGroupOutputIntermediate Include="$(OutDir)$(_DeploymentTargetApplicationManifestFileName)" Condition="('@(NativeReference)'!='' or '@(_IsolatedComReference)'!='') And Exists('$(OutDir)$(_DeploymentTargetApplicationManifestFileName)')"> - $(_DeploymentTargetApplicationManifestFileName) - - $(OutDir)$(_DeploymentTargetApplicationManifestFileName) - - - - - - - %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) - - - - - - - - - - @(_DebugSymbolsOutputPath->'%(FullPath)') - @(_DebugSymbolsIntermediatePath->'%(Filename)%(Extension)') - - - - - - - @(WinMDExpFinalOutputPdbItem->'%(FullPath)') - @(WinMDExpOutputPdbItem->'%(Filename)%(Extension)') - - - - - - - - - - @(FinalDocFile->'%(FullPath)') - true - @(DocFileItem->'%(Filename)%(Extension)') - - - - - - - @(WinMDExpFinalOutputDocItem->'%(FullPath)') - @(WinMDOutputDocumentationFileItem->'%(Filename)%(Extension)') - - - - - - $(SatelliteDllsProjectOutputGroupDependsOn);PrepareForBuild;PrepareResourceNames - - - - - %(EmbeddedResource.Culture)\$(TargetName).resources.dll - %(EmbeddedResource.Culture) - - - - - - $(TargetDir)%(SatelliteDllsProjectOutputGroupOutputIntermediate.TargetPath) - - %(SatelliteDllsProjectOutputGroupOutputIntermediate.Identity) - - - - - - PrepareForBuild;AssignTargetPaths - - - - - - - - - - - - $(MSBuildProjectFullPath) - $(ProjectFileName) - - - - - - - - PrepareForBuild;AssignTargetPaths - - - - - - - - - - - - - - @(_OutputPathItem->'%(FullPath)$(_SGenDllName)') - $(_SGenDllName) - - - - - - - - - - - - - - - - - - - ResolveSDKReferences;ExpandSDKReferences - - - - - - - - - - - - - $(CommonOutputGroupsDependsOn); - BuildOnlySettings; - PrepareForBuild; - AssignTargetPaths; - ResolveReferences - - - - - - - - $(BuiltProjectOutputGroupDependenciesDependsOn); - $(CommonOutputGroupsDependsOn) - - - - - - - - - - - $(DebugSymbolsProjectOutputGroupDependenciesDependsOn); - $(CommonOutputGroupsDependsOn) - - - - - - - - - - - - $(SatelliteDllsProjectOutputGroupDependenciesDependsOn); - $(CommonOutputGroupsDependsOn) - - - - - - - - - - - - $(DocumentationProjectOutputGroupDependenciesDependsOn); - $(CommonOutputGroupsDependsOn) - - - - - - - - - - - - $(SGenFilesOutputGroupDependenciesDependsOn); - $(CommonOutputGroupsDependsOn) - - - - - - - - - - - - $(ReferenceCopyLocalPathsOutputGroupDependsOn); - $(CommonOutputGroupsDependsOn) - - - - - - %(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension) - - - - - - - $(DesignerRuntimeImplementationProjectOutputGroupDependsOn); - $(CommonOutputGroupsDependsOn) - - - - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeAnalysis\Microsoft.CodeAnalysis.targets - - - - - - true - - - - - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TeamTest\Microsoft.TeamTest.targets - - - - false - - - - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\AppxPackage\Microsoft.AppXPackage.Targets - - true - - - - - - - - $([MSBuild]::IsRunningFromVisualStudio()) - $([MSBuild]::GetToolsDirectory32())\..\..\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets - $(MSBuildToolsPath)\NuGet.targets - - - - - - true - - NuGet.Build.Tasks.dll - - false - - true - true - - false - - WarnAndContinue - - $(BuildInParallel) - true - - <_RestoreSolutionFileUsed Condition=" '$(_RestoreSolutionFileUsed)' == '' AND '$(SolutionDir)' != '' AND $(MSBuildProjectFullPath.EndsWith('.metaproj')) == 'true' ">true - - $(MSBuildInteractive) - - true - - true - - true - - <_CentralPackageVersionsEnabled Condition="'$(ManagePackageVersionsCentrally)' == 'true' AND '$(CentralPackageVersionsFileImported)' == 'true'">true - - - - - true - - low - - all - direct - - - - - true - false - true - false - - - - <_GenerateRestoreGraphProjectEntryInputProperties>ExcludeRestorePackageImports=true - - <_GenerateRestoreGraphProjectEntryInputProperties Condition=" '$(RestoreUseCustomAfterTargets)' == 'true' "> - $(_GenerateRestoreGraphProjectEntryInputProperties); - NuGetRestoreTargets=$(MSBuildThisFileFullPath); - RestoreUseCustomAfterTargets=$(RestoreUseCustomAfterTargets); - CustomAfterMicrosoftCommonCrossTargetingTargets=$(MSBuildThisFileFullPath); - CustomAfterMicrosoftCommonTargets=$(MSBuildThisFileFullPath); - - - <_GenerateRestoreGraphProjectEntryInputProperties Condition=" '$(_RestoreSolutionFileUsed)' == 'true' "> - $(_GenerateRestoreGraphProjectEntryInputProperties); - _RestoreSolutionFileUsed=true; - SolutionDir=$(SolutionDir); - SolutionName=$(SolutionName); - SolutionFileName=$(SolutionFileName); - SolutionPath=$(SolutionPath); - SolutionExt=$(SolutionExt); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(ContinueOnError) - false - - - - - - - - - - - - - - $(ContinueOnError) - false - - - - - - - - - - - - - - $(ContinueOnError) - false - - - - - - - - - - - - - <_FrameworkReferenceForRestore Include="@(FrameworkReference)" Condition="'%(FrameworkReference.IsTransitiveFrameworkReference)' != 'true'" /> - - - - - - - $(ContinueOnError) - false - - - - - - - - - - - - - $(ContinueOnError) - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - exclusionlist - - - - <_FilteredRestoreGraphProjectInputItemsTmp Include="@(RestoreGraphProjectInputItems)" Condition=" '%(RestoreGraphProjectInputItems.Extension)' == '.csproj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.vbproj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.fsproj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.nuproj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.proj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.msbuildproj' Or '%(RestoreGraphProjectInputItems.Extension)' == '.vcxproj' " /> - - - - <_FilteredRestoreGraphProjectInputItemsTmp Include="@(RestoreGraphProjectInputItems)" Condition=" '%(RestoreGraphProjectInputItems.Extension)' != '.metaproj' AND '%(RestoreGraphProjectInputItems.Extension)' != '.shproj' AND '%(RestoreGraphProjectInputItems.Extension)' != '.vcxitems' AND '%(RestoreGraphProjectInputItems.Extension)' != '.vdproj' AND '%(RestoreGraphProjectInputItems.Extension)' != '' " /> - - - - <_FilteredRestoreGraphProjectInputItemsTmp Include="@(RestoreGraphProjectInputItems)" /> - - - - - - - - - - - - - - - - - - - - - - - - <_GenerateRestoreGraphProjectEntryInput Include="@(FilteredRestoreGraphProjectInputItems)" Condition=" '$(RestoreRecursive)' != 'true' " /> - <_GenerateRestoreGraphProjectEntryInput Include="@(_RestoreProjectPathItems)" Condition=" '$(RestoreRecursive)' == 'true' " /> - - - - - - - - - - - - - - - - - - - - <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())" Condition=" '$(RestoreProjectStyle)' != 'Unknown' "> - RestoreSpec - $(MSBuildProjectFullPath) - - - - - - - netcoreapp1.0 - - - - - - - - - - - <_HasPackageReferenceItems Condition="'@(PackageReference)' != ''">true - - - <_HasPackageReferenceItems Condition="@(PackageReference->Count()) > 0">true - - - - - - - <_HasPackageReferenceItems /> - - - - - - true - - - - - - <_RestoreProjectFramework /> - <_TargetFrameworkToBeUsed Condition=" '$(_TargetFrameworkOverride)' == '' ">$(TargetFrameworks) - - - - - - <_RestoreTargetFrameworksOutputFiltered Include="$(_RestoreProjectFramework.Split(';'))" /> - - - - - - <_RestoreTargetFrameworkItems Include="$(TargetFrameworks.Split(';'))" /> - - - <_RestoreTargetFrameworkItems Include="$(_TargetFrameworkOverride)" /> - - - - - - $(SolutionDir) - - - - - - - - - - - - - - - - - - - - - - - <_RestoreSettingsPerFramework Include="$([System.Guid]::NewGuid())"> - $(RestoreAdditionalProjectSources) - $(RestoreAdditionalProjectFallbackFolders) - $(RestoreAdditionalProjectFallbackFoldersExcludes) - - - - - - - - $(MSBuildProjectExtensionsPath) - - - - - - - <_RestoreProjectName>$(MSBuildProjectName) - <_RestoreProjectName Condition=" '$(PackageReferenceCompatibleProjectStyle)' == 'true' AND '$(AssemblyName)' != '' ">$(AssemblyName) - <_RestoreProjectName Condition=" '$(PackageReferenceCompatibleProjectStyle)' == 'true' AND '$(PackageId)' != '' ">$(PackageId) - - - - <_RestoreProjectVersion>1.0.0 - <_RestoreProjectVersion Condition=" '$(Version)' != '' ">$(Version) - <_RestoreProjectVersion Condition=" '$(PackageVersion)' != '' ">$(PackageVersion) - - - - <_RestoreCrossTargeting>true - - - - <_RestoreSkipContentFileWrite Condition=" '$(TargetFrameworks)' == '' AND '$(TargetFramework)' == '' ">true - - - - <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())"> - ProjectSpec - $(_RestoreProjectVersion) - $(MSBuildProjectFullPath) - $(MSBuildProjectFullPath) - $(_RestoreProjectName) - $(_OutputSources) - $(_OutputFallbackFolders) - $(_OutputPackagesPath) - $(RestoreProjectStyle) - $(RestoreOutputAbsolutePath) - $(RuntimeIdentifiers);$(RuntimeIdentifier) - $(RuntimeSupports) - $(_RestoreCrossTargeting) - $(RestoreLegacyPackagesDirectory) - $(ValidateRuntimeIdentifierCompatibility) - $(_RestoreSkipContentFileWrite) - $(_OutputConfigFilePaths) - $(TreatWarningsAsErrors) - $(WarningsAsErrors) - $(WarningsNotAsErrors) - $(NoWarn) - $(RestorePackagesWithLockFile) - $(NuGetLockFilePath) - $(RestoreLockedMode) - <_CentralPackageVersionsEnabled>$(_CentralPackageVersionsEnabled) - $(CentralPackageFloatingVersionsEnabled) - $(CentralPackageVersionOverrideEnabled) - $(CentralPackageTransitivePinningEnabled) - $(NuGetAudit) - $(NuGetAuditLevel) - $(NuGetAuditMode) - $(SdkAnalysisLevel) - $(UsingMicrosoftNETSdk) - $(NETCoreSdkVersion) - $(RestoreUseLegacyDependencyResolver) - $(RestoreDoNotWriteDependencyGraphSpec) - - - - - <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())"> - ProjectSpec - $(MSBuildProjectFullPath) - $(MSBuildProjectFullPath) - $(_RestoreProjectName) - $(RestoreProjectStyle) - $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config - $(MSBuildProjectDirectory)\packages.config - $(RestorePackagesWithLockFile) - $(NuGetLockFilePath) - $(RestoreLockedMode) - $(_OutputSources) - $(SolutionDir) - $(_OutputRepositoryPath) - $(_OutputConfigFilePaths) - $(_OutputPackagesPath) - @(_RestoreTargetFrameworksOutputFiltered) - $(NuGetAudit) - $(NuGetAuditLevel) - - - - - <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())"> - ProjectSpec - $(MSBuildProjectFullPath) - $(MSBuildProjectFullPath) - $(_RestoreProjectName) - $(RestoreProjectStyle) - @(_RestoreTargetFrameworksOutputFiltered) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_RestoreGraphEntry Include="$([System.Guid]::NewGuid())"> - TargetFrameworkInformation - $(MSBuildProjectFullPath) - $(PackageTargetFallback) - $(AssetTargetFallback) - $(TargetFramework) - $(TargetFrameworkIdentifier) - $(TargetFrameworkVersion) - $(TargetFrameworkMoniker) - $(TargetFrameworkProfile) - $(TargetPlatformMoniker) - $(TargetPlatformIdentifier) - $(TargetPlatformVersion) - $(TargetPlatformMinVersion) - $(CLRSupport) - $(RuntimeIdentifierGraphPath) - $(WindowsTargetPlatformMinVersion) - $(RestoreEnablePackagePruning) - $(RestorePackagePruningDefault) - $(NuGetAuditMode) - - - - - - - - - - - - - <_RestoreProjectPathItems Include="$(_RestoreGraphAbsoluteProjectPaths)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_GenerateRestoreProjectPathWalkOutputs Include="$(MSBuildProjectFullPath)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_RestorePackagesPathOverride>$(RestorePackagesPath) - - - - - - <_RestorePackagesPathOverride>$(RestoreRepositoryPath) - - - - - - <_RestoreSourcesOverride>$(RestoreSources) - - - - - - <_RestoreFallbackFoldersOverride>$(RestoreFallbackFolders) - - - - - - - - - - - - - <_TargetFrameworkOverride Condition=" '$(TargetFrameworks)' == '' ">$(TargetFramework) - - - - - - <_ValidProjectsForRestore Include="$(MSBuildProjectFullPath)" /> - - - - - - - - - - $(MSBuildExtensionsPath)\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets - - - - - <_TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion.TrimStart('vV')) - $(MSBuildThisFileDirectory)\tools\net11.0\Microsoft.NET.Build.Extensions.Tasks.dll - $(MSBuildThisFileDirectory)\tools\net472\Microsoft.NET.Build.Extensions.Tasks.dll - - true - - - - - - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - $(MSBuildExtensionsPath)\Microsoft.TestPlatform.targets - - - - - - Microsoft.TestPlatform.Build.dll - $([System.IO.Path]::Combine($(MSBuildThisFileDirectory),"vstest.console.dll")) - False - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - true - - - - - - - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - GetNuPkgVersion; - $(VersionDependsOn) - - - GetBuildVersion; - $(CleanDependsOn) - - - GetBuildVersion; - $(GenerateNuspecDependsOn) - - - GetBuildVersion; - $(GetPackageVersionDependsOn) - - - false - false - false - - - - <_NBGV_Common_Targets_Imported>true - <_NBGV_PlatformSuffix Condition=" '$(_NBGV_PlatformSuffix)' == '' and '$(MSBuildRuntimeType)' == 'Core' ">MSBuildCore/ - <_NBGV_PlatformSuffix Condition=" '$(_NBGV_PlatformSuffix)' == '' ">MSBuildFull/ - $(MSBuildThisFileDirectory)$(_NBGV_PlatformSuffix) - - - - - - - - - - - - - false - false - - <_NBGV_LanguageMode Condition=" '$(Language)' == 'c++' ">Native - <_NBGV_LanguageMode Condition=" '$(Language)' == 'c#' ">Managed - <_NBGV_LanguageMode Condition=" '$(Language)' == 'cs' ">Managed - <_NBGV_LanguageMode Condition=" '$(Language)' == 'csharp' ">Managed - <_NBGV_LanguageMode Condition=" '$(Language)' == 'vb' ">Managed - <_NBGV_LanguageMode Condition=" '$(Language)' == 'visualbasic' ">Managed - <_NBGV_LanguageMode Condition=" '$(Language)' == 'visual basic' ">Managed - <_NBGV_LanguageMode Condition=" '$(Language)' == 'f#' ">Managed - <_NBGV_LanguageMode Condition=" '$(Language)' == 'fs' ">Managed - <_NBGV_LanguageMode Condition=" '$(Language)' == 'fsharp' ">Managed - false - - - GenerateNativeNBGVVersionInfo; - $(PrepareForBuildDependsOn); - - - GenerateAssemblyNBGVVersionInfo; - $(PrepareResourcesDependsOn) - - - GenerateAssemblyNBGVVersionInfo; - $(CoreCompileDependsOn) - - - - - - <_NBGV_BuildingRef>$(_NBGV_BuildingTag) - <_NBGV_BuildingRef Condition=" '$(_NBGV_BuildingRef)' == '' ">$(_NBGV_BuildingBranch) - $(MSBuildProjectDirectory) - - - - - - - - - %(Value) - - - - - - $(NBGV_InnerGlobalProperties)GitRepoRoot=$(GitRepoRoot); - $(NBGV_InnerGlobalProperties)PublicRelease=$(PublicRelease); - $(NBGV_InnerGlobalProperties)_NBGV_BuildingRef=$(_NBGV_BuildingRef); - $(NBGV_InnerGlobalProperties)ProjectPathRelativeToGitRepoRoot=$(ProjectPathRelativeToGitRepoRoot); - $(NBGV_InnerGlobalProperties)GitVersionBaseDirectory=$(GitVersionBaseDirectory); - $(NBGV_InnerGlobalProperties)OverrideBuildNumberOffset=$(OverrideBuildNumberOffset); - $(NBGV_InnerGlobalProperties)NBGV_PrivateP2PAuxTargets=$(NBGV_PrivateP2PAuxTargets); - $(NBGV_InnerGlobalProperties)NBGV_GitEngine=$(NBGV_GitEngine); - - - - - - <_BuildMetadataSnapped Include="@(BuildMetadata)" /> - <_PrereleaseIdentifierSnapped Include="@(PrereleaseIdentifier)" /> - - - - GetBuildVersion_Properties;GetBuildVersion_CloudBuildVersionVars - $(NBGV_InnerGlobalProperties)BuildMetadata=@(BuildMetadata, ',');PrereleaseIdentifiers=@(PrereleaseIdentifier, ',');Configuration=Release;Platform=AnyCPU - Configuration=Release - Platform=AnyCPU - @(NBGV_GlobalPropertiesToRemove) - - false - false - true - false - all - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $([MSBuild]::NormalizePath('$(IntermediateOutputPath)', '$(AssemblyName).Version$(DefaultLanguageSourceExtension)')) - $(VersionSourceFile).new - - $(RootNamespace) - $(_TargetAssemblyProjectName) - - - - - - - - - - - - - - <_CompileWithVersionFile Include="$(VersionSourceFile);@(Compile)" /> - - - <_CompileWithVersionFile Remove="@(_CompileWithVersionFile)" /> - - - - - $([MSBuild]::NormalizePath('$(IntermediateOutputPath)', '$(AssemblyName).Version.rc')) - $(VersionSourceFile).new - - - - - - - - - - - - - - - - - $(NuGetPackageVersion) - - - - - - - $(NuGetPackageVersion) - $(NuSpecProperties);$(NuGetProperties);GitCommitIdShort=$(GitCommitIdShort) - - - - - - - - - - - - - - - - <_NBGV_Major_Shifted>$([MSBuild]::Multiply($([System.Version]::Parse('$(BuildVersion)').Major), 16777216)) - <_NBGV_Minor_Shifted>$([MSBuild]::Multiply($([System.Version]::Parse('$(BuildVersion)').Minor), 65536)) - $([MSBuild]::Add($([MSBuild]::Add($(_NBGV_Major_Shifted), $(_NBGV_Minor_Shifted))), $(BuildNumber))) - $(Version) - - - - - - $(BuildVersionSimple) - - $(BuildVersionSimple) - - - - - - - - $(BuildVersion) - - - - - - <_NBGV_OriginalServerJson Include="@(None)" Condition="'%(None.FileName)%(None.Extension)'=='server.json'" /> - <_NBGV_StampedServerJson Include="@(_NBGV_OriginalServerJson->'$(IntermediateOutputPath)\nb.gv\server.json')" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(RepositoryUrl) - $(ScmRepositoryUrl) - - - - %(SourceRoot.ScmRepositoryUrl) - - - - - - - - <_SourceLinkFilePath>$(IntermediateOutputPath)$(MSBuildProjectName).sourcelink.json - - - - - - - - - <_GenerateSourceLinkFileBeforeTargets>Link - <_GenerateSourceLinkFileDependsOnTargets>ComputeLinkSwitches - - - <_GenerateSourceLinkFileBeforeTargets>CoreCompile - <_GenerateSourceLinkFileDependsOnTargets /> - - - - - - - - - - - - - - - - %(Link.AdditionalOptions) /sourcelink:"$(SourceLink)" - - - - - - - - - - - - local - - - - - - - - - - - git - - - - - - - - - - - - - <_SourceLinkGitHubAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\Microsoft.SourceLink.GitHub.dll - <_SourceLinkGitHubAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\core\Microsoft.SourceLink.GitHub.dll - - - - - $(SourceLinkUrlInitializerTargets);_InitializeGitHubSourceLinkUrl - $(SourceControlManagerUrlTranslationTargets);TranslateGitHubUrlsInSourceControlInformation - - - - - - - - - - - - - - - <_TranslatedSourceRoot Remove="@(_TranslatedSourceRoot)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - <_DirectoryBuildTargetsFile Condition="'$(_DirectoryBuildTargetsFile)' == ''">Directory.Build.targets - <_DirectoryBuildTargetsBasePath Condition="'$(_DirectoryBuildTargetsBasePath)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), '$(_DirectoryBuildTargetsFile)')) - $([System.IO.Path]::Combine('$(_DirectoryBuildTargetsBasePath)', '$(_DirectoryBuildTargetsFile)')) - - - - - $(AssemblyName) ($(TargetFramework)) - - - $(DefineConstants);P_LINQ;SUPPORTS_BINDINGLIST - - - $(DefineConstants);NETSTANDARD;P_LINQ;SUPPORTS_BINDINGLIST;SUPPORTS_ASYNC_DISPOSABLE;SUPPORTS_DICTIONARY_MUTATION_DURING_ENUMERATION - - - - - - - - -// <autogenerated /> -using System%3b -using System.Reflection%3b -[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute("$(TargetFrameworkMoniker)", FrameworkDisplayName = "$(TargetFrameworkMonikerDisplayName)")] - - - - - true - - true - true - - $([System.Globalization.CultureInfo]::CurrentUICulture.Name) - - - - - <_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" /> - - - - - - - - - - - TargetFramework - TargetFrameworks - - - true - - - - - - - - - <_MainReferenceTargetForBuild Condition="'$(BuildProjectReferences)' == '' or '$(BuildProjectReferences)' == 'true'">.projectReferenceTargetsOrDefaultTargets - <_MainReferenceTargetForBuild Condition="'$(_MainReferenceTargetForBuild)' == ''">GetTargetPath - $(_MainReferenceTargetForBuild);GetNativeManifest;$(_RecursiveTargetForContentCopying);$(ProjectReferenceTargetsForBuild) - - <_MainReferenceTargetForPublish Condition="'$(NoBuild)' == 'true'">GetTargetPath - <_MainReferenceTargetForPublish Condition="'$(NoBuild)' != 'true'">$(_MainReferenceTargetForBuild) - GetTargetFrameworks;$(_MainReferenceTargetForPublish);GetNativeManifest;GetCopyToPublishDirectoryItems;$(ProjectReferenceTargetsForPublish) - - $(ProjectReferenceTargetsForBuild);$(ProjectReferenceTargetsForPublish) - $(ProjectReferenceTargetsForRebuild);$(ProjectReferenceTargetsForPublish) - GetCopyToPublishDirectoryItems;$(ProjectReferenceTargetsForGetCopyToPublishDirectoryItems) - - - .default;$(ProjectReferenceTargetsForBuild) - - - Clean;$(ProjectReferenceTargetsForClean) - $(ProjectReferenceTargetsForClean);$(ProjectReferenceTargetsForBuild);$(ProjectReferenceTargetsForRebuild) - - - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildThisFileDirectory)..\tools\ - net11.0 - net472 - $(MicrosoftNETBuildTasksDirectoryRoot)$(MicrosoftNETBuildTasksTFM)\ - $(MicrosoftNETBuildTasksDirectory)Microsoft.NET.Build.Tasks.dll - - Microsoft.NETCore.App;NETStandard.Library - - - - <_IsExecutable Condition="'$(OutputType)' == 'Exe' or '$(OutputType)'=='WinExe'">true - $(_IsExecutable) - - - - netcoreapp2.2 - - - Preview - - - - - - - $(NuGetPackageRoot)\microsoft.net.sdk.compilers.toolset\$(NETCoreSdkVersion) - $(RoslynTargetsPath)\Microsoft.Build.Tasks.CodeAnalysis.dll - <_NeedToDownloadMicrosoftNetSdkCompilersToolsetPackage>true - <_MicrosoftNetSdkCompilersToolsetPackageRootEmpty Condition="'$(NuGetPackageRoot)' == ''">true - - - - true - - - - - - - - $(MSBuildProjectExtensionsPath)/project.assets.json - $([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(ProjectAssetsFile))) - - $(IntermediateOutputPath)$(MSBuildProjectName).assets.cache - $([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(ProjectAssetsCacheFile))) - - false - - false - - true - $(IntermediateOutputPath)NuGet\ - true - $(TargetPlatformIdentifier),Version=v$([System.Version]::Parse('$(TargetPlatformMinVersion)').ToString(3)) - $(TargetFrameworkMoniker) - true - - false - - true - - - - <_NugetTargetMonikerAndRID Condition="'$(RuntimeIdentifier)' == ''">$(NuGetTargetMoniker) - <_NugetTargetMonikerAndRID Condition="'$(RuntimeIdentifier)' != ''">$(NuGetTargetMoniker)/$(RuntimeIdentifier) - - - - - - - - - $(ResolveAssemblyReferencesDependsOn); - ResolvePackageDependenciesForBuild; - _HandlePackageFileConflicts; - - - ResolvePackageDependenciesForBuild; - _HandlePackageFileConflicts; - $(PrepareResourcesDependsOn) - - - - - - $(RootNamespace) - - - $(AssemblyName) - - - $(MSBuildProjectDirectory) - - - $(TargetFileName) - - - $(MSBuildProjectFile) - - - - - - true - - - - - - ResolveLockFileReferences; - ResolveLockFileAnalyzers; - ResolveLockFileCopyLocalFiles; - ResolveRuntimePackAssets; - RunProduceContentAssets; - IncludeTransitiveProjectReferences - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_RoslynApiVersion>$([System.Version]::Parse(%(_CodeAnalysisIdentity.Version)).Major).$([System.Version]::Parse(%(_CodeAnalysisIdentity.Version)).Minor) - roslyn$(_RoslynApiVersion) - - - - - - false - - - true - - - true - - - - true - - - <_PackAsToolShimRuntimeIdentifiers Condition="@(_PackAsToolShimRuntimeIdentifiers) ==''" Include="$(PackAsToolShimRuntimeIdentifiers)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_NativeRestoredAppHostNETCore Include="@(NativeCopyLocalItems)" Condition="'%(NativeCopyLocalItems.FileName)%(NativeCopyLocalItems.Extension)' == '$(_DotNetAppHostExecutableName)'" /> - - - <_ApphostsForShimRuntimeIdentifiers Include="@(_ApphostsForShimRuntimeIdentifiersResolvePackageAssets)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ResolvedCopyLocalBuildAssets Include="@(RuntimeCopyLocalItems)" Condition="'%(RuntimeCopyLocalItems.CopyLocal)' == 'true'" /> - <_ResolvedCopyLocalBuildAssets Include="@(ResourceCopyLocalItems)" Condition="'%(ResourceCopyLocalItems.CopyLocal)' == 'true'" /> - - <_ResolvedCopyLocalBuildAssets Include="@(NativeCopyLocalItems)" Exclude="@(_NativeRestoredAppHostNETCore)" Condition="'%(NativeCopyLocalItems.CopyLocal)' == 'true'" /> - <_ResolvedCopyLocalBuildAssets Include="@(RuntimeTargetsCopyLocalItems)" Condition="'%(RuntimeTargetsCopyLocalItems.CopyLocal)' == 'true'" /> - - - - - - - - - - - - - - - false - true - true - true - true - - - - - $(DefaultItemExcludes);$(BaseOutputPath)/** - - $(DefaultItemExcludes);$(BaseIntermediateOutputPath)/** - - $(DefaultItemExcludes);$(PublishDir)/** - - $(DefaultItemExcludes);**/*.user - $(DefaultItemExcludes);**/*.*proj - $(DefaultItemExcludes);**/*.sln - $(DefaultItemExcludes);**/*.slnx - $(DefaultItemExcludes);**/*.vssscc - $(DefaultItemExcludes);**/.DS_Store - - $(DefaultExcludesInProjectFolder);$(DefaultItemExcludesInProjectFolder);**/.*/** - - - - - 1.6.1 - - 2.0.3 - - - - - - - - true - false - <_TargetLatestRuntimePatchIsDefault>true - - - - true - - - - - all - true - - - all - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(_TargetFrameworkVersionWithoutV) - - - - - - - - https://aka.ms/sdkimplicitrefs - - - - - - - - - - - <_PackageReferenceToAdd Remove="@(_PackageReferenceToAdd)" /> - - - - false - - - - - - https://aka.ms/sdkimplicititems - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_WindowsDesktopTransitiveFrameworkReference Include="@(TransitiveFrameworkReference)" Condition="'%(Identity)' == 'Microsoft.WindowsDesktop.App' Or '%(Identity)' == 'Microsoft.WindowsDesktop.App.WPF' Or '%(Identity)' == 'Microsoft.WindowsDesktop.App.WindowsForms'" /> - - - - - - - - - - - - - $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) - - - $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) - - - $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) - - - $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) - - - $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) - - - $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) - - - $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - $(ResolveAssemblyReferencesDependsOn); - ResolveTargetingPackAssets; - - - - - - - - - - - - - - - - - - - - - - $(NetCoreRoot)\sdk\$(NETCoreSdkVersion)\PrunePackageData\ - $(NetCoreTargetingPackRoot) - false - false - - - - - - - - - - - - - - - - - true - true - false - - - <_NuGetRestoreSupported Condition="('$(Language)' == 'C++' and '$(_EnablePackageReferencesInVCProjects)' != 'true')">false - - - <_PackAsToolShimRuntimeIdentifiers Condition="@(_PackAsToolShimRuntimeIdentifiers) ==''" Include="$(PackAsToolShimRuntimeIdentifiers)" /> - - - - - - - - - - - - - - - $(RuntimeIdentifier) - $(DefaultAppHostRuntimeIdentifier) - - - - - - - - - - - true - true - false - - - - [%(_PackageToDownload.Version)] - - - - - - - - <_ImplicitPackageReference Remove="@(PackageReference)" /> - - - - - - - - - - - - - - - - - - %(ResolvedTargetingPack.PackageDirectory) - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ApphostsForShimRuntimeIdentifiers Include="%(_ApphostsForShimRuntimeIdentifiersGetPackageDirectory.PackageDirectory)\%(_ApphostsForShimRuntimeIdentifiersGetPackageDirectory.PathInPackage)"> - %(_ApphostsForShimRuntimeIdentifiersGetPackageDirectory.RuntimeIdentifier) - - - - - %(ResolvedAppHostPack.PackageDirectory)\%(ResolvedAppHostPack.PathInPackage) - - - - @(ResolvedAppHostPack->'%(Path)') - - - - %(ResolvedSingleFileHostPack.PackageDirectory)\%(ResolvedSingleFileHostPack.PathInPackage) - - - - @(ResolvedSingleFileHostPack->'%(Path)') - - - - %(ResolvedComHostPack.PackageDirectory)\%(ResolvedComHostPack.PathInPackage) - - - - @(ResolvedComHostPack->'%(Path)') - - - - %(ResolvedIjwHostPack.PackageDirectory)\%(ResolvedIjwHostPack.PathInPackage) - - - - @(ResolvedIjwHostPack->'%(Path)') - - - - - - - - - - - - - - - true - false - - - - - - - - - - - - $([MSBuild]::Unescape($(PackageConflictPreferredPackages))) - - - - - - - - - - - - - true - true - - - - $(InterceptorsPreviewNamespaces);Microsoft.AspNetCore.Http.Generated - - $(InterceptorsPreviewNamespaces);Microsoft.Extensions.Configuration.Binder.SourceGeneration - - $(InterceptorsPreviewNamespaces);Microsoft.Extensions.Validation.Generated - - - - - - - - - - - - - - - - - - <_ExistingReferenceAssembliesPackageReference Include="@(PackageReference)" Condition="'%(PackageReference.Identity)' == 'Microsoft.NETFramework.ReferenceAssemblies'" /> - - - - - - - - - - - - - - - - - - <_Parameter1>$(UserSecretsId.Trim()) - - - - - - - - - - $(_IsNETCoreOrNETStandard) - - - true - false - true - $(MSBuildProjectDirectory)/runtimeconfig.template.json - true - true - <_GenerateRuntimeConfigurationPropertyInputsCache Condition="'$(_GenerateRuntimeConfigurationPropertyInputsCache)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).genruntimeconfig.cache - <_GenerateRuntimeConfigurationPropertyInputsCache>$([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(_GenerateRuntimeConfigurationPropertyInputsCache))) - <_GeneratePublishDependencyFilePropertyInputsCache Condition="'$(_GeneratePublishDependencyFilePropertyInputsCache)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).genpublishdeps.cache - <_GeneratePublishDependencyFilePropertyInputsCache>$([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(_GeneratePublishDependencyFilePropertyInputsCache))) - <_GenerateSingleFileBundlePropertyInputsCache Condition="'$(_GenerateSingleFileBundlePropertyInputsCache)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).genbundle.cache - <_GenerateSingleFileBundlePropertyInputsCache>$([MSBuild]::NormalizePath($(MSBuildProjectDirectory), $(_GenerateSingleFileBundlePropertyInputsCache))) - - - - <_UseRidGraphWasSpecified Condition="'$(UseRidGraph)' != ''">true - - - false - true - - - $(BundledRuntimeIdentifierGraphFile) - - $([System.IO.Path]::GetDirectoryName($(BundledRuntimeIdentifierGraphFile)))/PortableRuntimeIdentifierGraph.json - - - - - - - - - - - true - - - false - - - $(AssemblyName).deps.json - $(TargetDir)$(ProjectDepsFileName) - $(AssemblyName).runtimeconfig.json - $(TargetDir)$(ProjectRuntimeConfigFileName) - $(TargetDir)$(AssemblyName).runtimeconfig.dev.json - true - true - - - - - - true - true - - - - CurrentArchitecture - CurrentRuntime - - - <_NativeLibraryPrefix Condition="'$(_NativeLibraryPrefix)' == '' and !$(RuntimeIdentifier.StartsWith('win'))">lib - <_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == '' and $(RuntimeIdentifier.StartsWith('win'))">.dll - <_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == '' and $(RuntimeIdentifier.StartsWith('osx'))">.dylib - <_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == ''">.so - <_NativeExecutableExtension Condition="'$(_NativeExecutableExtension)' == '' and ($(RuntimeIdentifier.StartsWith('win')) or $(DefaultAppHostRuntimeIdentifier.StartsWith('win')))">.exe - <_ComHostLibraryExtension Condition="'$(_ComHostLibraryExtension)' == '' and ($(RuntimeIdentifier.StartsWith('win')) or $(DefaultAppHostRuntimeIdentifier.StartsWith('win')))">.dll - <_IjwHostLibraryExtension Condition="'$(_IjwHostLibraryExtension)' == '' and ($(RuntimeIdentifier.StartsWith('win')) or $(DefaultAppHostRuntimeIdentifier.StartsWith('win')))">.dll - <_DotNetHostExecutableName>dotnet$(_NativeExecutableExtension) - <_DotNetAppHostExecutableNameWithoutExtension>apphost - <_DotNetAppHostExecutableName>$(_DotNetAppHostExecutableNameWithoutExtension)$(_NativeExecutableExtension) - <_DotNetSingleFileHostExecutableNameWithoutExtension>singlefilehost - <_DotNetComHostLibraryNameWithoutExtension>comhost - <_DotNetComHostLibraryName>$(_DotNetComHostLibraryNameWithoutExtension)$(_ComHostLibraryExtension) - <_DotNetIjwHostLibraryNameWithoutExtension>Ijwhost - <_DotNetIjwHostLibraryName>$(_DotNetIjwHostLibraryNameWithoutExtension)$(_IjwHostLibraryExtension) - <_DotNetHostPolicyLibraryName>$(_NativeLibraryPrefix)hostpolicy$(_NativeLibraryExtension) - <_DotNetHostFxrLibraryName>$(_NativeLibraryPrefix)hostfxr$(_NativeLibraryExtension) - - - - - - <_ExcludeFromPublishPackageReference Include="@(PackageReference)" Condition="('%(PackageReference.Publish)' == 'false')" /> - - - - - - Microsoft.NETCore.App - - - - - <_DefaultUserProfileRuntimeStorePath>$(HOME) - <_DefaultUserProfileRuntimeStorePath Condition="$([MSBuild]::IsOSPlatform(`Windows`))">$(USERPROFILE) - <_DefaultUserProfileRuntimeStorePath>$([System.IO.Path]::Combine($(_DefaultUserProfileRuntimeStorePath), '.dotnet', 'store')) - $(_DefaultUserProfileRuntimeStorePath) - - - true - - - true - - - true - - - - - - - false - true - - - - true - - - true - - - $(AvailablePlatforms),ARM32 - - - $(AvailablePlatforms),ARM64 - - - $(AvailablePlatforms),ARM64 - - - - false - - - - true - - - - - <_ProjectTypeRequiresBinaryFormatter Condition="'$(UseWindowsForms)' == 'true' AND $([MSBuild]::VersionLessThanOrEquals($(TargetFrameworkVersion), '8.0'))">true - <_ProjectTypeRequiresBinaryFormatter Condition="'$(UseWPF)' == 'true' AND $([MSBuild]::VersionLessThanOrEquals($(TargetFrameworkVersion), '8.0'))">true - - <_BinaryFormatterObsoleteAsError>true - - false - - - - _CheckForBuildWithNoBuild; - $(CoreBuildDependsOn); - GenerateBuildDependencyFile; - GenerateBuildRuntimeConfigurationFiles - - - - - _SdkBeforeClean; - $(CoreCleanDependsOn) - - - - - _SdkBeforeRebuild; - $(RebuildDependsOn) - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0.0 - - - - - - - - - - - - - <_ValidRuntimeIdentifierPlatformsForAssets Include="@(_KnownRuntimeIdentifierPlatforms)" /> - - <_ValidRuntimeIdentifierPlatformsForAssets Include="@(_KnownRuntimeIdentifierPlatformsForTargetFramework)" Exclude="@(_ExcludedKnownRuntimeIdentifierPlatforms)" /> - - - - - - - - - - - - <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="@(AdditionalProbingPath->'%(Identity)')" /> - <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(EnableDynamicLoading)" /> - <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(RollForward)" /> - <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="@(RuntimeHostConfigurationOption->'%(Identity)%(Value)')" /> - <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(RuntimeIdentifier)" /> - <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(SelfContained)" /> - <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(TargetFramework)" /> - <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(UserRuntimeConfig)" /> - <_GenerateRuntimeConfigurationPropertyInputsCacheToHash Include="$(_WriteIncludedFrameworks)" /> - - - - - - - - - - - - - <_IsRollForwardSupported Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'">true - LatestMinor - - - - - <_WriteIncludedFrameworks Condition="'$(SelfContained)' == 'true' and '$(_TargetFrameworkVersionWithoutV)' >= '3.1'">true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_CleaningWithoutRebuilding>true - false - - - - - <_CleaningWithoutRebuilding>false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(CompileDependsOn); - _CreateAppHost; - _CreateComHost; - _GetIjwHostPaths; - - - - - - <_UseWindowsGraphicalUserInterface Condition="($(RuntimeIdentifier.StartsWith('win')) or $(DefaultAppHostRuntimeIdentifier.StartsWith('win'))) and '$(OutputType)'=='WinExe'">true - <_EnableMacOSCodeSign Condition="'$(_EnableMacOSCodeSign)' == '' and ($(RuntimeIdentifier.StartsWith('osx')) or $(AppHostRuntimeIdentifier.StartsWith('osx')))">true - <_UseSingleFileHostForPublish Condition="'$(PublishSingleFile)' == 'true' and '$(SelfContained)' == 'true' and '$(SingleFileHostSourcePath)' != '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0))">true - <_DisableCetCompat Condition="'$(CetCompat)' == 'false'">true - - AppRelative - <_UpdateAppHostForPublish Condition="'$(_UseSingleFileHostForPublish)' != 'true' and ('$(AppHostRelativeDotNet)' != '' or '$(AppHostDotNetSearch)' != '')">true - - - - - - - - - - - - - @(_NativeRestoredAppHostNETCore) - - - $([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)apphost$(_NativeExecutableExtension)')) - $([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)apphost_publish$(_NativeExecutableExtension)')) - $([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)singlefilehost$(_NativeExecutableExtension)')) - - - - - - - - - - - - - - - - - - - - - - - - - $(AssemblyName).comhost$(_ComHostLibraryExtension) - $([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(ComHostFileName)')) - - - - - - - - - - - - <_CopyAndRenameDotnetHost Condition="'$(_CopyAndRenameDotnetHost)' == ''">true - - - - $(AssemblyName)$(_NativeExecutableExtension) - PreserveNewest - PreserveNewest - - - - - - PreserveNewest - Never - - - - - $(AssemblyName)$(_NativeExecutableExtension) - PreserveNewest - - Always - - - - - $(AssemblyName).$(_DotNetComHostLibraryName) - PreserveNewest - PreserveNewest - - - %(FileName)%(Extension) - PreserveNewest - PreserveNewest - - - - - $(_DotNetIjwHostLibraryName) - PreserveNewest - PreserveNewest - - - - - - - <_FrameworkReferenceAssemblies Include="@(ReferencePath)" Condition="(%(ReferencePath.FrameworkFile) == 'true' or %(ReferencePath.ResolvedFrom) == 'ImplicitlyExpandDesignTimeFacades') and ('%(ReferencePath.NuGetSourceType)' == '' or '%(ReferencePath.NuGetIsFrameworkReference)' == 'true')" /> - - <_ReferenceOnlyAssemblies Include="@(ReferencePath)" Exclude="@(_FrameworkReferenceAssemblies)" Condition="%(ReferencePath.CopyLocal) != 'true' and %(ReferencePath.NuGetSourceType) == ''" /> - <_ReferenceAssemblies Include="@(_FrameworkReferenceAssemblies)" /> - <_ReferenceAssemblies Include="@(_ReferenceOnlyAssemblies)" /> - - - - - - - - true - - - true - - - - - - - - - $(CreateSatelliteAssembliesDependsOn); - CoreGenerateSatelliteAssemblies - - - - - - - <_AssemblyInfoFile>$(IntermediateOutputPath)%(_SatelliteAssemblyResourceInputs.Culture)\$(TargetName).resources.cs - <_OutputAssembly>$(IntermediateOutputPath)%(_SatelliteAssemblyResourceInputs.Culture)\$(TargetName).resources.dll - - - - <_Parameter1>%(_SatelliteAssemblyResourceInputs.Culture) - - - - - - - true - - - <_SatelliteAssemblyReferences Remove="@(_SatelliteAssemblyReferences)" /> - <_SatelliteAssemblyReferences Include="@(ReferencePath)" Condition="'%(Filename)' == 'mscorlib' or '%(Filename)' == 'netstandard' or '%(Filename)' == 'System.Runtime' " /> - - - - - - - - - - - - - - - - - - - - - - - - - $(TargetFrameworkIdentifier) - $(_TargetFrameworkVersionWithoutV) - - - - - - - - - - - - - - - - - - - - false - - - - <_UseAttributeForTargetFrameworkInfoPropertyNames Condition="$([MSBuild]::VersionGreaterThanOrEquals($(MSBuildVersion), '17.0'))">true - - - - - - <_IsVSTestTestProject Condition="'$(IsTestProject)' == 'true' and '$(IsTestingPlatformApplication)' != 'true'">true - <_IsVSTestTestProject Condition="'$(_IsVSTestTestProject)' == ''">false - - false - - false - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildThisFileDirectory)Microsoft.NET.CrossGen.targets - - - - - - - - .NET Standard $(_TargetFrameworkVersionWithoutV) - .NET Core $(_TargetFrameworkVersionWithoutV) - .NET $(_TargetFrameworkVersionWithoutV) - <_TargetFrameworkDirectories /> - - - - true - - - - - - - $(CommonOutputGroupsDependsOn); - - - - - $(DesignerRuntimeImplementationProjectOutputGroupDependsOn); - _GenerateDesignerDepsFile; - _GenerateDesignerRuntimeConfigFile; - GetCopyToOutputDirectoryItems; - _GatherDesignerShadowCopyFiles; - - <_DesignerDepsFileName>$(AssemblyName).designer.deps.json - <_DesignerRuntimeConfigFileName>$(AssemblyName).designer.runtimeconfig.json - <_DesignerDepsFilePath>$(IntermediateOutputPath)$(_DesignerDepsFileName) - <_DesignerRuntimeConfigFilePath>$(IntermediateOutputPath)$(_DesignerRuntimeConfigFileName) - - - - - - - - - - - - - - <_DesignerHostConfigurationOption Include="Microsoft.NETCore.DotNetHostPolicy.SetAppPaths" Value="true" /> - - - - - - - - - - - <_DesignerShadowCopy Include="@(ReferenceCopyLocalPaths)" /> - - <_DesignerShadowCopy Remove="@(_ResolvedCopyLocalBuildAssets)" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" /> - - <_DesignerShadowCopy Remove="@(RuntimePackAsset)" Condition="'%(RuntimePackAsset.RuntimePackAlwaysCopyLocal)' != 'true'" /> - - - - - - - - - - - $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyInfo$(DefaultLanguageSourceExtension) - true - - - true - true - true - true - true - true - true - true - true - true - true - true - true - true - true - true - true - true - true - - - - - - - <_InformationalVersionContainsPlus>false - <_InformationalVersionContainsPlus Condition="$(InformationalVersion.Contains('+'))">true - $(InformationalVersion)+$(SourceRevisionId) - $(InformationalVersion).$(SourceRevisionId) - - - - - - <_Parameter1>$(Company) - - - <_Parameter1>$(Configuration) - - - <_Parameter1>$(Copyright) - - - <_Parameter1>$(Description) - - - <_Parameter1>$(FileVersion) - - - <_Parameter1>$(InformationalVersion) - - - <_Parameter1>$(Product) - - - <_Parameter1>$(Trademark) - - - <_Parameter1>$(AssemblyTitle) - - - <_Parameter1>$(AssemblyVersion) - - - <_Parameter1>RepositoryUrl - <_Parameter2 Condition="'$(RepositoryUrl)' != ''">$(RepositoryUrl) - <_Parameter2 Condition="'$(RepositoryUrl)' == ''">$(PrivateRepositoryUrl) - - - <_Parameter1>$(NeutralLanguage) - - - %(InternalsVisibleTo.PublicKey) - - - <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' != ''">%(InternalsVisibleTo.Identity), PublicKey=%(InternalsVisibleTo.Key) - <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' == '' and '$(PublicKey)' != ''">%(InternalsVisibleTo.Identity), PublicKey=$(PublicKey) - <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' == '' and '$(PublicKey)' == ''">%(InternalsVisibleTo.Identity) - - - <_Parameter1>%(AssemblyMetadata.Identity) - <_Parameter2>%(AssemblyMetadata.Value) - - - - - - <_Parameter1>$(TargetPlatformIdentifier)$(TargetPlatformVersion) - - - - - <_Parameter1>$(TargetPlatformIdentifier)$(SupportedOSPlatformVersion) - - - <_Parameter1>$(TargetPlatformIdentifier) - - - - - - - - - - $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyInfoInputs.cache - - - - - - - - - - - - - - - - - - - - - - - - - - - $(AssemblyVersion) - $(Version) - - - - - - - - - $(IntermediateOutputPath)$(MSBuildProjectName).GlobalUsings.g$(DefaultLanguageSourceExtension) - - - - - - - - - - - - - - - - - - - <_GenerateSupportedRuntimeIntermediateAppConfig>$(IntermediateOutputPath)$(TargetFileName).withSupportedRuntime.config - - - - - - - - - - - - - - - - - - - - - - - - - - <_AllProjects Include="$(AdditionalProjects.Split('%3B'))" /> - <_AllProjects Include="$(MSBuildProjectFullPath)" /> - - - - - - - - - - %(PackageReference.Identity) - %(PackageReference.Version) - - StorePackageName=%(PackageReference.Identity); - StorePackageVersion=%(PackageReference.Version); - ComposeWorkingDir=$(ComposeWorkingDir); - PublishDir=$(PublishDir); - StoreStagingDir=$(StoreStagingDir); - TargetFramework=$(TargetFramework); - RuntimeIdentifier=$(RuntimeIdentifier); - JitPath=$(JitPath); - Crossgen=$(Crossgen); - SkipUnchangedFiles=$(SkipUnchangedFiles); - PreserveStoreLayout=$(PreserveStoreLayout); - CreateProfilingSymbols=$(CreateProfilingSymbols); - StoreSymbolsStagingDir=$(StoreSymbolsStagingDir); - DisableImplicitFrameworkReferences=false; - - - - - - - - - - - - - - - - - - - - - - - <_StoreArtifactContent> -@(ListOfPackageReference) - -]]> - - - - - - - - - - <_OptimizedResolvedFileToPublish Include="$(StoreStagingDir)\**\*.*" /> - <_OptimizedSymbolFileToPublish Include="$(StoreSymbolsStagingDir)\**\*.*" /> - - - - - - - - - - - - true - true - <_TFM Condition="'$(_TFM)' == ''">$(TargetFramework) - true - - - - - - $(UserProfileRuntimeStorePath) - <_ProfilingSymbolsDirectoryName>symbols - $([System.IO.Path]::Combine($(DefaultComposeDir), $(_ProfilingSymbolsDirectoryName))) - $([System.IO.Path]::Combine($(ComposeDir), $(_ProfilingSymbolsDirectoryName))) - $([System.IO.Path]::Combine($(ProfilingSymbolsDir), $(PlatformTarget))) - $(DefaultProfilingSymbolsDir) - $([System.IO.Path]::Combine($(ProfilingSymbolsDir), $(_TFM))) - $(ProfilingSymbolsDir)\ - $(DefaultComposeDir) - $([System.IO.Path]::Combine($(ComposeDir), $(PlatformTarget))) - $([System.IO.Path]::Combine($(ComposeDir), $(_TFM))) - $([System.IO.Path]::Combine($(ComposeDir),"artifact.xml")) - $([System.IO.Path]::GetFullPath($(ComposeDir))) - <_RandomFileName>$([System.IO.Path]::GetRandomFileName()) - $([System.IO.Path]::GetTempPath()) - $([System.IO.Path]::Combine($(TEMP), $(_RandomFileName))) - $([System.IO.Path]::GetFullPath($(ComposeWorkingDir))) - $([System.IO.Path]::Combine($(ComposeWorkingDir),"StagingDir")) - - $([System.IO.Path]::Combine($(ComposeWorkingDir),"SymbolsStagingDir")) - - $(PublishDir)\ - - - - false - true - - - - - - - - $(StorePackageVersion.Replace('*','-')) - $([System.IO.Path]::Combine($(ComposeWorkingDir),"$(StorePackageName)_$(StorePackageVersionForFolderName)")) - <_PackageProjFile>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "Restore.csproj")) - $(StoreWorkerWorkingDir)\ - $(BaseIntermediateOutputPath)\project.assets.json - - - $(MicrosoftNETPlatformLibrary) - true - - - - - - - - - - - - - - - - - - - - - - - <_ManagedResolvedFileToPublishCandidates Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.AssetType)'=='runtime'" /> - <_UnOptimizedResolvedFileToPublish Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.AssetType)'!='runtime'" /> - - - true - - - - - - <_UnOptimizedResolvedFileToPublish Include="@(ResolvedFileToPublish)" /> - - - - - - - true - true - - - - - - - - - - - - - - - - - - - - - - true - true - false - true - false - true - 1 - false - pe - true - false - false - false - false - false - false - true - true - true - true - true - true - true - true - true - true - true - true - true - true - true - $(PublishReadyToRunCrossgen2ExtraArgs);--strip-inlining-info - $(PublishReadyToRunCrossgen2ExtraArgs);--strip-debug-info - - - $(MicrosoftNETBuildTasksAssembly) - - - - - - <_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='coreclr'" /> - <_CoreclrResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libcoreclr'" /> - <_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='clrjit'" /> - <_JitResolvedPath Include="@(CrossgenResolvedAssembliesToPublish)" Condition="'%(CrossgenResolvedAssembliesToPublish.Filename)'=='libclrjit'" /> - - - - - - - - <_CoreclrPath>@(_CoreclrResolvedPath) - @(_JitResolvedPath) - <_CoreclrDir>$([System.IO.Path]::GetDirectoryName($(_CoreclrPath))) - <_CoreclrPkgDir>$([System.IO.Path]::Combine($(_CoreclrDir),"..\..\..\")) - $([System.IO.Path]::Combine($(_CoreclrPkgDir),"tools")) - - $([System.IO.Path]::Combine($(CrossgenDir),"crossgen")) - $([System.IO.Path]::Combine($(CrossgenDir),"crossgen.exe")) - - - - - - - - $([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine($(_NetCoreRefDir), $([System.IO.Path]::GetFileName($(Crossgen))))))) - - - - - - - - CrossgenExe=$(Crossgen); - CrossgenJit=$(JitPath); - CrossgenInputAssembly=%(_ManagedResolvedFilesToOptimize.Fullpath); - CrossgenOutputAssembly=$(_RuntimeOptimizedDir)$(DirectorySeparatorChar)%(_ManagedResolvedFilesToOptimize.FileName)%(_ManagedResolvedFilesToOptimize.Extension); - CrossgenSubOutputPath=%(_ManagedResolvedFilesToOptimize.DestinationSubPath); - _RuntimeOptimizedDir=$(_RuntimeOptimizedDir); - PublishDir=$(StoreStagingDir); - CrossgenPlatformAssembliesPath=$(_RuntimeRefDir)$(PathSeparator)$(_NetCoreRefDir); - CreateProfilingSymbols=$(CreateProfilingSymbols); - StoreSymbolsStagingDir=$(StoreSymbolsStagingDir); - _RuntimeSymbolsDir=$(_RuntimeSymbolsDir) - - - - - - - - - - $([System.IO.Path]::GetDirectoryName($(_RuntimeSymbolsDir)\$(CrossgenSubOutputPath))) - $([System.IO.Path]::GetDirectoryName($(StoreSymbolsStagingDir)\$(CrossgenSubOutputPath))) - $(CrossgenExe) -nologo -readytorun -in "$(CrossgenInputAssembly)" -out "$(CrossgenOutputAssembly)" -jitpath "$(CrossgenJit)" -platform_assemblies_paths "$(CrossgenPlatformAssembliesPath)" - CreatePDB - CreatePerfMap - - - - - - - - - - - - <_ProfilingSymbols Include="$(CrossgenProfilingSymbolsOutputDirectory)\*" Condition="'$(CreateProfilingSymbols)' == 'true'" /> - - - - - - - - $([System.IO.Path]::PathSeparator) - $([System.IO.Path]::DirectorySeparatorChar) - - - - - - <_CrossProjFileDir>$([System.IO.Path]::Combine($(ComposeWorkingDir),"Optimize")) - <_NetCoreRefDir>$([System.IO.Path]::Combine($(_CrossProjFileDir), "netcoreapp")) - - - - - <_CrossProjAssetsFile>$([System.IO.Path]::Combine($(_CrossProjFileDir), project.assets.json)) - - - - - - <_RuntimeRefDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimeref")) - - <_RuntimeOptimizedDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimopt")) - - <_RuntimeSymbolsDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimesymbols")) - - - <_ManagedResolvedFilesToOptimize Include="@(_ManagedResolvedFileToPublishCandidates)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ReadyToRunOutputPath>$(IntermediateOutputPath)R2R - - - - <_ReadyToRunImplementationAssemblies Include="@(ResolvedFileToPublish->WithMetadataValue('PostprocessAssembly', 'true'))" /> - - - - <_ReadyToRunImplementationAssemblies Include="@(_ManagedRuntimePackAssembly)" ReferenceOnly="true" /> - - - - - - <_ReadyToRunImplementationAssemblies Remove="@(_ReadyToRunImplementationAssemblies)" /> - <_ReadyToRunImplementationAssemblies Include="@(_ReadyToRunImplementationAssembliesWithoutConflicts)" /> - - - <_ReadyToRunPgoFiles Include="@(PublishReadyToRunPgoFiles)" /> - <_ReadyToRunPgoFiles Include="@(RuntimePackAsset)" Condition="'%(RuntimePackAsset.AssetType)' == 'pgodata' and '%(RuntimePackAsset.Extension)' == '.mibc' and '$(PublishReadyToRunUseRuntimePackOptimizationData)' == 'true'" /> - - - - - - - - - - - - <_ReadyToRunNativeObjectOutputs Include="@(_ReadyToRunFilesToPublish->WithMetadataValue('RequiresNativeLink', 'true'))" /> - <_ReadyToRunNativeObjectOutputs OutputPath="%(Identity)" /> - - - $(PublishReadyToRunCrossgen2CompositeExtraArgs);--strip-il-bodies - - - - - - - - - - - - - - - - - - - <_ReadyToRunCompilerHasWarnings Condition="'$(_ReadyToRunWarningsDetected)' == 'true'">true - - - <_ReadyToRunCompilationFailures Condition="'$(_ReadyToRunCompilerExitCode)' != '' And $(_ReadyToRunCompilerExitCode) != 0" Include="@(_ReadyToRunCompileList)" /> - - - - - - - - - - - <_ReadyToRunCompilerHasWarnings Condition="'$(_ReadyToRunWarningsDetected)' == 'true'">true - - - <_ReadyToRunCompilationFailures Condition="'$(_ReadyToRunCompilerExitCode)' != '' And $(_ReadyToRunCompilerExitCode) != 0" Include="@(_ReadyToRunSymbolsCompileList)" /> - - - - - <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('ios-'))">ios - <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('tvos-'))">tvos - <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('iossimulator-'))">iossimulator - <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('tvossimulator-'))">tvossimulator - <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('maccatalyst-'))">maccatalyst - <_AppleTargetOS Condition="$(RuntimeIdentifier.StartsWith('osx-'))">osx - <_AppleTargetArchitecture Condition="$(RuntimeIdentifier.EndsWith('-x64'))">x86_64 - <_AppleTargetArchitecture Condition="$(RuntimeIdentifier.EndsWith('-arm64'))">arm64 - - - 12.0 - 15.0 - 12.2 - <_AppleSdkName Condition="'$(_AppleTargetOS)' == 'ios'">iphoneos - <_AppleSdkName Condition="'$(_AppleTargetOS)' == 'iossimulator'">iphonesimulator - <_AppleSdkName Condition="'$(_AppleTargetOS)' == 'tvos'">appletvos - <_AppleSdkName Condition="'$(_AppleTargetOS)' == 'tvossimulator'">appletvsimulator - <_AppleSdkName Condition="'$(_AppleTargetOS)' == 'maccatalyst' or '$(_AppleTargetOS)' == 'osx'">macosx - <_AppleTripleOS Condition="'$(_AppleTargetOS)' == 'osx'">macos - <_AppleTripleOS Condition="'$(_AppleTargetOS)' == 'maccatalyst' or $(_AppleTargetOS.StartsWith('ios'))">ios - <_AppleTripleOS Condition="$(_AppleTargetOS.StartsWith('tvos'))">tvos - <_AppleTripleAbi Condition="'$(_AppleTargetOS)' == 'ios' or '$(_AppleTargetOS)' == 'tvos'">macho - <_AppleTripleAbi Condition="'$(_AppleTargetOS)' == 'maccatalyst'">macabi - <_AppleTripleAbi Condition="$(_AppleTargetOS.EndsWith('simulator'))">simulator - $(_AppleTargetArchitecture)-apple-$(_AppleTripleOS)$(AppleMinOSVersion) - $(_AppleTargetArchitecture)-apple-$(_AppleTripleOS)$(AppleMinOSVersion)-$(_AppleTripleAbi) - - - xcrun - <_WhereXcrun>0 - - - - - - - - - - - - - - - - - - $(DsymUtilOptions) --minimize - - - <_MachLinkerArg Include="-gz=zlib" Condition="'$(CompressSymbols)' != 'false'" /> - <_MachLinkerArg Include="-isysroot "$(SysRoot)"" Condition="'$(SysRoot)' != ''" /> - <_MachLinkerArg Include="--target=$(TargetTriple)" /> - <_MachLinkerArg Include="-g" Condition="'$(NativeDebugSymbols)' == 'true'" /> - <_MachLinkerArg Include="-dynamiclib" /> - <_MachLinkerArg Include="-Wl,-dead_strip" /> - - - - - - - <_XcodeVersion>$([System.Text.RegularExpressions.Regex]::Match($(_XcodeVersionString), '[1-9]\d*')) - - - <_MachLinkerArg Condition="'$(UseLdClassicXCodeLinker)' == 'true' or '$(_XcodeVersion)' == '15' or '$(_XcodeVersion)' == '16'" Include="-ld_classic" /> - - - - <_IgnoreLinkerWarnings Condition="'$(_XcodeVersion)' == '16'">true - - - - - - @rpath/%(_ReadyToRunNativeObjectOutputs.Filename)%(_ReadyToRunNativeObjectOutputs.Extension) - - - <_MachLinkerArg Include="-Wl,-install_name,"$(SharedLibraryInstallName)"" /> - <_MachLinkerArg Include="%(_ReadyToRunNativeObjectOutputs.NativeLinkerInputPath)" /> - <_MachLinkerArg Include="-o %(_ReadyToRunNativeObjectOutputs.Identity)" /> - - - - - - - - - - - - $(MSBuildThisFileDirectory)..\..\..\Microsoft.NETCoreSdk.BundledCliTools.props - - - - - - - <_ReferenceToObsoleteDotNetCliTool Include="@(DotNetCliToolReference)" /> - - <_ReferenceToObsoleteDotNetCliTool Remove="@(DotNetCliToolReference)" /> - - - - - - - - - true - <_GetChildProjectCopyToPublishDirectoryItems Condition="'$(_GetChildProjectCopyToPublishDirectoryItems)' == ''">true - true - - - - - true - true - <_FirstTargetFrameworkToSupportTrimming>net6.0 - <_FirstTargetFrameworkToSupportAot>net7.0 - <_FirstTargetFrameworkToSupportSingleFile>net6.0 - <_FirstTargetFrameworkVersionToSupportTrimAnalyzer>$([MSBuild]::GetTargetFrameworkVersion('$(_FirstTargetFrameworkToSupportTrimming)')) - <_FirstTargetFrameworkVersionToSupportAotAnalyzer>$([MSBuild]::GetTargetFrameworkVersion('$(_FirstTargetFrameworkToSupportAot)')) - <_FirstTargetFrameworkVersionToSupportSingleFileAnalyzer>$([MSBuild]::GetTargetFrameworkVersion('$(_FirstTargetFrameworkToSupportSingleFile)')) - - - - - - - - - - - - Always - - - - - - <_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == '' And ( '$(PublishAot)' == 'true' Or '$(IsAotCompatible)' == 'true' Or '$(EnableAotAnalyzer)' == 'true' Or '$(PublishTrimmed)' == 'true' Or '$(IsTrimmable)' == 'true' Or '$(EnableTrimAnalyzer)' == 'true' Or '$(EnableSingleFileAnalyzer)' == 'true')">true - <_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == ''">false - - - - - <_MinNonEolTargetFrameworkForTrimming>$(_MinimumNonEolSupportedNetCoreTargetFramework) - <_MinNonEolTargetFrameworkForSingleFile>$(_MinimumNonEolSupportedNetCoreTargetFramework) - - <_MinNonEolTargetFrameworkForAot>$(_MinimumNonEolSupportedNetCoreTargetFramework) - <_MinNonEolTargetFrameworkForAot Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(_FirstTargetFrameworkToSupportAot)', '$(_MinimumNonEolSupportedNetCoreTargetFramework)'))">$(_FirstTargetFrameworkToSupportAot) - - - <_TargetFramework Include="$(TargetFrameworks)" /> - <_DecomposedTargetFramework Include="@(_TargetFramework)"> - $([MSBuild]::IsTargetFrameworkCompatible('%(Identity)', '$(_FirstTargetFrameworkToSupportTrimming)')) - $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForTrimming)', '%(Identity)')) - $([MSBuild]::IsTargetFrameworkCompatible('%(Identity)', '$(_FirstTargetFrameworkToSupportAot)')) - $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForAot)', '%(Identity)')) - $([MSBuild]::IsTargetFrameworkCompatible('%(Identity)', '$(_FirstTargetFrameworkToSupportSingleFile)')) - $([MSBuild]::IsTargetFrameworkCompatible('$(_MinNonEolTargetFrameworkForSingleFile)', '%(Identity)')) - - <_TargetFrameworkToSilenceIsTrimmableUnsupportedWarning Include="@(_DecomposedTargetFramework)" Condition="'%(SupportsTrimming)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForTrimming)' == 'true'" /> - <_TargetFrameworkToSilenceIsAotCompatibleUnsupportedWarning Include="@(_DecomposedTargetFramework->'%(Identity)')" Condition="'%(SupportsAot)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForAot)' == 'true'" /> - <_TargetFrameworkToSilenceEnableSingleFileAnalyzerUnsupportedWarning Include="@(_DecomposedTargetFramework)" Condition="'%(SupportsSingleFile)' == 'true' And '%(SupportedByMinNonEolTargetFrameworkForSingleFile)' == 'true'" /> - - - - <_SilenceIsTrimmableUnsupportedWarning Condition="'$(_SilenceIsTrimmableUnsupportedWarning)' == '' And @(_TargetFrameworkToSilenceIsTrimmableUnsupportedWarning->Count()) > 0">true - <_SilenceIsAotCompatibleUnsupportedWarning Condition="'$(_SilenceIsAotCompatibleUnsupportedWarning)' == '' And @(_TargetFrameworkToSilenceIsAotCompatibleUnsupportedWarning->Count()) > 0">true - <_SilenceEnableSingleFileAnalyzerUnsupportedWarning Condition="'$(_SilenceEnableSingleFileAnalyzerUnsupportedWarning)' == '' And @(_TargetFrameworkToSilenceEnableSingleFileAnalyzerUnsupportedWarning->Count()) > 0">true - - - - - - - - <_BeforePublishNoBuildTargets> - BuildOnlySettings; - _PreventProjectReferencesFromBuilding; - ResolveReferences; - PrepareResourceNames; - ComputeIntermediateSatelliteAssemblies; - ComputeEmbeddedApphostPaths; - - <_CorePublishTargets> - PrepareForPublish; - ComputeAndCopyFilesToPublishDirectory; - $(PublishProtocolProviderTargets); - PublishItemsOutputGroup; - - <_PublishNoBuildAlternativeDependsOn>$(_BeforePublishNoBuildTargets);$(_CorePublishTargets) - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - $(PublishDir)\ - - - - - - - - - - - - <_OrphanPublishFileWrites Include="@(_PriorPublishFileWrites)" Exclude="@(_CurrentPublishFileWrites)" /> - - - - - - - - - - - - <_NormalizedPublishDir>$([MSBuild]::NormalizeDirectory($(PublishDir))) - - - - - - <_PublishCleanFile Condition="'$(PublishCleanFile)'==''">PublishOutputs.$(_NormalizedPublishDirHash.Substring(0, 10)).txt - - - - - - - - - - - - - - - - - - <_CurrentPublishFileWritesUnfiltered Include="@(ResolvedFileToPublish->'$(_NormalizedPublishDir)%(RelativePath)')" /> - <_CurrentPublishFileWritesUnfiltered Include="$(_NormalizedPublishDir)$(AssemblyName)$(_NativeExecutableExtension)" Condition="'$(UseAppHost)' == 'true'" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ResolvedFileToPublishPreserveNewest Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.CopyToPublishDirectory)'=='PreserveNewest'" /> - <_ResolvedFileToPublishAlways Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.CopyToPublishDirectory)'=='Always'" /> - <_ResolvedFileToPublishIfDifferent Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.CopyToPublishDirectory)'=='IfDifferent'" /> - - - <_ResolvedUnbundledFileToPublishPreserveNewest Include="@(_ResolvedFileToPublishPreserveNewest)" Condition="'$(PublishSingleFile)' != 'true' or '%(_ResolvedFileToPublishPreserveNewest.ExcludeFromSingleFile)'=='true'" /> - <_ResolvedUnbundledFileToPublishAlways Include="@(_ResolvedFileToPublishAlways)" Condition="'$(PublishSingleFile)' != 'true' or '%(_ResolvedFileToPublishAlways.ExcludeFromSingleFile)'=='true'" /> - <_ResolvedUnbundledFileToPublishIfDifferent Include="@(_ResolvedFileToPublishIfDifferent)" Condition="'$(PublishSingleFile)' != 'true' or '%(_ResolvedFileToPublishIfDifferent.ExcludeFromSingleFile)'=='true'" /> - - - - - <_ComputeFilesToPublishDependsOn> - $(_ComputeFilesToPublishDependsOn); - PrepareForPublish; - ComputeResolvedFilesToPublishList; - ILLink; - NativeCompile; - CreateReadyToRunImages; - GeneratePublishDependencyFile; - GenerateSingleFileBundle; - - - - - - - - - true - true - false - - - - - - - - @(IntermediateAssembly->'%(Filename)%(Extension)') - PreserveNewest - - - - $(ProjectDepsFileName) - PreserveNewest - - - - $(ProjectRuntimeConfigFileName) - PreserveNewest - - - - @(AppConfigWithTargetPath->'%(TargetPath)') - PreserveNewest - - - - @(_DebugSymbolsIntermediatePath->'%(Filename)%(Extension)') - PreserveNewest - true - - - - %(IntermediateSatelliteAssembliesWithTargetPath.Culture)\%(Filename)%(Extension) - PreserveNewest - - - - %(Filename)%(Extension) - PreserveNewest - - - - - - - - - <_ResolvedCopyLocalPublishAssets Remove="@(_ResolvedCopyLocalPublishAssetsRemoved)" /> - - - - %(_ResolvedCopyLocalPublishAssets.DestinationSubDirectory)%(Filename)%(Extension) - PreserveNewest - - - - @(FinalDocFile->'%(Filename)%(Extension)') - PreserveNewest - - - - shims/%(_EmbeddedApphostPaths.ShimRuntimeIdentifier)/%(_EmbeddedApphostPaths.Filename)%(_EmbeddedApphostPaths.Extension) - PreserveNewest - - - <_FilesToDrop Include="@(ResolvedFileToPublish)" Condition="'$(PublishSingleFile)' == 'true' and '%(ResolvedFileToPublish.DropFromSingleFile)' == 'true'" /> - - - - - - - - - - - - <_ResolvedCopyLocalPublishAssets Include="@(RuntimePackAsset)" Condition="('$(SelfContained)' == 'true' Or '%(RuntimePackAsset.RuntimePackAlwaysCopyLocal)' == 'true') and '%(RuntimePackAsset.AssetType)' != 'pgodata'" /> - - - - <_ResolvedCopyLocalPublishAssets Remove="@(_NativeRestoredAppHostNETCore)" /> - - - <_ResolvedCopyLocalPublishAssets Include="@(_ResolvedCopyLocalBuildAssets)" Condition="'%(_ResolvedCopyLocalBuildAssets.CopyToPublishDirectory)' != 'false' " /> - - - - - - - - - - - - - <_PublishSatelliteResources Include="@(_ResolvedCopyLocalPublishAssets)" Condition="'%(_ResolvedCopyLocalPublishAssets.AssetType)' == 'resources'" /> - - - - - - <_ResolvedCopyLocalPublishAssets Remove="@(_PublishSatelliteResources)" /> - <_ResolvedCopyLocalPublishAssets Include="@(_FilteredPublishSatelliteResources)" /> - - - - - - <_ResolvedCopyLocalPublishAssets Include="@(ReferenceCopyLocalPaths)" Exclude="@(_ResolvedCopyLocalBuildAssets);@(RuntimePackAsset)" Condition="(('$(PublishReferencesDocumentationFiles)' == 'true' and '%(ReferenceCopyLocalPaths.Extension)' == '.xml') or ('$(PublishReferencesSymbols)' == 'true' and '%(ReferenceCopyLocalPaths.Extension)' == '.pdb') or ('%(ReferenceCopyLocalPaths.Extension)' != '.xml' and '%(ReferenceCopyLocalPaths.Extension)' != '.pdb')) and '%(ReferenceCopyLocalPaths.Private)' != 'false'"> - %(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension) - - - - - - - - - - - - - - - - %(_SourceItemsToCopyToPublishDirectoryAlways.TargetPath) - Always - True - - - %(_SourceItemsToCopyToPublishDirectory.TargetPath) - PreserveNewest - True - - - %(_SourceItemsToCopyToPublishDirectoryIfDifferent.TargetPath) - IfDifferent - True - - - - - - - <_ContentWithPublishMetadata Include="@(Content)" Condition="'%(Content.CopyToPublishDirectory)' != '' and '%(Content.CopyToPublishDirectory)' != 'Never' and '%(Content.CopyToOutputDirectory)' == ''"> - - %(Content.TargetPath) - %(Content.Link) - - $([MSBuild]::MakeRelative('$(MSBuildProjectDirectory)', '%(Content.FullPath)')) - - - - - - - - - <_GCTPDIKeepDuplicates>false - <_GCTPDIKeepMetadata>CopyToPublishDirectory;ExcludeFromSingleFile;TargetPath - - - - - - - - <_SourceItemsToCopyToPublishDirectoryAlways KeepDuplicates=" '$(_GCTPDIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_AllChildProjectPublishItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectPublishItemsWithTargetPath.CopyToPublishDirectory)'=='Always'" /> - <_SourceItemsToCopyToPublishDirectory KeepDuplicates=" '$(_GCTPDIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_AllChildProjectPublishItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectPublishItemsWithTargetPath.CopyToPublishDirectory)'=='PreserveNewest'" /> - <_SourceItemsToCopyToPublishDirectoryIfDifferent KeepDuplicates=" '$(_GCTPDIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_AllChildProjectPublishItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectPublishItemsWithTargetPath.CopyToPublishDirectory)'=='IfDifferent'" /> - - - - <_AllChildProjectPublishItemsWithTargetPath Remove="@(_AllChildProjectPublishItemsWithTargetPath)" /> - - - - <_SourceItemsToCopyToPublishDirectoryAlways KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToPublishDirectory)'=='Always'" /> - <_SourceItemsToCopyToPublishDirectory KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToPublishDirectory)'=='PreserveNewest'" /> - <_SourceItemsToCopyToPublishDirectoryIfDifferent KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToPublishDirectory)'=='IfDifferent'" /> - - - <_SourceItemsToCopyToPublishDirectoryAlways KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToPublishDirectory)'=='Always'" /> - <_SourceItemsToCopyToPublishDirectory KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToPublishDirectory)'=='PreserveNewest'" /> - <_SourceItemsToCopyToPublishDirectoryIfDifferent KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToPublishDirectory)'=='IfDifferent'" /> - - - <_CompileItemsToPublish Include="@(Compile->'%(FullPath)')" Condition="'%(Compile.CopyToPublishDirectory)'=='Always' or '%(Compile.CopyToPublishDirectory)'=='PreserveNewest' or '%(Compile.CopyToPublishDirectory)'=='IfDifferent'" /> - - - - - - <_SourceItemsToCopyToPublishDirectoryAlways KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_CompileItemsToPublishWithTargetPath)" Condition="'%(_CompileItemsToPublishWithTargetPath.CopyToPublishDirectory)'=='Always'" /> - <_SourceItemsToCopyToPublishDirectory KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_CompileItemsToPublishWithTargetPath)" Condition="'%(_CompileItemsToPublishWithTargetPath.CopyToPublishDirectory)'=='PreserveNewest'" /> - <_SourceItemsToCopyToPublishDirectoryIfDifferent KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_CompileItemsToPublishWithTargetPath)" Condition="'%(_CompileItemsToPublishWithTargetPath.CopyToPublishDirectory)'=='IfDifferent'" /> - - - <_SourceItemsToCopyToPublishDirectoryAlways KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToPublishDirectory)'=='Always'" /> - <_SourceItemsToCopyToPublishDirectory KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToPublishDirectory)'=='PreserveNewest'" /> - <_SourceItemsToCopyToPublishDirectoryIfDifferent KeepMetadata="$(_GCTPDIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToPublishDirectory)'=='IfDifferent'" /> - - - - <_SourceItemsToCopyToPublishDirectoryAlways Remove="$(AppHostIntermediatePath)" /> - <_SourceItemsToCopyToPublishDirectory Remove="$(AppHostIntermediatePath)" /> - <_SourceItemsToCopyToPublishDirectoryIfDifferent Remove="$(AppHostIntermediatePath)" /> - - <_SourceItemsToCopyToPublishDirectoryAlways Include="$(SingleFileHostIntermediatePath)" CopyToOutputDirectory="Always" TargetPath="$(AssemblyName)$(_NativeExecutableExtension)" /> - - - - <_SourceItemsToCopyToPublishDirectoryAlways Remove="$(AppHostIntermediatePath)" /> - <_SourceItemsToCopyToPublishDirectory Remove="$(AppHostIntermediatePath)" /> - <_SourceItemsToCopyToPublishDirectoryIfDifferent Remove="$(AppHostIntermediatePath)" /> - - <_SourceItemsToCopyToPublishDirectoryAlways Include="$(AppHostForPublishIntermediatePath)" CopyToOutputDirectory="Always" TargetPath="$(AssemblyName)$(_NativeExecutableExtension)" /> - - - - - - - - - - Always - - - PreserveNewest - - - IfDifferent - - - Always - - - PreserveNewest - - - IfDifferent - - - Always - - - PreserveNewest - - - IfDifferent - - <_NoneWithTargetPath Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='Always' and '%(_NoneWithTargetPath.CopyToPublishDirectory)' == ''"> - Always - - <_NoneWithTargetPath Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest' and '%(_NoneWithTargetPath.CopyToPublishDirectory)' == ''"> - PreserveNewest - - <_NoneWithTargetPath Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='IfDifferent' and '%(_NoneWithTargetPath.CopyToPublishDirectory)' == ''"> - IfDifferent - - - - - <_ComputeManagedRuntimePackAssembliesIfSelfContained>_ComputeManagedRuntimePackAssemblies - - - - - - - <_ManagedRuntimeAssembly Include="@(RuntimeCopyLocalItems)" /> - - <_ManagedRuntimeAssembly Include="@(UserRuntimeAssembly)" /> - - <_ManagedRuntimeAssembly Include="@(IntermediateAssembly)" /> - - - - <_ManagedRuntimeAssembly Include="@(_ManagedRuntimePackAssembly)" /> - - - - - - - - - - - - - - - <_ManagedRuntimePackAssembly Include="@(RuntimePackAsset)" Condition="'%(RuntimePackAsset.AssetType)' == 'runtime' or '%(RuntimePackAsset.Filename)' == 'System.Private.Corelib'" /> - - - - - - <_TrimRuntimeAssets Condition="'$(PublishSingleFile)' == 'true' and '$(SelfContained)' == 'true'">true - <_UseBuildDependencyFile Condition="'@(_ExcludeFromPublishPackageReference)' == '' and '@(RuntimeStorePackages)' == '' and '$(PreserveStoreLayout)' != 'true' and '$(PublishTrimmed)' != 'true' and '$(_TrimRuntimeAssets)' != 'true'">true - - - - - - $(AssemblyName)$(_NativeExecutableExtension) - $(PublishDir)$(PublishedSingleFileName) - false - false - $(IncludeAllContentForSelfExtract) - - - <_FilesToBundle Include="@(ResolvedFileToPublish)" Condition="'%(ResolvedFileToPublish.ExcludeFromSingleFile)' != 'true'" /> - - - - - - <_BundleExcludedFiles Include="@(_FilesToBundle)" Condition="$([MSBuild]::ValueOrDefault('%(_FilesToBundle.RelativePath)', '').EndsWith('.runtimeconfig.dev.json'))" /> - - <_BundleExcludedFiles Include="@(_FilesToBundle)" Condition=" $([MSBuild]::VersionGreaterThan($(_TargetFrameworkVersionWithoutV), '3.1' )) and (('%(_FilesToBundle.FileName)' == 'hostfxr' or '%(_FilesToBundle.FileName)' == 'libhostfxr' or '%(_FilesToBundle.FileName)' == 'hostpolicy' or '%(_FilesToBundle.FileName)' == 'libhostpolicy') and ('%(_FilesToBundle.Extension)' == '.dll' or '%(_FilesToBundle.Extension)' == '.so' or '%(_FilesToBundle.Extension)' == '.dylib'))" /> - - <_BundleExcludedFiles Include="@(_FilesToBundle)" Condition="'%(_FilesToBundle.AssetType)' == 'native' and '$(IncludeNativeLibrariesForSelfExtract)' != 'true'" /> - - <_BundleExcludedFiles Include="@(_FilesToBundle)" Condition="'%(_FilesToBundle.Extension)' == '.pdb' and '$(IncludeSymbolsInSingleFile)' != 'true'" /> - - <_BundleExcludedFiles Include="@(_FilesToBundle)" Condition="'$(IncludeAllContentForSelfExtract)' != 'true' and '%(_FilesToBundle.Extension)' != '.dll' and '%(_FilesToBundle.Extension)' != '.exe' and '%(_FilesToBundle.Extension)' != '.pdb' and '%(_FilesToBundle.AssetType)' != 'native' and '%(_FilesToBundle.AssetType)' != 'runtime' and '%(_FilesToBundle.IsKeyOutput)' != 'true' and !$([MSBuild]::ValueOrDefault('%(_FilesToBundle.RelativePath)', '').EndsWith('.deps.json')) and !$([MSBuild]::ValueOrDefault('%(_FilesToBundle.RelativePath)', '').EndsWith('.runtimeconfig.json'))" /> - - - - - - - - - - - $(PublishedSingleFileName) - - - - - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(PublishedSingleFilePath)" /> - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(TraceSingleFileBundler)" /> - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(IncludeSymbolsInSingleFile)" /> - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(IncludeAllContentForSelfExtract)" /> - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(IncludeNativeLibrariesForSelfExtract)" /> - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(EnableCompressionInSingleFile)" /> - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(PublishedSingleFileName)" /> - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(RuntimeIdentifier)" /> - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(PublishDir)" /> - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(_TargetFrameworkVersionWithoutV)" /> - <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="@(FilesToBundle)" /> - - - - - - - - - - false - false - - - - - - - - - - - - - $(PublishDepsFilePath) - $(IntermediateOutputPath)$(ProjectDepsFileName) - - - - - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(PublishDepsFilePath)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(PublishSingleFile)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(MSBuildProjectFullPath)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(ProjectAssetsFile)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IntermediateDepsFilePath)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(TargetFramework)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(AssemblyName)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(TargetExt)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(Version)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IncludeMainProjectInDepsFile)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(RuntimeIdentifier)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(MicrosoftNETPlatformLibrary)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(SelfContained)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IncludeFileVersionsInDependencyFile)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(RuntimeIdentifierGraphPath)" /> - <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IncludeProjectsNotInAssetsFileInDepsFile)" /> - - - - - - - - - - - - - - $(PublishDir)$(ProjectDepsFileName) - <_IsSingleFilePublish Condition="'$(PublishSingleFile)' == ''">false - <_IsSingleFilePublish Condition="'$(PublishSingleFile)' != ''">$(PublishSingleFile) - - - - - - <_ResolvedNuGetFilesForPublish Include="@(NativeCopyLocalItems)" Condition="'%(NativeCopyLocalItems.CopyToPublishDirectory)' != 'false'" /> - <_ResolvedNuGetFilesForPublish Include="@(ResourceCopyLocalItems)" Condition="'%(ResourceCopyLocalItems.CopyToPublishDirectory)' != 'false'" /> - <_ResolvedNuGetFilesForPublish Include="@(RuntimeCopyLocalItems)" Condition="'%(RuntimeCopyLocalItems.CopyToPublishDirectory)' != 'false'" /> - <_ResolvedNuGetFilesForPublish Remove="@(_PublishConflictPackageFiles)" Condition="'%(_PublishConflictPackageFiles.ConflictItemType)' != 'Reference'" /> - - - - - $(ProjectDepsFileName) - - - - - - - - <_PackAsToolShimRuntimeIdentifiers Condition="@(_PackAsToolShimRuntimeIdentifiers) ==''" Include="$(PackAsToolShimRuntimeIdentifiers)" /> - - - - - - - - - - - - - - - - - - $(PublishItemsOutputGroupDependsOn); - ResolveReferences; - ComputeResolvedFilesToPublishList; - _ComputeFilesToBundle; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - refs - $(PreserveCompilationContext) - - - - - $(DefineConstants) - $(LangVersion) - $(PlatformTarget) - $(AllowUnsafeBlocks) - $(TreatWarningsAsErrors) - $(Optimize) - $(AssemblyOriginatorKeyFile) - $(DelaySign) - $(PublicSign) - $(DebugType) - $(OutputType) - $(GenerateDocumentationFile) - - - - - - - - - - - <_RefAssembliesToExclude Include="@(_ResolvedCopyLocalPublishAssets->'%(FullPath)')" /> - - <_RefAssembliesToExclude Include="@(_RuntimeItemsInRuntimeStore)" /> - - $(RefAssembliesFolderName)\%(Filename)%(Extension) - - - - - - - - - - - - - - - - - - Microsoft.CSharp|4.4.0; - Microsoft.Win32.Primitives|4.3.0; - Microsoft.Win32.Registry|4.4.0; - runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; - runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; - runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; - runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; - runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; - runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple|4.3.0; - runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; - runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; - runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; - runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; - runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl|4.3.0; - System.AppContext|4.3.0; - System.Buffers|4.4.0; - System.Collections|4.3.0; - System.Collections.Concurrent|4.3.0; - System.Collections.Immutable|1.4.0; - System.Collections.NonGeneric|4.3.0; - System.Collections.Specialized|4.3.0; - System.ComponentModel|4.3.0; - System.ComponentModel.EventBasedAsync|4.3.0; - System.ComponentModel.Primitives|4.3.0; - System.ComponentModel.TypeConverter|4.3.0; - System.Console|4.3.0; - System.Data.Common|4.3.0; - System.Diagnostics.Contracts|4.3.0; - System.Diagnostics.Debug|4.3.0; - System.Diagnostics.DiagnosticSource|4.4.0; - System.Diagnostics.FileVersionInfo|4.3.0; - System.Diagnostics.Process|4.3.0; - System.Diagnostics.StackTrace|4.3.0; - System.Diagnostics.TextWriterTraceListener|4.3.0; - System.Diagnostics.Tools|4.3.0; - System.Diagnostics.TraceSource|4.3.0; - System.Diagnostics.Tracing|4.3.0; - System.Dynamic.Runtime|4.3.0; - System.Globalization|4.3.0; - System.Globalization.Calendars|4.3.0; - System.Globalization.Extensions|4.3.0; - System.IO|4.3.0; - System.IO.Compression|4.3.0; - System.IO.Compression.ZipFile|4.3.0; - System.IO.FileSystem|4.3.0; - System.IO.FileSystem.AccessControl|4.4.0; - System.IO.FileSystem.DriveInfo|4.3.0; - System.IO.FileSystem.Primitives|4.3.0; - System.IO.FileSystem.Watcher|4.3.0; - System.IO.IsolatedStorage|4.3.0; - System.IO.MemoryMappedFiles|4.3.0; - System.IO.Pipes|4.3.0; - System.IO.UnmanagedMemoryStream|4.3.0; - System.Linq|4.3.0; - System.Linq.Expressions|4.3.0; - System.Linq.Queryable|4.3.0; - System.Net.Http|4.3.0; - System.Net.NameResolution|4.3.0; - System.Net.Primitives|4.3.0; - System.Net.Requests|4.3.0; - System.Net.Security|4.3.0; - System.Net.Sockets|4.3.0; - System.Net.WebHeaderCollection|4.3.0; - System.ObjectModel|4.3.0; - System.Private.DataContractSerialization|4.3.0; - System.Reflection|4.3.0; - System.Reflection.Emit|4.3.0; - System.Reflection.Emit.ILGeneration|4.3.0; - System.Reflection.Emit.Lightweight|4.3.0; - System.Reflection.Extensions|4.3.0; - System.Reflection.Metadata|1.5.0; - System.Reflection.Primitives|4.3.0; - System.Reflection.TypeExtensions|4.3.0; - System.Resources.ResourceManager|4.3.0; - System.Runtime|4.3.0; - System.Runtime.Extensions|4.3.0; - System.Runtime.Handles|4.3.0; - System.Runtime.InteropServices|4.3.0; - System.Runtime.InteropServices.RuntimeInformation|4.3.0; - System.Runtime.Loader|4.3.0; - System.Runtime.Numerics|4.3.0; - System.Runtime.Serialization.Formatters|4.3.0; - System.Runtime.Serialization.Json|4.3.0; - System.Runtime.Serialization.Primitives|4.3.0; - System.Security.AccessControl|4.4.0; - System.Security.Claims|4.3.0; - System.Security.Cryptography.Algorithms|4.3.0; - System.Security.Cryptography.Cng|4.4.0; - System.Security.Cryptography.Csp|4.3.0; - System.Security.Cryptography.Encoding|4.3.0; - System.Security.Cryptography.OpenSsl|4.4.0; - System.Security.Cryptography.Primitives|4.3.0; - System.Security.Cryptography.X509Certificates|4.3.0; - System.Security.Cryptography.Xml|4.4.0; - System.Security.Principal|4.3.0; - System.Security.Principal.Windows|4.4.0; - System.Text.Encoding|4.3.0; - System.Text.Encoding.Extensions|4.3.0; - System.Text.RegularExpressions|4.3.0; - System.Threading|4.3.0; - System.Threading.Overlapped|4.3.0; - System.Threading.Tasks|4.3.0; - System.Threading.Tasks.Extensions|4.3.0; - System.Threading.Tasks.Parallel|4.3.0; - System.Threading.Thread|4.3.0; - System.Threading.ThreadPool|4.3.0; - System.Threading.Timer|4.3.0; - System.ValueTuple|4.3.0; - System.Xml.ReaderWriter|4.3.0; - System.Xml.XDocument|4.3.0; - System.Xml.XmlDocument|4.3.0; - System.Xml.XmlSerializer|4.3.0; - System.Xml.XPath|4.3.0; - System.Xml.XPath.XDocument|4.3.0; - - - - - Microsoft.Win32.Primitives|4.3.0; - System.AppContext|4.3.0; - System.Collections|4.3.0; - System.Collections.Concurrent|4.3.0; - System.Collections.Immutable|1.4.0; - System.Collections.NonGeneric|4.3.0; - System.Collections.Specialized|4.3.0; - System.ComponentModel|4.3.0; - System.ComponentModel.EventBasedAsync|4.3.0; - System.ComponentModel.Primitives|4.3.0; - System.ComponentModel.TypeConverter|4.3.0; - System.Console|4.3.0; - System.Data.Common|4.3.0; - System.Diagnostics.Contracts|4.3.0; - System.Diagnostics.Debug|4.3.0; - System.Diagnostics.FileVersionInfo|4.3.0; - System.Diagnostics.Process|4.3.0; - System.Diagnostics.StackTrace|4.3.0; - System.Diagnostics.TextWriterTraceListener|4.3.0; - System.Diagnostics.Tools|4.3.0; - System.Diagnostics.TraceSource|4.3.0; - System.Diagnostics.Tracing|4.3.0; - System.Dynamic.Runtime|4.3.0; - System.Globalization|4.3.0; - System.Globalization.Calendars|4.3.0; - System.Globalization.Extensions|4.3.0; - System.IO|4.3.0; - System.IO.Compression|4.3.0; - System.IO.Compression.ZipFile|4.3.0; - System.IO.FileSystem|4.3.0; - System.IO.FileSystem.DriveInfo|4.3.0; - System.IO.FileSystem.Primitives|4.3.0; - System.IO.FileSystem.Watcher|4.3.0; - System.IO.IsolatedStorage|4.3.0; - System.IO.MemoryMappedFiles|4.3.0; - System.IO.Pipes|4.3.0; - System.IO.UnmanagedMemoryStream|4.3.0; - System.Linq|4.3.0; - System.Linq.Expressions|4.3.0; - System.Linq.Queryable|4.3.0; - System.Net.Http|4.3.0; - System.Net.NameResolution|4.3.0; - System.Net.Primitives|4.3.0; - System.Net.Requests|4.3.0; - System.Net.Security|4.3.0; - System.Net.Sockets|4.3.0; - System.Net.WebHeaderCollection|4.3.0; - System.ObjectModel|4.3.0; - System.Private.DataContractSerialization|4.3.0; - System.Reflection|4.3.0; - System.Reflection.Emit|4.3.0; - System.Reflection.Emit.ILGeneration|4.3.0; - System.Reflection.Emit.Lightweight|4.3.0; - System.Reflection.Extensions|4.3.0; - System.Reflection.Primitives|4.3.0; - System.Reflection.TypeExtensions|4.3.0; - System.Resources.ResourceManager|4.3.0; - System.Runtime|4.3.0; - System.Runtime.Extensions|4.3.0; - System.Runtime.Handles|4.3.0; - System.Runtime.InteropServices|4.3.0; - System.Runtime.InteropServices.RuntimeInformation|4.3.0; - System.Runtime.Loader|4.3.0; - System.Runtime.Numerics|4.3.0; - System.Runtime.Serialization.Formatters|4.3.0; - System.Runtime.Serialization.Json|4.3.0; - System.Runtime.Serialization.Primitives|4.3.0; - System.Security.AccessControl|4.4.0; - System.Security.Claims|4.3.0; - System.Security.Cryptography.Algorithms|4.3.0; - System.Security.Cryptography.Csp|4.3.0; - System.Security.Cryptography.Encoding|4.3.0; - System.Security.Cryptography.Primitives|4.3.0; - System.Security.Cryptography.X509Certificates|4.3.0; - System.Security.Cryptography.Xml|4.4.0; - System.Security.Principal|4.3.0; - System.Security.Principal.Windows|4.4.0; - System.Text.Encoding|4.3.0; - System.Text.Encoding.Extensions|4.3.0; - System.Text.RegularExpressions|4.3.0; - System.Threading|4.3.0; - System.Threading.Overlapped|4.3.0; - System.Threading.Tasks|4.3.0; - System.Threading.Tasks.Extensions|4.3.0; - System.Threading.Tasks.Parallel|4.3.0; - System.Threading.Thread|4.3.0; - System.Threading.ThreadPool|4.3.0; - System.Threading.Timer|4.3.0; - System.ValueTuple|4.3.0; - System.Xml.ReaderWriter|4.3.0; - System.Xml.XDocument|4.3.0; - System.Xml.XmlDocument|4.3.0; - System.Xml.XmlSerializer|4.3.0; - System.Xml.XPath|4.3.0; - System.Xml.XPath.XDocument|4.3.0; - - - - - - - - - - - <_RuntimeAssetsForConflictResolution Include="@(RuntimeCopyLocalItems); @(NativeCopyLocalItems); @(ResourceCopyLocalItems); @(RuntimeTargetsCopyLocalItems)" Exclude="@(ReferenceCopyLocalPaths)" /> - - - - - - - - - - - - - - - - - - - - - - - - - <_ResolvedCopyLocalPublishAssets Remove="@(_ResolvedCopyLocalPublishAssets)" /> - <_ResolvedCopyLocalPublishAssets Include="@(_ResolvedCopyLocalPublishAssetsWithoutConflicts)" /> - - - - - - - - - - - - - - - Properties - - - $(Configuration.ToUpperInvariant()) - - $(ImplicitConfigurationDefine.Replace('-', '_')) - $(ImplicitConfigurationDefine.Replace('.', '_')) - $(ImplicitConfigurationDefine.Replace(' ', '_')) - $(DefineConstants);$(ImplicitConfigurationDefine) - - - - - - - - $(WarningsAsErrors);SYSLIB0011 - - - - - - - - - - $(IntermediateOutputPath)linked\ - $(IntermediateLinkDir)\ - - <_LinkSemaphore>$(IntermediateLinkDir)Link.semaphore - - - - <_Parameter1>IsTrimmable - <_Parameter2>True - - - <_Parameter1>IsAotCompatible - <_Parameter2>True - - - - - false - false - false - false - false - false - false - - false - false - false - false - - <_EnableConsumingManagedCodeFromNativeHosting Condition="'$(EnableCppCLIHostActivation)' == 'true'">true - <_EnableConsumingManagedCodeFromNativeHosting Condition="'$(_EnableConsumingManagedCodeFromNativeHosting)' == ''">false - true - false - false - - <_UseManagedNtlm Condition="'$(_UseManagedNtlm)' == '' and $(RuntimeIdentifier.StartsWith('linux-bionic'))">true - - <_UseManagedNtlm Condition="'$(_UseManagedNtlm)' == '' and $(RuntimeIdentifier.StartsWith('linux'))">false - <_ComObjectDescriptorSupport Condition="'$(_ComObjectDescriptorSupport)' == ''">false - <_DesignerHostSupport Condition="'$(_DesignerHostSupport)' == ''">false - <_DefaultValueAttributeSupport Condition="'$(_DefaultValueAttributeSupport)' == ''">false - true - false - <_DataSetXmlSerializationSupport Condition="'$(_DataSetXmlSerializationSupport)' == ''">false - - - - true - - false - - - - <_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --notrimwarn - false - - - - $(NoWarn);IL2121 - - - - - - <_LinkedResolvedFileToPublish Include="@(_LinkedResolvedFileToPublishCandidate)" Condition="Exists('%(Identity)')" /> - - - - - - - <_RemovedManagedAssembly Include="@(ManagedAssemblyToLink)" Condition="!Exists('$(IntermediateLinkDir)%(Filename)%(Extension)')" /> - - - - - - - - - - - - - - <_DotNetHostDirectory>$(NetCoreRoot) - <_DotNetHostFileName>dotnet - <_DotNetHostFileName Condition="$([MSBuild]::IsOSPlatform(`Windows`))">dotnet.exe - - - - - - - - - - - - - - - - 5 - 0 - - - - - <_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --link-attributes "@(_ILLinkSuppressions->'%(Identity)', '" --link-attributes "')" - - - - full - - - $(TreatWarningsAsErrors) - true - - - - - true - false - - - - <_TrimmerKeepMetadata Include="all" Condition=" '$(DebuggerSupport)' != 'false' " /> - - - <_TrimmerPreserveSymbolPaths Condition=" '$(_TrimmerPreserveSymbolPaths)' == '' and '$(DeterministicSourcePaths)' == 'true' ">true - <_TrimmerPreserveSymbolPaths Condition=" '$(_TrimmerPreserveSymbolPaths)' == '' ">false - - - - - true - - - - - - - - - - - - - - - - - - <__SingleWarnIntermediateAssembly Include="@(ManagedAssemblyToLink)" /> - <__SingleWarnIntermediateAssembly Remove="@(IntermediateAssembly)" /> - - <_SingleWarnIntermediateAssembly Include="@(ManagedAssemblyToLink)" /> - <_SingleWarnIntermediateAssembly Remove="@(__SingleWarnIntermediateAssembly)" /> - - <_SingleWarnIntermediateAssembly> - false - - - - - - - false - - - - <_TrimmerFeatureSettings Include="@(RuntimeHostConfigurationOption)" Condition="'%(RuntimeHostConfigurationOption.Trim)' == 'true'" /> - - - - - - - - - - - - <__PDBToLink Include="@(ResolvedFileToPublish)" Exclude="@(ManagedAssemblyToLink->'%(RelativeDir)%(Filename).pdb')" /> - <_PDBToLink Include="@(ResolvedFileToPublish)" Exclude="@(__PDBToLink)" /> - - - <_LinkedResolvedFileToPublishCandidate Include="@(ManagedAssemblyToLink->'$(IntermediateLinkDir)%(Filename)%(Extension)')" /> - <_LinkedResolvedFileToPublishCandidate Include="@(_PDBToLink->'$(IntermediateLinkDir)%(Filename)%(Extension)')" /> - - - - - - - - - <_NoneAnalysisLevel>4.0 - - <_LatestAnalysisLevel>11.0 - <_PreviewAnalysisLevel>12.0 - latest - $(_TargetFrameworkVersionWithoutV) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevel), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevel), '$(AnalysisLevelPrefix)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefix) - $(AnalysisLevel) - - - - 9999 - - 4 - - $(_TargetFrameworkVersionWithoutV.Split('.')[0]) - - - - - true - - true - - true - - true - - false - - - - false - false - false - false - false - - - - - - - - <_NETAnalyzersSDKAssemblyVersion>11.0.100 - - - - CA1000;CA1001;CA1002;CA1003;CA1005;CA1008;CA1010;CA1012;CA1014;CA1016;CA1017;CA1018;CA1019;CA1021;CA1024;CA1027;CA1028;CA1030;CA1031;CA1032;CA1033;CA1034;CA1036;CA1040;CA1041;CA1043;CA1044;CA1045;CA1046;CA1047;CA1050;CA1051;CA1052;CA1054;CA1055;CA1056;CA1058;CA1060;CA1061;CA1062;CA1063;CA1064;CA1065;CA1066;CA1067;CA1068;CA1069;CA1070;CA1200;CA1303;CA1304;CA1305;CA1307;CA1308;CA1309;CA1310;CA1311;CA1401;CA1416;CA1417;CA1418;CA1419;CA1420;CA1421;CA1422;CA1501;CA1502;CA1505;CA1506;CA1507;CA1508;CA1509;CA1510;CA1511;CA1512;CA1513;CA1514;CA1515;CA1516;CA1517;CA1700;CA1707;CA1708;CA1710;CA1711;CA1712;CA1713;CA1715;CA1716;CA1720;CA1721;CA1724;CA1725;CA1727;CA1802;CA1805;CA1806;CA1810;CA1812;CA1813;CA1814;CA1815;CA1816;CA1819;CA1820;CA1821;CA1822;CA1823;CA1824;CA1825;CA1826;CA1827;CA1828;CA1829;CA1830;CA1831;CA1832;CA1833;CA1834;CA1835;CA1836;CA1837;CA1838;CA1839;CA1840;CA1841;CA1842;CA1843;CA1844;CA1845;CA1846;CA1847;CA1848;CA1849;CA1850;CA1851;CA1852;CA1853;CA1854;CA1855;CA1856;CA1857;CA1858;CA1859;CA1860;CA1861;CA1862;CA1863;CA1864;CA1865;CA1866;CA1867;CA1868;CA1869;CA1870;CA1871;CA1872;CA1873;CA1874;CA1875;CA1876;CA1877;CA2000;CA2002;CA2007;CA2008;CA2009;CA2011;CA2012;CA2013;CA2014;CA2015;CA2016;CA2017;CA2018;CA2019;CA2020;CA2021;CA2022;CA2023;CA2024;CA2025;CA2026;CA2027;CA2028;CA2100;CA2101;CA2119;CA2153;CA2200;CA2201;CA2207;CA2208;CA2211;CA2213;CA2214;CA2215;CA2216;CA2217;CA2218;CA2219;CA2224;CA2225;CA2226;CA2227;CA2231;CA2234;CA2235;CA2237;CA2241;CA2242;CA2243;CA2244;CA2245;CA2246;CA2247;CA2248;CA2249;CA2250;CA2251;CA2252;CA2253;CA2254;CA2255;CA2256;CA2257;CA2258;CA2259;CA2260;CA2261;CA2262;CA2263;CA2264;CA2265;CA2266;CA2300;CA2301;CA2302;CA2305;CA2310;CA2311;CA2312;CA2315;CA2321;CA2322;CA2326;CA2327;CA2328;CA2329;CA2330;CA2350;CA2351;CA2352;CA2353;CA2354;CA2355;CA2356;CA2361;CA2362;CA3001;CA3002;CA3003;CA3004;CA3005;CA3006;CA3007;CA3008;CA3009;CA3010;CA3011;CA3012;CA3061;CA3075;CA3076;CA3077;CA3147;CA5350;CA5351;CA5358;CA5359;CA5360;CA5361;CA5362;CA5363;CA5364;CA5365;CA5366;CA5367;CA5368;CA5369;CA5370;CA5371;CA5372;CA5373;CA5374;CA5375;CA5376;CA5377;CA5378;CA5379;CA5380;CA5381;CA5382;CA5383;CA5384;CA5385;CA5386;CA5387;CA5388;CA5389;CA5390;CA5391;CA5392;CA5393;CA5394;CA5395;CA5396;CA5397;CA5398;CA5399;CA5400;CA5401;CA5402;CA5403;CA5404;CA5405 - $(CodeAnalysisTreatWarningsAsErrors) - $(WarningsNotAsErrors);$(CodeAnalysisRuleIds) - - - - - - - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevel), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers>$(AnalysisLevelSuffix) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers)' == ''">$(AnalysisMode) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(MicrosoftCodeAnalysisNetAnalyzersRulesVersion)' != ''">AnalysisLevel_$(MicrosoftCodeAnalysisNetAnalyzersRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzers)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzers)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzers Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzers)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzers) - - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelDesign), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelDesign), '$(AnalysisLevelPrefixDesign)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixDesign) - $(AnalysisLevelDesign) - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelDesign), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign>$(AnalysisLevelSuffixDesign) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign)' == ''">$(AnalysisModeDesign) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(MicrosoftCodeAnalysisNetAnalyzersDesignRulesVersion)' != ''">AnalysisLevelDesign_$(MicrosoftCodeAnalysisNetAnalyzersDesignRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDesign)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDesign)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersDesign Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDesign)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDesign) - - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelDocumentation), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelDocumentation), '$(AnalysisLevelPrefixDocumentation)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixDocumentation) - $(AnalysisLevelDocumentation) - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelDocumentation), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation>$(AnalysisLevelSuffixDocumentation) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' == ''">$(AnalysisModeDocumentation) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(MicrosoftCodeAnalysisNetAnalyzersDocumentationRulesVersion)' != ''">AnalysisLevelDocumentation_$(MicrosoftCodeAnalysisNetAnalyzersDocumentationRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersDocumentation)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersDocumentation Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersDocumentation)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersDocumentation) - - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelGlobalization), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelGlobalization), '$(AnalysisLevelPrefixGlobalization)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixGlobalization) - $(AnalysisLevelGlobalization) - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelGlobalization), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization>$(AnalysisLevelSuffixGlobalization) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' == ''">$(AnalysisModeGlobalization) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(MicrosoftCodeAnalysisNetAnalyzersGlobalizationRulesVersion)' != ''">AnalysisLevelGlobalization_$(MicrosoftCodeAnalysisNetAnalyzersGlobalizationRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersGlobalization)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersGlobalization Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersGlobalization)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersGlobalization) - - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelInteroperability), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelInteroperability), '$(AnalysisLevelPrefixInteroperability)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixInteroperability) - $(AnalysisLevelInteroperability) - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelInteroperability), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability>$(AnalysisLevelSuffixInteroperability) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' == ''">$(AnalysisModeInteroperability) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(MicrosoftCodeAnalysisNetAnalyzersInteroperabilityRulesVersion)' != ''">AnalysisLevelInteroperability_$(MicrosoftCodeAnalysisNetAnalyzersInteroperabilityRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersInteroperability)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersInteroperability Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersInteroperability)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersInteroperability) - - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelMaintainability), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelMaintainability), '$(AnalysisLevelPrefixMaintainability)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixMaintainability) - $(AnalysisLevelMaintainability) - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelMaintainability), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability>$(AnalysisLevelSuffixMaintainability) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' == ''">$(AnalysisModeMaintainability) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(MicrosoftCodeAnalysisNetAnalyzersMaintainabilityRulesVersion)' != ''">AnalysisLevelMaintainability_$(MicrosoftCodeAnalysisNetAnalyzersMaintainabilityRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersMaintainability)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersMaintainability Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersMaintainability)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersMaintainability) - - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelNaming), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelNaming), '$(AnalysisLevelPrefixNaming)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixNaming) - $(AnalysisLevelNaming) - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelNaming), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming>$(AnalysisLevelSuffixNaming) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming)' == ''">$(AnalysisModeNaming) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(MicrosoftCodeAnalysisNetAnalyzersNamingRulesVersion)' != ''">AnalysisLevelNaming_$(MicrosoftCodeAnalysisNetAnalyzersNamingRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersNaming)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersNaming)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersNaming Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersNaming)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersNaming) - - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelPerformance), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelPerformance), '$(AnalysisLevelPrefixPerformance)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixPerformance) - $(AnalysisLevelPerformance) - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelPerformance), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance>$(AnalysisLevelSuffixPerformance) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance)' == ''">$(AnalysisModePerformance) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(MicrosoftCodeAnalysisNetAnalyzersPerformanceRulesVersion)' != ''">AnalysisLevelPerformance_$(MicrosoftCodeAnalysisNetAnalyzersPerformanceRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersPerformance)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersPerformance)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersPerformance Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersPerformance)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersPerformance) - - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelReliability), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelReliability), '$(AnalysisLevelPrefixReliability)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixReliability) - $(AnalysisLevelReliability) - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelReliability), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability>$(AnalysisLevelSuffixReliability) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability)' == ''">$(AnalysisModeReliability) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(MicrosoftCodeAnalysisNetAnalyzersReliabilityRulesVersion)' != ''">AnalysisLevelReliability_$(MicrosoftCodeAnalysisNetAnalyzersReliabilityRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersReliability)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersReliability)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersReliability Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersReliability)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersReliability) - - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelSecurity), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelSecurity), '$(AnalysisLevelPrefixSecurity)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixSecurity) - $(AnalysisLevelSecurity) - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelSecurity), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity>$(AnalysisLevelSuffixSecurity) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity)' == ''">$(AnalysisModeSecurity) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(MicrosoftCodeAnalysisNetAnalyzersSecurityRulesVersion)' != ''">AnalysisLevelSecurity_$(MicrosoftCodeAnalysisNetAnalyzersSecurityRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersSecurity)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersSecurity)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersSecurity Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersSecurity)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersSecurity) - - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelUsage), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelUsage), '$(AnalysisLevelPrefixUsage)-', '')) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixUsage) - $(AnalysisLevelUsage) - - $([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevelUsage), '(\.0)*$', '')) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage>$(AnalysisLevelSuffixUsage) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage)' == ''">$(AnalysisModeUsage) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage)' == ''">Default - - - $(CodeAnalysisTreatWarningsAsErrors) - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage_WarnAsErrorSuffix Condition="'$(EffectiveCodeAnalysisTreatWarningsAsErrors)' == 'true'">_warnaserror - - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(MicrosoftCodeAnalysisNetAnalyzersUsageRulesVersion)' != ''">AnalysisLevelUsage_$(MicrosoftCodeAnalysisNetAnalyzersUsageRulesVersion.Replace(".","_"))_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisNetAnalyzersUsage)$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage_WarnAsErrorSuffix).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersUsage)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisNetAnalyzersUsage Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisNetAnalyzersUsage)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisNetAnalyzersUsage) - - - - - - - - - - - - - - - - - - - - - <_SupportedPlatformList>@(SupportedPlatform, ',') - - - - - - - - - $(CodeAnalysisTreatWarningsAsErrors) - $(WarningsNotAsErrors);$(CodeAnalysisRuleIds) - - - - - - - - - $(AnalysisLevel) - - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelStyle), '-(.)*', '')) - $([System.Text.RegularExpressions.Regex]::Replace($(AnalysisLevelStyle), '$(AnalysisLevelPrefixStyle)-', '')) - - $(AnalysisLevelSuffix) - - $(AnalysisMode) - - $(_NoneAnalysisLevel) - $(_LatestAnalysisLevel) - $(_PreviewAnalysisLevel) - - $(AnalysisLevelPrefixStyle) - $(AnalysisLevelStyle) - - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle>$(AnalysisModeStyle) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle)' == ''">$(AnalysisLevelSuffixStyle) - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle)' == 'AllEnabledByDefault'">All - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle)' == 'AllDisabledByDefault'">None - <_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle)' == ''">Default - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle>AnalysisLevelStyle_$(_GlobalAnalyzerConfigAnalysisMode_MicrosoftCodeAnalysisCSharpCodeStyle).globalconfig - <_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle>$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle.ToLowerInvariant()) - <_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisCSharpCodeStyle)' == ''">$(MSBuildThisFileDirectory)config - <_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisCSharpCodeStyle Condition="'$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle)' != ''">$(_GlobalAnalyzerConfigDir_MicrosoftCodeAnalysisCSharpCodeStyle)\$(_GlobalAnalyzerConfigFileName_MicrosoftCodeAnalysisCSharpCodeStyle) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(StartWorkingDirectory) - - - - - $(StartProgram) - $(StartArguments) - - - - - - dotnet - <_NetCoreRunArguments>exec "$(TargetPath)" - $(_NetCoreRunArguments) $(StartArguments) - $(_NetCoreRunArguments) - - - $(TargetDir)$(AssemblyName)$(_NativeExecutableExtension) - $(StartArguments) - - - - - $(TargetPath) - $(StartArguments) - - - - - - $([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(RunWorkingDirectory)')))) - - - - - - - - - - - - - - true - true - - - $(AfterMicrosoftNETSdkTargets);$(MSBuildThisFileDirectory)../../Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets - - - - - - - - - - 0.0 - $(TargetPlatformIdentifier),Version=$(TargetPlatformVersion) - $([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKDisplayName($(TargetPlatformIdentifier), $(TargetPlatformVersion))) - - - - $(TargetPlatformVersion) - - - - $(EffectiveTargetPlatformVersion) - - - - - - - $(MSBuildThisFileDirectory)..\tools\net11.0\Microsoft.DotNet.ApiCompat.Task.dll - - - - - - - - - - - - - - - <_UseRoslynToolsetPackage Condition="'$(ApiCompatUseRoslynToolsetPackagePath)' == 'true' and '@(PackageReference->AnyHaveMetadataValue('Identity', 'Microsoft.Net.Compilers.Toolset'))' == 'true'">true - - $([System.IO.Path]::GetDirectoryName('$(CSharpCoreTargetsPath)')) - - $(RoslynTargetsPath) - - $([System.IO.Path]::Combine('$(RoslynAssembliesPath)', 'bincore')) - - - - $(GenerateCompatibilitySuppressionFile) - - - - - - - <_apiCompatDefaultProjectSuppressionFile>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', 'CompatibilitySuppressions.xml')) - - $(_apiCompatDefaultProjectSuppressionFile) - - - - - - - - - - - <_ApiCompatValidatePackageSemaphoreFile>$(IntermediateOutputPath)$(MSBuildThisFileName).semaphore - - CollectApiCompatInputs;_GetReferencePathFromInnerProjects;$(RunPackageValidationDependsOn) - - - - $(PackageId) - $([MSBuild]::NormalizePath('$(NuGetPackageRoot)', '$(PackageValidationBaselineName.ToLower())', '$(PackageValidationBaselineVersion)', '$(PackageValidationBaselineName.ToLower()).$(PackageValidationBaselineVersion).nupkg')) - <_packageValidationBaselinePath Condition="'$(DisablePackageBaselineValidation)' != 'true'">$(PackageValidationBaselinePath) - - - <_PackageTargetPath Include="@(NuGetPackOutput->WithMetadataValue('Extension', '.nupkg'))" Condition="!$([System.String]::new('%(Identity)').EndsWith('.symbols.nupkg'))" /> - - - - - - - - - - $(TargetPlatformMoniker) - - - - - - - - - - - - - - - $(MSBuildThisFileDirectory)..\..\..\NuGet.Build.Tasks.Pack.targets - true - - - - - - Sdks\Microsoft.NET.Sdk\tools\net472\NuGet.Build.Tasks.Pack.dll - NuGet.Build.Tasks.Pack.dll - - - - - - - - - $(AssemblyName) - $(Version) - true - _LoadPackInputItems; _GetTargetFrameworksOutput; _WalkEachTargetPerFramework; _GetPackageFiles; $(GenerateNuspecDependsOn) - $(Description) - Package Description - false - true - true - tools - lib - content;contentFiles - $(BeforePack); _GetRestoreProjectStyle; _IntermediatePack; GenerateNuspec; $(PackDependsOn) - true - symbols.nupkg - DeterminePortableBuildCapabilities - false - false - .dll; .exe; .winmd; .json; .pri; .xml - $(DefaultAllowedOutputExtensionsInPackageBuildOutputFolder) ;$(AllowedOutputExtensionsInPackageBuildOutputFolder) - .pdb; .mdb; $(AllowedOutputExtensionsInPackageBuildOutputFolder); $(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder) - .pdb - false - - - $(GenerateNuspecDependsOn) - - - Build;$(GenerateNuspecDependsOn) - - - - - - - $(TargetFramework) - - - - $(MSBuildProjectExtensionsPath) - $(BaseOutputPath)$(Configuration)\ - $(BaseIntermediateOutputPath)$(Configuration)\ - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFrameworks /> - - - - - - <_TargetFrameworks Include="$(_ProjectFrameworks.Split(';'))" /> - - - - - - - <_PackageFilesToDelete Include="@(_OutputPackItems)" /> - - - - - - false - - - - - - - - - - - - - - - - - - - - true - - - - - - - - $(SOURCE_DATE_EPOCH) - - - - - - - - - $(PrivateRepositoryUrl) - $(SourceRevisionId) - $(SourceBranchName) - - - - - - - $(MSBuildProjectFullPath) - - - - - - - - - - - - - - - - - <_ProjectPathWithVersion Include="$(MSBuildProjectFullPath)"> - $(PackageVersion) - 1.0.0 - - - - - - <_ProjectsWithTFM Include="$(MSBuildProjectFullPath)" AdditionalProperties="TargetFramework=%(_TargetFrameworks.Identity)" /> - <_ProjectsWithTFMNoBuild Include="$(MSBuildProjectFullPath)" AdditionalProperties="TargetFramework=%(_TargetFrameworks.Identity);BuildProjectReferences=false" /> - - - - - - - - - - - - - - - - - - - - - - - <_TfmWithDependenciesSuppressed Include="$(TargetFramework)" Condition="'$(SuppressDependenciesWhenPacking)' == 'true'" /> - - - - - - $(TargetFramework) - - - - - - - - - - - - - %(TfmSpecificPackageFile.RecursiveDir) - %(TfmSpecificPackageFile.BuildAction) - - - - - - <_TargetPathsToSymbolsWithTfm Include="@(DebugSymbolsProjectOutputGroupOutput)"> - $(TargetFramework) - - - - <_TargetPathsToSymbolsWithTfm Include="@(TfmSpecificDebugSymbolsFile)" /> - - - - - - <_PathToPriFile Include="$(ProjectPriFullPath)"> - $(ProjectPriFullPath) - $(ProjectPriFileName) - - - - - - - <_PackageFilesToExclude Include="@(Content)" Condition="'%(Content.Pack)' == 'false'" /> - - - - <_PackageFiles Include="@(Content)" Condition=" %(Content.Pack) != 'false' "> - Content - - <_PackageFiles Include="@(Compile)" Condition=" %(Compile.Pack) == 'true' "> - Compile - - <_PackageFiles Include="@(None)" Condition=" %(None.Pack) == 'true' "> - None - - <_PackageFiles Include="@(EmbeddedResource)" Condition=" %(EmbeddedResource.Pack) == 'true' "> - EmbeddedResource - - <_PackageFiles Include="@(ApplicationDefinition)" Condition=" %(ApplicationDefinition.Pack) == 'true' "> - ApplicationDefinition - - <_PackageFiles Include="@(Page)" Condition=" %(Page.Pack) == 'true' "> - Page - - <_PackageFiles Include="@(Resource)" Condition=" %(Resource.Pack) == 'true' "> - Resource - - <_PackageFiles Include="@(SplashScreen)" Condition=" %(SplashScreen.Pack) == 'true' "> - SplashScreen - - <_PackageFiles Include="@(DesignData)" Condition=" %(DesignData.Pack) == 'true' "> - DesignData - - <_PackageFiles Include="@(DesignDataWithDesignTimeCreatableTypes)" Condition=" %(DesignDataWithDesignTimeCreatableTypes.Pack) == 'true' "> - DesignDataWithDesignTimeCreatableTypes - - <_PackageFiles Include="@(CodeAnalysisDictionary)" Condition=" %(CodeAnalysisDictionary.Pack) == 'true' "> - CodeAnalysisDictionary - - <_PackageFiles Include="@(AndroidAsset)" Condition=" %(AndroidAsset.Pack) == 'true' "> - AndroidAsset - - <_PackageFiles Include="@(AndroidResource)" Condition=" %(AndroidResource.Pack) == 'true' "> - AndroidResource - - <_PackageFiles Include="@(BundleResource)" Condition=" %(BundleResource.Pack) == 'true' "> - BundleResource - - - - - - - <_IsNotSetContainersTargetsDir>false - <_IsNotSetContainersTargetsDir Condition=" '$(_ContainersTargetsDir)'=='' ">true - <_ContainersTargetsDir Condition="$(_IsNotSetContainersTargetsDir)">$(MSBuildThisFileDirectory)..\..\..\Containers\build\ - - - - - true - tasks - net11.0 - - true - - $(MSBuildThisFileDirectory)..\$(ContainerTaskFolderName)\$(ContainerTaskFramework)\ - - $(ContainerCustomTasksFolder)$(MSBuildThisFileName).dll - - - - - - - - - - <_IsSDKContainerAllowedVersion>false - - <_IsSDKContainerAllowedVersion Condition="$([MSBuild]::VersionGreaterThan($(NetCoreSdkVersion), 7.0.100)) OR ( $([MSBuild]::VersionEquals($(NetCoreSdkVersion), 7.0.100)) AND ( $(NETCoreSdkVersion.Contains('-preview.7')) OR $(NETCoreSdkVersion.Contains('-rc')) OR $(NETCoreSdkVersion.Contains('-')) == false ) )">true - <_ContainerIsTargetingNet8TFM>false - <_ContainerIsTargetingNet8TFM Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionGreaterThanOrEquals($(_TargetFrameworkVersionWithoutV), '8.0'))">true - <_ContainerIsSelfContained>false - <_ContainerIsSelfContained Condition="'$(SelfContained)' == 'true' or '$(PublishSelfContained)' == 'true'">true - true - - - - - - - - - - - - $(RuntimeIdentifier) - $(RuntimeIdentifiers) - linux-$(NETCoreSdkPortableRuntimeIdentifier.Split('-')[1]) - - <_InitialContainerBaseImage>$(ContainerBaseImage) - - - <_TargetRuntimeIdentifiers Include="$(ContainerRuntimeIdentifier)" Condition="'$(ContainerRuntimeIdentifier)' != ''" /> - <_TargetRuntimeIdentifiers Include="$(ContainerRuntimeIdentifiers)" Condition="@(_TargetRuntimeIdentifiers->Count()) == 0" /> - - - - - - <_TargetRuntimeIdentifiers Remove="$(_TargetRuntimeIdentifiers)" /> - - - - - - - $(RegistryUrl) - - $(PublishImageTag) - - $([System.DateTime]::UtcNow.ToString('yyyyMMddhhmmss')) - - - - - - - - - - - $(ContainerImageName) - - $(AssemblyName) - - latest - $([System.DateTime]::UtcNow.ToString('yyyyMMddhhmmss')) - - - - - - - - - - - - - true - true - true - true - true - true - true - true - true - true - true - true - true - true - true - - - $(Description) - $(Authors) - $(PackageProjectUrl) - $(PackageProjectUrl) - $(PackageVersion) - $(PackageLicenseExpression) - $(Title) - - - - - - - - - - - - - - - - - - - - - - <_TrimmedRepositoryUrl Condition="'$(RepositoryType)' == 'git' and '$(PrivateRepositoryUrl)' != '' and $(PrivateRepositoryUrl.EndsWith('.git'))">$(PrivateRepositoryUrl.Substring(0, $(PrivateRepositoryUrl.LastIndexOf('.git')))) - <_TrimmedRepositoryUrl Condition="'$(_TrimmedRepositoryUrl)' == '' and '$(PrivateRepositoryUrl)' != ''">$(PrivateRepositoryUrl) - - - - - - - - - _ContainerVerifySDKVersion; - ComputeContainerConfig; - _CheckContainersPackage; - - - - - - - <_ContainerIsTargetingWindows>false - <_ContainerIsTargetingWindows Condition="$(ContainerRuntimeIdentifier.StartsWith('win'))">true - - /app/ - C:\app\ - <_ContainerIsUsingMicrosoftDefaultImages Condition="'$(_InitialContainerBaseImage)' == ''">true - <_ContainerIsUsingMicrosoftDefaultImages Condition="'$(_InitialContainerBaseImage)' != ''">false - - - - ContainerUser - - - - - - - - - - - - <_ContainersPackageIdentity>Microsoft.NET.Build.Containers - <_WebDefaultSdkVersion>7.0.300 - <_WorkerDefaultSdkVersion>8.0.100 - <_ConsoleDefaultSdkVersion>8.0.200 - - <_SdkCanPublishWeb>$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '$(_WebDefaultSdkVersion)')) - <_SdkCanPublishWorker>$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '$(_WorkerDefaultSdkVersion)')) - <_SdkCanPublishConsole>$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '$(_ConsoleDefaultSdkVersion)')) - - <_ContainerPackageIsPresent>false - <_ContainerPackageIsPresent Condition="@(PackageReference->AnyHaveMetadataValue('Identity', '$(_ContainersPackageIdentity)'))">true - <_IsWebProject>false - <_IsWebProject Condition="@(ProjectCapability->AnyHaveMetadataValue('Identity', 'DotNetCoreWeb'))">true - <_IsWorkerProject>false - <_IsWorkerProject Condition="@(ProjectCapability->AnyHaveMetadataValue('Identity', 'DotNetCoreWorker'))">true - - - - - - - - - - - - - - - - - - $(GeneratedContainerManifest) - $(GeneratedContainerConfiguration) - $(GeneratedContainerDigest) - $(GeneratedContainerMediaType) - - - - - - - - - <_SkipContainerPublishing>false - <_SkipContainerPublishing Condition="$(ContainerArchiveOutputPath) != '' or ( $(ContainerRegistry) == '' and ( $(LocalRegistry) == '' or $(LocalRegistry) == 'Docker' ) )">true - - <_SkipCreateImageIndex>false - <_SkipCreateImageIndex Condition="$(ContainerArchiveOutputPath) == '' and $(ContainerRegistry) == '' and $(LocalRegistry) == 'Podman'">true - - - <_SingleImageContainerFormat Condition="'$(ContainerImageFormat)' != ''">$(ContainerImageFormat) - - <_SingleImageContainerFormat Condition="$(_SkipContainerPublishing) == 'true' ">OCI - - - <_rids Include="$(ContainerRuntimeIdentifiers)" Condition="'$(ContainerRuntimeIdentifiers)' != ''" /> - <_rids Include="$(RuntimeIdentifiers)" Condition="'$(ContainerRuntimeIdentifiers)' == '' and '$(RuntimeIdentifiers)' != ''" /> - <_InnerBuild Include="$(MSBuildProjectFullPath)" AdditionalProperties=" ContainerRuntimeIdentifier=%(_rids.Identity); RuntimeIdentifier=%(_rids.Identity); ContainerBaseRegistry=$(ContainerBaseRegistry); ContainerBaseName=$(ContainerBaseName); ContainerBaseTag=$(ContainerBaseTag); ContainerBaseDigest=$(ContainerBaseDigest); ContainerRegistry=$(ContainerRegistry); _ContainerImageTags=@(ContainerImageTags, ';'); ContainerRepository=$(ContainerRepository); _ContainerLabel=@(ContainerLabel->'%(Identity):%(Value)'); _ContainerPort=@(ContainerPort->'%(Identity):%(Type)'); _ContainerEnvironmentVariables=@(ContainerEnvironmentVariable->'%(Identity):%(Value)'); ContainerGenerateLabels=$(ContainerGenerateLabels); ContainerGenerateLabelsImageBaseDigest=$(ContainerGenerateLabelsImageBaseDigest); _SkipContainerPublishing=$(_SkipContainerPublishing); ContainerImageFormat=$(_SingleImageContainerFormat); _IsMultiRIDBuild=false; _IsSingleRIDBuild=true; _InitialContainerBaseImage=$(_InitialContainerBaseImage) " /> - <_rids Remove="$(_rids)" /> - - - - - - - - - - - - - - <_ParsedContainerLabel Condition="'$(_ContainerLabel)' != ':'" Include="$(_ContainerLabel)" /> - - <_ParsedContainerPort Condition="'$(_ContainerPort)' != ':'" Include="$(_ContainerPort)" /> - - <_ParsedContainerEnvironmentVariables Condition="'$(_ContainerEnvironmentVariables)' != ':'" Include="$(_ContainerEnvironmentVariables)" /> - - - - - - <_IsMultiTFMBuild Condition="'$(TargetFrameworks)' != '' and '$(TargetFramework)' == ''">true - - <_HasCRIDsAndNoCRID Condition="'$(ContainerRuntimeIdentifiers)' != '' and '$(ContainerRuntimeIdentifier)' == ''">true - <_HasRIDs Condition="'$(RuntimeIdentifiers)' != ''">true - <_NoCRIDsOrCRIDorRID Condition="'$(ContainerRuntimeIdentifiers)' == '' and '$(ContainerRuntimeIdentifier)' == '' and '$(RuntimeIdentifier)' == ''">true - - <_IsMultiRIDBuild Condition="'$(BuildingInsideVisualStudio)' != 'true' and ('$(_HasCRIDsAndNoCRID)' == true or ('$(_HasRIDs)' == 'true' and '$(_NoCRIDsOrCRIDorRID)' == 'true'))">true - <_IsSingleRIDBuild Condition="'$(_IsMultiRIDBuild)' == ''">true - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/DynamicData/Aggregation/AggregateEnumerator.cs b/src/DynamicData/Aggregation/AggregateEnumerator.cs index a394e0fb8..669f48584 100644 --- a/src/DynamicData/Aggregation/AggregateEnumerator.cs +++ b/src/DynamicData/Aggregation/AggregateEnumerator.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif internal sealed class AggregateEnumerator(IChangeSet source) : IAggregateChangeSet where T : notnull diff --git a/src/DynamicData/Aggregation/AggregateItem.cs b/src/DynamicData/Aggregation/AggregateItem.cs index a346ab930..b3496fd67 100644 --- a/src/DynamicData/Aggregation/AggregateItem.cs +++ b/src/DynamicData/Aggregation/AggregateItem.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif /// /// An object representing added and removed items in a continuous aggregation stream. diff --git a/src/DynamicData/Aggregation/AggregateType.cs b/src/DynamicData/Aggregation/AggregateType.cs index 776d18949..e277184d1 100644 --- a/src/DynamicData/Aggregation/AggregateType.cs +++ b/src/DynamicData/Aggregation/AggregateType.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif /// /// The type of aggregation. diff --git a/src/DynamicData/Aggregation/AggregationEx.cs b/src/DynamicData/Aggregation/AggregationEx.cs index f6006b569..0d7de5395 100644 --- a/src/DynamicData/Aggregation/AggregationEx.cs +++ b/src/DynamicData/Aggregation/AggregationEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif /// /// Aggregation extensions. diff --git a/src/DynamicData/Aggregation/Avg.cs b/src/DynamicData/Aggregation/Avg.cs index 9dfb17498..706ad4b00 100644 --- a/src/DynamicData/Aggregation/Avg.cs +++ b/src/DynamicData/Aggregation/Avg.cs @@ -1,7 +1,12 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif internal readonly record struct Avg(int Count, TValue Sum); diff --git a/src/DynamicData/Aggregation/AvgEx.cs b/src/DynamicData/Aggregation/AvgEx.cs index 3c40cca1a..60b1d83e1 100644 --- a/src/DynamicData/Aggregation/AvgEx.cs +++ b/src/DynamicData/Aggregation/AvgEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif /// /// Average extensions. diff --git a/src/DynamicData/Aggregation/CountEx.cs b/src/DynamicData/Aggregation/CountEx.cs index 8b199a1e8..a3bbb35d4 100644 --- a/src/DynamicData/Aggregation/CountEx.cs +++ b/src/DynamicData/Aggregation/CountEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif /// /// Count extensions. diff --git a/src/DynamicData/Aggregation/IAggregateChangeSet.cs b/src/DynamicData/Aggregation/IAggregateChangeSet.cs index bd0b72e43..62720cc9d 100644 --- a/src/DynamicData/Aggregation/IAggregateChangeSet.cs +++ b/src/DynamicData/Aggregation/IAggregateChangeSet.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif /// /// A change set which has been shaped for rapid online aggregations. diff --git a/src/DynamicData/Aggregation/MaxEx.cs b/src/DynamicData/Aggregation/MaxEx.cs index 0795832da..5dce75b24 100644 --- a/src/DynamicData/Aggregation/MaxEx.cs +++ b/src/DynamicData/Aggregation/MaxEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif /// /// Maximum and minimum value extensions. diff --git a/src/DynamicData/Aggregation/StdDev.cs b/src/DynamicData/Aggregation/StdDev.cs index d43cce9a7..2a5fa74f5 100644 --- a/src/DynamicData/Aggregation/StdDev.cs +++ b/src/DynamicData/Aggregation/StdDev.cs @@ -1,7 +1,12 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif internal readonly record struct StdDev(int Count, TValue SumOfItems, TValue SumOfSquares); diff --git a/src/DynamicData/Aggregation/StdDevEx.cs b/src/DynamicData/Aggregation/StdDevEx.cs index 8332e5851..68dccc209 100644 --- a/src/DynamicData/Aggregation/StdDevEx.cs +++ b/src/DynamicData/Aggregation/StdDevEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif /// /// Extensions for calculating standard deviation. diff --git a/src/DynamicData/Aggregation/SumEx.cs b/src/DynamicData/Aggregation/SumEx.cs index fdc31c486..a476f2078 100644 --- a/src/DynamicData/Aggregation/SumEx.cs +++ b/src/DynamicData/Aggregation/SumEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Aggregation; +#else namespace DynamicData.Aggregation; +#endif /// /// Aggregation extensions. diff --git a/src/DynamicData/Alias/ObservableCacheAlias.cs b/src/DynamicData/Alias/ObservableCacheAlias.cs index be0245b8e..74b0d82c7 100644 --- a/src/DynamicData/Alias/ObservableCacheAlias.cs +++ b/src/DynamicData/Alias/ObservableCacheAlias.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Alias; +#else namespace DynamicData.Alias; +#endif /// /// Observable cache alias names. diff --git a/src/DynamicData/Alias/ObservableListAlias.cs b/src/DynamicData/Alias/ObservableListAlias.cs index 90c66a672..ce8a98be1 100644 --- a/src/DynamicData/Alias/ObservableListAlias.cs +++ b/src/DynamicData/Alias/ObservableListAlias.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Alias; +#else namespace DynamicData.Alias; +#endif /// /// Observable cache alias names. diff --git a/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs b/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs index 3f6fa6f0f..df56b0f1f 100644 --- a/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs +++ b/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Base class for implementing notify property changes. diff --git a/src/DynamicData/Binding/BindPaged.cs b/src/DynamicData/Binding/BindPaged.cs index f0aab5e1a..a2a1624b5 100644 --- a/src/DynamicData/Binding/BindPaged.cs +++ b/src/DynamicData/Binding/BindPaged.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /* * Binding for the result of the SortAndPage operator diff --git a/src/DynamicData/Binding/BindVirtualized.cs b/src/DynamicData/Binding/BindVirtualized.cs index 879f7fe0c..7feb07fdb 100644 --- a/src/DynamicData/Binding/BindVirtualized.cs +++ b/src/DynamicData/Binding/BindVirtualized.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /* * Binding for the result of the SortAndVirtualize operator diff --git a/src/DynamicData/Binding/BindingListAdaptor.cs b/src/DynamicData/Binding/BindingListAdaptor.cs index 84e9949bd..f90f56c65 100644 --- a/src/DynamicData/Binding/BindingListAdaptor.cs +++ b/src/DynamicData/Binding/BindingListAdaptor.cs @@ -1,11 +1,20 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. #if SUPPORTS_BINDINGLIST +#if REACTIVE_SHIM +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Adaptor to reflect a change set into a binding list. diff --git a/src/DynamicData/Binding/BindingListEventsSuspender.cs b/src/DynamicData/Binding/BindingListEventsSuspender.cs index d49608c0b..279fd297c 100644 --- a/src/DynamicData/Binding/BindingListEventsSuspender.cs +++ b/src/DynamicData/Binding/BindingListEventsSuspender.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif internal sealed class BindingListEventsSuspender<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T> : IDisposable { diff --git a/src/DynamicData/Binding/BindingListEx.cs b/src/DynamicData/Binding/BindingListEx.cs index 9bf99754a..de2ffe5e6 100644 --- a/src/DynamicData/Binding/BindingListEx.cs +++ b/src/DynamicData/Binding/BindingListEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Extensions to convert an binding list into a dynamic stream. diff --git a/src/DynamicData/Binding/BindingOptions.cs b/src/DynamicData/Binding/BindingOptions.cs index eb2d30934..3a316863b 100644 --- a/src/DynamicData/Binding/BindingOptions.cs +++ b/src/DynamicData/Binding/BindingOptions.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// System wide default values for binding operators. diff --git a/src/DynamicData/Binding/ExpressionBuilder.cs b/src/DynamicData/Binding/ExpressionBuilder.cs index 541c02578..1ebdd71c2 100644 --- a/src/DynamicData/Binding/ExpressionBuilder.cs +++ b/src/DynamicData/Binding/ExpressionBuilder.cs @@ -4,8 +4,13 @@ using System.Linq.Expressions; using System.Reflection; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif internal static class ExpressionBuilder { diff --git a/src/DynamicData/Binding/IEvaluateAware.cs b/src/DynamicData/Binding/IEvaluateAware.cs index 6f4ce4206..06a5fa4e9 100644 --- a/src/DynamicData/Binding/IEvaluateAware.cs +++ b/src/DynamicData/Binding/IEvaluateAware.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Implement on an object and use in conjunction with InvokeEvaluate operator diff --git a/src/DynamicData/Binding/IIndexAware.cs b/src/DynamicData/Binding/IIndexAware.cs index dc3a8d825..fd731f8ae 100644 --- a/src/DynamicData/Binding/IIndexAware.cs +++ b/src/DynamicData/Binding/IIndexAware.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Implement on an object and use in conjunction with UpdateIndex operator diff --git a/src/DynamicData/Binding/INotifyCollectionChangedSuspender.cs b/src/DynamicData/Binding/INotifyCollectionChangedSuspender.cs index d0a75cc81..1eaab65ff 100644 --- a/src/DynamicData/Binding/INotifyCollectionChangedSuspender.cs +++ b/src/DynamicData/Binding/INotifyCollectionChangedSuspender.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Represents an observable collection where collection changed and count notifications can be suspended. diff --git a/src/DynamicData/Binding/IObservableCollection.cs b/src/DynamicData/Binding/IObservableCollection.cs index a4adc6fd5..bfb5d69a8 100644 --- a/src/DynamicData/Binding/IObservableCollection.cs +++ b/src/DynamicData/Binding/IObservableCollection.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Specialized; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// An override of observable collection which allows the suspension of notifications. diff --git a/src/DynamicData/Binding/IObservableCollectionAdaptor.cs b/src/DynamicData/Binding/IObservableCollectionAdaptor.cs index a8f2d420b..0f6d29d2b 100644 --- a/src/DynamicData/Binding/IObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/IObservableCollectionAdaptor.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Represents an adaptor which is used to update observable collection from diff --git a/src/DynamicData/Binding/IObservableListEx.cs b/src/DynamicData/Binding/IObservableListEx.cs index 9e119f3be..fe76eff4b 100644 --- a/src/DynamicData/Binding/IObservableListEx.cs +++ b/src/DynamicData/Binding/IObservableListEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Extensions to convert a dynamic stream out to an . diff --git a/src/DynamicData/Binding/ISortedObservableCollectionAdaptor.cs b/src/DynamicData/Binding/ISortedObservableCollectionAdaptor.cs index 4188c4ef0..168360394 100644 --- a/src/DynamicData/Binding/ISortedObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/ISortedObservableCollectionAdaptor.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Represents an adaptor which is used to update observable collection from diff --git a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs index ba2d32f46..b661f9c5e 100644 --- a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs +++ b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Property changes notification. diff --git a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs index f6370417d..f105052ce 100644 --- a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Adaptor to reflect a change set into an observable list. diff --git a/src/DynamicData/Binding/ObservableCollectionEx.cs b/src/DynamicData/Binding/ObservableCollectionEx.cs index 037ab82eb..c30a68039 100644 --- a/src/DynamicData/Binding/ObservableCollectionEx.cs +++ b/src/DynamicData/Binding/ObservableCollectionEx.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Specialized; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Extensions to convert an observable collection into a dynamic stream. diff --git a/src/DynamicData/Binding/ObservableCollectionExtended.cs b/src/DynamicData/Binding/ObservableCollectionExtended.cs index 2802ccf8e..2e34a9897 100644 --- a/src/DynamicData/Binding/ObservableCollectionExtended.cs +++ b/src/DynamicData/Binding/ObservableCollectionExtended.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Specialized; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// An override of observable collection which allows the suspension of notifications. diff --git a/src/DynamicData/Binding/ObservablePropertyFactory.cs b/src/DynamicData/Binding/ObservablePropertyFactory.cs index b1660f0c1..7fa480956 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactory.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactory.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif internal sealed class ObservablePropertyFactory where TObject : INotifyPropertyChanged diff --git a/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs b/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs index 45d1ec749..d2265fcd7 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs @@ -4,8 +4,13 @@ using System.Collections.Concurrent; using System.Linq.Expressions; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif internal sealed class ObservablePropertyFactoryCache { diff --git a/src/DynamicData/Binding/ObservablePropertyPart.cs b/src/DynamicData/Binding/ObservablePropertyPart.cs index 888ff1fb4..c0515d930 100644 --- a/src/DynamicData/Binding/ObservablePropertyPart.cs +++ b/src/DynamicData/Binding/ObservablePropertyPart.cs @@ -4,8 +4,13 @@ using System.Diagnostics; using System.Linq.Expressions; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif [DebuggerDisplay("ObservablePropertyPart<{" + nameof(expression) + "}>")] internal sealed class ObservablePropertyPart(Expression expression) diff --git a/src/DynamicData/Binding/PropertyValue.cs b/src/DynamicData/Binding/PropertyValue.cs index af6e7405b..126bc0166 100644 --- a/src/DynamicData/Binding/PropertyValue.cs +++ b/src/DynamicData/Binding/PropertyValue.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Container holding sender and latest property value. diff --git a/src/DynamicData/Binding/SortAndBind.cs b/src/DynamicData/Binding/SortAndBind.cs index b76402e04..32637ebd8 100644 --- a/src/DynamicData/Binding/SortAndBind.cs +++ b/src/DynamicData/Binding/SortAndBind.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /* * A much more optimised bind where the sort forms part of the binding. diff --git a/src/DynamicData/Binding/SortAndBindOptions.cs b/src/DynamicData/Binding/SortAndBindOptions.cs index 38c207856..5d8e7b835 100644 --- a/src/DynamicData/Binding/SortAndBindOptions.cs +++ b/src/DynamicData/Binding/SortAndBindOptions.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Options for the sort and bind operator. diff --git a/src/DynamicData/Binding/SortDirection.cs b/src/DynamicData/Binding/SortDirection.cs index 84313ab99..e2aa23c5f 100644 --- a/src/DynamicData/Binding/SortDirection.cs +++ b/src/DynamicData/Binding/SortDirection.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Sort direction. diff --git a/src/DynamicData/Binding/SortExpression.cs b/src/DynamicData/Binding/SortExpression.cs index 9ff365ad2..0c9376ce5 100644 --- a/src/DynamicData/Binding/SortExpression.cs +++ b/src/DynamicData/Binding/SortExpression.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// A value expression with sort direction. diff --git a/src/DynamicData/Binding/SortExpressionComparer.cs b/src/DynamicData/Binding/SortExpressionComparer.cs index 14c7f94c4..32b5fce19 100644 --- a/src/DynamicData/Binding/SortExpressionComparer.cs +++ b/src/DynamicData/Binding/SortExpressionComparer.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Generic sort expression to help create inline sorting for the .Sort(IComparer comparer) operator. diff --git a/src/DynamicData/Binding/SortedBindingListAdaptor.cs b/src/DynamicData/Binding/SortedBindingListAdaptor.cs index dad83e349..1808ef1b5 100644 --- a/src/DynamicData/Binding/SortedBindingListAdaptor.cs +++ b/src/DynamicData/Binding/SortedBindingListAdaptor.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. #if SUPPORTS_BINDINGLIST +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Represents an adaptor which is used to update a binding list from diff --git a/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs b/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs index cf4e428fc..682865624 100644 --- a/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Binding; +#else namespace DynamicData.Binding; +#endif /// /// Represents an adaptor which is used to update observable collection from diff --git a/src/DynamicData/Cache/CacheChangeSetEx.cs b/src/DynamicData/Cache/CacheChangeSetEx.cs index bdd01b1c5..66d84ccf0 100644 --- a/src/DynamicData/Cache/CacheChangeSetEx.cs +++ b/src/DynamicData/Cache/CacheChangeSetEx.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache; +#else namespace DynamicData.Cache; +#endif internal static class CacheChangeSetEx { diff --git a/src/DynamicData/Cache/Change.cs b/src/DynamicData/Cache/Change.cs index ec9360400..51a911ad5 100644 --- a/src/DynamicData/Cache/Change.cs +++ b/src/DynamicData/Cache/Change.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Container to describe a single change to a cache. @@ -22,7 +26,7 @@ namespace DynamicData; /// The current. /// The index. public Change(ChangeReason reason, TKey key, TObject current, int index = -1) - : this(reason, key, current, Optional.None, index) + : this(reason, key, current, ReactiveUI.Primitives.Optional.None, index) { } @@ -53,7 +57,7 @@ public Change(TKey key, TObject current, int currentIndex, int previousIndex) } Current = current; - Previous = Optional.None; + Previous = ReactiveUI.Primitives.Optional.None; Key = key; Reason = ChangeReason.Moved; CurrentIndex = currentIndex; @@ -74,7 +78,7 @@ public Change(TKey key, TObject current, int currentIndex, int previousIndex) /// or /// For , must supply previous value. /// - public Change(ChangeReason reason, TKey key, TObject current, in Optional previous, int currentIndex = -1, int previousIndex = -1) + public Change(ChangeReason reason, TKey key, TObject current, in ReactiveUI.Primitives.Optional previous, int currentIndex = -1, int previousIndex = -1) : this() { Current = current; @@ -119,7 +123,7 @@ public Change(ChangeReason reason, TKey key, TObject current, in OptionalGets the item from before the change. /// This is only when is . /// - public Optional Previous { get; } + public ReactiveUI.Primitives.Optional Previous { get; } /// /// Gets the previous index. diff --git a/src/DynamicData/Cache/ChangeAwareCache.cs b/src/DynamicData/Cache/ChangeAwareCache.cs index e5a5fe80e..d05742b5b 100644 --- a/src/DynamicData/Cache/ChangeAwareCache.cs +++ b/src/DynamicData/Cache/ChangeAwareCache.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A cache which captures all changes which are made to it. These changes are recorded until CaptureChanges() at which point thw changes are cleared. @@ -138,7 +142,7 @@ public void Clone(IChangeSet changes) } /// - public Optional Lookup(TKey key) => _data.Lookup(key); + public ReactiveUI.Primitives.Optional Lookup(TKey key) => _data.Lookup(key); /// /// Raises an evaluate change for the specified keys. diff --git a/src/DynamicData/Cache/ChangeReason.cs b/src/DynamicData/Cache/ChangeReason.cs index 899295daa..aee9a5632 100644 --- a/src/DynamicData/Cache/ChangeReason.cs +++ b/src/DynamicData/Cache/ChangeReason.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// The reason for an individual change. diff --git a/src/DynamicData/Cache/ChangeSet.cs b/src/DynamicData/Cache/ChangeSet.cs index 01c65f5f9..870b67eef 100644 --- a/src/DynamicData/Cache/ChangeSet.cs +++ b/src/DynamicData/Cache/ChangeSet.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A collection of changes with some arbitrary additional context. diff --git a/src/DynamicData/Cache/DistinctChangeSet.cs b/src/DynamicData/Cache/DistinctChangeSet.cs index 0edd202a9..8f0fb7ad4 100644 --- a/src/DynamicData/Cache/DistinctChangeSet.cs +++ b/src/DynamicData/Cache/DistinctChangeSet.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal sealed class DistinctChangeSet : ChangeSet, IDistinctChangeSet where T : notnull diff --git a/src/DynamicData/Cache/GroupChangeSet.cs b/src/DynamicData/Cache/GroupChangeSet.cs index 43127e584..f223434bf 100644 --- a/src/DynamicData/Cache/GroupChangeSet.cs +++ b/src/DynamicData/Cache/GroupChangeSet.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal sealed class GroupChangeSet : ChangeSet, TGroupKey>, IGroupChangeSet where TObject : notnull diff --git a/src/DynamicData/Cache/ICache.cs b/src/DynamicData/Cache/ICache.cs index b7335b4c3..135e2de93 100644 --- a/src/DynamicData/Cache/ICache.cs +++ b/src/DynamicData/Cache/ICache.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A cache which captures all changes which are made to it. These changes are recorded until CaptureChanges() at which point thw changes are cleared. diff --git a/src/DynamicData/Cache/ICacheUpdater.cs b/src/DynamicData/Cache/ICacheUpdater.cs index aaeefc725..0ecdef96a 100644 --- a/src/DynamicData/Cache/ICacheUpdater.cs +++ b/src/DynamicData/Cache/ICacheUpdater.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Api for updating an intermediate cache. diff --git a/src/DynamicData/Cache/IChangeSet.cs b/src/DynamicData/Cache/IChangeSet.cs index 59301f394..45487fe74 100644 --- a/src/DynamicData/Cache/IChangeSet.cs +++ b/src/DynamicData/Cache/IChangeSet.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A collection of changes with some arbitrary additional context. diff --git a/src/DynamicData/Cache/IChangeSetAdaptor.cs b/src/DynamicData/Cache/IChangeSetAdaptor.cs index 454395795..de974a3da 100644 --- a/src/DynamicData/Cache/IChangeSetAdaptor.cs +++ b/src/DynamicData/Cache/IChangeSetAdaptor.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A simple adaptor to inject side effects into a change set observable. diff --git a/src/DynamicData/Cache/IConnectableCache.cs b/src/DynamicData/Cache/IConnectableCache.cs index 7663c0e83..4165fe54e 100644 --- a/src/DynamicData/Cache/IConnectableCache.cs +++ b/src/DynamicData/Cache/IConnectableCache.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A cache for observing and querying in memory data. diff --git a/src/DynamicData/Cache/IDistinctChangeSet.cs b/src/DynamicData/Cache/IDistinctChangeSet.cs index 1410ab6d8..1a2d27e0a 100644 --- a/src/DynamicData/Cache/IDistinctChangeSet.cs +++ b/src/DynamicData/Cache/IDistinctChangeSet.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A collection of distinct value updates. diff --git a/src/DynamicData/Cache/IGroup.cs b/src/DynamicData/Cache/IGroup.cs index 431b79c13..5974fc985 100644 --- a/src/DynamicData/Cache/IGroup.cs +++ b/src/DynamicData/Cache/IGroup.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// An update stream which has been grouped by a common key. diff --git a/src/DynamicData/Cache/IGroupChangeSet.cs b/src/DynamicData/Cache/IGroupChangeSet.cs index e9a9d1f29..5375666c1 100644 --- a/src/DynamicData/Cache/IGroupChangeSet.cs +++ b/src/DynamicData/Cache/IGroupChangeSet.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A grouped change set. diff --git a/src/DynamicData/Cache/IGrouping.cs b/src/DynamicData/Cache/IGrouping.cs index 4d17531ac..4a73f282a 100644 --- a/src/DynamicData/Cache/IGrouping.cs +++ b/src/DynamicData/Cache/IGrouping.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Represents a group which provides an update after any value within the group changes. @@ -50,5 +54,5 @@ public interface IGrouping /// /// The key. /// The value that is looked up. - Optional Lookup(TKey key); + ReactiveUI.Primitives.Optional Lookup(TKey key); } diff --git a/src/DynamicData/Cache/IImmutableGroupChangeSet.cs b/src/DynamicData/Cache/IImmutableGroupChangeSet.cs index 7cfdc789c..52f9c8738 100644 --- a/src/DynamicData/Cache/IImmutableGroupChangeSet.cs +++ b/src/DynamicData/Cache/IImmutableGroupChangeSet.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A grouped update collection. diff --git a/src/DynamicData/Cache/IIntermediateCache.cs b/src/DynamicData/Cache/IIntermediateCache.cs index 7ca604be0..47ce7c1d4 100644 --- a/src/DynamicData/Cache/IIntermediateCache.cs +++ b/src/DynamicData/Cache/IIntermediateCache.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// An observable cache which exposes an update API. diff --git a/src/DynamicData/Cache/IKey.cs b/src/DynamicData/Cache/IKey.cs index eb7b2e351..6d027c60b 100644 --- a/src/DynamicData/Cache/IKey.cs +++ b/src/DynamicData/Cache/IKey.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Represents the key of an object. diff --git a/src/DynamicData/Cache/IKeyValue.cs b/src/DynamicData/Cache/IKeyValue.cs index 9782c0001..a2158f5d4 100644 --- a/src/DynamicData/Cache/IKeyValue.cs +++ b/src/DynamicData/Cache/IKeyValue.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A keyed value. diff --git a/src/DynamicData/Cache/IKeyValueCollection.cs b/src/DynamicData/Cache/IKeyValueCollection.cs index 41314fc55..f8e6afa4d 100644 --- a/src/DynamicData/Cache/IKeyValueCollection.cs +++ b/src/DynamicData/Cache/IKeyValueCollection.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A key collection which contains sorting information. diff --git a/src/DynamicData/Cache/IObservableCache.cs b/src/DynamicData/Cache/IObservableCache.cs index 8897962a6..68193c804 100644 --- a/src/DynamicData/Cache/IObservableCache.cs +++ b/src/DynamicData/Cache/IObservableCache.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A cache for observing and querying in memory data. With additional data access operators. @@ -42,5 +46,5 @@ public interface IObservableCache : IConnectableCache /// The key. /// An optional with the looked up value. - Optional Lookup(TKey key); + ReactiveUI.Primitives.Optional Lookup(TKey key); } diff --git a/src/DynamicData/Cache/IPageRequest.cs b/src/DynamicData/Cache/IPageRequest.cs index 4d5b06956..b2a4d6d0d 100644 --- a/src/DynamicData/Cache/IPageRequest.cs +++ b/src/DynamicData/Cache/IPageRequest.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Represents a new page request. diff --git a/src/DynamicData/Cache/IPageResponse.cs b/src/DynamicData/Cache/IPageResponse.cs index c92011c3d..78e4cfaa3 100644 --- a/src/DynamicData/Cache/IPageResponse.cs +++ b/src/DynamicData/Cache/IPageResponse.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Operators; +#else namespace DynamicData.Operators; +#endif /// /// Response from the pagination operator. diff --git a/src/DynamicData/Cache/IPagedChangeSet.cs b/src/DynamicData/Cache/IPagedChangeSet.cs index 4fd88a798..7001c593e 100644 --- a/src/DynamicData/Cache/IPagedChangeSet.cs +++ b/src/DynamicData/Cache/IPagedChangeSet.cs @@ -1,11 +1,20 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Operators; +#else using DynamicData.Operators; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A paged update collection. diff --git a/src/DynamicData/Cache/IQuery.cs b/src/DynamicData/Cache/IQuery.cs index 4f071c272..c14a069c0 100644 --- a/src/DynamicData/Cache/IQuery.cs +++ b/src/DynamicData/Cache/IQuery.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Exposes internal cache state to enable querying. @@ -44,5 +48,5 @@ public interface IQuery /// /// The key. /// The looked up value. - Optional Lookup(TKey key); + ReactiveUI.Primitives.Optional Lookup(TKey key); } diff --git a/src/DynamicData/Cache/ISortedChangeSet.cs b/src/DynamicData/Cache/ISortedChangeSet.cs index 8379f4992..682564be1 100644 --- a/src/DynamicData/Cache/ISortedChangeSet.cs +++ b/src/DynamicData/Cache/ISortedChangeSet.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// An update collection as per the system convention additionally providing a sorted set of the underling state. diff --git a/src/DynamicData/Cache/ISortedChangeSetAdaptor.cs b/src/DynamicData/Cache/ISortedChangeSetAdaptor.cs index 0e904cf22..bbdb108e7 100644 --- a/src/DynamicData/Cache/ISortedChangeSetAdaptor.cs +++ b/src/DynamicData/Cache/ISortedChangeSetAdaptor.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A simple adaptor to inject side effects into a sorted change set observable. diff --git a/src/DynamicData/Cache/ISourceCache.cs b/src/DynamicData/Cache/ISourceCache.cs index a24d693ed..011c9a4d7 100644 --- a/src/DynamicData/Cache/ISourceCache.cs +++ b/src/DynamicData/Cache/ISourceCache.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// An observable cache which exposes an update API. Used at the root diff --git a/src/DynamicData/Cache/ISourceUpdater.cs b/src/DynamicData/Cache/ISourceUpdater.cs index 10eb71f22..7e0e7383c 100644 --- a/src/DynamicData/Cache/ISourceUpdater.cs +++ b/src/DynamicData/Cache/ISourceUpdater.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// API for updating a source cache. diff --git a/src/DynamicData/Cache/IVirtualChangeSet.cs b/src/DynamicData/Cache/IVirtualChangeSet.cs index 4c86cbce7..d02c85929 100644 --- a/src/DynamicData/Cache/IVirtualChangeSet.cs +++ b/src/DynamicData/Cache/IVirtualChangeSet.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Represents a subset of data reduced by a defined set of parameters. diff --git a/src/DynamicData/Cache/IVirtualRequest.cs b/src/DynamicData/Cache/IVirtualRequest.cs index cdbee1ee5..e47c05c58 100644 --- a/src/DynamicData/Cache/IVirtualRequest.cs +++ b/src/DynamicData/Cache/IVirtualRequest.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A request to virtualise a stream. diff --git a/src/DynamicData/Cache/IVirtualResponse.cs b/src/DynamicData/Cache/IVirtualResponse.cs index 616e2fb11..422f7af77 100644 --- a/src/DynamicData/Cache/IVirtualResponse.cs +++ b/src/DynamicData/Cache/IVirtualResponse.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Defines values used to virtualise the result set. diff --git a/src/DynamicData/Cache/IndexedItem.cs b/src/DynamicData/Cache/IndexedItem.cs index 7b5c77511..2442640ae 100644 --- a/src/DynamicData/Cache/IndexedItem.cs +++ b/src/DynamicData/Cache/IndexedItem.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// An item with it's index. diff --git a/src/DynamicData/Cache/IntermediateCache.cs b/src/DynamicData/Cache/IntermediateCache.cs index fb67fb81b..522025f41 100644 --- a/src/DynamicData/Cache/IntermediateCache.cs +++ b/src/DynamicData/Cache/IntermediateCache.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Cache designed to be used for custom operator construction. It requires no key to be specified @@ -64,7 +72,7 @@ public IObservable> Connect(Func? predi public void Edit(Action> updateAction) => _innerCache.UpdateFromIntermediate(updateAction); /// - public Optional Lookup(TKey key) => _innerCache.Lookup(key); + public ReactiveUI.Primitives.Optional Lookup(TKey key) => _innerCache.Lookup(key); /// public IObservable> Preview(Func? predicate = null) diff --git a/src/DynamicData/Cache/Internal/AbstractFilter.cs b/src/DynamicData/Cache/Internal/AbstractFilter.cs index 3e2b5ea2f..1e7a38028 100644 --- a/src/DynamicData/Cache/Internal/AbstractFilter.cs +++ b/src/DynamicData/Cache/Internal/AbstractFilter.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal abstract class AbstractFilter : IFilter where TObject : notnull @@ -24,7 +29,7 @@ public IChangeSet Refresh(IEnumerable { // this is an internal method only so we can be sure there are no duplicate keys in the result // (therefore safe to parallelise) - Optional> Factory(KeyValuePair kv) + ReactiveUI.Primitives.Optional> Factory(KeyValuePair kv) { var existing = _cache.Lookup(kv.Key); var matches = Filter(kv.Value); @@ -41,7 +46,7 @@ Optional> Factory(KeyValuePair kv) return new Change(ChangeReason.Remove, kv.Key, kv.Value, existing); } - return Optional>.None; + return ReactiveUI.Primitives.Optional>.None; } var result = Refresh(items, Factory); @@ -58,7 +63,7 @@ public IChangeSet Update(IChangeSet updates) protected abstract IEnumerable GetChangesWithFilter(ChangeSet updates); - protected abstract IEnumerable> Refresh(IEnumerable> items, Func, Optional>> factory); + protected abstract IEnumerable> Refresh(IEnumerable> items, Func, ReactiveUI.Primitives.Optional>> factory); private ChangeSet ProcessResult(IEnumerable source) { diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index f4dbc53ad..224e33bd7 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif [DebuggerDisplay("AnonymousObservableCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] internal sealed class AnonymousObservableCache : IObservableCache @@ -45,7 +50,7 @@ public AnonymousObservableCache(IObservableCache cache) public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => _cache.Connect(predicate, suppressEmptyChangeSets); - public Optional Lookup(TKey key) => _cache.Lookup(key); + public ReactiveUI.Primitives.Optional Lookup(TKey key) => _cache.Lookup(key); public IObservable> Preview(Func? predicate = null) => _cache.Preview(predicate); diff --git a/src/DynamicData/Cache/Internal/AnonymousQuery.cs b/src/DynamicData/Cache/Internal/AnonymousQuery.cs index f83fd2018..35f88cfb5 100644 --- a/src/DynamicData/Cache/Internal/AnonymousQuery.cs +++ b/src/DynamicData/Cache/Internal/AnonymousQuery.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class AnonymousQuery(Cache cache) : IQuery where TObject : notnull @@ -18,5 +23,5 @@ internal sealed class AnonymousQuery(Cache cache) public IEnumerable> KeyValues => _cache.KeyValues; - public Optional Lookup(TKey key) => _cache.Lookup(key); + public ReactiveUI.Primitives.Optional Lookup(TKey key) => _cache.Lookup(key); } diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index e59488317..ae92cac5e 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif #if SUPPORTS_ASYNC_DISPOSABLE internal static class AsyncDisposeMany diff --git a/src/DynamicData/Cache/Internal/AutoRefresh.cs b/src/DynamicData/Cache/Internal/AutoRefresh.cs index 55c5e725b..176dd9bb3 100644 --- a/src/DynamicData/Cache/Internal/AutoRefresh.cs +++ b/src/DynamicData/Cache/Internal/AutoRefresh.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class AutoRefresh(IObservable> source, Func> reEvaluator, TimeSpan? buffer = null, IScheduler? scheduler = null) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/BatchIf.cs b/src/DynamicData/Cache/Internal/BatchIf.cs index ae204bded..1da3ea31a 100644 --- a/src/DynamicData/Cache/Internal/BatchIf.cs +++ b/src/DynamicData/Cache/Internal/BatchIf.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class BatchIf(IObservable> source, IObservable pauseIfTrueSelector, TimeSpan? timeOut, bool initialPauseState = false, IObservable? intervalTimer = null, IScheduler? scheduler = null) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/Cache.cs b/src/DynamicData/Cache/Internal/Cache.cs index 1cc599dc2..f0398072a 100644 --- a/src/DynamicData/Cache/Internal/Cache.cs +++ b/src/DynamicData/Cache/Internal/Cache.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif [DebuggerDisplay("Cache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] internal sealed class Cache : ICache @@ -57,7 +62,7 @@ public void Clone(IChangeSet changes) } } - public Optional Lookup(TKey key) => _data.Lookup(key); + public ReactiveUI.Primitives.Optional Lookup(TKey key) => _data.Lookup(key); /// /// Sends a signal for operators to recalculate it's state. diff --git a/src/DynamicData/Cache/Internal/CacheEx.cs b/src/DynamicData/Cache/Internal/CacheEx.cs index 8250f168e..2831fa34b 100644 --- a/src/DynamicData/Cache/Internal/CacheEx.cs +++ b/src/DynamicData/Cache/Internal/CacheEx.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static class CacheEx { diff --git a/src/DynamicData/Cache/Internal/CacheUpdater.cs b/src/DynamicData/Cache/Internal/CacheUpdater.cs index bf5b415e5..3926dfc13 100644 --- a/src/DynamicData/Cache/Internal/CacheUpdater.cs +++ b/src/DynamicData/Cache/Internal/CacheUpdater.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class CacheUpdater : ISourceUpdater where TObject : notnull @@ -196,13 +201,13 @@ public void Load(IEnumerable items) AddOrUpdate(items); } - public Optional Lookup(TKey key) + public ReactiveUI.Primitives.Optional Lookup(TKey key) { var item = _cache.Lookup(key); - return item.HasValue ? item.Value : Optional.None; + return item.HasValue ? item.Value : ReactiveUI.Primitives.Optional.None; } - public Optional Lookup(TObject item) + public ReactiveUI.Primitives.Optional Lookup(TObject item) { if (_keySelector is null) { diff --git a/src/DynamicData/Cache/Internal/Cast.cs b/src/DynamicData/Cache/Internal/Cast.cs index 3b5f62c8e..ca5daecb4 100644 --- a/src/DynamicData/Cache/Internal/Cast.cs +++ b/src/DynamicData/Cache/Internal/Cast.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class Cast(IObservable> source, Func converter) where TSource : notnull diff --git a/src/DynamicData/Cache/Internal/ChangeSetCache.cs b/src/DynamicData/Cache/Internal/ChangeSetCache.cs index 5a3defe00..4aa01912c 100644 --- a/src/DynamicData/Cache/Internal/ChangeSetCache.cs +++ b/src/DynamicData/Cache/Internal/ChangeSetCache.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// Wraps an Observable ChangeSet while maintaining a copy of the aggregated changes. diff --git a/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs b/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs index f0d804f13..5b797fb92 100644 --- a/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs +++ b/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class ChangeSetMergeTracker(Func>> selectCaches, IComparer? comparer, IEqualityComparer? equalityComparer) where TObject : notnull @@ -141,7 +146,7 @@ private void OnItemRemoved(ChangeSetCache[] sourceCaches, TObject } } - private void OnItemUpdated(ChangeSetCache[] sources, TObject item, TKey key, in Optional prev) + private void OnItemUpdated(ChangeSetCache[] sources, TObject item, TKey key, in ReactiveUI.Primitives.Optional prev) { var cached = _resultCache.Lookup(key); @@ -219,7 +224,7 @@ private void ForceEvaluate(ChangeSetCache[] sources, TKey key) UpdateToBestValue(sources, key, cached); } - private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key, in Optional current) + private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key, in ReactiveUI.Primitives.Optional current) { // Determine which value should be the one seen downstream var candidate = LookupBestValue(sources, key); @@ -248,11 +253,11 @@ private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key return true; } - private Optional LookupBestValue(ChangeSetCache[] sources, TKey key) + private ReactiveUI.Primitives.Optional LookupBestValue(ChangeSetCache[] sources, TKey key) { if (sources.Length == 0) { - return Optional.None; + return ReactiveUI.Primitives.Optional.None; } var values = sources.Select(s => s.Cache.Lookup(key)).Where(opt => opt.HasValue); diff --git a/src/DynamicData/Cache/Internal/CombineOperator.cs b/src/DynamicData/Cache/Internal/CombineOperator.cs index 9bba3dd38..e382a7ab8 100644 --- a/src/DynamicData/Cache/Internal/CombineOperator.cs +++ b/src/DynamicData/Cache/Internal/CombineOperator.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// How the multiple streams are combinedL. diff --git a/src/DynamicData/Cache/Internal/Combiner.cs b/src/DynamicData/Cache/Internal/Combiner.cs index ff7de18f5..ba14195cd 100644 --- a/src/DynamicData/Cache/Internal/Combiner.cs +++ b/src/DynamicData/Cache/Internal/Combiner.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// Combines multiple caches using logical operators. diff --git a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs index ca396c067..7abc790f9 100644 --- a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class DeferUntilLoaded where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/DictionaryExtensions.cs b/src/DynamicData/Cache/Internal/DictionaryExtensions.cs index d8d9f27ea..b921fd116 100644 --- a/src/DynamicData/Cache/Internal/DictionaryExtensions.cs +++ b/src/DynamicData/Cache/Internal/DictionaryExtensions.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static class DictionaryExtensions { diff --git a/src/DynamicData/Cache/Internal/DisposeMany.cs b/src/DynamicData/Cache/Internal/DisposeMany.cs index f10cdfd35..90bac3f00 100644 --- a/src/DynamicData/Cache/Internal/DisposeMany.cs +++ b/src/DynamicData/Cache/Internal/DisposeMany.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class DisposeMany(IObservable> source) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/DistinctCalculator.cs b/src/DynamicData/Cache/Internal/DistinctCalculator.cs index 33ed4a913..98b748230 100644 --- a/src/DynamicData/Cache/Internal/DistinctCalculator.cs +++ b/src/DynamicData/Cache/Internal/DistinctCalculator.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class DistinctCalculator(IObservable> source, Func valueSelector) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/DynamicCombiner.cs b/src/DynamicData/Cache/Internal/DynamicCombiner.cs index df8fafcd5..8fd3c85d0 100644 --- a/src/DynamicData/Cache/Internal/DynamicCombiner.cs +++ b/src/DynamicData/Cache/Internal/DynamicCombiner.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class DynamicCombiner(IObservableList>> source, CombineOperator type) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/DynamicGrouper.cs b/src/DynamicData/Cache/Internal/DynamicGrouper.cs index ede740ddc..8c7277624 100644 --- a/src/DynamicData/Cache/Internal/DynamicGrouper.cs +++ b/src/DynamicData/Cache/Internal/DynamicGrouper.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class DynamicGrouper(Func? groupSelector = null) : IDisposable where TObject : notnull @@ -178,7 +183,7 @@ public void Dispose() _groupCache.Items.ForEach(group => (group as ManagedGroup)?.Dispose()); } - private static void PerformGroupRefresh(TKey key, in Optional> optionalGroup, SuspendTracker? suspendTracker = null) + private static void PerformGroupRefresh(TKey key, in ReactiveUI.Primitives.Optional> optionalGroup, SuspendTracker? suspendTracker = null) { if (optionalGroup.HasValue) { @@ -191,10 +196,10 @@ private static void PerformGroupRefresh(TKey key, in Optional> LookupGroup(TKey key) => + private ReactiveUI.Primitives.Optional> LookupGroup(TKey key) => _groupKeys.Lookup(key).Convert(LookupGroup); - private Optional> LookupGroup(TGroupKey groupKey) => + private ReactiveUI.Primitives.Optional> LookupGroup(TGroupKey groupKey) => _groupCache.Lookup(groupKey).Convert(static grp => (grp as ManagedGroup)!); private ManagedGroup GetOrAddGroup(TGroupKey groupKey) => diff --git a/src/DynamicData/Cache/Internal/EditDiff.cs b/src/DynamicData/Cache/Internal/EditDiff.cs index ba6679d03..b1a4c4576 100644 --- a/src/DynamicData/Cache/Internal/EditDiff.cs +++ b/src/DynamicData/Cache/Internal/EditDiff.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class EditDiff(ISourceCache source, Func areEqual) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/EditDiffChangeSet.cs b/src/DynamicData/Cache/Internal/EditDiffChangeSet.cs index b363a9505..22bbc48f9 100644 --- a/src/DynamicData/Cache/Internal/EditDiffChangeSet.cs +++ b/src/DynamicData/Cache/Internal/EditDiffChangeSet.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class EditDiffChangeSet(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs index 2966a446b..67c7db55a 100644 --- a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs +++ b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs @@ -1,14 +1,19 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif -internal sealed class EditDiffChangeSetOptional(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) +internal sealed class EditDiffChangeSetOptional(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) where TObject : notnull where TKey : notnull { - private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); private readonly IEqualityComparer _equalityComparer = equalityComparer ?? EqualityComparer.Default; @@ -16,7 +21,7 @@ internal sealed class EditDiffChangeSetOptional(IObservable> Run() => Observable.Create>(observer => { - var previous = Optional.None; + var previous = ReactiveUI.Primitives.Optional.None; return _source.Synchronize().Subscribe( nextValue => diff --git a/src/DynamicData/Cache/Internal/ExpirableItem.cs b/src/DynamicData/Cache/Internal/ExpirableItem.cs index 87714e917..4e77daa5b 100644 --- a/src/DynamicData/Cache/Internal/ExpirableItem.cs +++ b/src/DynamicData/Cache/Internal/ExpirableItem.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal readonly record struct ExpirableItem(TObject Value, TKey Key, DateTime ExpireAt, long Index = 0) { diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs index f38c36f95..7fdc53ce6 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static partial class ExpireAfter { diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs index 81a587ce6..8d2afefe8 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static partial class ExpireAfter { diff --git a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs index 976cd245a..0719ec2bb 100644 --- a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static partial class Filter { diff --git a/src/DynamicData/Cache/Internal/Filter.Static.cs b/src/DynamicData/Cache/Internal/Filter.Static.cs index 2791affbb..679a243eb 100644 --- a/src/DynamicData/Cache/Internal/Filter.Static.cs +++ b/src/DynamicData/Cache/Internal/Filter.Static.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static partial class Filter { diff --git a/src/DynamicData/Cache/Internal/FilterEx.cs b/src/DynamicData/Cache/Internal/FilterEx.cs index f21c493e9..85b7fdb84 100644 --- a/src/DynamicData/Cache/Internal/FilterEx.cs +++ b/src/DynamicData/Cache/Internal/FilterEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static class FilterEx { diff --git a/src/DynamicData/Cache/Internal/FilterImmutable.cs b/src/DynamicData/Cache/Internal/FilterImmutable.cs index 466d83aa7..1219ea375 100644 --- a/src/DynamicData/Cache/Internal/FilterImmutable.cs +++ b/src/DynamicData/Cache/Internal/FilterImmutable.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class FilterImmutable where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/FilterOnObservable.cs b/src/DynamicData/Cache/Internal/FilterOnObservable.cs index de3d20cf9..78987c41b 100644 --- a/src/DynamicData/Cache/Internal/FilterOnObservable.cs +++ b/src/DynamicData/Cache/Internal/FilterOnObservable.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class FilterOnObservable(IObservable> source, Func> filterFactory, TimeSpan? buffer = null, IScheduler? scheduler = null) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/FilteredIndexCalculator.cs b/src/DynamicData/Cache/Internal/FilteredIndexCalculator.cs index c8ed437e0..bbfa7879f 100644 --- a/src/DynamicData/Cache/Internal/FilteredIndexCalculator.cs +++ b/src/DynamicData/Cache/Internal/FilteredIndexCalculator.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static class FilteredIndexCalculator where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/FinallySafe.cs b/src/DynamicData/Cache/Internal/FinallySafe.cs index 577d42c32..2ef71658c 100644 --- a/src/DynamicData/Cache/Internal/FinallySafe.cs +++ b/src/DynamicData/Cache/Internal/FinallySafe.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class FinallySafe(IObservable source, Action finallyAction) { diff --git a/src/DynamicData/Cache/Internal/FullJoin.cs b/src/DynamicData/Cache/Internal/FullJoin.cs index 5666930aa..a8e484fef 100644 --- a/src/DynamicData/Cache/Internal/FullJoin.cs +++ b/src/DynamicData/Cache/Internal/FullJoin.cs @@ -1,10 +1,15 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif -internal sealed class FullJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) +internal sealed class FullJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, ReactiveUI.Primitives.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +18,7 @@ internal sealed class FullJoin { private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, Optional, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, ReactiveUI.Primitives.Optional, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); @@ -56,7 +61,7 @@ public IObservable> Run() => Observable.Creat else { // update with no left value - joinedCache.AddOrUpdate(_resultSelector(change.Key, Optional.None, rightLookup), change.Key); + joinedCache.AddOrUpdate(_resultSelector(change.Key, ReactiveUI.Primitives.Optional.None, rightLookup), change.Key); } break; @@ -98,7 +103,7 @@ public IObservable> Run() => Observable.Creat else { // update with no right value - joinedCache.AddOrUpdate(_resultSelector(change.Key, left, Optional.None), change.Key); + joinedCache.AddOrUpdate(_resultSelector(change.Key, left, ReactiveUI.Primitives.Optional.None), change.Key); } } diff --git a/src/DynamicData/Cache/Internal/FullJoinMany.cs b/src/DynamicData/Cache/Internal/FullJoinMany.cs index 28ae5a008..cbf095fba 100644 --- a/src/DynamicData/Cache/Internal/FullJoinMany.cs +++ b/src/DynamicData/Cache/Internal/FullJoinMany.cs @@ -1,10 +1,15 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif -internal sealed class FullJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) +internal sealed class FullJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +18,7 @@ internal sealed class FullJoinMany> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); diff --git a/src/DynamicData/Cache/Internal/GroupOn.cs b/src/DynamicData/Cache/Internal/GroupOn.cs index 98982946c..9e7140aff 100644 --- a/src/DynamicData/Cache/Internal/GroupOn.cs +++ b/src/DynamicData/Cache/Internal/GroupOn.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class GroupOn(IObservable> source, Func groupSelectorKey, IObservable? regrouper) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs index f89d1cc4e..b82ebfa80 100644 --- a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs +++ b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class GroupOnDynamic(IObservable> source, IObservable> selectGroupObservable, IObservable? regrouper = null) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/GroupOnImmutable.cs b/src/DynamicData/Cache/Internal/GroupOnImmutable.cs index 2700e4f6c..b210dc1d2 100644 --- a/src/DynamicData/Cache/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/Cache/Internal/GroupOnImmutable.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class GroupOnImmutable(IObservable> source, Func groupSelectorKey, IObservable? regrouper) where TObject : notnull @@ -74,7 +79,7 @@ private ImmutableGroupChangeSet CreateChangeSet(IDicti } else { - var previousState = Optional.Some(initialGroup.Value); + var previousState = ReactiveUI.Primitives.Optional.Some(initialGroup.Value); result.Add(new Change, TGroupKey>(ChangeReason.Update, key, currentState, previousState)); } } diff --git a/src/DynamicData/Cache/Internal/GroupOnObservable.cs b/src/DynamicData/Cache/Internal/GroupOnObservable.cs index 4ec36814f..314b8c7cd 100644 --- a/src/DynamicData/Cache/Internal/GroupOnObservable.cs +++ b/src/DynamicData/Cache/Internal/GroupOnObservable.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class GroupOnObservable(IObservable> source, Func> selectGroup) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/GroupOnProperty.cs b/src/DynamicData/Cache/Internal/GroupOnProperty.cs index 36f87ac22..11e2efc86 100644 --- a/src/DynamicData/Cache/Internal/GroupOnProperty.cs +++ b/src/DynamicData/Cache/Internal/GroupOnProperty.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class GroupOnProperty(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged diff --git a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs index 95abc0298..a2957db97 100644 --- a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class GroupOnPropertyWithImmutableState(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged diff --git a/src/DynamicData/Cache/Internal/IFilter.cs b/src/DynamicData/Cache/Internal/IFilter.cs index 6301a0cfa..f7bb17058 100644 --- a/src/DynamicData/Cache/Internal/IFilter.cs +++ b/src/DynamicData/Cache/Internal/IFilter.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// Provides a filter. diff --git a/src/DynamicData/Cache/Internal/IKeySelector.cs b/src/DynamicData/Cache/Internal/IKeySelector.cs index 71c6e5aa9..d09206c72 100644 --- a/src/DynamicData/Cache/Internal/IKeySelector.cs +++ b/src/DynamicData/Cache/Internal/IKeySelector.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// Selects a key from a item. diff --git a/src/DynamicData/Cache/Internal/ImmutableGroup.cs b/src/DynamicData/Cache/Internal/ImmutableGroup.cs index 816ed6846..91e4a270a 100644 --- a/src/DynamicData/Cache/Internal/ImmutableGroup.cs +++ b/src/DynamicData/Cache/Internal/ImmutableGroup.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class ImmutableGroup : IGrouping, IEquatable> where TObject : notnull @@ -46,7 +51,7 @@ public bool Equals(ImmutableGroup? other) public override int GetHashCode() => EqualityComparer.Default.GetHashCode(Key); - public Optional Lookup(TKey key) => _cache.Lookup(key); + public ReactiveUI.Primitives.Optional Lookup(TKey key) => _cache.Lookup(key); public override string ToString() => $"Grouping for: {Key} ({Count} items)"; } diff --git a/src/DynamicData/Cache/Internal/ImmutableGroupChangeSet.cs b/src/DynamicData/Cache/Internal/ImmutableGroupChangeSet.cs index 81ebbc290..60700744c 100644 --- a/src/DynamicData/Cache/Internal/ImmutableGroupChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ImmutableGroupChangeSet.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class ImmutableGroupChangeSet : ChangeSet, TGroupKey>, IImmutableGroupChangeSet where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/IndexAndNode.cs b/src/DynamicData/Cache/Internal/IndexAndNode.cs index 0f2237a21..db348a6df 100644 --- a/src/DynamicData/Cache/Internal/IndexAndNode.cs +++ b/src/DynamicData/Cache/Internal/IndexAndNode.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static class IndexAndNode { diff --git a/src/DynamicData/Cache/Internal/IndexCalculator.cs b/src/DynamicData/Cache/Internal/IndexCalculator.cs index 709245408..0fa5899b9 100644 --- a/src/DynamicData/Cache/Internal/IndexCalculator.cs +++ b/src/DynamicData/Cache/Internal/IndexCalculator.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// Calculates a sequential change set. diff --git a/src/DynamicData/Cache/Internal/InnerJoin.cs b/src/DynamicData/Cache/Internal/InnerJoin.cs index 155526d04..bbeb6d711 100644 --- a/src/DynamicData/Cache/Internal/InnerJoin.cs +++ b/src/DynamicData/Cache/Internal/InnerJoin.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class InnerJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func<(TLeftKey leftKey, TRightKey rightKey), TLeft, TRight, TDestination> resultSelector) where TLeft : notnull diff --git a/src/DynamicData/Cache/Internal/InnerJoinMany.cs b/src/DynamicData/Cache/Internal/InnerJoinMany.cs index dcec95d86..0b1994762 100644 --- a/src/DynamicData/Cache/Internal/InnerJoinMany.cs +++ b/src/DynamicData/Cache/Internal/InnerJoinMany.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class InnerJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull diff --git a/src/DynamicData/Cache/Internal/KeyComparer.cs b/src/DynamicData/Cache/Internal/KeyComparer.cs index 6cc831558..df3b7ca10 100644 --- a/src/DynamicData/Cache/Internal/KeyComparer.cs +++ b/src/DynamicData/Cache/Internal/KeyComparer.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class KeyComparer : IEqualityComparer> { diff --git a/src/DynamicData/Cache/Internal/KeySelector.cs b/src/DynamicData/Cache/Internal/KeySelector.cs index 164d84caa..7d83f8097 100644 --- a/src/DynamicData/Cache/Internal/KeySelector.cs +++ b/src/DynamicData/Cache/Internal/KeySelector.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class KeySelector(Func keySelector) : IKeySelector { diff --git a/src/DynamicData/Cache/Internal/KeySelectorException.cs b/src/DynamicData/Cache/Internal/KeySelectorException.cs index 5a5fe737b..d539f5e58 100644 --- a/src/DynamicData/Cache/Internal/KeySelectorException.cs +++ b/src/DynamicData/Cache/Internal/KeySelectorException.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// An exception that happens when there is a problem with the key selector. diff --git a/src/DynamicData/Cache/Internal/KeyValueCollection.cs b/src/DynamicData/Cache/Internal/KeyValueCollection.cs index 614f7b49f..8a6a03947 100644 --- a/src/DynamicData/Cache/Internal/KeyValueCollection.cs +++ b/src/DynamicData/Cache/Internal/KeyValueCollection.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class KeyValueCollection : IKeyValueCollection { diff --git a/src/DynamicData/Cache/Internal/KeyValueComparer.cs b/src/DynamicData/Cache/Internal/KeyValueComparer.cs index b9f3face6..37a7e03dd 100644 --- a/src/DynamicData/Cache/Internal/KeyValueComparer.cs +++ b/src/DynamicData/Cache/Internal/KeyValueComparer.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class KeyValueComparer(IComparer? comparer = null) : IComparer> { diff --git a/src/DynamicData/Cache/Internal/LeftJoin.cs b/src/DynamicData/Cache/Internal/LeftJoin.cs index 55e39c2aa..0386031d5 100644 --- a/src/DynamicData/Cache/Internal/LeftJoin.cs +++ b/src/DynamicData/Cache/Internal/LeftJoin.cs @@ -1,10 +1,15 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif -internal sealed class LeftJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) +internal sealed class LeftJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +18,7 @@ internal sealed class LeftJoin { private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); @@ -89,7 +94,7 @@ public IObservable> Run() => Observable.Creat { var priorLeft = leftCache.Lookup(priorForeignKey); if (priorLeft.HasValue) - joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, Optional.None), priorForeignKey); + joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, ReactiveUI.Primitives.Optional.None), priorForeignKey); } if (left.HasValue) @@ -102,7 +107,7 @@ public IObservable> Run() => Observable.Creat case ChangeReason.Remove: if (left.HasValue) - joined.AddOrUpdate(_resultSelector(foreignKey, left.Value, Optional.None), foreignKey); + joined.AddOrUpdate(_resultSelector(foreignKey, left.Value, ReactiveUI.Primitives.Optional.None), foreignKey); rightForeignKeysByKey.Remove(change.Key); @@ -115,7 +120,7 @@ public IObservable> Run() => Observable.Creat { var priorLeft = leftCache.Lookup(priorForeignKey); if (priorLeft.HasValue) - joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, Optional.None), priorForeignKey); + joined.AddOrUpdate(_resultSelector(priorForeignKey, priorLeft.Value, ReactiveUI.Primitives.Optional.None), priorForeignKey); if (left.HasValue) joined.AddOrUpdate(_resultSelector(foreignKey, left.Value, right), foreignKey); diff --git a/src/DynamicData/Cache/Internal/LeftJoinMany.cs b/src/DynamicData/Cache/Internal/LeftJoinMany.cs index 8ce0b1f06..bc321b643 100644 --- a/src/DynamicData/Cache/Internal/LeftJoinMany.cs +++ b/src/DynamicData/Cache/Internal/LeftJoinMany.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class LeftJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull diff --git a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs index 594325bb9..abf271529 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// An observable cache which exposes an update API. Used at the root @@ -131,7 +136,7 @@ public void Edit(Action> editAction) /// /// Fast indexed lookup. /// - public Optional Lookup(TKey key) => _innerCache.Lookup(key); + public ReactiveUI.Primitives.Optional Lookup(TKey key) => _innerCache.Lookup(key); /// public IObservable> Preview(Func? predicate = null) => predicate is null ? _changesPreview : _changesPreview.Filter(predicate); diff --git a/src/DynamicData/Cache/Internal/ManagedGroup.cs b/src/DynamicData/Cache/Internal/ManagedGroup.cs index 02d3583fa..f573190d2 100644 --- a/src/DynamicData/Cache/Internal/ManagedGroup.cs +++ b/src/DynamicData/Cache/Internal/ManagedGroup.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class ManagedGroup(TGroupKey groupKey) : IGroup, IDisposable where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/MergeChangeSets.cs b/src/DynamicData/Cache/Internal/MergeChangeSets.cs index d6d5d15f9..05192616e 100644 --- a/src/DynamicData/Cache/Internal/MergeChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeChangeSets.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// Operator that is similiar to Merge but intelligently handles Cache ChangeSets. diff --git a/src/DynamicData/Cache/Internal/MergeMany.cs b/src/DynamicData/Cache/Internal/MergeMany.cs index 762a4d1a3..048edd21f 100644 --- a/src/DynamicData/Cache/Internal/MergeMany.cs +++ b/src/DynamicData/Cache/Internal/MergeMany.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class MergeMany where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs index ad8794392..e786ba2db 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// Operator that is similiar to MergeMany but intelligently handles Cache ChangeSets. diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs index a8875e776..7e6238826 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// Alternate version of MergeManyCacheChangeSets that uses a Comparer of the source, not the destination type diff --git a/src/DynamicData/Cache/Internal/MergeManyItems.cs b/src/DynamicData/Cache/Internal/MergeManyItems.cs index c815e4774..3cf5a75b5 100644 --- a/src/DynamicData/Cache/Internal/MergeManyItems.cs +++ b/src/DynamicData/Cache/Internal/MergeManyItems.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class MergeManyItems where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs index 801e96c3c..56987292c 100644 --- a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// /// Operator that is similiar to MergeMany but intelligently handles List ChangeSets. diff --git a/src/DynamicData/Cache/Internal/ObservableWithValue.cs b/src/DynamicData/Cache/Internal/ObservableWithValue.cs index 59baa2bd6..09626adf3 100644 --- a/src/DynamicData/Cache/Internal/ObservableWithValue.cs +++ b/src/DynamicData/Cache/Internal/ObservableWithValue.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class ObservableWithValue where TValue : notnull @@ -15,7 +20,7 @@ public ObservableWithValue(TObject item, IObservable source) public TObject Item { get; } - public Optional LatestValue { get; private set; } = Optional.None; + public ReactiveUI.Primitives.Optional LatestValue { get; private set; } = ReactiveUI.Primitives.Optional.None; public IObservable Observable { get; } } diff --git a/src/DynamicData/Cache/Internal/OfType.cs b/src/DynamicData/Cache/Internal/OfType.cs index d5fbdb828..f3192d364 100644 --- a/src/DynamicData/Cache/Internal/OfType.cs +++ b/src/DynamicData/Cache/Internal/OfType.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class OfType(IObservable> source, bool suppressEmptyChangeSets) where TObject : notnull @@ -36,7 +41,7 @@ public IObservable> Run() => // For any other change reason, if the Current is the right type, forward with converted types (_, TDestination otherDestination) => - new(change.Reason, change.Key, otherDestination, change.Previous.HasValue && change.Previous.Value is TDestination pd ? Optional.Some(pd) : default), + new(change.Reason, change.Key, otherDestination, change.Previous.HasValue && change.Previous.Value is TDestination pd ? ReactiveUI.Primitives.Optional.Some(pd) : default), // Otherwise, don't do anything at all _ => default, diff --git a/src/DynamicData/Cache/Internal/OnBeingRemoved.cs b/src/DynamicData/Cache/Internal/OnBeingRemoved.cs index 148b94fec..0c47a65a5 100644 --- a/src/DynamicData/Cache/Internal/OnBeingRemoved.cs +++ b/src/DynamicData/Cache/Internal/OnBeingRemoved.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class OnBeingRemoved(IObservable> source, Action removeAction) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/Page.cs b/src/DynamicData/Cache/Internal/Page.cs index f172f33f7..4c4706a1b 100644 --- a/src/DynamicData/Cache/Internal/Page.cs +++ b/src/DynamicData/Cache/Internal/Page.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class Page(IObservable> source, IObservable pageRequests) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs index e5ea2ffdd..778ac6f5f 100644 --- a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class QueryWhenChanged(IObservable> source, Func>? itemChangedTrigger = null) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/ReaderWriter.cs b/src/DynamicData/Cache/Internal/ReaderWriter.cs index feb53f96f..41b3b3cac 100644 --- a/src/DynamicData/Cache/Internal/ReaderWriter.cs +++ b/src/DynamicData/Cache/Internal/ReaderWriter.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class ReaderWriter(Func? keySelector = null) where TObject : notnull @@ -83,7 +88,7 @@ public ChangeSet GetInitialUpdates(Func? filter = } } - public Optional Lookup(TKey key) + public ReactiveUI.Primitives.Optional Lookup(TKey key) { lock (_locker) { diff --git a/src/DynamicData/Cache/Internal/RefCount.cs b/src/DynamicData/Cache/Internal/RefCount.cs index 49f246d2d..3cad3f23b 100644 --- a/src/DynamicData/Cache/Internal/RefCount.cs +++ b/src/DynamicData/Cache/Internal/RefCount.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class RefCount(IObservable> source) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs b/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs index 1194f5ef2..3beb0c7f9 100644 --- a/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs +++ b/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /// Initializes a new instance of the class.Converts a to . /// The change set with a key. diff --git a/src/DynamicData/Cache/Internal/RightJoin.cs b/src/DynamicData/Cache/Internal/RightJoin.cs index 26bc89128..621b65f50 100644 --- a/src/DynamicData/Cache/Internal/RightJoin.cs +++ b/src/DynamicData/Cache/Internal/RightJoin.cs @@ -1,10 +1,15 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif -internal sealed class RightJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) +internal sealed class RightJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +18,7 @@ internal sealed class RightJoin> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, TRight, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, TRight, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); @@ -110,7 +115,7 @@ public IObservable> Run() => Observable.Crea case ChangeReason.Remove: if (right.HasValue) { - joinedCache.AddOrUpdate(_resultSelector(right.Value.key, Optional.None, right.Value.item), right.Value.key); + joinedCache.AddOrUpdate(_resultSelector(right.Value.key, ReactiveUI.Primitives.Optional.None, right.Value.item), right.Value.key); } break; diff --git a/src/DynamicData/Cache/Internal/RightJoinMany.cs b/src/DynamicData/Cache/Internal/RightJoinMany.cs index 825d71a90..fdba67e77 100644 --- a/src/DynamicData/Cache/Internal/RightJoinMany.cs +++ b/src/DynamicData/Cache/Internal/RightJoinMany.cs @@ -1,10 +1,15 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif -internal sealed class RightJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) +internal sealed class RightJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -13,7 +18,7 @@ internal sealed class RightJoinMany> _left = left ?? throw new ArgumentNullException(nameof(left)); - private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); diff --git a/src/DynamicData/Cache/Internal/SizeExpirer.cs b/src/DynamicData/Cache/Internal/SizeExpirer.cs index 3dda1820c..6d546dfa8 100644 --- a/src/DynamicData/Cache/Internal/SizeExpirer.cs +++ b/src/DynamicData/Cache/Internal/SizeExpirer.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class SizeExpirer where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/SizeLimiter.cs b/src/DynamicData/Cache/Internal/SizeLimiter.cs index a1522fc93..88eacde9d 100644 --- a/src/DynamicData/Cache/Internal/SizeLimiter.cs +++ b/src/DynamicData/Cache/Internal/SizeLimiter.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class SizeLimiter(int size) where TObject : notnull @@ -22,7 +27,7 @@ public IChangeSet Change(IChangeSet, } var notifications = _cache.CaptureChanges(); - var changed = notifications.Select(update => new Change(update.Reason, update.Key, update.Current.Value, update.Previous.HasValue ? update.Previous.Value.Value : Optional.None)); + var changed = notifications.Select(update => new Change(update.Reason, update.Key, update.Current.Value, update.Previous.HasValue ? update.Previous.Value.Value : ReactiveUI.Primitives.Optional.None)); return new ChangeSet(changed); } diff --git a/src/DynamicData/Cache/Internal/Sort.cs b/src/DynamicData/Cache/Internal/Sort.cs index a835af94c..bc85d35e5 100644 --- a/src/DynamicData/Cache/Internal/Sort.cs +++ b/src/DynamicData/Cache/Internal/Sort.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class Sort where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/SortAndPage.cs b/src/DynamicData/Cache/Internal/SortAndPage.cs index 70d74ab5f..5f5258bc8 100644 --- a/src/DynamicData/Cache/Internal/SortAndPage.cs +++ b/src/DynamicData/Cache/Internal/SortAndPage.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class SortAndPage where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/SortAndVirtualize.cs b/src/DynamicData/Cache/Internal/SortAndVirtualize.cs index 84854791f..a8572cb5b 100644 --- a/src/DynamicData/Cache/Internal/SortAndVirtualize.cs +++ b/src/DynamicData/Cache/Internal/SortAndVirtualize.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class SortAndVirtualize where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/SortExtensions.cs b/src/DynamicData/Cache/Internal/SortExtensions.cs index 7f011a7f9..9941074c0 100644 --- a/src/DynamicData/Cache/Internal/SortExtensions.cs +++ b/src/DynamicData/Cache/Internal/SortExtensions.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static class SortExtensions { diff --git a/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs b/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs index 4ab732ceb..d1c055ea5 100644 --- a/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs +++ b/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs @@ -1,10 +1,20 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif /* * Object which maintains a sorted list of key value pair and produces a change set. diff --git a/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs b/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs index aa128ecf2..cb236f8a6 100644 --- a/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs +++ b/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class SpecifiedGrouper(IObservable> source, Func groupSelector, IObservable> resultGroupSource) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/StatusMonitor.cs b/src/DynamicData/Cache/Internal/StatusMonitor.cs index 339b2bedb..2596712cf 100644 --- a/src/DynamicData/Cache/Internal/StatusMonitor.cs +++ b/src/DynamicData/Cache/Internal/StatusMonitor.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class StatusMonitor(IObservable source) { diff --git a/src/DynamicData/Cache/Internal/SubscribeMany.cs b/src/DynamicData/Cache/Internal/SubscribeMany.cs index 54521db2c..024e6d267 100644 --- a/src/DynamicData/Cache/Internal/SubscribeMany.cs +++ b/src/DynamicData/Cache/Internal/SubscribeMany.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class SubscribeMany where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/Switch.cs b/src/DynamicData/Cache/Internal/Switch.cs index b62557f6a..dff25c48f 100644 --- a/src/DynamicData/Cache/Internal/Switch.cs +++ b/src/DynamicData/Cache/Internal/Switch.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class Switch(IObservable>> sources) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs index a0037ca02..9b880f013 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal static class ToObservableChangeSet where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/ToObservableOptional.cs b/src/DynamicData/Cache/Internal/ToObservableOptional.cs index 5aa4296a0..7c405f839 100644 --- a/src/DynamicData/Cache/Internal/ToObservableOptional.cs +++ b/src/DynamicData/Cache/Internal/ToObservableOptional.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class ToObservableOptional(IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) where TObject : notnull @@ -12,9 +17,9 @@ internal sealed class ToObservableOptional(IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); private readonly TKey _key = key; - public IObservable> Run() => Observable.Create>(observer => + public IObservable> Run() => Observable.Create>(observer => { - var lastValue = Optional.None; + var lastValue = ReactiveUI.Primitives.Optional.None; return _source.Subscribe( changes => lastValue = EmitChanges(changes, observer, lastValue), @@ -22,7 +27,7 @@ public IObservable> Run() => Observable.Create EmitChanges(IChangeSet changes, IObserver> observer, Optional lastValue) + private ReactiveUI.Primitives.Optional EmitChanges(IChangeSet changes, IObserver> observer, ReactiveUI.Primitives.Optional lastValue) { foreach (var change in changes.ToConcreteType()) { @@ -35,8 +40,8 @@ private Optional EmitChanges(IChangeSet changes, IObserv // Remove is None, everything else is the current value var emitValue = change switch { - { Reason: ChangeReason.Remove } => Optional.None, - _ => Optional.Some(change.Current), + { Reason: ChangeReason.Remove } => ReactiveUI.Primitives.Optional.None, + _ => ReactiveUI.Primitives.Optional.Some(change.Current), }; // Emit the value if it has changed diff --git a/src/DynamicData/Cache/Internal/Transform.cs b/src/DynamicData/Cache/Internal/Transform.cs index e0da30457..c80c87f6a 100644 --- a/src/DynamicData/Cache/Internal/Transform.cs +++ b/src/DynamicData/Cache/Internal/Transform.cs @@ -1,10 +1,15 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif -internal sealed class Transform(IObservable> source, Func, TKey, TDestination> transformFactory, Action>? exceptionCallback = null, bool transformOnRefresh = false) +internal sealed class Transform(IObservable> source, Func, TKey, TDestination> transformFactory, Action>? exceptionCallback = null, bool transformOnRefresh = false) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/Internal/TransformAsync.cs b/src/DynamicData/Cache/Internal/TransformAsync.cs index efa251e05..a63a721a8 100644 --- a/src/DynamicData/Cache/Internal/TransformAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformAsync.cs @@ -1,12 +1,17 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal class TransformAsync( IObservable> source, - Func, TKey, Task> transformFactory, + Func, TKey, Task> transformFactory, Action>? exceptionCallback, IObservable>? forceTransform = null, int? maximumConcurrency = null, @@ -146,7 +151,7 @@ public TransformResult(in Change change, in TransformedItemContai public TransformResult(in Change change) { Change = change; - Container = Optional.None; + Container = ReactiveUI.Primitives.Optional.None; Success = true; Key = change.Key; } @@ -161,7 +166,7 @@ public TransformResult(in Change change, Exception error) public Change Change { get; } - public Optional Container { get; } + public ReactiveUI.Primitives.Optional Container { get; } public Exception? Error { get; } diff --git a/src/DynamicData/Cache/Internal/TransformImmutable.cs b/src/DynamicData/Cache/Internal/TransformImmutable.cs index c494cd16c..d01c82666 100644 --- a/src/DynamicData/Cache/Internal/TransformImmutable.cs +++ b/src/DynamicData/Cache/Internal/TransformImmutable.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class TransformImmutable where TDestination : notnull @@ -37,7 +42,7 @@ public IObservable> Run() current: _transformFactory.Invoke(change.Current), previous: change.Previous.HasValue ? _transformFactory.Invoke(change.Previous.Value) - : Optional.None, + : ReactiveUI.Primitives.Optional.None, currentIndex: change.CurrentIndex, previousIndex: change.PreviousIndex)); } diff --git a/src/DynamicData/Cache/Internal/TransformMany.cs b/src/DynamicData/Cache/Internal/TransformMany.cs index fcef94fcc..2732ec87f 100644 --- a/src/DynamicData/Cache/Internal/TransformMany.cs +++ b/src/DynamicData/Cache/Internal/TransformMany.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class TransformMany(IObservable> source, Func> manySelector, Func keySelector, Func>>? childChanges = null) where TDestination : notnull diff --git a/src/DynamicData/Cache/Internal/TransformManyAsync.cs b/src/DynamicData/Cache/Internal/TransformManyAsync.cs index 924bda571..b7ce4e292 100644 --- a/src/DynamicData/Cache/Internal/TransformManyAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformManyAsync.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class TransformManyAsync(IObservable> source, Func>>> transformer, IEqualityComparer? equalityComparer, IComparer? comparer, Action>? errorHandler = null) where TSource : notnull diff --git a/src/DynamicData/Cache/Internal/TransformOnObservable.cs b/src/DynamicData/Cache/Internal/TransformOnObservable.cs index e446c24a2..c1feaad96 100644 --- a/src/DynamicData/Cache/Internal/TransformOnObservable.cs +++ b/src/DynamicData/Cache/Internal/TransformOnObservable.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class TransformOnObservable(IObservable> source, Func> transform, bool transformOnRefresh = false) where TSource : notnull diff --git a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs index 50c900b75..2a99b5dac 100644 --- a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs +++ b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs @@ -1,10 +1,15 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif -internal sealed class TransformWithForcedTransform(IObservable> source, Func, TKey, TDestination> transformFactory, IObservable> forceTransform, Action>? exceptionCallback = null) +internal sealed class TransformWithForcedTransform(IObservable> source, Func, TKey, TDestination> transformFactory, IObservable> forceTransform, Action>? exceptionCallback = null) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs index 69c4c9169..ce0b643e5 100644 --- a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class TransformWithInlineUpdate(IObservable> source, Func transformFactory, diff --git a/src/DynamicData/Cache/Internal/TreeBuilder.cs b/src/DynamicData/Cache/Internal/TreeBuilder.cs index 31d0426eb..591088045 100644 --- a/src/DynamicData/Cache/Internal/TreeBuilder.cs +++ b/src/DynamicData/Cache/Internal/TreeBuilder.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class TreeBuilder(IObservable> source, Func pivotOn, IObservable, bool>>? predicateChanged) where TObject : class diff --git a/src/DynamicData/Cache/Internal/TrueFor.cs b/src/DynamicData/Cache/Internal/TrueFor.cs index abaa58f63..565c7f5db 100644 --- a/src/DynamicData/Cache/Internal/TrueFor.cs +++ b/src/DynamicData/Cache/Internal/TrueFor.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class TrueFor(IObservable> source, Func> observableSelector, Func>, bool> collectionMatcher) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs b/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs index ec5068dfb..6bcb16218 100644 --- a/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs +++ b/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class UniquenessEnforcer(IObservable> source) where TObject : notnull diff --git a/src/DynamicData/Cache/Internal/Virtualise.cs b/src/DynamicData/Cache/Internal/Virtualise.cs index e93a3c8e2..9c2a4b157 100644 --- a/src/DynamicData/Cache/Internal/Virtualise.cs +++ b/src/DynamicData/Cache/Internal/Virtualise.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else namespace DynamicData.Cache.Internal; +#endif internal sealed class Virtualise(IObservable> source, IObservable virtualRequests) where TObject : notnull diff --git a/src/DynamicData/Cache/MissingKeyException.cs b/src/DynamicData/Cache/MissingKeyException.cs index 72b2b2bea..7635165d9 100644 --- a/src/DynamicData/Cache/MissingKeyException.cs +++ b/src/DynamicData/Cache/MissingKeyException.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Thrown when a key is expected in a cache but not found. diff --git a/src/DynamicData/Cache/Node.cs b/src/DynamicData/Cache/Node.cs index 19d72e51e..14ae79fa2 100644 --- a/src/DynamicData/Cache/Node.cs +++ b/src/DynamicData/Cache/Node.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Node describing the relationship between and item and it's ancestors and descendent. @@ -37,7 +41,7 @@ public Node(TObject item, TKey key) /// The item. /// The key. /// The parent. - public Node(TObject item, TKey key, in Optional> parent) + public Node(TObject item, TKey key, in ReactiveUI.Primitives.Optional> parent) { Item = item ?? throw new ArgumentNullException(nameof(item)); Key = key; @@ -91,7 +95,7 @@ public int Depth /// /// Gets the parent if it has one. /// - public Optional> Parent { get; internal set; } + public ReactiveUI.Primitives.Optional> Parent { get; internal set; } /// /// Determines whether the specified objects are equal. diff --git a/src/DynamicData/Cache/ObservableCache.cs b/src/DynamicData/Cache/ObservableCache.cs index decbb3f33..512526843 100644 --- a/src/DynamicData/Cache/ObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCache.cs @@ -3,11 +3,23 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif [DebuggerDisplay("ObservableCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] internal sealed class ObservableCache : IObservableCache, INotifyCollectionChangedSuspender @@ -121,7 +133,7 @@ public IObservable> Connect(Func? predi public void Dispose() => _cleanUp.Dispose(); - public Optional Lookup(TKey key) => _readerWriter.Lookup(key); + public ReactiveUI.Primitives.Optional Lookup(TKey key) => _readerWriter.Lookup(key); public IObservable> Preview(Func? predicate = null) => predicate is null ? _changesPreview : _changesPreview.Filter(predicate); diff --git a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs index 4e808ec00..9f4d8ecf2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs index a04d82fa9..0fa92faf6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs index 5447ac473..d70effc77 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.And.cs b/src/DynamicData/Cache/ObservableCacheEx.And.cs index 0913186c6..a79d2b925 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.And.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.And.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs index 1bc978cae..896540c13 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs index c43a1da2f..e6c36bb9e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs index 86b9b078c..036ec3e1f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs @@ -3,11 +3,20 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs index 2f67555ef..a7068174f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs index ad920316a..3d580284e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs index 585e6d759..d663a8d72 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs index c7e8d979f..87839ef1d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs index 95649e472..567d3ba04 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs index 571ca1fdc..41df889bd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs index 91ddaffb4..d69030ade 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs index 59a49d9c6..ddb09abf2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs index 7d612435b..5947f9c88 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs index c1218b714..88b0da390 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs index b8219669e..e2ddc645a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs index 994fa8e38..97102f6ac 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs @@ -3,11 +3,20 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Specialized; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs index 9bedb7017..4c54778aa 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs index baa2edd02..273ca2965 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs index 8b8c8c8bf..b5f7d0eaf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs index cfd04cdb7..7e590a6a0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -115,7 +125,7 @@ public static IObservable> EditDiff(thi /// /// /// or is . - public static IObservable> EditDiff(this IObservable> source, Func keySelector, IEqualityComparer? equalityComparer = null) + public static IObservable> EditDiff(this IObservable> source, Func keySelector, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { diff --git a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs index f4eebaddd..5207f4c87 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Except.cs b/src/DynamicData/Cache/ObservableCacheEx.Except.cs index d443c10e0..2166cc332 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Except.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Except.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs index 2495d6917..a88be4055 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs index a2b616930..b267f45fe 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs index 5715fc7f9..e121a0723 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs index 80c3bb083..e13836609 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs index 3f71f42b4..9f54b3b58 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs index 5c50fd8f1..b91f7bdb7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs index 6ec036c50..385151e38 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs index d68f56214..3f6ed6ad7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs index 6fca43439..bb2bd3e90 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs index 079c3153c..f5c89ed40 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -19,7 +29,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left and right values into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) + public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, ReactiveUI.Primitives.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -54,9 +64,9 @@ public static IObservable> FullJoinLeft-side change handling: /// /// EventBehavior - /// AddEmits with the left value and the matching right (or if no right exists). + /// AddEmits with the left value and the matching right (or if no right exists). /// UpdateRe-invokes with the new left value and current right (if any). - /// RemoveIf a right match still exists, re-invokes the selector with left as . If neither side remains, removes the joined result. + /// RemoveIf a right match still exists, re-invokes the selector with left as . If neither side remains, removes the joined result. /// RefreshForwarded as Refresh on the joined result. /// /// @@ -64,9 +74,9 @@ public static IObservable> FullJoinRight-side change handling: /// /// EventBehavior - /// AddEmits with the matching left (or ) and the right value. + /// AddEmits with the matching left (or ) and the right value. /// UpdateRe-invokes selector with current left (if any) and the new right value. - /// RemoveIf a left match still exists, re-invokes the selector with right as . If neither side remains, removes the joined result. + /// RemoveIf a left match still exists, re-invokes the selector with right as . If neither side remains, removes the joined result. /// RefreshForwarded as Refresh on the joined result. /// /// @@ -77,7 +87,7 @@ public static IObservable> FullJoin /// /// - public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, Optional, TDestination> resultSelector) + public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, ReactiveUI.Primitives.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs index 14a7cd5e6..56da40b0b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -19,7 +29,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left value and the right group into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -57,7 +67,7 @@ public static IObservable> FullJoinManyEventBehavior /// AddEmits with the left value and the current right group for that key (may be empty). /// UpdateRe-invokes with the new left value and current right group. - /// RemoveIf the right group is non-empty, re-invokes with left as . If both sides are empty, removes the result. + /// RemoveIf the right group is non-empty, re-invokes with left as . If both sides are empty, removes the result. /// RefreshForwarded as Refresh on the joined result. /// /// @@ -78,7 +88,7 @@ public static IObservable> FullJoinMany /// /// - public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Group.cs b/src/DynamicData/Cache/ObservableCacheEx.Group.cs index 251b89e0f..68dab2c72 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Group.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Group.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs index a725feff0..df4231cce 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs index f11da7bab..ba2b40f07 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs @@ -3,11 +3,20 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs index 19162ce83..71fc48355 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs @@ -3,11 +3,20 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs index 7e2659683..ad0194fd9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs index db11fc2ee..acbfcff4d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs index 6879aa463..2f4c88f36 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs index f9ab45c77..b82ba7c80 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs index 73ace3cf3..afcd0f103 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs index 89def0889..4fb3df0c2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs index 64f0455a0..0d30a208f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs index d65e5f851..6136761c7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -19,7 +29,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the left value and the optional right into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) + public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -54,7 +64,7 @@ public static IObservable> LeftJoinLeft-side change handling: /// /// EventBehavior - /// AddAlways emits. Invokes with the left value and matching right (or ). + /// AddAlways emits. Invokes with the left value and matching right (or ). /// UpdateRe-invokes the selector with the new left value and current right (if any). /// RemoveRemoves the joined result. /// RefreshForwarded as Refresh on the joined result. @@ -77,7 +87,7 @@ public static IObservable> LeftJoin /// /// - public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) + public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs index ef46a0dc0..85025513e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs index 71348f773..e01078e86 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs index efe8c71aa..62f4bb898 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs index c74e70771..dd2ac15ed 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs index 18f98faa6..9415a37dc 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs index bd68bfe6c..23b7a50c7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs index aa39897fb..5c3fd7e1c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs index 58a6de047..2cd057957 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs index 15ede32c9..96ac16dcf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs index 15c7448cb..e06781744 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs index 2cd22da04..103b06cf4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs index d5e6e881d..8b05b3ce5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs index 4c583b4df..54b2841f5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs index 85c406e58..500aff82b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Or.cs b/src/DynamicData/Cache/ObservableCacheEx.Or.cs index 1b8e6501d..e1476c173 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Or.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Or.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs index 5ba18b14d..adc8d02e0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs index 24645a1f9..5009c71a1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs index baa39444b..80849ad61 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs @@ -1,13 +1,27 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs index fa93a996d..4789a19fc 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs index 642def1ff..012d26934 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs index 80cc7435d..5e4caa4a6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs index 93946ca1f..2f0804e3f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs index b0fe28095..126957978 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs index 11ff810da..216b1f761 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -19,7 +29,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left and right values into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) + public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -54,7 +64,7 @@ public static IObservable> RightJoinRight-side change handling: /// /// EventBehavior - /// AddAlways emits. Invokes with the matching left (or ) and the right value. + /// AddAlways emits. Invokes with the matching left (or ) and the right value. /// UpdateRe-invokes the selector with current left (if any) and the new right value. /// RemoveRemoves the joined result. /// RefreshForwarded as Refresh on the joined result. @@ -77,7 +87,7 @@ public static IObservable> RightJoin /// /// - public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) + public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs index 7a0010015..7ffe70cda 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -19,7 +29,7 @@ public static partial class ObservableCacheEx /// A that maps each right item to the left key it should join on. /// A that combines the optional left value and the right group into a destination object. The key is not provided in this overload. /// Overload that omits the key from the result selector. Delegates to . - public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull @@ -78,7 +88,7 @@ public static IObservable> RightJoinMany /// /// - public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) + public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull where TRight : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs index d75013f9d..92fc7a08c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs index b5cd298f6..494685824 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs index a86559039..3015acd09 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs b/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs index 20f83edf4..7b530101c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs index cc5c46ba6..c504fa66a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs index 8bf58234b..b175c8720 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs index 7c917fcf9..81cb401ff 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs index a6a4faafe..e16ddda43 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs index bfdf5223a..dce03d7b6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs index 0b22bfe01..cac72b378 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs index 19ade0fb5..ea2077ce1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs index 8b5aba702..14f86dc6c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -14,8 +24,8 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Watches a single key in the source changeset stream, emitting Optional.Some(value) when the key - /// is present and when it is removed. Duplicate values are suppressed via . + /// Watches a single key in the source changeset stream, emitting ReactiveUI.Primitives.Optional.Some(value) when the key + /// is present and when it is removed. Duplicate values are suppressed via . /// /// The type of the object. /// The type of the key. @@ -30,17 +40,17 @@ public static partial class ObservableCacheEx /// /// /// EventBehavior - /// AddEmits Optional.Some(value) if the key was not previously tracked. - /// UpdateEmits Optional.Some(newValue) if the new value differs from the previous per . Otherwise suppressed. - /// RemoveEmits . - /// RefreshEmits Optional.Some(value) if the value differs from the last emission per . Otherwise suppressed. + /// AddEmits ReactiveUI.Primitives.Optional.Some(value) if the key was not previously tracked. + /// UpdateEmits ReactiveUI.Primitives.Optional.Some(newValue) if the new value differs from the previous per . Otherwise suppressed. + /// RemoveEmits . + /// RefreshEmits ReactiveUI.Primitives.Optional.Some(value) if the value differs from the last emission per . Otherwise suppressed. /// /// Worth noting: No emission occurs if the key is not present at subscription time. To get an initial None when the key is absent, use the overload with initialOptionalWhenMissing: true. /// /// is . /// /// - public static IObservable> ToObservableOptional(this IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) + public static IObservable> ToObservableOptional(this IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { @@ -63,7 +73,7 @@ public static IObservable> ToObservableOptional /// /// Worth noting: Uses lock-based coordination. If the key exists synchronously on Connect(), the initial None may or may not be emitted depending on timing. /// - public static IObservable> ToObservableOptional(this IObservable> source, TKey key, bool initialOptionalWhenMissing, IEqualityComparer? equalityComparer = null) + public static IObservable> ToObservableOptional(this IObservable> source, TKey key, bool initialOptionalWhenMissing, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { @@ -75,8 +85,8 @@ public static IObservable> ToObservableOptional return source.ToObservableOptional(key, equalityComparer) .Do(_ => seenValue = true) .Merge(Observable.Defer(() => seenValue - ? Observable.Empty>() - : Observable.Return(Optional.None))); + ? Observable.Empty>() + : Observable.Return(ReactiveUI.Primitives.Optional.None))); }); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs index 863f8642f..658ed4326 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs index 038d58cce..54c9662da 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -42,7 +52,7 @@ public static IObservable> Transform /// This overload accepts a bool transformOnRefresh flag. When , Refresh changes cause re-transformation (emitted as Update). - public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, bool transformOnRefresh) + public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, bool transformOnRefresh) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -117,7 +127,7 @@ public static IObservable> Transform /// /// or is . - public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable>? forceTransform = null) + public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -155,7 +165,7 @@ public static IObservable> Transform /// This overload accepts of to force re-transformation of ALL items when the observable emits. - public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable forceTransform) + public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs index 13e2d5c19..952e062e1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -76,7 +86,7 @@ public static IObservable> TransformAsync /// or is . [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, IObservable>? forceTransform = null) + public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -118,7 +128,7 @@ public static IObservable> TransformAsync /// This overload accepts to control concurrency and Refresh handling. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, TransformAsyncOptions options) + public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, TransformAsyncOptions options) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs index 84eeb377b..698c05cdf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs index 3ecc9c3db..9cd4eb3af 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs index bb70fcad3..26203650a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs @@ -3,11 +3,20 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Specialized; +#if REACTIVE_SHIM +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs index 9522582f7..b1532f42a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs @@ -3,11 +3,20 @@ // See the LICENSE file in the project root for full license information. using System.Collections.Specialized; +#if REACTIVE_SHIM +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs index c9258071f..aee73db8f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs index 046f57aef..e94ad8b6a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -62,7 +72,7 @@ public static IObservable> TransformSafeWorth noting: Factory exceptions are caught per-item; the faulting item is skipped and reported to the error handler while the stream continues. Source-level errors still terminate the stream. /// /// , , or is . - public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) + public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -101,7 +111,7 @@ public static IObservable> TransformSafe /// This overload accepts of to force re-transformation of ALL items. - public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable forceTransform) + public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs index d5f7481ca..0b05ee355 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -58,7 +68,7 @@ public static IObservable> TransformSafeAsyncCombines the async execution model of with the error-safe behavior of . /// , , or is . [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) + public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) where TDestination : notnull where TSource : notnull where TKey : notnull @@ -103,7 +113,7 @@ public static IObservable> TransformSafeAsync /// This overload accepts to control concurrency and Refresh handling. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] - public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, TransformAsyncOptions options) + public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, TransformAsyncOptions options) where TDestination : notnull where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs index 48e5ec992..7b09fcdf0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs index eee143ada..7ad8ee7e1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs index 96c8b2427..fc85c39c1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs index 0a859dd21..14ae4bff4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs index 94f49cfc8..8ffb49468 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs index 8cf74b6a6..657a9bf2b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs index 5f97c7d63..843f7524b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs index 806689cfe..a063e398e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs index 704cffd13..cfe117af9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs index 776499c67..6df2c281f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. @@ -23,7 +28,7 @@ public static partial class ObservableCacheEx /// /// /// Unlike , - /// this does not emit on removal. It emits the removed item's value instead. + /// this does not emit on removal. It emits the removed item's value instead. /// If you need to distinguish presence from absence, use ToObservableOptional. /// /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs index a2b9d890a..6cbfcc84d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs index db42527b7..18845bdc8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs @@ -3,11 +3,20 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs index fde2aad8b..1dfd3b75a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs @@ -3,11 +3,20 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs index 38d80bde9..751edcbee 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs index 5e2d785bd..faf63f801 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Xor.cs b/src/DynamicData/Cache/ObservableCacheEx.Xor.cs index 0b077d3dc..2b384302e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Xor.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Xor.cs @@ -1,12 +1,22 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/ObservableCacheEx.cs b/src/DynamicData/Cache/ObservableCacheEx.cs index f201d769f..118532aa9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Cache/PageContext.cs b/src/DynamicData/Cache/PageContext.cs index a36afc396..cc4559ee2 100644 --- a/src/DynamicData/Cache/PageContext.cs +++ b/src/DynamicData/Cache/PageContext.cs @@ -1,10 +1,20 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Operators; +#else using DynamicData.Operators; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Parameters associated with the page operation. diff --git a/src/DynamicData/Cache/PageRequest.cs b/src/DynamicData/Cache/PageRequest.cs index bddf8f33a..55f2c94f3 100644 --- a/src/DynamicData/Cache/PageRequest.cs +++ b/src/DynamicData/Cache/PageRequest.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Represents a new page request. diff --git a/src/DynamicData/Cache/PageResponse.cs b/src/DynamicData/Cache/PageResponse.cs index 425eb440e..7d730ac1f 100644 --- a/src/DynamicData/Cache/PageResponse.cs +++ b/src/DynamicData/Cache/PageResponse.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Operators; +#else using DynamicData.Operators; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal sealed class PageResponse(int pageSize, int totalSize, int page, int pages) : IEquatable, IPageResponse { diff --git a/src/DynamicData/Cache/PagedChangeSet.cs b/src/DynamicData/Cache/PagedChangeSet.cs index f16135527..bfdb67c8c 100644 --- a/src/DynamicData/Cache/PagedChangeSet.cs +++ b/src/DynamicData/Cache/PagedChangeSet.cs @@ -1,12 +1,25 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif +#if REACTIVE_SHIM +using DynamicData.Reactive.Operators; +#else using DynamicData.Operators; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal sealed class PagedChangeSet : ChangeSet, IPagedChangeSet where TObject : notnull diff --git a/src/DynamicData/Cache/SortAndPageOptions.cs b/src/DynamicData/Cache/SortAndPageOptions.cs index 4250c2737..5ed8dfb62 100644 --- a/src/DynamicData/Cache/SortAndPageOptions.cs +++ b/src/DynamicData/Cache/SortAndPageOptions.cs @@ -1,10 +1,20 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Options for the sort and virtualize operator. diff --git a/src/DynamicData/Cache/SortAndVirtualizeOptions.cs b/src/DynamicData/Cache/SortAndVirtualizeOptions.cs index c0b655da2..d078218fd 100644 --- a/src/DynamicData/Cache/SortAndVirtualizeOptions.cs +++ b/src/DynamicData/Cache/SortAndVirtualizeOptions.cs @@ -1,10 +1,20 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Options for the sort and virtualize operator. diff --git a/src/DynamicData/Cache/SortOptimisations.cs b/src/DynamicData/Cache/SortOptimisations.cs index 52cda18a8..af1226366 100644 --- a/src/DynamicData/Cache/SortOptimisations.cs +++ b/src/DynamicData/Cache/SortOptimisations.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Flags used to specify one or more sort optimisations. diff --git a/src/DynamicData/Cache/SortReason.cs b/src/DynamicData/Cache/SortReason.cs index b94ab15e4..d503f61b6 100644 --- a/src/DynamicData/Cache/SortReason.cs +++ b/src/DynamicData/Cache/SortReason.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// The reason why the sorted collection has changed. diff --git a/src/DynamicData/Cache/SortedChangeSet.cs b/src/DynamicData/Cache/SortedChangeSet.cs index fa9e37be0..7e18c1b4b 100644 --- a/src/DynamicData/Cache/SortedChangeSet.cs +++ b/src/DynamicData/Cache/SortedChangeSet.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal sealed class SortedChangeSet : ChangeSet, ISortedChangeSet where TObject : notnull diff --git a/src/DynamicData/Cache/SourceCache.cs b/src/DynamicData/Cache/SourceCache.cs index 5d281579c..23d74d618 100644 --- a/src/DynamicData/Cache/SourceCache.cs +++ b/src/DynamicData/Cache/SourceCache.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// An observable cache which exposes an update API. Used at the root @@ -54,7 +62,7 @@ public sealed class SourceCache(Func keySelector) public void Edit(Action> updateAction) => _innerCache.UpdateFromSource(updateAction); /// - public Optional Lookup(TKey key) => _innerCache.Lookup(key); + public ReactiveUI.Primitives.Optional Lookup(TKey key) => _innerCache.Lookup(key); /// public IObservable> Preview(Func? predicate = null) => _innerCache.Preview(predicate); diff --git a/src/DynamicData/Cache/SourceCacheEx.cs b/src/DynamicData/Cache/SourceCacheEx.cs index fa7a2e430..8d4c7dbb3 100644 --- a/src/DynamicData/Cache/SourceCacheEx.cs +++ b/src/DynamicData/Cache/SourceCacheEx.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Source cache convenience extensions. diff --git a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs index dac9063ec..9fe1a9605 100644 --- a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Diagnostics; +#else using DynamicData.Diagnostics; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Tests; +#else namespace DynamicData.Tests; +#endif /// /// Aggregates all events and statistics for a change set to help assertions when testing. diff --git a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs index e83127735..5ea59fad0 100644 --- a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Diagnostics; +#else using DynamicData.Diagnostics; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Tests; +#else namespace DynamicData.Tests; +#endif /// /// Aggregates all events and statistics for a distinct change set to help assertions when testing. diff --git a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs index 68e3838fd..ef6e8ff9e 100644 --- a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Diagnostics; +#else using DynamicData.Diagnostics; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Tests; +#else namespace DynamicData.Tests; +#endif /// /// Aggregates all events and statistics for a group change set to help assertions when testing. diff --git a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs index 94cde9eab..7b4a5ca4e 100644 --- a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Diagnostics; +#else using DynamicData.Diagnostics; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Tests; +#else namespace DynamicData.Tests; +#endif /// /// Aggregates all events and statistics for a paged change set to help assertions when testing. diff --git a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs index 72ebb0727..408d16590 100644 --- a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Diagnostics; +#else using DynamicData.Diagnostics; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Tests; +#else namespace DynamicData.Tests; +#endif /// /// Aggregates all events and statistics for a sorted change set to help assertions when testing. diff --git a/src/DynamicData/Cache/Tests/TestEx.cs b/src/DynamicData/Cache/Tests/TestEx.cs index dd495f56d..0c693745b 100644 --- a/src/DynamicData/Cache/Tests/TestEx.cs +++ b/src/DynamicData/Cache/Tests/TestEx.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Tests; +#else namespace DynamicData.Tests; +#endif /// /// Test extensions. diff --git a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs index 0bcdf82bf..f77b7cd8d 100644 --- a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Diagnostics; +#else using DynamicData.Diagnostics; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Tests; +#else namespace DynamicData.Tests; +#endif /// /// Aggregates all events and statistics for a virtual change set to help assertions when testing. diff --git a/src/DynamicData/Cache/TransformAsyncOptions.cs b/src/DynamicData/Cache/TransformAsyncOptions.cs index 19ed9ab40..a2d1efc01 100644 --- a/src/DynamicData/Cache/TransformAsyncOptions.cs +++ b/src/DynamicData/Cache/TransformAsyncOptions.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Options for TransformAsync and TransformSafeAsync. diff --git a/src/DynamicData/Cache/VirtualChangeSet.cs b/src/DynamicData/Cache/VirtualChangeSet.cs index 3aae7f59f..625ec3909 100644 --- a/src/DynamicData/Cache/VirtualChangeSet.cs +++ b/src/DynamicData/Cache/VirtualChangeSet.cs @@ -1,11 +1,20 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal sealed class VirtualChangeSet : ChangeSet, IVirtualChangeSet, IEquatable> where TObject : notnull diff --git a/src/DynamicData/Cache/VirtualContext.cs b/src/DynamicData/Cache/VirtualContext.cs index f909ddbc0..0de322ffc 100644 --- a/src/DynamicData/Cache/VirtualContext.cs +++ b/src/DynamicData/Cache/VirtualContext.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Parameters associated with the virtualize operation. diff --git a/src/DynamicData/Cache/VirtualRequest.cs b/src/DynamicData/Cache/VirtualRequest.cs index 4d94c9412..d6a3ddcd3 100644 --- a/src/DynamicData/Cache/VirtualRequest.cs +++ b/src/DynamicData/Cache/VirtualRequest.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A request object for virtualisation. diff --git a/src/DynamicData/Cache/VirtualResponse.cs b/src/DynamicData/Cache/VirtualResponse.cs index 70152976c..60e4cc45e 100644 --- a/src/DynamicData/Cache/VirtualResponse.cs +++ b/src/DynamicData/Cache/VirtualResponse.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Defines values used to virtualise the result set. diff --git a/src/DynamicData/Constants.cs b/src/DynamicData/Constants.cs index 11f6d9330..72f25a7f2 100644 --- a/src/DynamicData/Constants.cs +++ b/src/DynamicData/Constants.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal static class Constants { diff --git a/src/DynamicData/Diagnostics/ChangeStatistics.cs b/src/DynamicData/Diagnostics/ChangeStatistics.cs index 96d0830db..e4778ac1e 100644 --- a/src/DynamicData/Diagnostics/ChangeStatistics.cs +++ b/src/DynamicData/Diagnostics/ChangeStatistics.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Diagnostics; +#else namespace DynamicData.Diagnostics; +#endif /// /// Object used to capture accumulated changes. diff --git a/src/DynamicData/Diagnostics/ChangeSummary.cs b/src/DynamicData/Diagnostics/ChangeSummary.cs index 5b9f88a34..7f7b59873 100644 --- a/src/DynamicData/Diagnostics/ChangeSummary.cs +++ b/src/DynamicData/Diagnostics/ChangeSummary.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Diagnostics; +#else namespace DynamicData.Diagnostics; +#endif /// /// Accumulates change statics. diff --git a/src/DynamicData/Diagnostics/DiagnosticOperators.cs b/src/DynamicData/Diagnostics/DiagnosticOperators.cs index 19720234d..7e8b0193c 100644 --- a/src/DynamicData/Diagnostics/DiagnosticOperators.cs +++ b/src/DynamicData/Diagnostics/DiagnosticOperators.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Diagnostics; +#else namespace DynamicData.Diagnostics; +#endif /// /// Extensions for diagnostics. diff --git a/src/DynamicData/DynamicDataOptions.cs b/src/DynamicData/DynamicDataOptions.cs index 4d0cececb..91019d5a9 100644 --- a/src/DynamicData/DynamicDataOptions.cs +++ b/src/DynamicData/DynamicDataOptions.cs @@ -1,10 +1,20 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// System-wide options container. diff --git a/src/DynamicData/EnumerableEx.cs b/src/DynamicData/EnumerableEx.cs index 298355f0f..35698a848 100644 --- a/src/DynamicData/EnumerableEx.cs +++ b/src/DynamicData/EnumerableEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for dynamic data. diff --git a/src/DynamicData/Experimental/ExperimentalEx.cs b/src/DynamicData/Experimental/ExperimentalEx.cs index b78d8a9ce..8ba1573e8 100644 --- a/src/DynamicData/Experimental/ExperimentalEx.cs +++ b/src/DynamicData/Experimental/ExperimentalEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Experimental; +#else namespace DynamicData.Experimental; +#endif /// /// Experimental operator extensions. diff --git a/src/DynamicData/Experimental/ISubjectWithRefCount.cs b/src/DynamicData/Experimental/ISubjectWithRefCount.cs index 3f92c5930..2d4142f1f 100644 --- a/src/DynamicData/Experimental/ISubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/ISubjectWithRefCount.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Experimental; +#else namespace DynamicData.Experimental; +#endif /// /// A subject which also contains its current reference count. diff --git a/src/DynamicData/Experimental/IWatcher.cs b/src/DynamicData/Experimental/IWatcher.cs index c936472ac..ccc6d4a4b 100644 --- a/src/DynamicData/Experimental/IWatcher.cs +++ b/src/DynamicData/Experimental/IWatcher.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Experimental; +#else namespace DynamicData.Experimental; +#endif /// /// A specialisation of the SourceList which is optimised for watching individual items. diff --git a/src/DynamicData/Experimental/SubjectWithRefCount.cs b/src/DynamicData/Experimental/SubjectWithRefCount.cs index a4de5d41c..bc3edd1fb 100644 --- a/src/DynamicData/Experimental/SubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/SubjectWithRefCount.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Experimental; +#else namespace DynamicData.Experimental; +#endif /// /// A subject with a count of the number of subscribers. diff --git a/src/DynamicData/Experimental/Watcher.cs b/src/DynamicData/Experimental/Watcher.cs index 8ab646c97..f6c425e77 100644 --- a/src/DynamicData/Experimental/Watcher.cs +++ b/src/DynamicData/Experimental/Watcher.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Experimental; +#else namespace DynamicData.Experimental; +#endif internal sealed class Watcher : IWatcher where TObject : notnull diff --git a/src/DynamicData/GlobalConfig.cs b/src/DynamicData/GlobalConfig.cs index 7aa192f97..7e4018594 100644 --- a/src/DynamicData/GlobalConfig.cs +++ b/src/DynamicData/GlobalConfig.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal static class GlobalConfig { diff --git a/src/DynamicData/IChangeSet.cs b/src/DynamicData/IChangeSet.cs index e0396936e..de3314701 100644 --- a/src/DynamicData/IChangeSet.cs +++ b/src/DynamicData/IChangeSet.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Base interface representing a set of changes. diff --git a/src/DynamicData/Internal/Bitset.cs b/src/DynamicData/Internal/Bitset.cs index 963468a09..641fa6680 100644 --- a/src/DynamicData/Internal/Bitset.cs +++ b/src/DynamicData/Internal/Bitset.cs @@ -5,8 +5,13 @@ #if NETCOREAPP3_0_OR_GREATER using System.Numerics; #endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Internal; +#else namespace DynamicData.Internal; +#endif /// /// diff --git a/src/DynamicData/Internal/CacheParentSubscription.cs b/src/DynamicData/Internal/CacheParentSubscription.cs index 4a3371ee3..41f57a4be 100644 --- a/src/DynamicData/Internal/CacheParentSubscription.cs +++ b/src/DynamicData/Internal/CacheParentSubscription.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Internal; +#else namespace DynamicData.Internal; +#endif /// /// Base class for subscriptions that need to manage child subscriptions and emit updates diff --git a/src/DynamicData/Internal/DeliveryQueue.cs b/src/DynamicData/Internal/DeliveryQueue.cs index 10c05d440..9a6436608 100644 --- a/src/DynamicData/Internal/DeliveryQueue.cs +++ b/src/DynamicData/Internal/DeliveryQueue.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Internal; +#else namespace DynamicData.Internal; +#endif /// /// A queue that serializes item delivery outside a caller-owned lock. diff --git a/src/DynamicData/Internal/KeyedDisposable.cs b/src/DynamicData/Internal/KeyedDisposable.cs index 13a411b31..81aa11fd8 100644 --- a/src/DynamicData/Internal/KeyedDisposable.cs +++ b/src/DynamicData/Internal/KeyedDisposable.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Internal; +#else namespace DynamicData.Internal; +#endif /// /// Manages Disposables by Key: diff --git a/src/DynamicData/Internal/Notification.cs b/src/DynamicData/Internal/Notification.cs index edddf158b..382b20120 100644 --- a/src/DynamicData/Internal/Notification.cs +++ b/src/DynamicData/Internal/Notification.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Internal; +#else namespace DynamicData.Internal; +#endif /// /// A lightweight notification struct for delivery queues. Discriminates @@ -13,10 +18,10 @@ namespace DynamicData.Internal; internal readonly struct Notification where T : notnull { - private readonly Optional _value; + private readonly ReactiveUI.Primitives.Optional _value; private readonly Exception? _error; - private Notification(Optional value, Exception? error) + private Notification(ReactiveUI.Primitives.Optional value, Exception? error) { _value = value; _error = error; @@ -29,11 +34,11 @@ private Notification(Optional value, Exception? error) public static Notification CreateError(Exception error) { ArgumentExceptionHelper.ThrowIfNull(error); - return new(Optional.None, error); + return new(ReactiveUI.Primitives.Optional.None, error); } /// Creates an OnCompleted notification (terminal). - public static Notification CreateCompleted() => new(Optional.None, null); + public static Notification CreateCompleted() => new(ReactiveUI.Primitives.Optional.None, null); /// Gets whether this is an OnError notification. public bool IsError => _error is not null; diff --git a/src/DynamicData/Internal/SharedDeliveryQueue.cs b/src/DynamicData/Internal/SharedDeliveryQueue.cs index 7a5c10890..55650cdf3 100644 --- a/src/DynamicData/Internal/SharedDeliveryQueue.cs +++ b/src/DynamicData/Internal/SharedDeliveryQueue.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Internal; +#else namespace DynamicData.Internal; +#endif /// /// A type-erased delivery queue that serializes delivery across multiple sources diff --git a/src/DynamicData/Internal/SwappableLock.cs b/src/DynamicData/Internal/SwappableLock.cs index 6b9fd31f3..d6153ce88 100644 --- a/src/DynamicData/Internal/SwappableLock.cs +++ b/src/DynamicData/Internal/SwappableLock.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif #if NET9_0_OR_GREATER diff --git a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs index fefcedb73..d01fb8447 100644 --- a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs +++ b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Internal; +#else namespace DynamicData.Internal; +#endif /// /// Provides SynchronizeSafe extension methods, drop-in replacements diff --git a/src/DynamicData/Kernel/ConnectionStatus.cs b/src/DynamicData/Kernel/ConnectionStatus.cs index a6a41d5cf..d6d0f49f2 100644 --- a/src/DynamicData/Kernel/ConnectionStatus.cs +++ b/src/DynamicData/Kernel/ConnectionStatus.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// Connectable cache status. diff --git a/src/DynamicData/Kernel/EnumerableEx.cs b/src/DynamicData/Kernel/EnumerableEx.cs index 05a051cce..dd14de279 100644 --- a/src/DynamicData/Kernel/EnumerableEx.cs +++ b/src/DynamicData/Kernel/EnumerableEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// Enumerable extensions. diff --git a/src/DynamicData/Kernel/EnumerableIList.cs b/src/DynamicData/Kernel/EnumerableIList.cs index 807914f1c..068fcc9d6 100644 --- a/src/DynamicData/Kernel/EnumerableIList.cs +++ b/src/DynamicData/Kernel/EnumerableIList.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // Lifted from here https://github.com/benaadams/Ben.Enumerable. Many thanks to the genius of the man. +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Same class name, different generics.")] internal readonly struct EnumerableIList(IList list) : IEnumerableIList, IList diff --git a/src/DynamicData/Kernel/EnumeratorIList.cs b/src/DynamicData/Kernel/EnumeratorIList.cs index 6adabc312..ca549a5c1 100644 --- a/src/DynamicData/Kernel/EnumeratorIList.cs +++ b/src/DynamicData/Kernel/EnumeratorIList.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // Lifted from here https://github.com/benaadams/Ben.Enumerable. Many thanks to the genius of the man. +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif internal struct EnumeratorIList(IList list) : IEnumerator { diff --git a/src/DynamicData/Kernel/Error.cs b/src/DynamicData/Kernel/Error.cs index 685e7a88f..3f5ca7764 100644 --- a/src/DynamicData/Kernel/Error.cs +++ b/src/DynamicData/Kernel/Error.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// An error container used to report errors from within dynamic data operators. diff --git a/src/DynamicData/Kernel/IEnumerableIList.cs b/src/DynamicData/Kernel/IEnumerableIList.cs index 34511c156..170376afa 100644 --- a/src/DynamicData/Kernel/IEnumerableIList.cs +++ b/src/DynamicData/Kernel/IEnumerableIList.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // Lifted from here https://github.com/benaadams/Ben.Enumerable. Many thanks to the genius of the man. +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// A enumerable that also contains the enumerable list. diff --git a/src/DynamicData/Kernel/ISupportsCapacity.cs b/src/DynamicData/Kernel/ISupportsCapacity.cs index ce0bfa83a..68e448f0a 100644 --- a/src/DynamicData/Kernel/ISupportsCapacity.cs +++ b/src/DynamicData/Kernel/ISupportsCapacity.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// A collection type that supports a capacity. diff --git a/src/DynamicData/Kernel/InternalEx.cs b/src/DynamicData/Kernel/InternalEx.cs index 0797834a9..98776f280 100644 --- a/src/DynamicData/Kernel/InternalEx.cs +++ b/src/DynamicData/Kernel/InternalEx.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// Extensions associated with times and intervals. diff --git a/src/DynamicData/Kernel/ItemWithIndex.cs b/src/DynamicData/Kernel/ItemWithIndex.cs index 720ac7946..6e611d972 100644 --- a/src/DynamicData/Kernel/ItemWithIndex.cs +++ b/src/DynamicData/Kernel/ItemWithIndex.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// Container for an item and it's index from a list. diff --git a/src/DynamicData/Kernel/ItemWithValue.cs b/src/DynamicData/Kernel/ItemWithValue.cs index 2519f3836..4ffc78d9a 100644 --- a/src/DynamicData/Kernel/ItemWithValue.cs +++ b/src/DynamicData/Kernel/ItemWithValue.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// Container for an item and it's Value from a list. diff --git a/src/DynamicData/Kernel/OptionElse.cs b/src/DynamicData/Kernel/OptionElse.cs index b6dc1952d..d53060624 100644 --- a/src/DynamicData/Kernel/OptionElse.cs +++ b/src/DynamicData/Kernel/OptionElse.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// Continuation container used for the else operator on an option object. diff --git a/src/DynamicData/Kernel/OptionExtensions.cs b/src/DynamicData/Kernel/OptionExtensions.cs index c03937701..b7dfcbee4 100644 --- a/src/DynamicData/Kernel/OptionExtensions.cs +++ b/src/DynamicData/Kernel/OptionExtensions.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// Extensions for optional. @@ -18,13 +23,13 @@ public static class OptionExtensions /// The converter. /// The converted value. /// converter. - public static Optional Convert(this in Optional source, Func converter) + public static ReactiveUI.Primitives.Optional Convert(this in ReactiveUI.Primitives.Optional source, Func converter) where TSource : notnull where TDestination : notnull { ArgumentExceptionHelper.ThrowIfNull(converter); - return source.HasValue ? converter(source.Value) : Optional.None; + return source.HasValue ? converter(source.Value) : ReactiveUI.Primitives.Optional.None; } /// @@ -36,13 +41,13 @@ public static Optional Convert(this in Opti /// The converter that returns an optional value. /// The converted value. /// converter. - public static Optional Convert(this in Optional source, Func> converter) + public static ReactiveUI.Primitives.Optional Convert(this in ReactiveUI.Primitives.Optional source, Func> converter) where TSource : notnull where TDestination : notnull { ArgumentExceptionHelper.ThrowIfNull(converter); - return source.HasValue ? converter(source.Value) : Optional.None; + return source.HasValue ? converter(source.Value) : ReactiveUI.Primitives.Optional.None; } /// @@ -59,7 +64,7 @@ public static Optional Convert(this in Opti /// or /// fallbackConverter. /// - public static TDestination? ConvertOr(this in Optional source, Func converter, Func fallbackConverter) + public static TDestination? ConvertOr(this in ReactiveUI.Primitives.Optional source, Func converter, Func fallbackConverter) where TSource : notnull { ArgumentExceptionHelper.ThrowIfNull(converter); @@ -80,7 +85,7 @@ public static Optional Convert(this in Opti /// or /// fallbackOperation. /// - public static Optional OrElse(this in Optional source, Func> fallbackOperation) + public static ReactiveUI.Primitives.Optional OrElse(this in ReactiveUI.Primitives.Optional source, Func> fallbackOperation) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(fallbackOperation); @@ -89,7 +94,7 @@ public static Optional OrElse(this in Optional source, Func } /// - /// Overloads Enumerable.FirstOrDefault() and wraps the result in a Optional + /// Overloads Enumerable.FirstOrDefault() and wraps the result in a ReactiveUI.Primitives.Optional /// &gt;T /// container. /// @@ -97,7 +102,7 @@ public static Optional OrElse(this in Optional source, Func /// The source. /// The selector. /// The first value or none. - public static Optional FirstOrOptional(this IEnumerable source, Func selector) + public static ReactiveUI.Primitives.Optional FirstOrOptional(this IEnumerable source, Func selector) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(source); @@ -105,10 +110,10 @@ public static Optional FirstOrOptional(this IEnumerable source, Func selector(item))) { - return Optional.Create(item); + return ReactiveUI.Primitives.Optional.Create(item); } - return Optional.None; + return ReactiveUI.Primitives.Optional.None; } /// @@ -118,7 +123,7 @@ public static Optional FirstOrOptional(this IEnumerable source, FuncThe source. /// The action. /// The optional else extension. - public static OptionElse IfHasValue(this in Optional source, Action action) + public static OptionElse IfHasValue(this in ReactiveUI.Primitives.Optional source, Action action) where T : notnull { if (!source.HasValue || source.Value is null) @@ -139,7 +144,7 @@ public static OptionElse IfHasValue(this in Optional source, Action act /// The source. /// The action. /// The optional else extension. - public static OptionElse IfHasValue(this Optional? source, Action action) + public static OptionElse IfHasValue(this ReactiveUI.Primitives.Optional? source, Action action) where T : notnull { if (!source.HasValue) @@ -159,7 +164,7 @@ public static OptionElse IfHasValue(this Optional? source, Action actio } /// - /// Overloads a TryGetValue of the dictionary wrapping the result as an Optional. + /// Overloads a TryGetValue of the dictionary wrapping the result as an ReactiveUI.Primitives.Optional. /// &gt;TValue /// /// @@ -168,13 +173,13 @@ public static OptionElse IfHasValue(this Optional? source, Action actio /// The source. /// The key. /// The option of the looked up value. - public static Optional Lookup(this IDictionary source, TKey key) + public static ReactiveUI.Primitives.Optional Lookup(this IDictionary source, TKey key) where TValue : notnull { ArgumentExceptionHelper.ThrowIfNull(source); var result = source.TryGetValue(key, out var contained); - return result ? contained : Optional.None; + return result ? contained : ReactiveUI.Primitives.Optional.None; } /// @@ -199,7 +204,7 @@ public static bool RemoveIfContained(this IDictionaryThe type of item. /// The source. /// An enumerable of the selected items. - public static IEnumerable SelectValues(this IEnumerable> source) + public static IEnumerable SelectValues(this IEnumerable> source) where T : notnull => source.Where(t => t.HasValue && t.Value is not null).Select(t => t.Value!); /// @@ -220,7 +225,7 @@ public static T ValueOr(this T? source, T defaultValue) /// The value selector. /// If the value or a provided default. /// valueSelector. - public static T ValueOr(this in Optional source, Func valueSelector) + public static T ValueOr(this in ReactiveUI.Primitives.Optional source, Func valueSelector) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(valueSelector); @@ -234,7 +239,7 @@ public static T ValueOr(this in Optional source, Func valueSelector) /// The type of the item. /// The source. /// The value or default. - public static T? ValueOrDefault(this in Optional source) + public static T? ValueOrDefault(this in ReactiveUI.Primitives.Optional source) where T : notnull { if (source.HasValue) @@ -253,7 +258,7 @@ public static T ValueOr(this in Optional source, Func valueSelector) /// The exception generator. /// The value. /// exceptionGenerator. - public static T ValueOrThrow(this in Optional source, Func exceptionGenerator) + public static T ValueOrThrow(this in ReactiveUI.Primitives.Optional source, Func exceptionGenerator) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(exceptionGenerator); diff --git a/src/DynamicData/Kernel/OptionObservableExtensions.cs b/src/DynamicData/Kernel/OptionObservableExtensions.cs index 10060142b..5b76b271f 100644 --- a/src/DynamicData/Kernel/OptionObservableExtensions.cs +++ b/src/DynamicData/Kernel/OptionObservableExtensions.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif /// /// Extensions for optional. @@ -20,19 +25,19 @@ public static class OptionObservableExtensions /// Observable Optional of . /// Source or Converter was null. /// Observable version of . - public static IObservable> Convert(this IObservable> source, Func converter) + public static IObservable> Convert(this IObservable> source, Func converter) where TSource : notnull where TDestination : notnull { ArgumentExceptionHelper.ThrowIfNull(source); ArgumentExceptionHelper.ThrowIfNull(converter); - return source.Select(optional => optional.HasValue ? converter(optional.Value) : Optional.None); + return source.Select(optional => optional.HasValue ? converter(optional.Value) : ReactiveUI.Primitives.Optional.None); } /// /// Overload of that allows the conversion - /// operation to also return an Optional. + /// operation to also return an ReactiveUI.Primitives.Optional. /// /// The type of the source. /// The type of the destination. @@ -41,14 +46,14 @@ public static IObservable> Convert /// Observable Optional of . /// Source or Converter was null. /// Observable version of . - public static IObservable> Convert(this IObservable> source, Func> converter) + public static IObservable> Convert(this IObservable> source, Func> converter) where TSource : notnull where TDestination : notnull { ArgumentExceptionHelper.ThrowIfNull(source); ArgumentExceptionHelper.ThrowIfNull(converter); - return source.Select(optional => optional.HasValue ? converter(optional.Value) : Optional.None); + return source.Select(optional => optional.HasValue ? converter(optional.Value) : ReactiveUI.Primitives.Optional.None); } /// @@ -68,7 +73,7 @@ public static IObservable> Convert /// or /// fallbackConverter. /// - public static IObservable ConvertOr(this IObservable> source, Func converter, Func fallbackConverter) + public static IObservable ConvertOr(this IObservable> source, Func converter, Func fallbackConverter) where TSource : notnull { ArgumentExceptionHelper.ThrowIfNull(source); @@ -91,7 +96,7 @@ public static IObservable> Convert /// fallbackOperation. /// /// Observable version of . - public static IObservable> OrElse(this IObservable> source, Func> fallbackOperation) + public static IObservable> OrElse(this IObservable> source, Func> fallbackOperation) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(source); @@ -107,9 +112,9 @@ public static IObservable> OrElse(this IObservable> s /// The source. /// The action. /// Optional alternative action for the Else case. - /// The same Observable Optional. + /// The same Observable ReactiveUI.Primitives.Optional. /// Observable version of . - public static IObservable> OnHasValue(this IObservable> source, Action action, Action? elseAction = null) + public static IObservable> OnHasValue(this IObservable> source, Action action, Action? elseAction = null) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(source); @@ -125,8 +130,8 @@ public static IObservable> OnHasValue(this IObservableThe source. /// The action. /// Optional alternative action for the Else case. - /// The same Observable Optional. - public static IObservable> OnHasNoValue(this IObservable> source, Action action, Action? elseAction = null) + /// The same Observable ReactiveUI.Primitives.Optional. + public static IObservable> OnHasNoValue(this IObservable> source, Action action, Action? elseAction = null) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(source); @@ -143,7 +148,7 @@ public static IObservable> OnHasNoValue(this IObservableThe source. /// An Observable with the Values. /// Observable version of . - public static IObservable SelectValues(this IObservable> source) + public static IObservable SelectValues(this IObservable> source) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(source); @@ -161,7 +166,7 @@ public static IObservable SelectValues(this IObservable> sourc /// If the value or a provided default. /// valueSelector. /// Observable version of . - public static IObservable ValueOr(this IObservable> source, Func valueSelector) + public static IObservable ValueOr(this IObservable> source, Func valueSelector) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(source); @@ -177,7 +182,7 @@ public static IObservable ValueOr(this IObservable> source, Fu /// The source. /// The value or default. /// Observable version of . - public static IObservable ValueOrDefault(this IObservable> source) + public static IObservable ValueOrDefault(this IObservable> source) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(source); @@ -195,7 +200,7 @@ public static IObservable ValueOr(this IObservable> source, Fu /// The value. /// exceptionGenerator. /// Observable version of . - public static IObservable ValueOrThrow(this IObservable> source, Func exceptionGenerator) + public static IObservable ValueOrThrow(this IObservable> source, Func exceptionGenerator) where T : notnull { ArgumentExceptionHelper.ThrowIfNull(source); diff --git a/src/DynamicData/Kernel/ParallelEx.cs b/src/DynamicData/Kernel/ParallelEx.cs index 1e23ed706..1b5ce675f 100644 --- a/src/DynamicData/Kernel/ParallelEx.cs +++ b/src/DynamicData/Kernel/ParallelEx.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif internal static class ParallelEx { diff --git a/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs b/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs index 35a70c6a7..2c5bd2a59 100644 --- a/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs +++ b/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif internal sealed class ReadOnlyCollectionLight : IReadOnlyCollection { diff --git a/src/DynamicData/Kernel/ReferenceEqualityComparer.cs b/src/DynamicData/Kernel/ReferenceEqualityComparer.cs index 962be384f..94fa5aff2 100644 --- a/src/DynamicData/Kernel/ReferenceEqualityComparer.cs +++ b/src/DynamicData/Kernel/ReferenceEqualityComparer.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Kernel; +#else namespace DynamicData.Kernel; +#endif internal sealed class ReferenceEqualityComparer : IEqualityComparer { diff --git a/src/DynamicData/List/Change.cs b/src/DynamicData/List/Change.cs index b117c6066..05888ed9f 100644 --- a/src/DynamicData/List/Change.cs +++ b/src/DynamicData/List/Change.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Container to describe a single change to a cache. @@ -19,7 +23,7 @@ public sealed class Change : IEquatable> /// The current. /// The index. public Change(ListChangeReason reason, T current, int index = -1) - : this(reason, current, Optional.None, index) + : this(reason, current, ReactiveUI.Primitives.Optional.None, index) { } @@ -70,7 +74,7 @@ public Change(T current, int currentIndex, int previousIndex) } Reason = ListChangeReason.Moved; - Item = new ItemChange(Reason, current, Optional.None, currentIndex, previousIndex); + Item = new ItemChange(Reason, current, ReactiveUI.Primitives.Optional.None, currentIndex, previousIndex); Range = RangeChange.Empty; } @@ -90,7 +94,7 @@ public Change(T current, int currentIndex, int previousIndex) /// or /// For , must supply an index. /// - public Change(ListChangeReason reason, T current, in Optional previous, int currentIndex = -1, int previousIndex = -1) + public Change(ListChangeReason reason, T current, in ReactiveUI.Primitives.Optional previous, int currentIndex = -1, int previousIndex = -1) { if (reason == ListChangeReason.Add && previous.HasValue) { diff --git a/src/DynamicData/List/ChangeAwareList.cs b/src/DynamicData/List/ChangeAwareList.cs index 9e0f02d20..c029261c5 100644 --- a/src/DynamicData/List/ChangeAwareList.cs +++ b/src/DynamicData/List/ChangeAwareList.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A list which captures all changes which are made to it. These changes are recorded until CaptureChanges() at which point the changes are cleared. @@ -83,7 +88,7 @@ public int Capacity /// /// Gets the last change in the collection. /// - private Optional> Last => _changes.Count == 0 ? Optional>.None : _changes[_changes.Count - 1]; + private ReactiveUI.Primitives.Optional> Last => _changes.Count == 0 ? ReactiveUI.Primitives.Optional>.None : _changes[_changes.Count - 1]; /// /// Gets or sets the item at the specified index. diff --git a/src/DynamicData/List/ChangeAwareListWithRefCounts.cs b/src/DynamicData/List/ChangeAwareListWithRefCounts.cs index 234b07930..82900f13e 100644 --- a/src/DynamicData/List/ChangeAwareListWithRefCounts.cs +++ b/src/DynamicData/List/ChangeAwareListWithRefCounts.cs @@ -1,11 +1,20 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal sealed class ChangeAwareListWithRefCounts : ChangeAwareList where T : notnull diff --git a/src/DynamicData/List/ChangeSet.cs b/src/DynamicData/List/ChangeSet.cs index d1b18aa09..211b0f76d 100644 --- a/src/DynamicData/List/ChangeSet.cs +++ b/src/DynamicData/List/ChangeSet.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A set of changes which has occurred since the last reported change. diff --git a/src/DynamicData/List/ChangeSetEx.cs b/src/DynamicData/List/ChangeSetEx.cs index 17fa61a4b..c01f3839f 100644 --- a/src/DynamicData/List/ChangeSetEx.cs +++ b/src/DynamicData/List/ChangeSetEx.cs @@ -1,12 +1,25 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif +#if REACTIVE_SHIM +using DynamicData.Reactive.List.Linq; +#else using DynamicData.List.Linq; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Change set extensions. diff --git a/src/DynamicData/List/ChangeType.cs b/src/DynamicData/List/ChangeType.cs index 481e7c1bf..cf91a311e 100644 --- a/src/DynamicData/List/ChangeType.cs +++ b/src/DynamicData/List/ChangeType.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Description of the type of change. diff --git a/src/DynamicData/List/IChangeSet.cs b/src/DynamicData/List/IChangeSet.cs index 36434a08d..f4dd92d5b 100644 --- a/src/DynamicData/List/IChangeSet.cs +++ b/src/DynamicData/List/IChangeSet.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A collection of changes. diff --git a/src/DynamicData/List/IChangeSetAdaptor.cs b/src/DynamicData/List/IChangeSetAdaptor.cs index db579cb12..79e579d01 100644 --- a/src/DynamicData/List/IChangeSetAdaptor.cs +++ b/src/DynamicData/List/IChangeSetAdaptor.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A simple adaptor to inject side effects into a change set observable. diff --git a/src/DynamicData/List/IExtendedList.cs b/src/DynamicData/List/IExtendedList.cs index 8afb9e5df..95ccd7a22 100644 --- a/src/DynamicData/List/IExtendedList.cs +++ b/src/DynamicData/List/IExtendedList.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Represents a list which supports range operations. diff --git a/src/DynamicData/List/IGroup.cs b/src/DynamicData/List/IGroup.cs index c8f4e09e9..60e28cb3b 100644 --- a/src/DynamicData/List/IGroup.cs +++ b/src/DynamicData/List/IGroup.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A grouping of observable lists. diff --git a/src/DynamicData/List/IGrouping.cs b/src/DynamicData/List/IGrouping.cs index 30af65d59..2568fb638 100644 --- a/src/DynamicData/List/IGrouping.cs +++ b/src/DynamicData/List/IGrouping.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List; +#else namespace DynamicData.List; +#endif /// /// Represents a group which provides an update after any value within the group changes. diff --git a/src/DynamicData/List/IObservableList.cs b/src/DynamicData/List/IObservableList.cs index 0935c0df0..f2b54db40 100644 --- a/src/DynamicData/List/IObservableList.cs +++ b/src/DynamicData/List/IObservableList.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// A readonly observable list, providing observable methods diff --git a/src/DynamicData/List/IPageChangeSet.cs b/src/DynamicData/List/IPageChangeSet.cs index 447612a76..b64f1c1ee 100644 --- a/src/DynamicData/List/IPageChangeSet.cs +++ b/src/DynamicData/List/IPageChangeSet.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Operators; +#else using DynamicData.Operators; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Represents a paged subset of data reduced by a defined set of parameters diff --git a/src/DynamicData/List/ISourceList.cs b/src/DynamicData/List/ISourceList.cs index d75ec1042..981f279cd 100644 --- a/src/DynamicData/List/ISourceList.cs +++ b/src/DynamicData/List/ISourceList.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// An editable observable list, providing observable methods diff --git a/src/DynamicData/List/IVirtualChangeSet.cs b/src/DynamicData/List/IVirtualChangeSet.cs index c971d7a3f..fd590316f 100644 --- a/src/DynamicData/List/IVirtualChangeSet.cs +++ b/src/DynamicData/List/IVirtualChangeSet.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Represents a subset of data reduced by a defined set of parameters diff --git a/src/DynamicData/List/Internal/AnonymousObservableList.cs b/src/DynamicData/List/Internal/AnonymousObservableList.cs index 4e5f7f6c9..f9036af47 100644 --- a/src/DynamicData/List/Internal/AnonymousObservableList.cs +++ b/src/DynamicData/List/Internal/AnonymousObservableList.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif [DebuggerDisplay("AnonymousObservableList<{typeof(T).Name}> ({Count} Items)")] internal sealed class AnonymousObservableList : IObservableList diff --git a/src/DynamicData/List/Internal/AutoRefresh.cs b/src/DynamicData/List/Internal/AutoRefresh.cs index 2839494ae..61a572690 100644 --- a/src/DynamicData/List/Internal/AutoRefresh.cs +++ b/src/DynamicData/List/Internal/AutoRefresh.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class AutoRefresh(IObservable> source, Func> reEvaluator, TimeSpan? buffer = null, IScheduler? scheduler = null) where TObject : notnull diff --git a/src/DynamicData/List/Internal/BufferIf.cs b/src/DynamicData/List/Internal/BufferIf.cs index c3b4814b0..9109caaaa 100644 --- a/src/DynamicData/List/Internal/BufferIf.cs +++ b/src/DynamicData/List/Internal/BufferIf.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class BufferIf(IObservable> source, IObservable pauseIfTrueSelector, bool initialPauseState = false, TimeSpan? timeOut = null, IScheduler? scheduler = null) where T : notnull diff --git a/src/DynamicData/List/Internal/ChangeSetMergeTracker.cs b/src/DynamicData/List/Internal/ChangeSetMergeTracker.cs index fa2e2cec0..336c90a36 100644 --- a/src/DynamicData/List/Internal/ChangeSetMergeTracker.cs +++ b/src/DynamicData/List/Internal/ChangeSetMergeTracker.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class ChangeSetMergeTracker where TObject : notnull diff --git a/src/DynamicData/List/Internal/ClonedListChangeSet.cs b/src/DynamicData/List/Internal/ClonedListChangeSet.cs index cbb9bc6e4..7c62e4c6b 100644 --- a/src/DynamicData/List/Internal/ClonedListChangeSet.cs +++ b/src/DynamicData/List/Internal/ClonedListChangeSet.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class ClonedListChangeSet where TObject : notnull diff --git a/src/DynamicData/List/Internal/Combiner.cs b/src/DynamicData/List/Internal/Combiner.cs index ff35c2be2..255f2301b 100644 --- a/src/DynamicData/List/Internal/Combiner.cs +++ b/src/DynamicData/List/Internal/Combiner.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class Combiner(ICollection>> source, CombineOperator type) where T : notnull diff --git a/src/DynamicData/List/Internal/DeferUntilLoaded.cs b/src/DynamicData/List/Internal/DeferUntilLoaded.cs index d76e3401a..3d426e23c 100644 --- a/src/DynamicData/List/Internal/DeferUntilLoaded.cs +++ b/src/DynamicData/List/Internal/DeferUntilLoaded.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class DeferUntilLoaded(IObservable> source) where T : notnull diff --git a/src/DynamicData/List/Internal/DisposeMany.cs b/src/DynamicData/List/Internal/DisposeMany.cs index 76afb3e5b..08dc8b103 100644 --- a/src/DynamicData/List/Internal/DisposeMany.cs +++ b/src/DynamicData/List/Internal/DisposeMany.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class DisposeMany(IObservable> source) where T : notnull diff --git a/src/DynamicData/List/Internal/Distinct.cs b/src/DynamicData/List/Internal/Distinct.cs index caaafef76..2e4f11505 100644 --- a/src/DynamicData/List/Internal/Distinct.cs +++ b/src/DynamicData/List/Internal/Distinct.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class Distinct(IObservable> source, Func valueSelector) where T : notnull diff --git a/src/DynamicData/List/Internal/DynamicCombiner.cs b/src/DynamicData/List/Internal/DynamicCombiner.cs index efa5e1d34..ac8f16676 100644 --- a/src/DynamicData/List/Internal/DynamicCombiner.cs +++ b/src/DynamicData/List/Internal/DynamicCombiner.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class DynamicCombiner(IObservableList>> source, CombineOperator type) where T : notnull diff --git a/src/DynamicData/List/Internal/EditDiff.cs b/src/DynamicData/List/Internal/EditDiff.cs index 0c48ff45f..9ff14a8aa 100644 --- a/src/DynamicData/List/Internal/EditDiff.cs +++ b/src/DynamicData/List/Internal/EditDiff.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class EditDiff(ISourceList source, IEqualityComparer? equalityComparer) where T : notnull diff --git a/src/DynamicData/List/Internal/ExpirableItem.cs b/src/DynamicData/List/Internal/ExpirableItem.cs index 23227719a..9f403dc6e 100644 --- a/src/DynamicData/List/Internal/ExpirableItem.cs +++ b/src/DynamicData/List/Internal/ExpirableItem.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class ExpirableItem(TObject value, DateTime dateTime, long index) : IEquatable> { diff --git a/src/DynamicData/List/Internal/ExpireAfter.cs b/src/DynamicData/List/Internal/ExpireAfter.cs index 23a68f654..0a63e5902 100644 --- a/src/DynamicData/List/Internal/ExpireAfter.cs +++ b/src/DynamicData/List/Internal/ExpireAfter.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class ExpireAfter where T : notnull diff --git a/src/DynamicData/List/Internal/Filter.Dynamic.cs b/src/DynamicData/List/Internal/Filter.Dynamic.cs index 0d59af43d..9bcdbce8e 100644 --- a/src/DynamicData/List/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/List/Internal/Filter.Dynamic.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal static partial class Filter { diff --git a/src/DynamicData/List/Internal/Filter.Static.cs b/src/DynamicData/List/Internal/Filter.Static.cs index 141e63521..368bb5186 100644 --- a/src/DynamicData/List/Internal/Filter.Static.cs +++ b/src/DynamicData/List/Internal/Filter.Static.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal static partial class Filter { diff --git a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs index 0943e1fc3..d5e55e86d 100644 --- a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs +++ b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal static partial class Filter { diff --git a/src/DynamicData/List/Internal/FilterOnObservable.cs b/src/DynamicData/List/Internal/FilterOnObservable.cs index 97214910c..6b1a4105d 100644 --- a/src/DynamicData/List/Internal/FilterOnObservable.cs +++ b/src/DynamicData/List/Internal/FilterOnObservable.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class FilterOnObservable(IObservable> source, Func> filter, TimeSpan? buffer = null, IScheduler? scheduler = null) where TObject : notnull diff --git a/src/DynamicData/List/Internal/FilterOnProperty.cs b/src/DynamicData/List/Internal/FilterOnProperty.cs index 1ff832f93..a94269e5f 100644 --- a/src/DynamicData/List/Internal/FilterOnProperty.cs +++ b/src/DynamicData/List/Internal/FilterOnProperty.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif [Obsolete("Use AutoRefresh(), followed by Filter() instead")] internal sealed class FilterOnProperty(IObservable> source, Expression> propertySelector, Func predicate, TimeSpan? throttle = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/FilterStatic.cs b/src/DynamicData/List/Internal/FilterStatic.cs index bd69d9e00..e3e93fbbc 100644 --- a/src/DynamicData/List/Internal/FilterStatic.cs +++ b/src/DynamicData/List/Internal/FilterStatic.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class FilterStatic(IObservable> source, Func predicate) where T : notnull diff --git a/src/DynamicData/List/Internal/Group.cs b/src/DynamicData/List/Internal/Group.cs index d6cd72e2d..0c9807659 100644 --- a/src/DynamicData/List/Internal/Group.cs +++ b/src/DynamicData/List/Internal/Group.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class Group(TGroup groupKey) : IGroup, IDisposable, IEquatable> where TObject : notnull diff --git a/src/DynamicData/List/Internal/GroupOn.cs b/src/DynamicData/List/Internal/GroupOn.cs index adefca815..e3b0258a8 100644 --- a/src/DynamicData/List/Internal/GroupOn.cs +++ b/src/DynamicData/List/Internal/GroupOn.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class GroupOn(IObservable> source, Func groupSelector, IObservable? regrouper) where TObject : notnull @@ -230,13 +235,13 @@ public GroupWithAddIndicator(Group group, bool wasCreated) public bool WasCreated { get; } } - private sealed class ItemWithGroupKey(TObject item, TGroupKey group, Optional previousGroup) : IEquatable + private sealed class ItemWithGroupKey(TObject item, TGroupKey group, ReactiveUI.Primitives.Optional previousGroup) : IEquatable { public TGroupKey Group { get; set; } = group; public TObject Item { get; } = item; - public Optional PreviousGroup { get; } = previousGroup; + public ReactiveUI.Primitives.Optional PreviousGroup { get; } = previousGroup; /// Returns a value that indicates whether the values of two objects are equal. /// The first value to compare. diff --git a/src/DynamicData/List/Internal/GroupOnImmutable.cs b/src/DynamicData/List/Internal/GroupOnImmutable.cs index 26fbd357a..e0e64d00b 100644 --- a/src/DynamicData/List/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/List/Internal/GroupOnImmutable.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class GroupOnImmutable(IObservable> source, Func groupSelector, IObservable? reGrouper) where TObject : notnull @@ -253,13 +258,13 @@ private sealed class GroupContainer(TGroupKey key) public IList List { get; } = new List(); } - private sealed class ItemWithGroupKey(TObject item, TGroupKey group, Optional previousGroup) : IEquatable + private sealed class ItemWithGroupKey(TObject item, TGroupKey group, ReactiveUI.Primitives.Optional previousGroup) : IEquatable { public TGroupKey Group { get; set; } = group; public TObject Item { get; } = item; - public Optional PreviousGroup { get; } = previousGroup; + public ReactiveUI.Primitives.Optional PreviousGroup { get; } = previousGroup; public static bool operator ==(ItemWithGroupKey left, ItemWithGroupKey right) => Equals(left, right); diff --git a/src/DynamicData/List/Internal/GroupOnProperty.cs b/src/DynamicData/List/Internal/GroupOnProperty.cs index a80b0e0db..ddf63758f 100644 --- a/src/DynamicData/List/Internal/GroupOnProperty.cs +++ b/src/DynamicData/List/Internal/GroupOnProperty.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class GroupOnProperty(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged diff --git a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs index dd48eb230..909a61940 100644 --- a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs @@ -3,8 +3,13 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class GroupOnPropertyWithImmutableState(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged diff --git a/src/DynamicData/List/Internal/ImmutableGroup.cs b/src/DynamicData/List/Internal/ImmutableGroup.cs index 3ad76d595..2d149541e 100644 --- a/src/DynamicData/List/Internal/ImmutableGroup.cs +++ b/src/DynamicData/List/Internal/ImmutableGroup.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class ImmutableGroup : IGrouping, IEquatable> { diff --git a/src/DynamicData/List/Internal/LimitSizeTo.cs b/src/DynamicData/List/Internal/LimitSizeTo.cs index 7408098bc..2f7e1bafa 100644 --- a/src/DynamicData/List/Internal/LimitSizeTo.cs +++ b/src/DynamicData/List/Internal/LimitSizeTo.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif #if NET9_0_OR_GREATER internal sealed class LimitSizeTo(ISourceList sourceList, int sizeLimit, IScheduler scheduler, Lock locker) diff --git a/src/DynamicData/List/Internal/MergeChangeSets.cs b/src/DynamicData/List/Internal/MergeChangeSets.cs index e6297834e..e50a0375b 100644 --- a/src/DynamicData/List/Internal/MergeChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeChangeSets.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif /// /// Operator that is similiar to Merge but intelligently handles List ChangeSets. diff --git a/src/DynamicData/List/Internal/MergeMany.cs b/src/DynamicData/List/Internal/MergeMany.cs index 647a324cb..b5baf01cc 100644 --- a/src/DynamicData/List/Internal/MergeMany.cs +++ b/src/DynamicData/List/Internal/MergeMany.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class MergeMany(IObservable> source, Func> observableSelector) where T : notnull diff --git a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs index afff3572c..9bdac35f3 100644 --- a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif /// /// Operator that is similiar to MergeMany but intelligently handles Cache ChangeSets. diff --git a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs index 9f0363d2f..6da79d2a6 100644 --- a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif /// /// Operator that is similiar to MergeMany but intelligently handles List ChangeSets. diff --git a/src/DynamicData/List/Internal/OnItemAdded.cs b/src/DynamicData/List/Internal/OnItemAdded.cs index 34228f6e4..4eb53967f 100644 --- a/src/DynamicData/List/Internal/OnItemAdded.cs +++ b/src/DynamicData/List/Internal/OnItemAdded.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal static class OnItemAdded where T : notnull diff --git a/src/DynamicData/List/Internal/OnItemRefreshed.cs b/src/DynamicData/List/Internal/OnItemRefreshed.cs index c159788e2..a66ce78bb 100644 --- a/src/DynamicData/List/Internal/OnItemRefreshed.cs +++ b/src/DynamicData/List/Internal/OnItemRefreshed.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal static class OnItemRefreshed where T : notnull diff --git a/src/DynamicData/List/Internal/OnItemRemoved.cs b/src/DynamicData/List/Internal/OnItemRemoved.cs index 5b04bb125..ccd3b8875 100644 --- a/src/DynamicData/List/Internal/OnItemRemoved.cs +++ b/src/DynamicData/List/Internal/OnItemRemoved.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal static class OnItemRemoved where T : notnull diff --git a/src/DynamicData/List/Internal/Pager.cs b/src/DynamicData/List/Internal/Pager.cs index a98caa2e4..099a2993f 100644 --- a/src/DynamicData/List/Internal/Pager.cs +++ b/src/DynamicData/List/Internal/Pager.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class Pager(IObservable> source, IObservable requests) where T : notnull diff --git a/src/DynamicData/List/Internal/QueryWhenChanged.cs b/src/DynamicData/List/Internal/QueryWhenChanged.cs index 7f7b1ab1f..afc2248fd 100644 --- a/src/DynamicData/List/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/List/Internal/QueryWhenChanged.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class QueryWhenChanged(IObservable> source) where T : notnull diff --git a/src/DynamicData/List/Internal/ReaderWriter.cs b/src/DynamicData/List/Internal/ReaderWriter.cs index 7241e58e5..0a2651bab 100644 --- a/src/DynamicData/List/Internal/ReaderWriter.cs +++ b/src/DynamicData/List/Internal/ReaderWriter.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class ReaderWriter where T : notnull diff --git a/src/DynamicData/List/Internal/RefCount.cs b/src/DynamicData/List/Internal/RefCount.cs index 323e08710..5518f6b5f 100644 --- a/src/DynamicData/List/Internal/RefCount.cs +++ b/src/DynamicData/List/Internal/RefCount.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class RefCount(IObservable> source) where T : notnull diff --git a/src/DynamicData/List/Internal/ReferenceCountTracker.cs b/src/DynamicData/List/Internal/ReferenceCountTracker.cs index 142cb83c1..e92b44b7f 100644 --- a/src/DynamicData/List/Internal/ReferenceCountTracker.cs +++ b/src/DynamicData/List/Internal/ReferenceCountTracker.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif /// /// Ripped and adapted from https://clinq.codeplex.com/. diff --git a/src/DynamicData/List/Internal/Sort.cs b/src/DynamicData/List/Internal/Sort.cs index 92c30a66e..3582697da 100644 --- a/src/DynamicData/List/Internal/Sort.cs +++ b/src/DynamicData/List/Internal/Sort.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class Sort(IObservable> source, IComparer? comparer, SortOptions sortOptions, IObservable? resort, IObservable>? comparerObservable, int resetThreshold) where T : notnull diff --git a/src/DynamicData/List/Internal/SubscribeMany.cs b/src/DynamicData/List/Internal/SubscribeMany.cs index 0d2f2f881..533e51280 100644 --- a/src/DynamicData/List/Internal/SubscribeMany.cs +++ b/src/DynamicData/List/Internal/SubscribeMany.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class SubscribeMany(IObservable> source, Func subscriptionFactory) where T : notnull diff --git a/src/DynamicData/List/Internal/Switch.cs b/src/DynamicData/List/Internal/Switch.cs index 3e55c1bda..dc8523684 100644 --- a/src/DynamicData/List/Internal/Switch.cs +++ b/src/DynamicData/List/Internal/Switch.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class Switch(IObservable>> sources) where T : notnull diff --git a/src/DynamicData/List/Internal/ToObservableChangeSet.cs b/src/DynamicData/List/Internal/ToObservableChangeSet.cs index 7da1eb6b4..dee9509e3 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal static class ToObservableChangeSet where TObject : notnull diff --git a/src/DynamicData/List/Internal/TransformAsync.cs b/src/DynamicData/List/Internal/TransformAsync.cs index f13292c3b..1bfd998c7 100644 --- a/src/DynamicData/List/Internal/TransformAsync.cs +++ b/src/DynamicData/List/Internal/TransformAsync.cs @@ -1,21 +1,26 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class TransformAsync where TSource : notnull where TDestination : notnull { - private readonly Func, int, Task.TransformedItemContainer>> _containerFactory; + private readonly Func, int, Task.TransformedItemContainer>> _containerFactory; private readonly IObservable> _source; private readonly bool _transformOnRefresh; public TransformAsync( IObservable> source, - Func, int, Task> factory, + Func, int, Task> factory, bool transformOnRefresh) { ArgumentExceptionHelper.ThrowIfNull(factory); @@ -75,7 +80,7 @@ private async Task Transform( var container = await _containerFactory( item.Item.Current, - Optional.None, + ReactiveUI.Primitives.Optional.None, transformed.Count).ConfigureAwait(false); transformed.Add(container); } @@ -84,7 +89,7 @@ await _containerFactory( var container = await _containerFactory( item.Item.Current, - Optional.None, + ReactiveUI.Primitives.Optional.None, change.CurrentIndex).ConfigureAwait(false); transformed.Insert(change.CurrentIndex, container); } @@ -95,7 +100,7 @@ await _containerFactory( case ListChangeReason.AddRange: { var startIndex = item.Range.Index < 0 ? transformed.Count : item.Range.Index; - var tasks = item.Range.Select((t, idx) => _containerFactory(t, Optional.None, idx + startIndex)); + var tasks = item.Range.Select((t, idx) => _containerFactory(t, ReactiveUI.Primitives.Optional.None, idx + startIndex)); var containers = await Task.WhenAll(tasks).ConfigureAwait(false); transformed.AddOrInsertRange(containers, item.Range.Index); break; @@ -106,7 +111,7 @@ await _containerFactory( var change = item.Item; if (_transformOnRefresh) { - Optional previous = transformed[change.CurrentIndex].Destination; + ReactiveUI.Primitives.Optional previous = transformed[change.CurrentIndex].Destination; var container = await _containerFactory(change.Current, previous, change.CurrentIndex) .ConfigureAwait(false); transformed[change.CurrentIndex] = container; @@ -123,7 +128,7 @@ await _containerFactory( { var change = item.Item; - Optional previous = transformed[change.PreviousIndex].Destination; + ReactiveUI.Primitives.Optional previous = transformed[change.PreviousIndex].Destination; if (change.CurrentIndex == change.PreviousIndex) { transformed[change.CurrentIndex] = await _containerFactory(change.Current, previous, change.CurrentIndex); @@ -131,7 +136,7 @@ await _containerFactory( else { transformed.RemoveAt(change.PreviousIndex); - transformed.Insert(change.CurrentIndex, await _containerFactory(change.Current, Optional.None, change.CurrentIndex)); + transformed.Insert(change.CurrentIndex, await _containerFactory(change.Current, ReactiveUI.Primitives.Optional.None, change.CurrentIndex)); } break; diff --git a/src/DynamicData/List/Internal/TransformMany.cs b/src/DynamicData/List/Internal/TransformMany.cs index 0e4a44118..13d5e260b 100644 --- a/src/DynamicData/List/Internal/TransformMany.cs +++ b/src/DynamicData/List/Internal/TransformMany.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null, Func>>? childChanges = null) where TSource : notnull diff --git a/src/DynamicData/List/Internal/Transformer.cs b/src/DynamicData/List/Internal/Transformer.cs index d4307f11b..3d6c66478 100644 --- a/src/DynamicData/List/Internal/Transformer.cs +++ b/src/DynamicData/List/Internal/Transformer.cs @@ -1,20 +1,25 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class Transformer where TSource : notnull where TDestination : notnull { - private readonly Func, int, TransformedItemContainer> _containerFactory; + private readonly Func, int, TransformedItemContainer> _containerFactory; private readonly IObservable> _source; private readonly bool _transformOnRefresh; - public Transformer(IObservable> source, Func, int, TDestination> factory, bool transformOnRefresh) + public Transformer(IObservable> source, Func, int, TDestination> factory, bool transformOnRefresh) { ArgumentExceptionHelper.ThrowIfNull(factory); ArgumentExceptionHelper.ThrowIfNull(source); @@ -50,11 +55,11 @@ private void Transform(ChangeAwareList transformed, IC var change = item.Item; if (change.CurrentIndex < 0 || change.CurrentIndex >= transformed.Count) { - transformed.Add(_containerFactory(change.Current, Optional.None, transformed.Count)); + transformed.Add(_containerFactory(change.Current, ReactiveUI.Primitives.Optional.None, transformed.Count)); } else { - var converted = _containerFactory(change.Current, Optional.None, change.CurrentIndex); + var converted = _containerFactory(change.Current, ReactiveUI.Primitives.Optional.None, change.CurrentIndex); transformed.Insert(change.CurrentIndex, converted); } @@ -65,7 +70,7 @@ private void Transform(ChangeAwareList transformed, IC { var startIndex = item.Range.Index < 0 ? transformed.Count : item.Range.Index; - transformed.AddOrInsertRange(item.Range.Select((t, idx) => _containerFactory(t, Optional.None, idx + startIndex)), item.Range.Index); + transformed.AddOrInsertRange(item.Range.Select((t, idx) => _containerFactory(t, ReactiveUI.Primitives.Optional.None, idx + startIndex)), item.Range.Index); break; } @@ -87,7 +92,7 @@ private void Transform(ChangeAwareList transformed, IC if (_transformOnRefresh) { - Optional previous = transformed[index].Destination; + ReactiveUI.Primitives.Optional previous = transformed[index].Destination; transformed[index] = _containerFactory(change.Current, previous, index); } else @@ -116,7 +121,7 @@ private void Transform(ChangeAwareList transformed, IC } else { - Optional previous = transformed[change.PreviousIndex].Destination; + ReactiveUI.Primitives.Optional previous = transformed[change.PreviousIndex].Destination; if (change.CurrentIndex == change.PreviousIndex) { transformed[change.CurrentIndex] = _containerFactory(change.Current, previous, change.CurrentIndex); @@ -124,7 +129,7 @@ private void Transform(ChangeAwareList transformed, IC else { transformed.RemoveAt(change.PreviousIndex); - transformed.Insert(change.CurrentIndex, _containerFactory(change.Current, Optional.None, change.CurrentIndex)); + transformed.Insert(change.CurrentIndex, _containerFactory(change.Current, ReactiveUI.Primitives.Optional.None, change.CurrentIndex)); } } diff --git a/src/DynamicData/List/Internal/UnifiedChange.cs b/src/DynamicData/List/Internal/UnifiedChange.cs index 9088320f6..957601e7d 100644 --- a/src/DynamicData/List/Internal/UnifiedChange.cs +++ b/src/DynamicData/List/Internal/UnifiedChange.cs @@ -1,14 +1,19 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif -internal readonly struct UnifiedChange(ListChangeReason reason, T current, Optional previous) : IEquatable> +internal readonly struct UnifiedChange(ListChangeReason reason, T current, ReactiveUI.Primitives.Optional previous) : IEquatable> where T : notnull { public UnifiedChange(ListChangeReason reason, T current) - : this(reason, current, Optional.None) + : this(reason, current, ReactiveUI.Primitives.Optional.None) { } @@ -16,7 +21,7 @@ public UnifiedChange(ListChangeReason reason, T current) public T Current { get; } = current; - public Optional Previous { get; } = previous; + public ReactiveUI.Primitives.Optional Previous { get; } = previous; public static bool operator ==(in UnifiedChange left, in UnifiedChange right) => left.Equals(right); diff --git a/src/DynamicData/List/Internal/Virtualiser.cs b/src/DynamicData/List/Internal/Virtualiser.cs index ff6438a86..1e282acd0 100644 --- a/src/DynamicData/List/Internal/Virtualiser.cs +++ b/src/DynamicData/List/Internal/Virtualiser.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else namespace DynamicData.List.Internal; +#endif internal sealed class Virtualiser(IObservable> source, IObservable requests) where T : notnull diff --git a/src/DynamicData/List/ItemChange.cs b/src/DynamicData/List/ItemChange.cs index 4b7d31a46..50f59adfa 100644 --- a/src/DynamicData/List/ItemChange.cs +++ b/src/DynamicData/List/ItemChange.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Container to describe a single change to a cache. @@ -25,7 +29,7 @@ namespace DynamicData; /// The previous. /// Value of the current. /// Value of the previous. - public ItemChange(ListChangeReason reason, T current, in Optional previous, int currentIndex = -1, int previousIndex = -1) + public ItemChange(ListChangeReason reason, T current, in ReactiveUI.Primitives.Optional previous, int currentIndex = -1, int previousIndex = -1) : this() { Reason = reason; @@ -48,7 +52,7 @@ public ItemChange(ListChangeReason reason, T current, int currentIndex) Current = current; CurrentIndex = currentIndex; PreviousIndex = -1; - Previous = Optional.None; + Previous = ReactiveUI.Primitives.Optional.None; } /// @@ -70,7 +74,7 @@ public ItemChange(ListChangeReason reason, T current, int currentIndex) /// Gets the item from before the change. /// This is only when is . /// - public Optional Previous { get; } + public ReactiveUI.Primitives.Optional Previous { get; } /// /// Gets the previous index. diff --git a/src/DynamicData/List/Linq/AddKeyEnumerator.cs b/src/DynamicData/List/Linq/AddKeyEnumerator.cs index 460b158c3..5792e7604 100644 --- a/src/DynamicData/List/Linq/AddKeyEnumerator.cs +++ b/src/DynamicData/List/Linq/AddKeyEnumerator.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Linq; +#else namespace DynamicData.List.Linq; +#endif internal sealed class AddKeyEnumerator(IChangeSet source, Func keySelector) : IEnumerable> where TObject : notnull diff --git a/src/DynamicData/List/Linq/ItemChangeEnumerator.cs b/src/DynamicData/List/Linq/ItemChangeEnumerator.cs index 56eca3b7c..bf65469f4 100644 --- a/src/DynamicData/List/Linq/ItemChangeEnumerator.cs +++ b/src/DynamicData/List/Linq/ItemChangeEnumerator.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Linq; +#else namespace DynamicData.List.Linq; +#endif internal sealed class ItemChangeEnumerator(IChangeSet changeSet) : IEnumerable> where T : notnull diff --git a/src/DynamicData/List/Linq/Reverser.cs b/src/DynamicData/List/Linq/Reverser.cs index 9be4b678a..17bdabf42 100644 --- a/src/DynamicData/List/Linq/Reverser.cs +++ b/src/DynamicData/List/Linq/Reverser.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Linq; +#else namespace DynamicData.List.Linq; +#endif internal sealed class Reverser where T : notnull diff --git a/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs b/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs index e9f6b7590..4421c38c2 100644 --- a/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs +++ b/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs @@ -1,10 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Linq; +#else namespace DynamicData.List.Linq; +#endif internal sealed class UnifiedChangeEnumerator(IChangeSet changeSet) : IEnumerable> where T : notnull diff --git a/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs b/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs index a1a02a2c8..e4f10b276 100644 --- a/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs +++ b/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Linq; +#else namespace DynamicData.List.Linq; +#endif /// /// Index to remove the index. This is necessary for WhereReasonAre* operators. diff --git a/src/DynamicData/List/ListChangeReason.cs b/src/DynamicData/List/ListChangeReason.cs index 89d8aa2dc..10fc0ea1c 100644 --- a/src/DynamicData/List/ListChangeReason.cs +++ b/src/DynamicData/List/ListChangeReason.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// The reason for an individual change to an observable list. diff --git a/src/DynamicData/List/ListEx.cs b/src/DynamicData/List/ListEx.cs index ab2dacb19..aaac1eaa9 100644 --- a/src/DynamicData/List/ListEx.cs +++ b/src/DynamicData/List/ListEx.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions to help with maintenance of a list. @@ -289,11 +293,11 @@ public static int IndexOf(this IEnumerable source, T item, IEqualityCompar /// The item. /// The equality comparer. /// The index of the item if available. - public static Optional> IndexOfOptional(this IEnumerable source, T item, IEqualityComparer? equalityComparer = null) + public static ReactiveUI.Primitives.Optional> IndexOfOptional(this IEnumerable source, T item, IEqualityComparer? equalityComparer = null) { var comparer = equalityComparer ?? EqualityComparer.Default; var index = source.IndexOf(item, comparer); - return index < 0 ? Optional>.None : new ItemWithIndex(item, index); + return index < 0 ? ReactiveUI.Primitives.Optional>.None : new ItemWithIndex(item, index); } /// diff --git a/src/DynamicData/List/ListFilterPolicy.cs b/src/DynamicData/List/ListFilterPolicy.cs index 8b347a765..943ead2cf 100644 --- a/src/DynamicData/List/ListFilterPolicy.cs +++ b/src/DynamicData/List/ListFilterPolicy.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Specifies which filter strategy should be used when the filter predicate is changed. diff --git a/src/DynamicData/List/ObservableListEx.Adapt.cs b/src/DynamicData/List/ObservableListEx.Adapt.cs index 0fb2ec2bb..40bdc5291 100644 --- a/src/DynamicData/List/ObservableListEx.Adapt.cs +++ b/src/DynamicData/List/ObservableListEx.Adapt.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.AddKey.cs b/src/DynamicData/List/ObservableListEx.AddKey.cs index 4f4ac4c1c..4a1caa523 100644 --- a/src/DynamicData/List/ObservableListEx.AddKey.cs +++ b/src/DynamicData/List/ObservableListEx.AddKey.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Linq; +#else using DynamicData.List.Linq; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.And.cs b/src/DynamicData/List/ObservableListEx.And.cs index 1ce7e2c3b..140577f76 100644 --- a/src/DynamicData/List/ObservableListEx.And.cs +++ b/src/DynamicData/List/ObservableListEx.And.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.AsObservableList.cs b/src/DynamicData/List/ObservableListEx.AsObservableList.cs index 487ef5b9d..51bd3b18a 100644 --- a/src/DynamicData/List/ObservableListEx.AsObservableList.cs +++ b/src/DynamicData/List/ObservableListEx.AsObservableList.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs index 382e9401a..724d735be 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs index 5866dde64..75b8fd516 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Bind.cs b/src/DynamicData/List/ObservableListEx.Bind.cs index c5424148c..f00e6b79f 100644 --- a/src/DynamicData/List/ObservableListEx.Bind.cs +++ b/src/DynamicData/List/ObservableListEx.Bind.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.BufferIf.cs b/src/DynamicData/List/ObservableListEx.BufferIf.cs index 2cea59346..5ceb50319 100644 --- a/src/DynamicData/List/ObservableListEx.BufferIf.cs +++ b/src/DynamicData/List/ObservableListEx.BufferIf.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.BufferInitial.cs b/src/DynamicData/List/ObservableListEx.BufferInitial.cs index f166a308b..6fa6204d4 100644 --- a/src/DynamicData/List/ObservableListEx.BufferInitial.cs +++ b/src/DynamicData/List/ObservableListEx.BufferInitial.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Cast.cs b/src/DynamicData/List/ObservableListEx.Cast.cs index e2a3ba0ca..0728d5210 100644 --- a/src/DynamicData/List/ObservableListEx.Cast.cs +++ b/src/DynamicData/List/ObservableListEx.Cast.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.CastToObject.cs b/src/DynamicData/List/ObservableListEx.CastToObject.cs index e31851138..0853b0961 100644 --- a/src/DynamicData/List/ObservableListEx.CastToObject.cs +++ b/src/DynamicData/List/ObservableListEx.CastToObject.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Clone.cs b/src/DynamicData/List/ObservableListEx.Clone.cs index 8300cf314..e3968e5ce 100644 --- a/src/DynamicData/List/ObservableListEx.Clone.cs +++ b/src/DynamicData/List/ObservableListEx.Clone.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Combine.cs b/src/DynamicData/List/ObservableListEx.Combine.cs index 6068ae2d0..b6082943e 100644 --- a/src/DynamicData/List/ObservableListEx.Combine.cs +++ b/src/DynamicData/List/ObservableListEx.Combine.cs @@ -1,12 +1,25 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif +#if REACTIVE_SHIM +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Convert.cs b/src/DynamicData/List/ObservableListEx.Convert.cs index df93d969a..ac3762876 100644 --- a/src/DynamicData/List/ObservableListEx.Convert.cs +++ b/src/DynamicData/List/ObservableListEx.Convert.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs index 77bee72bb..ab2be276e 100644 --- a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs +++ b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.DisposeMany.cs b/src/DynamicData/List/ObservableListEx.DisposeMany.cs index 1293b176d..f75ddc957 100644 --- a/src/DynamicData/List/ObservableListEx.DisposeMany.cs +++ b/src/DynamicData/List/ObservableListEx.DisposeMany.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.DistinctValues.cs b/src/DynamicData/List/ObservableListEx.DistinctValues.cs index 61869862b..9a042f352 100644 --- a/src/DynamicData/List/ObservableListEx.DistinctValues.cs +++ b/src/DynamicData/List/ObservableListEx.DistinctValues.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Except.cs b/src/DynamicData/List/ObservableListEx.Except.cs index 2ec6ace7a..eec99d64f 100644 --- a/src/DynamicData/List/ObservableListEx.Except.cs +++ b/src/DynamicData/List/ObservableListEx.Except.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs index 4b4090a45..b4108cee9 100644 --- a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs +++ b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Filter.cs b/src/DynamicData/List/ObservableListEx.Filter.cs index 27ae2778e..0275181be 100644 --- a/src/DynamicData/List/ObservableListEx.Filter.cs +++ b/src/DynamicData/List/ObservableListEx.Filter.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs index 055e7a297..cf7b6be0b 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs index facf57802..93dda7044 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs index 19db72fa3..15472262f 100644 --- a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs +++ b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.ForEachChange.cs b/src/DynamicData/List/ObservableListEx.ForEachChange.cs index 13d320f9f..84fd70884 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachChange.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs index 44f011604..9add09218 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.GroupOn.cs b/src/DynamicData/List/ObservableListEx.GroupOn.cs index c5a0111f6..902d38b6a 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOn.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOn.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs index 6b3eb5cf3..ab0634055 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs index aea1ac0c3..765b99217 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs index 5a486c761..e9b45c977 100644 --- a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs index 4d60fa92c..6d59b31c7 100644 --- a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs +++ b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs index 918211279..1075aa075 100644 --- a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.MergeMany.cs b/src/DynamicData/List/ObservableListEx.MergeMany.cs index 64df39f3a..cc4715b30 100644 --- a/src/DynamicData/List/ObservableListEx.MergeMany.cs +++ b/src/DynamicData/List/ObservableListEx.MergeMany.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs index 4ca3546be..d2022a992 100644 --- a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.NotEmpty.cs b/src/DynamicData/List/ObservableListEx.NotEmpty.cs index f54269db8..15e58b527 100644 --- a/src/DynamicData/List/ObservableListEx.NotEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.NotEmpty.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs index ab0b13466..bed6d8fab 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs index 07ef57caa..77b55570c 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs index aaab2ecbf..c17885e64 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Or.cs b/src/DynamicData/List/ObservableListEx.Or.cs index 63e69abea..074046002 100644 --- a/src/DynamicData/List/ObservableListEx.Or.cs +++ b/src/DynamicData/List/ObservableListEx.Or.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Page.cs b/src/DynamicData/List/ObservableListEx.Page.cs index 265115bbf..948663a36 100644 --- a/src/DynamicData/List/ObservableListEx.Page.cs +++ b/src/DynamicData/List/ObservableListEx.Page.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.PopulateInto.cs b/src/DynamicData/List/ObservableListEx.PopulateInto.cs index c10f7b967..61a7da15f 100644 --- a/src/DynamicData/List/ObservableListEx.PopulateInto.cs +++ b/src/DynamicData/List/ObservableListEx.PopulateInto.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs index bf0249e87..68cd8070e 100644 --- a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs +++ b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs @@ -1,12 +1,25 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.RefCount.cs b/src/DynamicData/List/ObservableListEx.RefCount.cs index a46209a60..93b443c15 100644 --- a/src/DynamicData/List/ObservableListEx.RefCount.cs +++ b/src/DynamicData/List/ObservableListEx.RefCount.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs index c19960333..190fbd6e9 100644 --- a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs +++ b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Reverse.cs b/src/DynamicData/List/ObservableListEx.Reverse.cs index 3ef6da735..58a5891db 100644 --- a/src/DynamicData/List/ObservableListEx.Reverse.cs +++ b/src/DynamicData/List/ObservableListEx.Reverse.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Linq; +#else using DynamicData.List.Linq; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.SkipInitial.cs b/src/DynamicData/List/ObservableListEx.SkipInitial.cs index 5cc0366bd..b1aaa99f4 100644 --- a/src/DynamicData/List/ObservableListEx.SkipInitial.cs +++ b/src/DynamicData/List/ObservableListEx.SkipInitial.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Sort.cs b/src/DynamicData/List/ObservableListEx.Sort.cs index 0b6062d5e..4702db60a 100644 --- a/src/DynamicData/List/ObservableListEx.Sort.cs +++ b/src/DynamicData/List/ObservableListEx.Sort.cs @@ -1,12 +1,25 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif +#if REACTIVE_SHIM +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs index 6f947e480..a48b51929 100644 --- a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs index 4455f357d..adfe1b531 100644 --- a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs +++ b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs index d728e50ed..b1b8c7fd5 100644 --- a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Switch.cs b/src/DynamicData/List/ObservableListEx.Switch.cs index 03ecd304a..d278e8d8b 100644 --- a/src/DynamicData/List/ObservableListEx.Switch.cs +++ b/src/DynamicData/List/ObservableListEx.Switch.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.ToCollection.cs b/src/DynamicData/List/ObservableListEx.ToCollection.cs index 48da34c8e..9d6da299e 100644 --- a/src/DynamicData/List/ObservableListEx.ToCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToCollection.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs index e1bc62fb0..6b4105aaa 100644 --- a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs +++ b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs index 67322d70e..2fca0b78f 100644 --- a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Top.cs b/src/DynamicData/List/ObservableListEx.Top.cs index 0ff91536c..2d4f7fc90 100644 --- a/src/DynamicData/List/ObservableListEx.Top.cs +++ b/src/DynamicData/List/ObservableListEx.Top.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Transform.cs b/src/DynamicData/List/ObservableListEx.Transform.cs index 82936c6fb..4e9a4f384 100644 --- a/src/DynamicData/List/ObservableListEx.Transform.cs +++ b/src/DynamicData/List/ObservableListEx.Transform.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. @@ -75,7 +84,7 @@ public static IObservable> Transform - public static IObservable> Transform(this IObservable> source, Func, TDestination> transformFactory, bool transformOnRefresh = false) + public static IObservable> Transform(this IObservable> source, Func, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { @@ -90,7 +99,7 @@ public static IObservable> Transform - public static IObservable> Transform(this IObservable> source, Func, int, TDestination> transformFactory, bool transformOnRefresh = false) + public static IObservable> Transform(this IObservable> source, Func, int, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull { diff --git a/src/DynamicData/List/ObservableListEx.TransformAsync.cs b/src/DynamicData/List/ObservableListEx.TransformAsync.cs index ba8381ba5..e0a66113f 100644 --- a/src/DynamicData/List/ObservableListEx.TransformAsync.cs +++ b/src/DynamicData/List/ObservableListEx.TransformAsync.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. @@ -78,7 +87,7 @@ public static IObservable> TransformAsync> TransformAsync( this IObservable> source, - Func, Task> transformFactory, + Func, Task> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull @@ -96,7 +105,7 @@ public static IObservable> TransformAsync> TransformAsync( this IObservable> source, - Func, int, Task> transformFactory, + Func, int, Task> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull diff --git a/src/DynamicData/List/ObservableListEx.TransformMany.cs b/src/DynamicData/List/ObservableListEx.TransformMany.cs index 4f6c170c0..3896ff377 100644 --- a/src/DynamicData/List/ObservableListEx.TransformMany.cs +++ b/src/DynamicData/List/ObservableListEx.TransformMany.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Virtualise.cs b/src/DynamicData/List/ObservableListEx.Virtualise.cs index aef6068f2..02db162fe 100644 --- a/src/DynamicData/List/ObservableListEx.Virtualise.cs +++ b/src/DynamicData/List/ObservableListEx.Virtualise.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs index 5dfbd2cc3..a814953f9 100644 --- a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs index 63564e8ca..3ee8b630b 100644 --- a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs index 19d91440c..3d021c1a2 100644 --- a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs @@ -3,10 +3,18 @@ // See the LICENSE file in the project root for full license information. using System.Linq.Expressions; +#if REACTIVE_SHIM +using DynamicData.Reactive.Binding; +#else using DynamicData.Binding; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs index 9afafa0e4..352ca6814 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs index 98e8cced2..cdbef4d29 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.Xor.cs b/src/DynamicData/List/ObservableListEx.Xor.cs index 253202a0e..2dfdadb12 100644 --- a/src/DynamicData/List/ObservableListEx.Xor.cs +++ b/src/DynamicData/List/ObservableListEx.Xor.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/ObservableListEx.cs b/src/DynamicData/List/ObservableListEx.cs index 57167e3dd..730c4dd8f 100644 --- a/src/DynamicData/List/ObservableListEx.cs +++ b/src/DynamicData/List/ObservableListEx.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Extensions for ObservableList. diff --git a/src/DynamicData/List/PageChangeSet.cs b/src/DynamicData/List/PageChangeSet.cs index 34124f2e1..f38555a7f 100644 --- a/src/DynamicData/List/PageChangeSet.cs +++ b/src/DynamicData/List/PageChangeSet.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Operators; +#else using DynamicData.Operators; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal sealed class PageChangeSet(IChangeSet virtualChangeSet, IPageResponse response) : IPageChangeSet where T : notnull diff --git a/src/DynamicData/List/RangeChange.cs b/src/DynamicData/List/RangeChange.cs index c3635d4db..f3da16011 100644 --- a/src/DynamicData/List/RangeChange.cs +++ b/src/DynamicData/List/RangeChange.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Multiple change container. diff --git a/src/DynamicData/List/SortException.cs b/src/DynamicData/List/SortException.cs index 42da97c8a..bd2070abe 100644 --- a/src/DynamicData/List/SortException.cs +++ b/src/DynamicData/List/SortException.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Thrown when an exception occurs within the sort operators. diff --git a/src/DynamicData/List/SortOptions.cs b/src/DynamicData/List/SortOptions.cs index 14beb63d7..25c9fada2 100644 --- a/src/DynamicData/List/SortOptions.cs +++ b/src/DynamicData/List/SortOptions.cs @@ -1,8 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Options for sorting. diff --git a/src/DynamicData/List/SourceList.cs b/src/DynamicData/List/SourceList.cs index 2fa880162..c6542474d 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.cs @@ -3,11 +3,20 @@ // See the LICENSE file in the project root for full license information. using System.Diagnostics; +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// An editable observable list. diff --git a/src/DynamicData/List/SourceListEditConvenienceEx.cs b/src/DynamicData/List/SourceListEditConvenienceEx.cs index 4159d7f4f..7f3194d2c 100644 --- a/src/DynamicData/List/SourceListEditConvenienceEx.cs +++ b/src/DynamicData/List/SourceListEditConvenienceEx.cs @@ -1,11 +1,20 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.List.Internal; +#else using DynamicData.List.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Convenience methods for a source list. diff --git a/src/DynamicData/List/SourceListEx.cs b/src/DynamicData/List/SourceListEx.cs index 78255cf29..c38b22982 100644 --- a/src/DynamicData/List/SourceListEx.cs +++ b/src/DynamicData/List/SourceListEx.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Source list extensions. diff --git a/src/DynamicData/List/Tests/ChangeSetAggregator.cs b/src/DynamicData/List/Tests/ChangeSetAggregator.cs index 7b9d5c7e0..39a2431ab 100644 --- a/src/DynamicData/List/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/List/Tests/ChangeSetAggregator.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Tests; +#else namespace DynamicData.Tests; +#endif /// /// Aggregates all events and statistics for a change set to help assertions when testing. diff --git a/src/DynamicData/List/Tests/ListTextEx.cs b/src/DynamicData/List/Tests/ListTextEx.cs index 7913113bf..cb771ee5d 100644 --- a/src/DynamicData/List/Tests/ListTextEx.cs +++ b/src/DynamicData/List/Tests/ListTextEx.cs @@ -1,9 +1,13 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.Tests; +#else namespace DynamicData.Tests; +#endif /// /// Test extensions. diff --git a/src/DynamicData/List/UnspecifiedIndexException.cs b/src/DynamicData/List/UnspecifiedIndexException.cs index 643fa9f62..21fbab3ef 100644 --- a/src/DynamicData/List/UnspecifiedIndexException.cs +++ b/src/DynamicData/List/UnspecifiedIndexException.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Thrown when an index is expected but not specified. diff --git a/src/DynamicData/List/VirtualChangeSet.cs b/src/DynamicData/List/VirtualChangeSet.cs index 61cee6b98..bd4575db6 100644 --- a/src/DynamicData/List/VirtualChangeSet.cs +++ b/src/DynamicData/List/VirtualChangeSet.cs @@ -3,7 +3,11 @@ // See the LICENSE file in the project root for full license information. // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif internal sealed class VirtualChangeSet(IChangeSet virtualChangeSet, IVirtualResponse response) : IVirtualChangeSet where T : notnull diff --git a/src/DynamicData/ObservableChangeSet.cs b/src/DynamicData/ObservableChangeSet.cs index 5054dc556..9649ca2ea 100644 --- a/src/DynamicData/ObservableChangeSet.cs +++ b/src/DynamicData/ObservableChangeSet.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Creation methods for observable change sets. diff --git a/src/DynamicData/Platforms/net45/PFilter.cs b/src/DynamicData/Platforms/net45/PFilter.cs index 375de57cc..64dbf5049 100644 --- a/src/DynamicData/Platforms/net45/PFilter.cs +++ b/src/DynamicData/Platforms/net45/PFilter.cs @@ -3,11 +3,20 @@ // See the LICENSE file in the project root for full license information. #if P_LINQ +#if REACTIVE_SHIM + +using DynamicData.Reactive.Cache.Internal; +#else using DynamicData.Cache.Internal; +#endif // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.PLinq +#else namespace DynamicData.PLinq +#endif { internal sealed class PFilter(IObservable> source, Func filter, ParallelisationOptions parallelisationOptions) where TObject : notnull @@ -34,7 +43,7 @@ protected override IEnumerable GetChangesWithFilter(ChangeSet< return updates.Select(u => new UpdateWithFilter(Filter(u.Current), u)).ToArray(); } - protected override IEnumerable> Refresh(IEnumerable> items, Func, Optional>> factory) + protected override IEnumerable> Refresh(IEnumerable> items, Func, ReactiveUI.Primitives.Optional>> factory) { var keyValuePairs = items as KeyValuePair[] ?? items.ToArray(); diff --git a/src/DynamicData/Platforms/net45/PSubscribeMany.cs b/src/DynamicData/Platforms/net45/PSubscribeMany.cs index d9a40ebe2..ebd2d7004 100644 --- a/src/DynamicData/Platforms/net45/PSubscribeMany.cs +++ b/src/DynamicData/Platforms/net45/PSubscribeMany.cs @@ -5,7 +5,11 @@ #if P_LINQ // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.PLinq +#else namespace DynamicData.PLinq +#endif { internal sealed class PSubscribeMany(IObservable> source, Func subscriptionFactory, ParallelisationOptions parallelisationOptions) where TObject : notnull diff --git a/src/DynamicData/Platforms/net45/PTransform.cs b/src/DynamicData/Platforms/net45/PTransform.cs index 54e0f56fc..50471c994 100644 --- a/src/DynamicData/Platforms/net45/PTransform.cs +++ b/src/DynamicData/Platforms/net45/PTransform.cs @@ -5,11 +5,15 @@ #if P_LINQ // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.PLinq +#else namespace DynamicData.PLinq +#endif { internal sealed class PTransform( IObservable> source, - Func, TKey, TDestination> transformFactory, + Func, TKey, TDestination> transformFactory, ParallelisationOptions parallelisationOptions, Action>? exceptionCallback = null) where TDestination : notnull @@ -106,7 +110,7 @@ public TransformResult(in Change change) : this() { Change = change; - Destination = Optional.None; + Destination = ReactiveUI.Primitives.Optional.None; Success = true; Key = change.Key; } @@ -126,7 +130,7 @@ public TransformResult(in Change change, Exception error) public bool Success { get; } - public Optional Destination { get; } + public ReactiveUI.Primitives.Optional Destination { get; } public TKey Key { get; } } diff --git a/src/DynamicData/Platforms/net45/ParallelEx.cs b/src/DynamicData/Platforms/net45/ParallelEx.cs index 3d29d2b96..82aeba987 100644 --- a/src/DynamicData/Platforms/net45/ParallelEx.cs +++ b/src/DynamicData/Platforms/net45/ParallelEx.cs @@ -4,7 +4,11 @@ #if P_LINQ // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.PLinq +#else namespace DynamicData.PLinq +#endif { /// /// Parallelisation extensions for DynamicData. diff --git a/src/DynamicData/Platforms/net45/ParallelOperators.cs b/src/DynamicData/Platforms/net45/ParallelOperators.cs index 6cec2a8a7..98f1c3b1d 100644 --- a/src/DynamicData/Platforms/net45/ParallelOperators.cs +++ b/src/DynamicData/Platforms/net45/ParallelOperators.cs @@ -5,7 +5,11 @@ #if P_LINQ // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.PLinq +#else namespace DynamicData.PLinq +#endif { /// /// PLinq operators or Net4 and Net45 only. diff --git a/src/DynamicData/Platforms/net45/ParallelType.cs b/src/DynamicData/Platforms/net45/ParallelType.cs index 1ef290a51..153da7158 100644 --- a/src/DynamicData/Platforms/net45/ParallelType.cs +++ b/src/DynamicData/Platforms/net45/ParallelType.cs @@ -4,7 +4,11 @@ #if P_LINQ // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.PLinq +#else namespace DynamicData.PLinq +#endif { /// /// The type of parallelisation. diff --git a/src/DynamicData/Platforms/net45/ParallelisationOptions.cs b/src/DynamicData/Platforms/net45/ParallelisationOptions.cs index 72011b438..5aeb79a30 100644 --- a/src/DynamicData/Platforms/net45/ParallelisationOptions.cs +++ b/src/DynamicData/Platforms/net45/ParallelisationOptions.cs @@ -4,7 +4,11 @@ #if P_LINQ // ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive.PLinq +#else namespace DynamicData.PLinq +#endif { /// /// Options to specify parallelisation of stream operations. Only applicable for .Net4 and .Net45 builds. diff --git a/src/DynamicData/Polyfills/ArgumentExceptionHelper.cs b/src/DynamicData/Polyfills/ArgumentExceptionHelper.cs index 6b50d4d5c..0136871e1 100644 --- a/src/DynamicData/Polyfills/ArgumentExceptionHelper.cs +++ b/src/DynamicData/Polyfills/ArgumentExceptionHelper.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// /// Polyfill for ArgumentNullException.ThrowIfNull on target frameworks (net462-net481) that predate it. diff --git a/src/DynamicData/Polyfills/ArgumentOutOfRangeExceptionHelper.cs b/src/DynamicData/Polyfills/ArgumentOutOfRangeExceptionHelper.cs index 20d9bfa90..a97f3823f 100644 --- a/src/DynamicData/Polyfills/ArgumentOutOfRangeExceptionHelper.cs +++ b/src/DynamicData/Polyfills/ArgumentOutOfRangeExceptionHelper.cs @@ -1,8 +1,13 @@ // Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive; +#else namespace DynamicData; +#endif /// Polyfill for modern guard helpers on target frameworks that predate them. [ExcludeFromCodeCoverage] From 7bd80fbe5233b56a411bcec7b83c4e57683c2461 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 16:27:45 +0100 Subject: [PATCH 26/36] Update reactive shims and replace obsolete operators Add a temporary ReactiveShimObservableExtensions shim to provide SubscribeSafe overloads when using the REACTIVE_SHIM symbol, and update usages to match Reactive Extensions API changes. Replaced deprecated SynchronizeObject calls with Synchronize, and swapped Tap usages for Do. Also fix a TaskPolyfill token registration cast (remove null-forgiving operator). Changes touch ReactiveShimObservableExtensions.cs, ExpireAfter.ForSource.cs, ExpireAfter.ForStream.cs, TreeBuilder.cs, DisposeMany.cs, DynamicCombiner.cs, and TaskPolyfillExtensions.cs to restore compatibility with updated RX primitives and tidy minor issues. --- .../ReactiveShimObservableExtensions.cs | 20 +++++++++++++++++++ .../Cache/Internal/ExpireAfter.ForSource.cs | 2 +- .../Cache/Internal/ExpireAfter.ForStream.cs | 2 +- src/DynamicData/Cache/Internal/TreeBuilder.cs | 2 +- src/DynamicData/List/Internal/DisposeMany.cs | 2 +- .../List/Internal/DynamicCombiner.cs | 2 +- .../Polyfills/TaskPolyfillExtensions.cs | 2 +- 7 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs diff --git a/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs b/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs new file mode 100644 index 000000000..9eb2536f9 --- /dev/null +++ b/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +namespace DynamicData.Reactive.Internal; + +/// +/// Temporary shim to provide SubscribeSafe extension methods for IObservable when using the REACTIVE_SHIM compilation symbol. This is a workaround for the absence of SubscribeSafe in the Reactive Extensions (Primitives) library as of V5.5.0. +/// +internal static class ReactiveShimObservableExtensions +{ + public static IDisposable SubscribeSafe(this IObservable source, Action onNext, Action onError) => + source.Subscribe(onNext, onError); + + public static IDisposable SubscribeSafe(this IObservable source, Action onNext, Action onError, Action onCompleted) => + source.Subscribe(onNext, onError, onCompleted); + + public static IDisposable SubscribeSafe(this IObservable source, Action onError, Action onCompleted) => + source.Subscribe(static _ => { }, onError, onCompleted); +} diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs index 7fdc53ce6..7e9c05ed9 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs @@ -76,7 +76,7 @@ protected SubscriptionBase( .Connect() // It's important to set this flag outside the context of a lock, because it'll be read outside of lock as well. .Finally(() => _hasSourceCompleted = true) - .SynchronizeObject(SynchronizationGate) + .Synchronize(SynchronizationGate) .SubscribeSafe( onNext: OnSourceNext, onError: OnSourceError, diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs index 8d2afefe8..c74a7d421 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -68,7 +68,7 @@ protected SubscriptionBase( _proposedExpirationsQueue = []; _sourceSubscription = source - .SynchronizeObject(SynchronizationGate) + .Synchronize(SynchronizationGate) .SubscribeSafe( onNext: OnSourceNext, onError: OnSourceError, diff --git a/src/DynamicData/Cache/Internal/TreeBuilder.cs b/src/DynamicData/Cache/Internal/TreeBuilder.cs index 591088045..3e911e01a 100644 --- a/src/DynamicData/Cache/Internal/TreeBuilder.cs +++ b/src/DynamicData/Cache/Internal/TreeBuilder.cs @@ -47,7 +47,7 @@ void UpdateChildren(Node parentNode) } // as nodes change, maintain parent and children - var parentSetter = allNodes.Connect().Tap( + var parentSetter = allNodes.Connect().Do( changes => { foreach (var group in changes.GroupBy(c => _pivotOn(c.Current.Item))) diff --git a/src/DynamicData/List/Internal/DisposeMany.cs b/src/DynamicData/List/Internal/DisposeMany.cs index 08dc8b103..48cf89985 100644 --- a/src/DynamicData/List/Internal/DisposeMany.cs +++ b/src/DynamicData/List/Internal/DisposeMany.cs @@ -19,7 +19,7 @@ public IObservable> Run() var cachedItems = new List(); var sourceSubscription = source - .SynchronizeObject(cachedItems) + .Synchronize(cachedItems) .SubscribeSafe(Observer.Create>( onNext: changeSet => { diff --git a/src/DynamicData/List/Internal/DynamicCombiner.cs b/src/DynamicData/List/Internal/DynamicCombiner.cs index ac8f16676..2205b6bce 100644 --- a/src/DynamicData/List/Internal/DynamicCombiner.cs +++ b/src/DynamicData/List/Internal/DynamicCombiner.cs @@ -190,7 +190,7 @@ private IChangeSet UpdateResultList(MergeContainer[] sourceLists, ChangeAware private sealed class MergeContainer { - public MergeContainer(IObservable> source) => Source = source.Tap(Clone); + public MergeContainer(IObservable> source) => Source = source.Do(Clone); public IObservable> Source { get; } diff --git a/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs b/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs index 554b8f1d3..03b302224 100644 --- a/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs +++ b/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs @@ -59,7 +59,7 @@ private static async Task WaitForCompletionAsync(Task task, TimeSpan timeout, Ca linked.CancelAfter(timeout); } - using (linked.Token.Register(static state => ((TaskCompletionSource)state!).TrySetResult(true), signal)) + using (linked.Token.Register(static state => ((TaskCompletionSource)state).TrySetResult(true), signal)) { var completed = await Task.WhenAny(task, signal.Task).ConfigureAwait(false); if (completed != task) From b6c04163b6d844d0dc6240d907434e19bab4c581 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 16:27:59 +0100 Subject: [PATCH 27/36] Update DynamicData.Reactive.csproj --- .../DynamicData.Reactive.csproj | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index d4a724117..fb761f272 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -9,6 +9,7 @@ net462;net472;net48;net481;net8.0;net9.0;net10.0;net11.0 true + $(DefineConstants);REACTIVE_SHIM @@ -31,26 +32,24 @@ + + + - + + + ObservableCacheEx.cs + - - - - - - - - - + From 709a626229d33e1ea9bc01e87f73eb66f4c54854 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 16:28:44 +0100 Subject: [PATCH 28/36] Update ReactiveShimObservableExtensions.cs --- .../Internal/ReactiveShimObservableExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs b/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs index 9eb2536f9..b4ca767b6 100644 --- a/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs +++ b/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs @@ -5,7 +5,7 @@ namespace DynamicData.Reactive.Internal; /// -/// Temporary shim to provide SubscribeSafe extension methods for IObservable when using the REACTIVE_SHIM compilation symbol. This is a workaround for the absence of SubscribeSafe in the Reactive Extensions (Primitives) library as of V5.5.0. +/// Temporary shim to provide SubscribeSafe extension methods for IObservable{T} when using the REACTIVE_SHIM compilation symbol. This is a workaround for the absence of SubscribeSafe in the Reactive Extensions (Primitives) library as of V5.5.0. /// internal static class ReactiveShimObservableExtensions { From d0c6cb6c2ad23a180528f13c9de0440f4a8b7257 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 17:42:08 +0100 Subject: [PATCH 29/36] docs: resolve DynamicData XML documentation warnings Remove CS1584, CS1658, and CS1591 documentation-warning suppressions from the shared build configuration and benchmark project settings. Enable internal and private XML documentation coverage in StyleCop, add missing XML documentation across DynamicData and the DynamicData.Reactive shim source, and fix invalid cref references that produced XML doc warnings. Keep GenerateDocumentationFile disabled for test and benchmark projects so documentation validation only applies to production packages. Verification: dotnet build src\DynamicData.sln -c Debug --no-restore /nr:false /m:1 /p:UseSharedCompilation=false; dotnet test src\DynamicData.Tests\DynamicData.Tests.csproj -c Debug --no-build /nr:false /m:1 /p:UseSharedCompilation=false. --- src/Directory.Build.props | 13 +- .../DynamicData.Benchmarks.csproj | 4 +- .../ReactiveShimObservableExtensions.cs | 25 + .../Aggregation/AggregateEnumerator.cs | 30 + src/DynamicData/Aggregation/AggregateItem.cs | 1 + src/DynamicData/Aggregation/Avg.cs | 6 + src/DynamicData/Aggregation/AvgEx.cs | 13 + src/DynamicData/Aggregation/MaxEx.cs | 48 +- src/DynamicData/Aggregation/StdDev.cs | 7 + src/DynamicData/Aggregation/StdDevEx.cs | 19 + src/DynamicData/Binding/BindPaged.cs | 23 +- src/DynamicData/Binding/BindVirtualized.cs | 23 +- src/DynamicData/Binding/BindingListAdaptor.cs | 24 + .../Binding/BindingListEventsSuspender.cs | 14 + src/DynamicData/Binding/BindingListEx.cs | 13 + src/DynamicData/Binding/ExpressionBuilder.cs | 58 + src/DynamicData/Binding/IObservableListEx.cs | 24 +- .../Binding/NotifyPropertyChangedEx.cs | 17 + .../Binding/ObservableCollectionAdaptor.cs | 19 + .../Binding/ObservableCollectionExtended.cs | 12 +- .../Binding/ObservablePropertyFactory.cs | 138 +- .../Binding/ObservablePropertyFactoryCache.cs | 19 + .../Binding/ObservablePropertyPart.cs | 10 + src/DynamicData/Binding/PropertyValue.cs | 6 + src/DynamicData/Binding/SortAndBind.cs | 70 +- .../Binding/SortExpressionComparer.cs | 3 + .../Binding/SortedBindingListAdaptor.cs | 8 + .../SortedObservableCollectionAdaptor.cs | 5 + src/DynamicData/Cache/CacheChangeSetEx.cs | 5 +- src/DynamicData/Cache/Change.cs | 6 + src/DynamicData/Cache/ChangeAwareCache.cs | 19 +- src/DynamicData/Cache/ChangeSet.cs | 1 + src/DynamicData/Cache/DistinctChangeSet.cs | 15 + src/DynamicData/Cache/GroupChangeSet.cs | 16 + src/DynamicData/Cache/ICache.cs | 2 +- src/DynamicData/Cache/IndexedItem.cs | 6 + src/DynamicData/Cache/IntermediateCache.cs | 20 + .../Cache/Internal/AbstractFilter.cs | 62 +- .../Internal/AnonymousObservableCache.cs | 59 + .../Cache/Internal/AnonymousQuery.cs | 26 + .../Cache/Internal/AsyncDisposeMany.cs | 13 +- src/DynamicData/Cache/Internal/AutoRefresh.cs | 23 + src/DynamicData/Cache/Internal/BatchIf.cs | 24 + src/DynamicData/Cache/Internal/Cache.cs | 60 + src/DynamicData/Cache/Internal/CacheEx.cs | 18 + .../Cache/Internal/CacheUpdater.cs | 150 ++ src/DynamicData/Cache/Internal/Cast.cs | 18 + .../Cache/Internal/ChangeSetCache.cs | 10 + .../Cache/Internal/ChangeSetMergeTracker.cs | 97 +- src/DynamicData/Cache/Internal/Combiner.cs | 33 + .../Cache/Internal/DeferUntilLoaded.cs | 20 + .../Cache/Internal/DictionaryExtensions.cs | 11 + src/DynamicData/Cache/Internal/DisposeMany.cs | 13 + .../Cache/Internal/DistinctCalculator.cs | 30 + .../Cache/Internal/DynamicCombiner.cs | 58 +- .../Cache/Internal/DynamicGrouper.cs | 163 +- src/DynamicData/Cache/Internal/EditDiff.cs | 20 + .../Cache/Internal/EditDiffChangeSet.cs | 21 + .../Internal/EditDiffChangeSetOptional.cs | 40 +- .../Cache/Internal/ExpirableItem.cs | 14 + .../Cache/Internal/ExpireAfter.ForSource.cs | 195 ++- .../Cache/Internal/ExpireAfter.ForStream.cs | 183 ++- .../Cache/Internal/Filter.Dynamic.cs | 148 +- .../Cache/Internal/Filter.Static.cs | 17 +- src/DynamicData/Cache/Internal/FilterEx.cs | 20 + .../Cache/Internal/FilterImmutable.cs | 26 + .../Cache/Internal/FilterOnObservable.cs | 36 +- .../Cache/Internal/FilteredIndexCalculator.cs | 19 + src/DynamicData/Cache/Internal/FinallySafe.cs | 16 + src/DynamicData/Cache/Internal/FullJoin.cs | 28 + .../Cache/Internal/FullJoinMany.cs | 28 + src/DynamicData/Cache/Internal/GroupOn.cs | 123 +- .../Cache/Internal/GroupOnDynamic.cs | 13 + .../Cache/Internal/GroupOnImmutable.cs | 143 +- .../Cache/Internal/GroupOnObservable.cs | 54 +- .../Cache/Internal/GroupOnProperty.cs | 21 + .../GroupOnPropertyWithImmutableState.cs | 24 + .../Cache/Internal/ImmutableGroup.cs | 64 + .../Cache/Internal/ImmutableGroupChangeSet.cs | 16 + .../Cache/Internal/IndexAndNode.cs | 22 + .../Cache/Internal/IndexCalculator.cs | 36 + src/DynamicData/Cache/Internal/InnerJoin.cs | 28 + .../Cache/Internal/InnerJoinMany.cs | 28 + src/DynamicData/Cache/Internal/KeyComparer.cs | 16 + src/DynamicData/Cache/Internal/KeySelector.cs | 17 + .../Cache/Internal/KeyValueCollection.cs | 39 + .../Cache/Internal/KeyValueComparer.cs | 12 + src/DynamicData/Cache/Internal/LeftJoin.cs | 28 + .../Cache/Internal/LeftJoinMany.cs | 28 + .../Cache/Internal/LockFreeObservableCache.cs | 23 + .../Cache/Internal/ManagedGroup.cs | 39 + .../Cache/Internal/MergeChangeSets.cs | 43 +- src/DynamicData/Cache/Internal/MergeMany.cs | 31 + .../Internal/MergeManyCacheChangeSets.cs | 49 +- .../MergeManyCacheChangeSetsSourceCompare.cs | 110 +- .../Cache/Internal/MergeManyItems.cs | 26 + .../Cache/Internal/MergeManyListChangeSets.cs | 40 +- .../Cache/Internal/ObservableWithValue.cs | 19 + src/DynamicData/Cache/Internal/OfType.cs | 12 + .../Cache/Internal/OnBeingRemoved.cs | 23 + src/DynamicData/Cache/Internal/Page.cs | 50 +- .../Cache/Internal/QueryWhenChanged.cs | 15 + .../Cache/Internal/ReaderWriter.cs | 69 + src/DynamicData/Cache/Internal/RefCount.cs | 22 + .../Cache/Internal/RemoveKeyEnumerator.cs | 13 +- src/DynamicData/Cache/Internal/RightJoin.cs | 28 + .../Cache/Internal/RightJoinMany.cs | 28 + src/DynamicData/Cache/Internal/SizeExpirer.cs | 20 + src/DynamicData/Cache/Internal/SizeLimiter.cs | 19 + src/DynamicData/Cache/Internal/Sort.cs | 63 +- src/DynamicData/Cache/Internal/SortAndPage.cs | 54 +- .../Cache/Internal/SortAndVirtualize.cs | 54 +- .../Cache/Internal/SortExtensions.cs | 45 + .../Internal/SortedKeyValueApplicator.cs | 52 +- .../Cache/Internal/SpecifiedGrouper.cs | 22 + .../Cache/Internal/StatusMonitor.cs | 9 + .../Cache/Internal/SubscribeMany.cs | 25 + src/DynamicData/Cache/Internal/Switch.cs | 13 + .../Cache/Internal/ToObservableChangeSet.cs | 150 +- .../Cache/Internal/ToObservableOptional.cs | 30 + src/DynamicData/Cache/Internal/Transform.cs | 18 + .../Cache/Internal/TransformAsync.cs | 86 +- .../Cache/Internal/TransformImmutable.cs | 22 + .../Cache/Internal/TransformMany.cs | 558 ++++--- .../Cache/Internal/TransformManyAsync.cs | 52 +- .../Cache/Internal/TransformOnObservable.cs | 56 +- .../Internal/TransformWithForcedTransform.cs | 20 + .../Internal/TransformWithInlineUpdate.cs | 29 + src/DynamicData/Cache/Internal/TreeBuilder.cs | 24 + src/DynamicData/Cache/Internal/TrueFor.cs | 22 + .../Cache/Internal/UniquenessEnforcer.cs | 10 + src/DynamicData/Cache/Internal/Virtualise.cs | 50 +- src/DynamicData/Cache/Node.cs | 13 + src/DynamicData/Cache/ObservableCache.cs | 213 ++- .../Cache/ObservableCacheEx.Adapt.cs | 23 +- .../Cache/ObservableCacheEx.AdaptSelector.cs | 9 + .../Cache/ObservableCacheEx.AddOrUpdate.cs | 54 +- .../Cache/ObservableCacheEx.And.cs | 14 +- .../ObservableCacheEx.AsObservableCache.cs | 18 +- .../ObservableCacheEx.AsyncDisposeMany.cs | 6 +- .../Cache/ObservableCacheEx.AutoRefresh.cs | 8 +- ...servableCacheEx.AutoRefreshOnObservable.cs | 10 +- .../Cache/ObservableCacheEx.Batch.cs | 8 +- .../Cache/ObservableCacheEx.BatchIf.cs | 53 +- .../Cache/ObservableCacheEx.Bind.cs | 60 +- .../Cache/ObservableCacheEx.BufferInitial.cs | 8 +- .../Cache/ObservableCacheEx.Cast.cs | 8 +- .../Cache/ObservableCacheEx.ChangeKey.cs | 16 +- .../Cache/ObservableCacheEx.Clear.cs | 16 +- .../Cache/ObservableCacheEx.Clone.cs | 6 +- .../Cache/ObservableCacheEx.Combine.cs | 41 + .../Cache/ObservableCacheEx.Convert.cs | 6 +- ...vableCacheEx.CreateChangeSetTransformer.cs | 30 + .../ObservableCacheEx.DeferUntilLoaded.cs | 12 +- .../Cache/ObservableCacheEx.DisposeMany.cs | 10 +- .../Cache/ObservableCacheEx.DistinctValues.cs | 6 +- .../Cache/ObservableCacheEx.EditDiff.cs | 40 +- .../ObservableCacheEx.EnsureUniqueKeys.cs | 2 +- .../Cache/ObservableCacheEx.Except.cs | 14 +- .../Cache/ObservableCacheEx.ExpireAfter.cs | 47 +- .../Cache/ObservableCacheEx.Filter.cs | 47 +- .../ObservableCacheEx.FilterImmutable.cs | 6 +- .../ObservableCacheEx.FilterOnObservable.cs | 21 +- .../Cache/ObservableCacheEx.FinallySafe.cs | 2 +- .../Cache/ObservableCacheEx.Flatten.cs | 10 +- .../ObservableCacheEx.FlattenBufferResult.cs | 2 +- .../Cache/ObservableCacheEx.ForEachChange.cs | 16 +- .../Cache/ObservableCacheEx.ForForced.cs | 14 + .../Cache/ObservableCacheEx.FullJoin.cs | 46 +- .../Cache/ObservableCacheEx.FullJoinMany.cs | 40 +- .../Cache/ObservableCacheEx.Group.cs | 53 +- .../ObservableCacheEx.GroupOnObservable.cs | 18 +- .../ObservableCacheEx.GroupOnProperty.cs | 4 +- ...cheEx.GroupOnPropertyWithImmutableState.cs | 4 +- ...servableCacheEx.GroupWithImmutableState.cs | 12 +- ...rvableCacheEx.IgnoreSameReferenceUpdate.cs | 2 +- .../ObservableCacheEx.IgnoreUpdateWhen.cs | 4 +- .../ObservableCacheEx.IncludeUpdateWhen.cs | 4 +- .../Cache/ObservableCacheEx.InnerJoin.cs | 36 +- .../Cache/ObservableCacheEx.InnerJoinMany.cs | 36 +- .../Cache/ObservableCacheEx.InvokeEvaluate.cs | 2 +- .../Cache/ObservableCacheEx.LeftJoin.cs | 40 +- .../Cache/ObservableCacheEx.LeftJoinMany.cs | 36 +- .../Cache/ObservableCacheEx.LimitSizeTo.cs | 6 +- .../ObservableCacheEx.MergeChangeSets.cs | 98 +- .../Cache/ObservableCacheEx.MergeMany.cs | 28 +- .../ObservableCacheEx.MergeManyChangeSets.cs | 127 +- .../Cache/ObservableCacheEx.MergeManyItems.cs | 22 +- .../Cache/ObservableCacheEx.MonitorStatus.cs | 4 +- .../Cache/ObservableCacheEx.NotEmpty.cs | 4 +- .../Cache/ObservableCacheEx.OfType.cs | 2 +- .../Cache/ObservableCacheEx.OnChangeAction.cs | 18 + .../Cache/ObservableCacheEx.OnItemAdded.cs | 25 +- .../ObservableCacheEx.OnItemRefreshed.cs | 21 +- .../Cache/ObservableCacheEx.OnItemRemoved.cs | 23 +- .../Cache/ObservableCacheEx.OnItemUpdated.cs | 21 +- src/DynamicData/Cache/ObservableCacheEx.Or.cs | 29 +- .../Cache/ObservableCacheEx.PopulateFrom.cs | 14 +- .../Cache/ObservableCacheEx.PopulateInto.cs | 36 +- .../ObservableCacheEx.QueryWhenChanged.cs | 18 +- .../Cache/ObservableCacheEx.RefCount.cs | 4 +- .../Cache/ObservableCacheEx.Refresh.cs | 14 +- .../Cache/ObservableCacheEx.Remove.cs | 42 +- .../Cache/ObservableCacheEx.RemoveKey.cs | 12 +- .../Cache/ObservableCacheEx.RemoveKeys.cs | 4 +- .../Cache/ObservableCacheEx.RightJoin.cs | 40 +- .../Cache/ObservableCacheEx.RightJoinMany.cs | 38 +- .../Cache/ObservableCacheEx.SkipInitial.cs | 6 +- .../Cache/ObservableCacheEx.Sort.cs | 22 +- .../Cache/ObservableCacheEx.SortAndBind.cs | 168 ++- .../Cache/ObservableCacheEx.SortBy.cs | 6 +- .../Cache/ObservableCacheEx.StartWithEmpty.cs | 58 +- .../Cache/ObservableCacheEx.StartWithItem.cs | 15 +- .../Cache/ObservableCacheEx.SubscribeMany.cs | 23 +- .../ObservableCacheEx.SuppressRefresh.cs | 2 +- .../Cache/ObservableCacheEx.Switch.cs | 11 +- .../Cache/ObservableCacheEx.ToCollection.cs | 4 +- ...ObservableCacheEx.ToObservableChangeSet.cs | 12 +- .../ObservableCacheEx.ToObservableOptional.cs | 22 +- .../ObservableCacheEx.ToSortedCollection.cs | 10 +- .../Cache/ObservableCacheEx.Transform.cs | 110 +- .../Cache/ObservableCacheEx.TransformAsync.cs | 69 +- .../ObservableCacheEx.TransformImmutable.cs | 8 +- .../Cache/ObservableCacheEx.TransformMany.cs | 54 +- .../ObservableCacheEx.TransformManyAsync.cs | 94 +- ...bservableCacheEx.TransformManySafeAsync.cs | 97 +- ...ObservableCacheEx.TransformOnObservable.cs | 20 +- .../Cache/ObservableCacheEx.TransformSafe.cs | 78 +- .../ObservableCacheEx.TransformSafeAsync.cs | 72 +- .../ObservableCacheEx.TransformToTree.cs | 10 +- ...rvableCacheEx.TransformWithInlineUpdate.cs | 43 +- ...ObservableCacheEx.TreatMovesAsRemoveAdd.cs | 2 +- .../Cache/ObservableCacheEx.TrueFor.cs | 10 + .../Cache/ObservableCacheEx.TrueForAll.cs | 14 +- .../Cache/ObservableCacheEx.TrueForAny.cs | 22 +- .../Cache/ObservableCacheEx.UpdateIndex.cs | 4 +- .../ObservableCacheEx.VirtualiseAndPage.cs | 94 +- .../Cache/ObservableCacheEx.Watch.cs | 12 +- .../Cache/ObservableCacheEx.WatchValue.cs | 23 +- ...bservableCacheEx.WhenAnyPropertyChanged.cs | 10 +- .../ObservableCacheEx.WhenPropertyChanged.cs | 12 +- .../ObservableCacheEx.WhenValueChanged.cs | 18 +- .../ObservableCacheEx.WhereReasonsAre.cs | 2 +- .../ObservableCacheEx.WhereReasonsAreNot.cs | 2 +- .../Cache/ObservableCacheEx.Xor.cs | 27 +- src/DynamicData/Cache/ObservableCacheEx.cs | 3 + src/DynamicData/Cache/PageContext.cs | 3 + src/DynamicData/Cache/PageRequest.cs | 22 +- src/DynamicData/Cache/PageResponse.cs | 38 +- src/DynamicData/Cache/PagedChangeSet.cs | 32 + src/DynamicData/Cache/SortedChangeSet.cs | 37 + src/DynamicData/Cache/SourceCache.cs | 15 + .../Cache/Tests/ChangeSetAggregator.cs | 6 + .../Tests/DistinctChangeSetAggregator.cs | 6 + .../Cache/Tests/GroupChangeSetAggregator.cs | 11 + .../Cache/Tests/PagedChangeSetAggregator.cs | 6 + .../Cache/Tests/SortedChangeSetAggregator.cs | 6 + .../Cache/Tests/VirtualChangeSetAggregator.cs | 6 + src/DynamicData/Cache/VirtualChangeSet.cs | 49 + src/DynamicData/Cache/VirtualContext.cs | 3 + src/DynamicData/Cache/VirtualRequest.cs | 22 +- src/DynamicData/Cache/VirtualResponse.cs | 22 +- src/DynamicData/Constants.cs | 18 + .../Diagnostics/ChangeStatistics.cs | 2 + src/DynamicData/Diagnostics/ChangeSummary.cs | 12 + .../Experimental/SubjectWithRefCount.cs | 9 + src/DynamicData/Experimental/Watcher.cs | 30 + src/DynamicData/GlobalConfig.cs | 6 + src/DynamicData/Internal/Bitset.cs | 32 +- .../Internal/CacheParentSubscription.cs | 74 + src/DynamicData/Internal/DeliveryQueue.cs | 79 +- src/DynamicData/Internal/KeyedDisposable.cs | 34 + src/DynamicData/Internal/Notification.cs | 21 +- .../Internal/SharedDeliveryQueue.cs | 126 +- src/DynamicData/Internal/SwappableLock.cs | 43 +- .../Internal/SynchronizeSafeExtensions.cs | 17 +- src/DynamicData/Kernel/EnumerableEx.cs | 30 + src/DynamicData/Kernel/EnumerableIList.cs | 59 + src/DynamicData/Kernel/EnumeratorIList.cs | 24 + src/DynamicData/Kernel/Error.cs | 18 + src/DynamicData/Kernel/InternalEx.cs | 23 + src/DynamicData/Kernel/ItemWithIndex.cs | 1 + src/DynamicData/Kernel/ItemWithValue.cs | 2 + src/DynamicData/Kernel/OptionElse.cs | 10 + .../Kernel/OptionObservableExtensions.cs | 24 +- src/DynamicData/Kernel/ParallelEx.cs | 12 + .../Kernel/ReadOnlyCollectionLight.cs | 28 + .../Kernel/ReferenceEqualityComparer.cs | 18 + src/DynamicData/List/Change.cs | 20 +- src/DynamicData/List/ChangeAwareList.cs | 19 +- .../List/ChangeAwareListWithRefCounts.cs | 41 + src/DynamicData/List/ChangeSet.cs | 2 +- src/DynamicData/List/IExtendedList.cs | 8 +- .../List/Internal/AnonymousObservableList.cs | 41 + src/DynamicData/List/Internal/AutoRefresh.cs | 20 + src/DynamicData/List/Internal/BufferIf.cs | 25 + .../List/Internal/ChangeSetMergeTracker.cs | 49 + .../List/Internal/ClonedListChangeSet.cs | 15 + src/DynamicData/List/Internal/Combiner.cs | 40 + .../List/Internal/DeferUntilLoaded.cs | 12 + src/DynamicData/List/Internal/DisposeMany.cs | 13 + src/DynamicData/List/Internal/Distinct.cs | 63 +- .../List/Internal/DynamicCombiner.cs | 61 +- src/DynamicData/List/Internal/EditDiff.cs | 16 + .../List/Internal/ExpirableItem.cs | 46 + src/DynamicData/List/Internal/ExpireAfter.cs | 167 ++- .../List/Internal/Filter.Dynamic.cs | 97 +- .../List/Internal/Filter.Static.cs | 16 +- .../Internal/Filter.WithPredicateState.cs | 277 +++- .../List/Internal/FilterOnObservable.cs | 76 +- .../List/Internal/FilterOnProperty.cs | 14 + src/DynamicData/List/Internal/FilterStatic.cs | 21 + src/DynamicData/List/Internal/Group.cs | 52 + src/DynamicData/List/Internal/GroupOn.cs | 96 +- .../List/Internal/GroupOnImmutable.cs | 118 +- .../List/Internal/GroupOnProperty.cs | 20 + .../GroupOnPropertyWithImmutableState.cs | 20 + .../List/Internal/ImmutableGroup.cs | 52 + src/DynamicData/List/Internal/LimitSizeTo.cs | 30 +- .../List/Internal/MergeChangeSets.cs | 52 +- src/DynamicData/List/Internal/MergeMany.cs | 63 +- .../List/Internal/MergeManyCacheChangeSets.cs | 11 + .../List/Internal/MergeManyListChangeSets.cs | 9 + src/DynamicData/List/Internal/OnItemAdded.cs | 96 +- .../List/Internal/OnItemRefreshed.cs | 70 +- .../List/Internal/OnItemRemoved.cs | 133 +- src/DynamicData/List/Internal/Pager.cs | 37 + .../List/Internal/QueryWhenChanged.cs | 12 + src/DynamicData/List/Internal/ReaderWriter.cs | 35 + src/DynamicData/List/Internal/RefCount.cs | 19 + .../List/Internal/ReferenceCountTracker.cs | 20 + src/DynamicData/List/Internal/Sort.cs | 91 ++ .../List/Internal/SubscribeMany.cs | 16 + src/DynamicData/List/Internal/Switch.cs | 12 + .../List/Internal/ToObservableChangeSet.cs | 134 +- .../List/Internal/TransformAsync.cs | 35 + .../List/Internal/TransformMany.cs | 564 ++++--- src/DynamicData/List/Internal/Transformer.cs | 72 +- .../List/Internal/UnifiedChange.cs | 51 + src/DynamicData/List/Internal/Virtualiser.cs | 31 + src/DynamicData/List/ItemChange.cs | 2 +- src/DynamicData/List/Linq/AddKeyEnumerator.cs | 19 +- .../List/Linq/ItemChangeEnumerator.cs | 13 + src/DynamicData/List/Linq/Reverser.cs | 12 + .../List/Linq/UnifiedChangeEnumerator.cs | 13 + .../List/Linq/WithoutIndexEnumerator.cs | 9 + src/DynamicData/List/ListEx.cs | 1305 +++++++++-------- .../List/ObservableListEx.Adapt.cs | 10 +- .../List/ObservableListEx.AddKey.cs | 8 +- src/DynamicData/List/ObservableListEx.And.cs | 56 +- .../List/ObservableListEx.AsObservableList.cs | 12 +- .../List/ObservableListEx.AutoRefresh.cs | 24 +- ...bservableListEx.AutoRefreshOnObservable.cs | 12 +- src/DynamicData/List/ObservableListEx.Bind.cs | 58 +- .../List/ObservableListEx.BufferIf.cs | 39 +- .../List/ObservableListEx.BufferInitial.cs | 6 +- src/DynamicData/List/ObservableListEx.Cast.cs | 16 +- .../List/ObservableListEx.CastToObject.cs | 6 +- .../List/ObservableListEx.Clone.cs | 10 +- .../List/ObservableListEx.Combine.cs | 36 + .../List/ObservableListEx.Convert.cs | 4 +- .../List/ObservableListEx.DeferUntilLoaded.cs | 15 +- .../List/ObservableListEx.DisposeMany.cs | 8 +- .../List/ObservableListEx.DistinctValues.cs | 6 +- .../List/ObservableListEx.Except.cs | 56 +- .../List/ObservableListEx.ExpireAfter.cs | 10 +- .../List/ObservableListEx.Filter.cs | 32 +- .../ObservableListEx.FilterOnObservable.cs | 12 +- .../List/ObservableListEx.FilterOnProperty.cs | 12 +- .../ObservableListEx.FlattenBufferResult.cs | 6 +- .../List/ObservableListEx.ForEachChange.cs | 22 +- .../ObservableListEx.ForEachItemChange.cs | 12 +- .../List/ObservableListEx.GroupOn.cs | 16 +- .../List/ObservableListEx.GroupOnProperty.cs | 12 +- ...istEx.GroupOnPropertyWithImmutableState.cs | 16 +- ...bservableListEx.GroupWithImmutableState.cs | 14 +- .../List/ObservableListEx.LimitSizeTo.cs | 8 +- .../List/ObservableListEx.MergeChangeSets.cs | 103 +- .../List/ObservableListEx.MergeMany.cs | 14 +- .../ObservableListEx.MergeManyChangeSets.cs | 40 +- .../List/ObservableListEx.NotEmpty.cs | 6 +- .../List/ObservableListEx.OnItemAdded.cs | 12 +- .../List/ObservableListEx.OnItemRefreshed.cs | 12 +- .../List/ObservableListEx.OnItemRemoved.cs | 12 +- src/DynamicData/List/ObservableListEx.Or.cs | 40 +- src/DynamicData/List/ObservableListEx.Page.cs | 10 +- .../List/ObservableListEx.PopulateInto.cs | 12 +- .../List/ObservableListEx.QueryWhenChanged.cs | 28 +- .../List/ObservableListEx.RefCount.cs | 8 +- .../List/ObservableListEx.RemoveIndex.cs | 4 +- .../List/ObservableListEx.Reverse.cs | 4 +- .../List/ObservableListEx.SkipInitial.cs | 8 +- src/DynamicData/List/ObservableListEx.Sort.cs | 30 +- .../List/ObservableListEx.StartWithEmpty.cs | 8 +- .../List/ObservableListEx.SubscribeMany.cs | 10 +- .../List/ObservableListEx.SuppressRefresh.cs | 6 +- .../List/ObservableListEx.Switch.cs | 14 +- .../List/ObservableListEx.ToCollection.cs | 10 +- .../ObservableListEx.ToObservableChangeSet.cs | 72 +- .../ObservableListEx.ToSortedCollection.cs | 24 +- src/DynamicData/List/ObservableListEx.Top.cs | 8 +- .../List/ObservableListEx.Transform.cs | 38 +- .../List/ObservableListEx.TransformAsync.cs | 36 +- .../List/ObservableListEx.TransformMany.cs | 42 +- .../List/ObservableListEx.Virtualise.cs | 10 +- ...ObservableListEx.WhenAnyPropertyChanged.cs | 14 +- .../ObservableListEx.WhenPropertyChanged.cs | 18 +- .../List/ObservableListEx.WhenValueChanged.cs | 12 +- .../List/ObservableListEx.WhereReasonsAre.cs | 10 +- .../ObservableListEx.WhereReasonsAreNot.cs | 8 +- src/DynamicData/List/ObservableListEx.Xor.cs | 38 +- src/DynamicData/List/PageChangeSet.cs | 44 + src/DynamicData/List/RangeChange.cs | 5 + src/DynamicData/List/SourceList.cs | 49 + .../List/SourceListEditConvenienceEx.cs | 6 +- .../List/Tests/ChangeSetAggregator.cs | 6 + src/DynamicData/List/VirtualChangeSet.cs | 44 + src/DynamicData/Platforms/net45/PFilter.cs | 35 +- .../Platforms/net45/PSubscribeMany.cs | 20 +- src/DynamicData/Platforms/net45/PTransform.cs | 67 +- src/DynamicData/Platforms/net45/ParallelEx.cs | 47 +- .../Platforms/net45/ParallelOperators.cs | 8 +- .../Platforms/net45/ParallelType.cs | 8 +- .../Platforms/net45/ParallelisationOptions.cs | 20 +- .../CancellationTokenPolyfillExtensions.cs | 1 - ...ncellationTokenSourcePolyfillExtensions.cs | 1 - .../DynamicallyAccessedMembersAttribute.cs | 78 +- src/DynamicData/Polyfills/EnumEx.cs | 20 +- .../Polyfills/ListEnsureCapacity.cs | 13 +- .../Polyfills/TaskCompletionSource.cs | 2 +- .../Polyfills/TaskPolyfillExtensions.cs | 3 - 431 files changed, 12686 insertions(+), 3006 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 416c25b75..f6818a629 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,7 +3,7 @@ true - $(NoWarn);1591;1701;1702;1705;VSX1000;CA1510 + $(NoWarn);1701;1702;1705;VSX1000;CA1510 AnyCPU enable latest @@ -22,9 +22,9 @@ logo.png README.md true - + - true + true true @@ -39,6 +39,7 @@ false + false @@ -66,10 +67,10 @@ - - + + - + diff --git a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj index e7c24464d..9a3ad1e6a 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -1,11 +1,11 @@ - + Exe net10.0 AnyCPU false - ;1591;1701;1702;1705;CA1822;CA1001 + ;1701;1702;1705;CA1822;CA1001 diff --git a/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs b/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs index b4ca767b6..6fc32a2a5 100644 --- a/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs +++ b/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs @@ -9,12 +9,37 @@ namespace DynamicData.Reactive.Internal; /// internal static class ReactiveShimObservableExtensions { + /// + /// Subscribes to the source with safe observer callbacks. + /// + /// The observable value type. + /// The observable source. + /// The callback invoked for each value. + /// The callback invoked when the source fails. + /// The subscription disposable. public static IDisposable SubscribeSafe(this IObservable source, Action onNext, Action onError) => source.Subscribe(onNext, onError); + /// + /// Subscribes to the source with safe observer callbacks and a completion callback. + /// + /// The observable value type. + /// The observable source. + /// The callback invoked for each value. + /// The callback invoked when the source fails. + /// The callback invoked when the source completes. + /// The subscription disposable. public static IDisposable SubscribeSafe(this IObservable source, Action onNext, Action onError, Action onCompleted) => source.Subscribe(onNext, onError, onCompleted); + /// + /// Subscribes to the source with safe error and completion callbacks. + /// + /// The observable value type. + /// The observable source. + /// The callback invoked when the source fails. + /// The callback invoked when the source completes. + /// The subscription disposable. public static IDisposable SubscribeSafe(this IObservable source, Action onError, Action onCompleted) => source.Subscribe(static _ => { }, onError, onCompleted); } diff --git a/src/DynamicData/Aggregation/AggregateEnumerator.cs b/src/DynamicData/Aggregation/AggregateEnumerator.cs index 669f48584..86ec50d72 100644 --- a/src/DynamicData/Aggregation/AggregateEnumerator.cs +++ b/src/DynamicData/Aggregation/AggregateEnumerator.cs @@ -9,9 +9,18 @@ namespace DynamicData.Reactive.Aggregation; namespace DynamicData.Aggregation; #endif +/// +/// Provides members for the AggregateEnumerator class. +/// +/// The type of the T value. +/// The source value. internal sealed class AggregateEnumerator(IChangeSet source) : IAggregateChangeSet where T : notnull { + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. public IEnumerator> GetEnumerator() { foreach (var change in source) @@ -51,16 +60,33 @@ public IEnumerator> GetEnumerator() } } + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } +/// +/// Provides members for the AggregateEnumerator class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Same name, different generics.")] internal sealed class AggregateEnumerator(IChangeSet source) : IAggregateChangeSet where TObject : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly ChangeSet _source = source.ToConcreteType(); + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. public IEnumerator> GetEnumerator() { foreach (var change in _source) @@ -86,5 +112,9 @@ public IEnumerator> GetEnumerator() } } + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/Aggregation/AggregateItem.cs b/src/DynamicData/Aggregation/AggregateItem.cs index b3496fd67..4da4fb37f 100644 --- a/src/DynamicData/Aggregation/AggregateItem.cs +++ b/src/DynamicData/Aggregation/AggregateItem.cs @@ -21,6 +21,7 @@ namespace DynamicData.Aggregation; public readonly record struct AggregateItem(AggregateType Type, TObject Item) { /// + /// The result of the operation. public override int GetHashCode() { var hashCode = -1719135621; diff --git a/src/DynamicData/Aggregation/Avg.cs b/src/DynamicData/Aggregation/Avg.cs index 706ad4b00..2dd2a61a6 100644 --- a/src/DynamicData/Aggregation/Avg.cs +++ b/src/DynamicData/Aggregation/Avg.cs @@ -9,4 +9,10 @@ namespace DynamicData.Reactive.Aggregation; namespace DynamicData.Aggregation; #endif +/// +/// Represents the Avg record. +/// +/// The type of the TValue value. +/// The Count value. +/// The Sum value. internal readonly record struct Avg(int Count, TValue Sum); diff --git a/src/DynamicData/Aggregation/AvgEx.cs b/src/DynamicData/Aggregation/AvgEx.cs index 60b1d83e1..9a6b3284d 100644 --- a/src/DynamicData/Aggregation/AvgEx.cs +++ b/src/DynamicData/Aggregation/AvgEx.cs @@ -430,6 +430,19 @@ public static IObservable Avg(this IObservable> /// public static IObservable Avg(this IObservable> source, Func valueSelector, float emptyValue = 0) => source.Avg(t => valueSelector(t).GetValueOrDefault(), emptyValue); + /// + /// Executes the AvgCalc operation. + /// + /// The type of the TObject value. + /// The type of the TValue value. + /// The type of the TResult value. + /// The source value. + /// The valueSelector value. + /// The fallbackValue value. + /// The addAction value. + /// The removeAction value. + /// The resultAction value. + /// The result of the operation. private static IObservable AvgCalc(this IObservable> source, Func valueSelector, TResult fallbackValue, Func, TValue, Avg> addAction, Func, TValue, Avg> removeAction, Func, TResult> resultAction) { ArgumentExceptionHelper.ThrowIfNull(source); diff --git a/src/DynamicData/Aggregation/MaxEx.cs b/src/DynamicData/Aggregation/MaxEx.cs index 5dce75b24..d51a2ada4 100644 --- a/src/DynamicData/Aggregation/MaxEx.cs +++ b/src/DynamicData/Aggregation/MaxEx.cs @@ -14,10 +14,19 @@ namespace DynamicData.Aggregation; /// public static class MaxEx { - private enum MaxOrMin +/// +/// Defines values for the MaxOrMin enumeration. +/// +private enum MaxOrMin { + /// + /// The Max value. + /// Max, + /// + /// The Min value. + /// Min } @@ -107,6 +116,16 @@ public static IObservable Minimum(this IObserva return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Min, emptyValue); } + /// + /// Executes the Calculate operation. + /// + /// The type of the TObject value. + /// The type of the TResult value. + /// The source value. + /// The valueSelector value. + /// The maxOrMin value. + /// The emptyValue value. + /// The result of the operation. private static IObservable Calculate(this IObservable> source, Func valueSelector, MaxOrMin maxOrMin, TResult emptyValue = default) where TResult : struct, IComparable { @@ -170,6 +189,13 @@ private static IObservable Calculate(this IObservable }).Select(t => t ?? emptyValue).DistinctUntilChanged(); } + /// + /// Executes the ToChangesAndCollection operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The result of the operation. private static IObservable> ToChangesAndCollection(this IObservable> source) where TObject : notnull where TKey : notnull @@ -185,6 +211,12 @@ private static IObservable> ToChangesAndCollection }); } + /// + /// Executes the ToChangesAndCollection operation. + /// + /// The type of the TObject value. + /// The source value. + /// The result of the operation. private static IObservable> ToChangesAndCollection(this IObservable> source) where TObject : notnull { @@ -199,10 +231,22 @@ private static IObservable> ToChangesAndCollection }); } - private sealed class ChangesAndCollection(IAggregateChangeSet changes, IReadOnlyCollection collection) +/// +/// Provides members for the ChangesAndCollection class. +/// +/// The type of the T value. +/// The changes value. +/// The collection value. +private sealed class ChangesAndCollection(IAggregateChangeSet changes, IReadOnlyCollection collection) { + /// + /// Gets the Changes value. + /// public IAggregateChangeSet Changes { get; } = changes; + /// + /// Gets the Collection value. + /// public IReadOnlyCollection Collection { get; } = collection; } } diff --git a/src/DynamicData/Aggregation/StdDev.cs b/src/DynamicData/Aggregation/StdDev.cs index 2a5fa74f5..37b4e8706 100644 --- a/src/DynamicData/Aggregation/StdDev.cs +++ b/src/DynamicData/Aggregation/StdDev.cs @@ -9,4 +9,11 @@ namespace DynamicData.Reactive.Aggregation; namespace DynamicData.Aggregation; #endif +/// +/// Represents the StdDev record. +/// +/// The type of the TValue value. +/// The Count value. +/// The SumOfItems value. +/// The SumOfSquares value. internal readonly record struct StdDev(int Count, TValue SumOfItems, TValue SumOfSquares); diff --git a/src/DynamicData/Aggregation/StdDevEx.cs b/src/DynamicData/Aggregation/StdDevEx.cs index 68dccc209..6c281af48 100644 --- a/src/DynamicData/Aggregation/StdDevEx.cs +++ b/src/DynamicData/Aggregation/StdDevEx.cs @@ -204,6 +204,19 @@ public static IObservable StdDev(this IObservable new StdDev(current.Count + 1, current.SumOfItems + item, current.SumOfSquares + (item * item)), (current, item) => new StdDev(current.Count - 1, current.SumOfItems - item, current.SumOfSquares - (item * item)), values => Math.Sqrt(values.SumOfSquares - ((values.SumOfItems * values.SumOfItems) / values.Count)) * (1.0d / (values.Count - 1))); } + /// + /// Executes the StdDevCalc operation. + /// + /// The type of the TObject value. + /// The type of the TValue value. + /// The type of the TResult value. + /// The source value. + /// The valueSelector value. + /// The fallbackValue value. + /// The addAction value. + /// The removeAction value. + /// The resultAction value. + /// The result of the operation. private static IObservable StdDevCalc(this IObservable> source, Func valueSelector, TResult fallbackValue, Func, TValue, StdDev> addAction, Func, TValue, StdDev> removeAction, Func, TResult> resultAction) { ArgumentExceptionHelper.ThrowIfNull(source); @@ -217,6 +230,12 @@ private static IObservable StdDevCalc(this IO aggregateItem.Type == AggregateType.Add ? addAction(current, valueSelector(aggregateItem.Item)) : removeAction(current, valueSelector(aggregateItem.Item)))).Select(values => values.Count < 2 ? fallbackValue : resultAction(values)); } + /// + /// Executes the Sqrt operation. + /// + /// The x value. + /// The epsilon value. + /// The result of the operation. private static decimal Sqrt(decimal x, decimal epsilon = 0.0M) { if (x < 0) diff --git a/src/DynamicData/Binding/BindPaged.cs b/src/DynamicData/Binding/BindPaged.cs index a2a1624b5..8a1a51fad 100644 --- a/src/DynamicData/Binding/BindPaged.cs +++ b/src/DynamicData/Binding/BindPaged.cs @@ -8,12 +8,20 @@ namespace DynamicData.Reactive.Binding; namespace DynamicData.Binding; #endif - /* * Binding for the result of the SortAndPage operator * * (Direct lift from BindVirtualized). */ + +/// +/// Provides members for the BindPaged class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The targetList value. +/// The options value. internal sealed class BindPaged<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( IObservable>> source, IList targetList, @@ -21,10 +29,19 @@ internal sealed class BindPaged<[DynamicallyAccessedMembers(DynamicallyAccessedM where TObject : notnull where TKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => options is null ? UseContextSortOptions() : UseProvidedOptions(options.Value); + /// + /// Executes the UseProvidedOptions operation. + /// + /// The sortAndBindOptions value. + /// The result of the operation. private IObservable> UseProvidedOptions(SortAndBindOptions sortAndBindOptions) => source.Publish(changes => { @@ -35,6 +52,10 @@ private IObservable> UseProvidedOptions(SortAndBindOpt return changes.SortAndBind(targetList, comparedChanged, sortAndBindOptions); }); + /// + /// Executes the UseContextSortOptions operation. + /// + /// The result of the operation. private IObservable> UseContextSortOptions() => Observable.Create>(observer => { diff --git a/src/DynamicData/Binding/BindVirtualized.cs b/src/DynamicData/Binding/BindVirtualized.cs index 7feb07fdb..7ebe9f5d6 100644 --- a/src/DynamicData/Binding/BindVirtualized.cs +++ b/src/DynamicData/Binding/BindVirtualized.cs @@ -8,10 +8,18 @@ namespace DynamicData.Reactive.Binding; namespace DynamicData.Binding; #endif - /* * Binding for the result of the SortAndVirtualize operator */ + +/// +/// Provides members for the BindVirtualized class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The targetList value. +/// The options value. internal sealed class BindVirtualized<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( IObservable>> source, IList targetList, @@ -19,10 +27,19 @@ internal sealed class BindVirtualized<[DynamicallyAccessedMembers(DynamicallyAcc where TObject : notnull where TKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => options is null ? UseVirtualSortOptions() : UseProvidedOptions(options.Value); + /// + /// Executes the UseProvidedOptions operation. + /// + /// The sortAndBindOptions value. + /// The result of the operation. private IObservable> UseProvidedOptions(SortAndBindOptions sortAndBindOptions) => source.Publish(changes => { @@ -33,6 +50,10 @@ private IObservable> UseProvidedOptions(SortAndBindOpt return changes.SortAndBind(targetList, comparedChanged, sortAndBindOptions); }); + /// + /// Executes the UseVirtualSortOptions operation. + /// + /// The result of the operation. private IObservable> UseVirtualSortOptions() => Observable.Create>(observer => { diff --git a/src/DynamicData/Binding/BindingListAdaptor.cs b/src/DynamicData/Binding/BindingListAdaptor.cs index f90f56c65..cfbb66e61 100644 --- a/src/DynamicData/Binding/BindingListAdaptor.cs +++ b/src/DynamicData/Binding/BindingListAdaptor.cs @@ -28,10 +28,18 @@ namespace DynamicData.Binding; public class BindingListAdaptor<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(BindingList list, int refreshThreshold = BindingOptions.DefaultResetThreshold) : IChangeSetAdaptor where T : notnull { + /// + /// The _list field. + /// private readonly BindingList _list = list ?? throw new ArgumentNullException(nameof(list)); + + /// + /// The _loaded field. + /// private bool _loaded; /// + /// The changes value. public void Adapt(IChangeSet changes) { ArgumentExceptionHelper.ThrowIfNull(changes); @@ -66,12 +74,23 @@ public class BindingListAdaptor<[DynamicallyAccessedMembers(DynamicallyAccessedM where TObject : notnull where TKey : notnull { + /// + /// The _cache field. + /// private readonly Cache _cache = new(); + /// + /// The _list field. + /// private readonly BindingList _list = list ?? throw new ArgumentNullException(nameof(list)); + + /// + /// The _loaded field. + /// private bool _loaded; /// + /// The changes value. public void Adapt(IChangeSet changes) { ArgumentExceptionHelper.ThrowIfNull(changes); @@ -92,6 +111,11 @@ public void Adapt(IChangeSet changes) } } + /// + /// Executes the DoUpdate operation. + /// + /// The changes value. + /// The list value. private static void DoUpdate(IChangeSet changes, BindingList list) { foreach (var update in changes.ToConcreteType()) diff --git a/src/DynamicData/Binding/BindingListEventsSuspender.cs b/src/DynamicData/Binding/BindingListEventsSuspender.cs index 279fd297c..1b061ab10 100644 --- a/src/DynamicData/Binding/BindingListEventsSuspender.cs +++ b/src/DynamicData/Binding/BindingListEventsSuspender.cs @@ -9,10 +9,21 @@ namespace DynamicData.Reactive.Binding; namespace DynamicData.Binding; #endif +/// +/// Provides members for the BindingListEventsSuspender class. +/// +/// The type of the T value. internal sealed class BindingListEventsSuspender<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T> : IDisposable { + /// + /// The _cleanUp field. + /// private readonly IDisposable _cleanUp; + /// + /// Initializes a new instance of the class. + /// + /// The list value. public BindingListEventsSuspender(BindingList list) { list.RaiseListChangedEvents = false; @@ -25,5 +36,8 @@ public BindingListEventsSuspender(BindingList list) }); } + /// + /// Executes the Dispose operation. + /// public void Dispose() => _cleanUp.Dispose(); } diff --git a/src/DynamicData/Binding/BindingListEx.cs b/src/DynamicData/Binding/BindingListEx.cs index de2ffe5e6..0031aef96 100644 --- a/src/DynamicData/Binding/BindingListEx.cs +++ b/src/DynamicData/Binding/BindingListEx.cs @@ -132,6 +132,12 @@ public static IObservable> ToObservableChangeSet(t }); } + /// + /// Executes the Clone operation. + /// + /// The type of the T value. + /// The source value. + /// The changes value. internal static void Clone<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this BindingList source, IEnumerable> changes) where T : notnull { @@ -145,6 +151,13 @@ public static IObservable> ToObservableChangeSet(t } } + /// + /// Executes the Clone operation. + /// + /// The type of the T value. + /// The source value. + /// The item value. + /// The equalityComparer value. private static void Clone<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this BindingList source, Change item, IEqualityComparer equalityComparer) where T : notnull { diff --git a/src/DynamicData/Binding/ExpressionBuilder.cs b/src/DynamicData/Binding/ExpressionBuilder.cs index 1ebdd71c2..707bb01e8 100644 --- a/src/DynamicData/Binding/ExpressionBuilder.cs +++ b/src/DynamicData/Binding/ExpressionBuilder.cs @@ -12,8 +12,18 @@ namespace DynamicData.Reactive.Binding; namespace DynamicData.Binding; #endif +/// +/// Provides members for the ExpressionBuilder class. +/// internal static class ExpressionBuilder { + /// + /// Executes the GetMembers operation. + /// + /// The type of the TObject value. + /// The type of the TProperty value. + /// The source value. + /// The result of the operation. public static IEnumerable GetMembers(this Expression> source) { var memberExpression = source.Body as MemberExpression; @@ -24,6 +34,11 @@ public static IEnumerable GetMembers(this } } + /// + /// Executes the CreatePropertyChangedFactory operation. + /// + /// The source value. + /// The result of the operation. internal static Func> CreatePropertyChangedFactory(this Expression source) { if ((source is not MemberExpression { Member: PropertyInfo property }) @@ -39,6 +54,11 @@ internal static Func> CreatePropertyChangedFactory(thi .Select(static _ => Unit.Default); } + /// + /// Executes the CreateInvoker operation. + /// + /// The source value. + /// The result of the operation. internal static Func CreateInvoker(this Expression source) { switch (source) @@ -71,6 +91,13 @@ internal static Func> CreatePropertyChangedFactory(thi } } + /// + /// Executes the GetMember operation. + /// + /// The type of the TObject value. + /// The type of the TProperty value. + /// The expression value. + /// The result of the operation. internal static MemberInfo GetMember(this Expression> expression) { if (expression is null) @@ -81,6 +108,13 @@ internal static MemberInfo GetMember(this Expression + /// Executes the SplitIntoSteps operation. + /// + /// The type of the TObject value. + /// The type of the TProperty value. + /// The expression value. + /// The result of the operation. internal static IEnumerable SplitIntoSteps(this Expression> expression) { var currentStep = expression.Body; @@ -107,6 +141,13 @@ internal static IEnumerable SplitIntoSteps(this } } + /// + /// Executes the GetProperty operation. + /// + /// The type of the TObject value. + /// The type of the TProperty value. + /// The expression value. + /// The result of the operation. internal static PropertyInfo GetProperty(this Expression> expression) { if (expression.GetMember() is not PropertyInfo property) @@ -117,6 +158,11 @@ internal static PropertyInfo GetProperty(this Expression + /// Executes the GetProperty operation. + /// + /// The expression value. + /// The result of the operation. internal static PropertyInfo GetProperty(this MemberExpression expression) { if (expression.Member is not PropertyInfo property) @@ -127,6 +173,13 @@ internal static PropertyInfo GetProperty(this MemberExpression expression) return property; } + /// + /// Executes the ToCacheKey operation. + /// + /// The type of the TObject value. + /// The type of the TProperty value. + /// The expression value. + /// The result of the operation. internal static string ToCacheKey(this Expression> expression) where TObject : INotifyPropertyChanged { @@ -147,6 +200,11 @@ internal static string ToCacheKey(this Expression + /// Executes the GetMemberInfo operation. + /// + /// The lambda value. + /// The result of the operation. private static MemberInfo GetMemberInfo(LambdaExpression lambda) { if (lambda is null) diff --git a/src/DynamicData/Binding/IObservableListEx.cs b/src/DynamicData/Binding/IObservableListEx.cs index fe76eff4b..55cc77b5f 100644 --- a/src/DynamicData/Binding/IObservableListEx.cs +++ b/src/DynamicData/Binding/IObservableListEx.cs @@ -10,14 +10,14 @@ namespace DynamicData.Binding; #endif /// -/// Extensions to convert a dynamic stream out to an . +/// Extensions to convert a dynamic stream out to an IObservableList<T>. /// public static class IObservableListEx { /// - /// Binds the results to the specified . Unlike - /// binding to a which loses the - /// ability to refresh items, binding to an . + /// Binds the results to the specified IObservableList<T>. Unlike + /// binding to a ReadOnlyObservableCollection<T> which loses the + /// ability to refresh items, binding to an IObservableList<T>. /// allows for refresh changes to be preserved and keeps the list read-only. /// /// The type of the object. @@ -42,9 +42,9 @@ public static IObservable> BindToObservableList(thi } /// - /// Binds the results to the specified . Unlike - /// binding to a which loses the - /// ability to refresh items, binding to an . + /// Binds the results to the specified IObservableList<T>. Unlike + /// binding to a ReadOnlyObservableCollection<T> which loses the + /// ability to refresh items, binding to an IObservableList<T>. /// allows for refresh changes to be preserved and keeps the list read-only. /// /// The type of the object. @@ -71,9 +71,9 @@ public static IObservable> BindToObservableList - /// Binds the results to the specified . Unlike - /// binding to a which loses the - /// ability to refresh items, binding to an . + /// Binds the results to the specified IObservableList<T>. Unlike + /// binding to a ReadOnlyObservableCollection<T> which loses the + /// ability to refresh items, binding to an IObservableList<T>. /// allows for refresh changes to be preserved and keeps the list read-only. /// /// The type of the object. @@ -128,14 +128,14 @@ public static IObservable> BindToObservableList< } /// - /// Converts a to + /// Converts a IChangeSet<TObject, TKey> to IChangeSet<TObject> /// which allows for binding a cache to a list. /// /// The type of the object. /// The type of the key. /// The source change set. /// The list needed to support refresh. - /// The down casted . + /// The down casted IChangeSet<TObject>. private static ChangeSet RemoveKey(this IChangeSet changeSetWithKey, IExtendedList list) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs index b661f9c5e..3e9def4f2 100644 --- a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs +++ b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs @@ -279,6 +279,13 @@ public static IObservable> WhenPropertyChanged return source.WhenChanged(propertyAccessor, notifyOnInitialValue, fallbackValue); } + /// + /// Executes the GetFactory operation. + /// + /// The type of the TObject value. + /// The type of the TProperty value. + /// The expression value. + /// The result of the operation. internal static Func>> GetFactory(this Expression> expression) where TObject : INotifyPropertyChanged { @@ -286,6 +293,16 @@ internal static Func factory.Create(t, initial); } + /// + /// Executes the WhenChanged operation. + /// + /// The type of the TObject value. + /// The type of the TProperty value. + /// The source value. + /// The expression value. + /// The notifyInitial value. + /// The fallbackValue value. + /// The result of the operation. internal static IObservable WhenChanged(this TObject source, Expression> expression, bool notifyInitial = true, Func? fallbackValue = null) where TObject : INotifyPropertyChanged { diff --git a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs index f105052ce..a80e6acfe 100644 --- a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs @@ -36,7 +36,14 @@ public class ObservableCollectionAdaptor(IObservableCollection collection, where T : notnull { + /// + /// The _collection field. + /// private readonly IObservableCollection _collection = collection ?? throw new ArgumentNullException(nameof(collection)); + + /// + /// The _loaded field. + /// private bool _loaded; /// @@ -99,7 +106,14 @@ public class ObservableCollectionAdaptor(int refreshThreshold = 2 where TObject : notnull where TKey : notnull { + /// + /// The _cache field. + /// private readonly Cache _cache = new(); + + /// + /// The _loaded field. + /// private bool _loaded; /// @@ -140,6 +154,11 @@ public void Adapt(IChangeSet changes, IObservableCollection + /// Executes the DoUpdate operation. + /// + /// The changes value. + /// The list value. private void DoUpdate(IChangeSet changes, IObservableCollection list) { foreach (var change in changes.ToConcreteType()) diff --git a/src/DynamicData/Binding/ObservableCollectionExtended.cs b/src/DynamicData/Binding/ObservableCollectionExtended.cs index 2e34a9897..306600d4c 100644 --- a/src/DynamicData/Binding/ObservableCollectionExtended.cs +++ b/src/DynamicData/Binding/ObservableCollectionExtended.cs @@ -17,8 +17,14 @@ namespace DynamicData.Binding; /// The type of the item. public class ObservableCollectionExtended : ObservableCollection, IObservableCollection, IExtendedList { + /// + /// The _suspendCount field. + /// private bool _suspendCount; + /// + /// The _suspendNotifications field. + /// private bool _suspendNotifications; /// @@ -62,7 +68,7 @@ public void AddRange(IEnumerable collection) } /// - /// Inserts the elements of a collection into the at the specified index. + /// Inserts the elements of a collection into the ObservableCollectionExtended<T> at the specified index. /// /// Inserts the items at the specified index. /// The zero-based index at which the new elements should be inserted. @@ -96,9 +102,9 @@ public void Load(IEnumerable items) } /// - /// Removes a range of elements from the . + /// Removes a range of elements from the ObservableCollectionExtended<T>. /// - /// The zero-based starting index of the range of elements to remove.The number of elements to remove. is less than 0.-or- is less than 0. and do not denote a valid range of elements in the . + /// The zero-based starting index of the range of elements to remove.The number of elements to remove. is less than 0.-or- is less than 0. and do not denote a valid range of elements in the List<T>. public void RemoveRange(int index, int count) { for (var i = 0; i < count; i++) diff --git a/src/DynamicData/Binding/ObservablePropertyFactory.cs b/src/DynamicData/Binding/ObservablePropertyFactory.cs index 7fa480956..66392e36b 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactory.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactory.cs @@ -11,11 +11,24 @@ namespace DynamicData.Reactive.Binding; namespace DynamicData.Binding; #endif +/// +/// Provides members for the ObservablePropertyFactory class. +/// +/// The type of the TObject value. +/// The type of the TProperty value. internal sealed class ObservablePropertyFactory where TObject : INotifyPropertyChanged { + /// + /// The _factory field. + /// private readonly Func>> _factory; + /// + /// Initializes a new instance of the class. + /// + /// The valueAccessor value. + /// The chain value. public ObservablePropertyFactory(Func valueAccessor, ObservablePropertyPart[] chain) { // chain is leaf-first (output of SplitIntoSteps). Reverse once to root-to-leaf order. @@ -24,6 +37,10 @@ public ObservablePropertyFactory(Func valueAccessor, Observa observer => new DeepChainSubscription(observer, source, rootToLeaf, valueAccessor, notifyInitial)); } + /// + /// Initializes a new instance of the class. + /// + /// The expression value. public ObservablePropertyFactory(Expression> expression) { // Shallow form: single property, no chain. Used when depth == 1. Skips SharedDeliveryQueue @@ -35,8 +52,13 @@ public ObservablePropertyFactory(Expression> expression observer => new SinglePropertySubscription(observer, source, memberName, accessor, notifyInitial)); } + /// + /// Executes the Create operation. + /// + /// The source value. + /// The notifyInitial value. + /// The result of the operation. public IObservable> Create(TObject source, bool notifyInitial) => _factory(source, notifyInitial); - // Single-property subscription. Attaches a direct PropertyChanged handler and forwards every // event through a DeliveryQueue. Used for x => x.Prop (depth == 1) where SharedDeliveryQueue // and Observable.FromEventPattern would be needless overhead on the hot path. @@ -45,13 +67,40 @@ public ObservablePropertyFactory(Expression> expression // is no equality dedup at the subscribe seam: a same-valued PropertyChanged firing in the // subscribe window is a legitimate event and must be delivered. The "never drop events" // contract takes precedence over avoiding a benign duplicate. - private sealed class SinglePropertySubscription : IDisposable + +/// +/// Provides members for the SinglePropertySubscription class. +/// +private sealed class SinglePropertySubscription : IDisposable { + /// + /// The _source field. + /// private readonly TObject _source; + + /// + /// The _memberName field. + /// private readonly string _memberName; + + /// + /// The _accessor field. + /// private readonly Func _accessor; + + /// + /// The _queue field. + /// private readonly DeliveryQueue> _queue; + /// + /// Initializes a new instance of the class. + /// + /// The observer value. + /// The source value. + /// The memberName value. + /// The accessor value. + /// The notifyInitial value. public SinglePropertySubscription( IObserver> observer, TObject source, @@ -73,12 +122,20 @@ public SinglePropertySubscription( } } + /// + /// Executes the Dispose operation. + /// public void Dispose() { _source.PropertyChanged -= OnPropertyChanged; _queue.Dispose(); } + /// + /// Executes the OnPropertyChanged operation. + /// + /// The sender value. + /// The args value. private void OnPropertyChanged(object? sender, PropertyChangedEventArgs args) { if (args.PropertyName == _memberName) @@ -86,12 +143,15 @@ private void OnPropertyChanged(object? sender, PropertyChangedEventArgs args) EmitCurrent(); } } - // Reads the current property value and forwards it through the queue. The accessor is // user code and may throw; that exception routes to OnError. The downstream OnNext call // is NOT wrapped: per the Rx contract, if the user observer throws, the exception // propagates back to whoever invoked the PropertyChanged setter, matching what a plain // Signal.OnNext would do. + + /// + /// Executes the EmitCurrent operation. + /// private void EmitCurrent() { PropertyValue value; @@ -108,7 +168,6 @@ private void EmitCurrent() _queue.OnNext(value); } } - // Deep-chain subscription. Encapsulates the SharedDeliveryQueue + sub-queues + per-level // SerialDisposable slots so fields are assigned in well-defined order and the signal sub-queue // never needs a forward null bootstrap. @@ -135,25 +194,75 @@ private void EmitCurrent() // notifyInitial only controls whether ProcessSignal emits the current chain value during // the InitialSetupSignal pass. There is no equality dedup at the subscribe seam: every // chain event is delivered. - private sealed class DeepChainSubscription : IDisposable + +/// +/// Provides members for the DeepChainSubscription class. +/// +private sealed class DeepChainSubscription : IDisposable { // Sentinel signal value enqueued during subscribe to perform the initial chain setup // from inside the SharedDeliveryQueue drainer. + + /// + /// The InitialSetupSignal field. + /// private const int InitialSetupSignal = -1; + /// + /// The _source field. + /// private readonly TObject _source; + + /// + /// The _rootToLeaf field. + /// private readonly ObservablePropertyPart[] _rootToLeaf; + + /// + /// The _valueAccessor field. + /// private readonly Func _valueAccessor; + + /// + /// The _notifyInitial field. + /// private readonly bool _notifyInitial; + + /// + /// The _sharedQueue field. + /// private readonly SharedDeliveryQueue _sharedQueue; + + /// + /// The _userSub field. + /// private readonly DeliverySubQueue> _userSub; + + /// + /// The _signalSub field. + /// private readonly DeliverySubQueue _signalSub; - private readonly SerialDisposable[] _levelSlots; + /// + /// The _levelSlots field. + /// + private readonly SerialDisposable[] _levelSlots; // Pre-allocated per-level notifier callbacks. Indexed by level. ResubscribeFrom reuses // these instead of allocating a fresh closure per re-walk. + + /// + /// The _levelCallbacks field. + /// private readonly Action[] _levelCallbacks; + /// + /// Initializes a new instance of the class. + /// + /// The observer value. + /// The source value. + /// The rootToLeaf value. + /// The valueAccessor value. + /// The notifyInitial value. public DeepChainSubscription( IObserver> observer, TObject source, @@ -192,6 +301,9 @@ public DeepChainSubscription( _signalSub.OnNext(InitialSetupSignal); } + /// + /// Executes the Dispose operation. + /// public void Dispose() { foreach (var slot in _levelSlots) @@ -204,6 +316,10 @@ public void Dispose() _sharedQueue.Dispose(); } + /// + /// Executes the ProcessSignal operation. + /// + /// The level value. private void ProcessSignal(int level) { // Drainer thread. The chain walk (Invoker / notifier Factory / ReadCurrent's accessor) @@ -237,6 +353,10 @@ private void ProcessSignal(int level) _userSub.OnNext(value); } + /// + /// Executes the ResubscribeFrom operation. + /// + /// The startLevel value. private void ResubscribeFrom(int startLevel) { var depth = _rootToLeaf.Length; @@ -274,8 +394,12 @@ private void ResubscribeFrom(int startLevel) value = _rootToLeaf[i].Invoker(value); } } - // Root-to-leaf chain walk. Stops at null and returns an unobtainable PropertyValue. + + /// + /// Executes the ReadCurrent operation. + /// + /// The result of the operation. private PropertyValue ReadCurrent() { object? value = _source; diff --git a/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs b/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs index d2265fcd7..ddfa8afb9 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs @@ -12,16 +12,35 @@ namespace DynamicData.Reactive.Binding; namespace DynamicData.Binding; #endif +/// +/// Provides members for the ObservablePropertyFactoryCache class. +/// internal sealed class ObservablePropertyFactoryCache { + /// + /// The Instance field. + /// public static readonly ObservablePropertyFactoryCache Instance = new(); + /// + /// The _factories field. + /// private readonly ConcurrentDictionary _factories = new(); + /// + /// Initializes a new instance of the class. + /// private ObservablePropertyFactoryCache() { } + /// + /// Executes the GetFactory operation. + /// + /// The type of the TObject value. + /// The type of the TProperty value. + /// The expression value. + /// The result of the operation. public ObservablePropertyFactory GetFactory(Expression> expression) where TObject : INotifyPropertyChanged { diff --git a/src/DynamicData/Binding/ObservablePropertyPart.cs b/src/DynamicData/Binding/ObservablePropertyPart.cs index c0515d930..ca7e7b142 100644 --- a/src/DynamicData/Binding/ObservablePropertyPart.cs +++ b/src/DynamicData/Binding/ObservablePropertyPart.cs @@ -12,10 +12,20 @@ namespace DynamicData.Reactive.Binding; namespace DynamicData.Binding; #endif +/// +/// Provides members for the ObservablePropertyPart class. +/// +/// The expression value. [DebuggerDisplay("ObservablePropertyPart<{" + nameof(expression) + "}>")] internal sealed class ObservablePropertyPart(Expression expression) { + /// + /// Gets the Invoker value. + /// public Func Invoker { get; } = expression.CreateInvoker(); + /// + /// Gets the Factory value. + /// public Func> Factory { get; } = expression.CreatePropertyChangedFactory(); } diff --git a/src/DynamicData/Binding/PropertyValue.cs b/src/DynamicData/Binding/PropertyValue.cs index 126bc0166..cff3040ad 100644 --- a/src/DynamicData/Binding/PropertyValue.cs +++ b/src/DynamicData/Binding/PropertyValue.cs @@ -29,12 +29,17 @@ public PropertyValue(TObject sender, TValue value) { } + /// + /// Initializes a new instance of the class. + /// + /// The sender value. internal PropertyValue(TObject sender) : this(sender, default, true) { } /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -44,5 +49,6 @@ public override int GetHashCode() } /// + /// The result of the operation. public override string ToString() => $"{Sender} ({Value})"; } diff --git a/src/DynamicData/Binding/SortAndBind.cs b/src/DynamicData/Binding/SortAndBind.cs index 32637ebd8..a38c0e8a6 100644 --- a/src/DynamicData/Binding/SortAndBind.cs +++ b/src/DynamicData/Binding/SortAndBind.cs @@ -15,7 +15,6 @@ namespace DynamicData.Reactive.Binding; namespace DynamicData.Binding; #endif - /* * A much more optimised bind where the sort forms part of the binding. * @@ -23,15 +22,35 @@ namespace DynamicData.Binding; * collection upon every change in order that the sorted list could be transmitted to the bind operator. * */ + +/// +/// Provides members for the SortAndBind class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey> where TObject : notnull where TKey : notnull { // NB: Either comparer or comparerChanged will be used, but not both. + /// + /// The _cache field. + /// private readonly Cache _cache = new(); + + /// + /// The _sorted field. + /// private readonly IObservable> _sorted; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The comparer value. + /// The options value. + /// The target value. public SortAndBind(IObservable> source, IComparer comparer, SortAndBindOptions options, @@ -56,6 +75,13 @@ public SortAndBind(IObservable> source, }); } + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The comparerChanged value. + /// The options value. + /// The target value. public SortAndBind(IObservable> source, IObservable> comparerChanged, SortAndBindOptions options, @@ -97,14 +123,28 @@ public SortAndBind(IObservable> source, return new CompositeDisposable(latestComparer, subscriber, queue); }); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => _sorted; - internal sealed class SortApplicator( +/// +/// Provides members for the SortApplicator class. +/// +/// The cache value. +/// The target value. +/// The comparer value. +/// The options value. +internal sealed class SortApplicator( Cache cache, IList target, IComparer comparer, SortAndBindOptions options) { + /// + /// Executes the ApplySort operation. + /// public void ApplySort() { if (cache.Count == 0) return; @@ -114,8 +154,13 @@ public void ApplySort() Reset(sorted, fireReset); } - // apply sorting as a side effect of the observable stream. + + /// + /// Executes the ProcessChanges operation. + /// + /// The changeSet value. + /// The isFirstTimeLoad value. public void ProcessChanges(IChangeSet changeSet, bool isFirstTimeLoad) { var forceReset = isFirstTimeLoad && options.ResetOnFirstTimeLoad; @@ -139,6 +184,11 @@ public void ProcessChanges(IChangeSet changeSet, bool isFirstTime } } + /// + /// Executes the Reset operation. + /// + /// The sorted value. + /// The fireReset value. private void Reset(IEnumerable sorted, bool fireReset) { if (fireReset && target is ObservableCollectionExtended observableCollectionExtended) @@ -167,6 +217,10 @@ private void Reset(IEnumerable sorted, bool fireReset) } } + /// + /// Executes the ApplyChanges operation. + /// + /// The changes value. private void ApplyChanges(IChangeSet changes) { // iterate through collection, find sorted position and apply changes @@ -253,9 +307,19 @@ private void ApplyChanges(IChangeSet changes) } } + /// + /// Executes the GetCurrentPosition operation. + /// + /// The item value. + /// The result of the operation. private int GetCurrentPosition(TObject item) => target.GetCurrentPosition(item, comparer, options.UseBinarySearch); + /// + /// Executes the GetInsertPosition operation. + /// + /// The item value. + /// The result of the operation. private int GetInsertPosition(TObject item) => target.GetInsertPosition(item, comparer, options.UseBinarySearch); } diff --git a/src/DynamicData/Binding/SortExpressionComparer.cs b/src/DynamicData/Binding/SortExpressionComparer.cs index 32b5fce19..09550ed8a 100644 --- a/src/DynamicData/Binding/SortExpressionComparer.cs +++ b/src/DynamicData/Binding/SortExpressionComparer.cs @@ -30,6 +30,9 @@ public class SortExpressionComparer : List>, IComparer public static SortExpressionComparer Descending(Func expression) => [new(expression, SortDirection.Descending)]; /// + /// The x value. + /// The y value. + /// The result of the operation. public int Compare(T? x, T? y) { foreach (var item in this) diff --git a/src/DynamicData/Binding/SortedBindingListAdaptor.cs b/src/DynamicData/Binding/SortedBindingListAdaptor.cs index 1808ef1b5..5fc07ee8c 100644 --- a/src/DynamicData/Binding/SortedBindingListAdaptor.cs +++ b/src/DynamicData/Binding/SortedBindingListAdaptor.cs @@ -24,9 +24,13 @@ public class SortedBindingListAdaptor<[DynamicallyAccessedMembers(DynamicallyAcc where TObject : notnull where TKey : notnull { + /// + /// The _list field. + /// private readonly BindingList _list = list ?? throw new ArgumentNullException(nameof(list)); /// + /// The changes value. public void Adapt(ISortedChangeSet changes) { ArgumentExceptionHelper.ThrowIfNull(changes); @@ -69,6 +73,10 @@ public void Adapt(ISortedChangeSet changes) } } + /// + /// Executes the DoUpdate operation. + /// + /// The changes value. private void DoUpdate(ISortedChangeSet changes) { foreach (var change in changes) diff --git a/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs b/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs index 682865624..a763afb16 100644 --- a/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs @@ -121,6 +121,11 @@ public void Adapt(ISortedChangeSet changes, IObservableCollection } } + /// + /// Executes the DoUpdate operation. + /// + /// The updates value. + /// The list value. private void DoUpdate(ISortedChangeSet updates, IObservableCollection list) { foreach (var update in updates) diff --git a/src/DynamicData/Cache/CacheChangeSetEx.cs b/src/DynamicData/Cache/CacheChangeSetEx.cs index 66d84ccf0..eb7d14c07 100644 --- a/src/DynamicData/Cache/CacheChangeSetEx.cs +++ b/src/DynamicData/Cache/CacheChangeSetEx.cs @@ -9,6 +9,9 @@ namespace DynamicData.Reactive.Cache; namespace DynamicData.Cache; #endif +/// +/// Provides members for the CacheChangeSetEx class. +/// internal static class CacheChangeSetEx { /// @@ -17,7 +20,7 @@ internal static class CacheChangeSetEx /// This extension is a crazy hack to cast to the concrete change set which means we no longer allocate /// as change set now inherits from List which has allocation free enumerations. /// - /// IChangeSet will be removed in a future version and instead will be used directly. + /// IChangeSet will be removed in a future version and instead ChangeSet<TObject, TKey> will be used directly. /// In the mean time I am banking that no-one has implemented a custom change set - personally I think it is very unlikely. /// /// ChangeSet Object Type. diff --git a/src/DynamicData/Cache/Change.cs b/src/DynamicData/Cache/Change.cs index 51a911ad5..59b3cfda8 100644 --- a/src/DynamicData/Cache/Change.cs +++ b/src/DynamicData/Cache/Change.cs @@ -148,9 +148,13 @@ public Change(ChangeReason reason, TKey key, TObject current, in ReactiveUI.Prim public static bool operator !=(in Change left, in Change right) => !left.Equals(right); /// + /// The other value. + /// The result of the operation. public bool Equals(Change other) => EqualityComparer.Default.Equals(Key, other.Key) && Reason == other.Reason && EqualityComparer.Default.Equals(Current, other.Current) && CurrentIndex == other.CurrentIndex && Previous.Equals(other.Previous) && PreviousIndex == other.PreviousIndex; /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -162,6 +166,7 @@ public override bool Equals(object? obj) } /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -177,5 +182,6 @@ public override int GetHashCode() } /// + /// The result of the operation. public override string ToString() => $"{Reason}, Key: {Key}, Current: {Current}, Previous: {Previous}"; } diff --git a/src/DynamicData/Cache/ChangeAwareCache.cs b/src/DynamicData/Cache/ChangeAwareCache.cs index d05742b5b..3964e1321 100644 --- a/src/DynamicData/Cache/ChangeAwareCache.cs +++ b/src/DynamicData/Cache/ChangeAwareCache.cs @@ -13,14 +13,21 @@ namespace DynamicData; /// A cache which captures all changes which are made to it. These changes are recorded until CaptureChanges() at which point thw changes are cleared. /// Used for creating custom operators. /// -/// +/// ICache<TObject, TKey> /// The value of the cache. /// The key of the cache. public sealed class ChangeAwareCache : ICache where TObject : notnull where TKey : notnull { + /// + /// The _data field. + /// private readonly Dictionary _data; + + /// + /// The _changes field. + /// private ChangeSet _changes; /// @@ -66,6 +73,10 @@ public ChangeAwareCache(Dictionary data) /// public IEnumerable> KeyValues => _data; + /// + /// Executes the GetDictionary operation. + /// + /// The result of the operation. internal Dictionary GetDictionary() => _data; /// @@ -80,6 +91,8 @@ public void Add(TObject item, TKey key) } /// + /// The item value. + /// The key value. public void AddOrUpdate(TObject item, TKey key) { _changes.Add(_data.TryGetValue(key, out var existingItem) ? new Change(ChangeReason.Update, key, item, existingItem) : new Change(ChangeReason.Add, key, item)); @@ -113,6 +126,7 @@ public void Clear() } /// + /// The changes value. public void Clone(IChangeSet changes) { ArgumentExceptionHelper.ThrowIfNull(changes); @@ -142,6 +156,8 @@ public void Clone(IChangeSet changes) } /// + /// The key value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TKey key) => _data.Lookup(key); /// @@ -210,6 +226,7 @@ public void Remove(IEnumerable keys) } /// + /// The key value. public void Remove(TKey key) { if (_data.TryGetValue(key, out var existingItem)) diff --git a/src/DynamicData/Cache/ChangeSet.cs b/src/DynamicData/Cache/ChangeSet.cs index 870b67eef..1e7d9e91f 100644 --- a/src/DynamicData/Cache/ChangeSet.cs +++ b/src/DynamicData/Cache/ChangeSet.cs @@ -102,5 +102,6 @@ public ChangeSet(int capacity) public int Updates => this.Count(c => c.Reason == ChangeReason.Update); /// + /// The result of the operation. public override string ToString() => $"ChangeSet<{typeof(TObject).Name}.{typeof(TKey).Name}>. Count={Count}"; } diff --git a/src/DynamicData/Cache/DistinctChangeSet.cs b/src/DynamicData/Cache/DistinctChangeSet.cs index 8f0fb7ad4..e863bc104 100644 --- a/src/DynamicData/Cache/DistinctChangeSet.cs +++ b/src/DynamicData/Cache/DistinctChangeSet.cs @@ -9,18 +9,33 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the DistinctChangeSet class. +/// +/// The type of the T value. internal sealed class DistinctChangeSet : ChangeSet, IDistinctChangeSet where T : notnull { + /// + /// Initializes a new instance of the class. + /// + /// The items value. public DistinctChangeSet(IEnumerable> items) : base(items) { } + /// + /// Initializes a new instance of the class. + /// public DistinctChangeSet() { } + /// + /// Initializes a new instance of the class. + /// + /// The capacity value. public DistinctChangeSet(int capacity) : base(capacity) { diff --git a/src/DynamicData/Cache/GroupChangeSet.cs b/src/DynamicData/Cache/GroupChangeSet.cs index f223434bf..034841998 100644 --- a/src/DynamicData/Cache/GroupChangeSet.cs +++ b/src/DynamicData/Cache/GroupChangeSet.cs @@ -9,18 +9,34 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the GroupChangeSet class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroupKey value. internal sealed class GroupChangeSet : ChangeSet, TGroupKey>, IGroupChangeSet where TObject : notnull where TKey : notnull where TGroupKey : notnull { + /// + /// The Empty field. + /// public static new readonly IGroupChangeSet Empty = new GroupChangeSet(); + /// + /// Initializes a new instance of the class. + /// + /// The items value. public GroupChangeSet(IEnumerable, TGroupKey>> items) : base(items) { } + /// + /// Initializes a new instance of the class. + /// private GroupChangeSet() { } diff --git a/src/DynamicData/Cache/ICache.cs b/src/DynamicData/Cache/ICache.cs index 135e2de93..42d2c8e96 100644 --- a/src/DynamicData/Cache/ICache.cs +++ b/src/DynamicData/Cache/ICache.cs @@ -15,7 +15,7 @@ namespace DynamicData; /// /// The type of the object. /// The type of the key. -/// +/// IQuery<TObject, TKey> public interface ICache : IQuery where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/IndexedItem.cs b/src/DynamicData/Cache/IndexedItem.cs index 2442640ae..39da83232 100644 --- a/src/DynamicData/Cache/IndexedItem.cs +++ b/src/DynamicData/Cache/IndexedItem.cs @@ -38,9 +38,13 @@ public sealed class IndexedItem(TObject value, TKey key, int inde public TObject Value { get; } = value; /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is IndexedItem indexedKey && Equals(indexedKey); /// + /// The other value. + /// The result of the operation. public bool Equals(IndexedItem? other) { if (other is null) @@ -52,6 +56,7 @@ public bool Equals(IndexedItem? other) } /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -64,5 +69,6 @@ public override int GetHashCode() } /// + /// The result of the operation. public override string ToString() => $"Value: {Value}, Key: {Key}, CurrentIndex: {Index}"; } diff --git a/src/DynamicData/Cache/IntermediateCache.cs b/src/DynamicData/Cache/IntermediateCache.cs index 522025f41..26bf009a8 100644 --- a/src/DynamicData/Cache/IntermediateCache.cs +++ b/src/DynamicData/Cache/IntermediateCache.cs @@ -27,6 +27,9 @@ public sealed class IntermediateCache : IIntermediateCache + /// The _innerCache field. + /// private readonly ObservableCache _innerCache; /// @@ -62,6 +65,9 @@ public IntermediateCache(IObservable> source) public IReadOnlyDictionary KeyValues => _innerCache.KeyValues; /// + /// The predicate value. + /// The suppressEmptyChangeSets value. + /// The result of the operation. public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => _innerCache.Connect(predicate, suppressEmptyChangeSets); @@ -69,23 +75,37 @@ public IObservable> Connect(Func? predi public void Dispose() => _innerCache.Dispose(); /// + /// The updateAction value. public void Edit(Action> updateAction) => _innerCache.UpdateFromIntermediate(updateAction); /// + /// The key value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TKey key) => _innerCache.Lookup(key); /// + /// The predicate value. + /// The result of the operation. public IObservable> Preview(Func? predicate = null) => _innerCache.Preview(predicate); /// + /// The key value. + /// The result of the operation. public IObservable> Watch(TKey key) => _innerCache.Watch(key); /// + /// The result of the operation. public IDisposable SuspendCount() => _innerCache.SuspendCount(); /// + /// The result of the operation. public IDisposable SuspendNotifications() => _innerCache.SuspendNotifications(); + /// + /// Executes the GetInitialUpdates operation. + /// + /// The filter value. + /// The result of the operation. internal IChangeSet GetInitialUpdates(Func? filter = null) => _innerCache.GetInitialUpdates(filter); } diff --git a/src/DynamicData/Cache/Internal/AbstractFilter.cs b/src/DynamicData/Cache/Internal/AbstractFilter.cs index 1e7a38028..dc397e4b7 100644 --- a/src/DynamicData/Cache/Internal/AbstractFilter.cs +++ b/src/DynamicData/Cache/Internal/AbstractFilter.cs @@ -9,12 +9,25 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the AbstractFilter class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal abstract class AbstractFilter : IFilter where TObject : notnull where TKey : notnull { + /// + /// The _cache field. + /// private readonly ChangeAwareCache _cache; + /// + /// Initializes a new instance of the class. + /// + /// The cache value. + /// The filter value. protected AbstractFilter(ChangeAwareCache cache, Func? filter) { ArgumentExceptionHelper.ThrowIfNull(cache); @@ -23,8 +36,16 @@ protected AbstractFilter(ChangeAwareCache cache, Func true); } + /// + /// Gets the Filter value. + /// public Func Filter { get; } + /// + /// Executes the Refresh operation. + /// + /// The items value. + /// The result of the operation. public IChangeSet Refresh(IEnumerable> items) { // this is an internal method only so we can be sure there are no duplicate keys in the result @@ -55,16 +76,37 @@ ReactiveUI.Primitives.Optional> Factory(KeyValuePair + /// Executes the Update operation. + /// + /// The updates value. + /// The result of the operation. public IChangeSet Update(IChangeSet updates) { var withFilter = GetChangesWithFilter(updates.ToConcreteType()); return ProcessResult(withFilter); } + /// + /// Executes the GetChangesWithFilter operation. + /// + /// The updates value. + /// The result of the operation. protected abstract IEnumerable GetChangesWithFilter(ChangeSet updates); + /// + /// Executes the Refresh operation. + /// + /// The items value. + /// The factory value. + /// The result of the operation. protected abstract IEnumerable> Refresh(IEnumerable> items, Func, ReactiveUI.Primitives.Optional>> factory); + /// + /// Executes the ProcessResult operation. + /// + /// The source value. + /// The result of the operation. private ChangeSet ProcessResult(IEnumerable source) { // Have to process one item at a time as an item can be included multiple @@ -132,16 +174,22 @@ private ChangeSet ProcessResult(IEnumerable sou return _cache.CaptureChanges(); } - /// - /// Initializes a new instance of the struct. - /// Initializes a new instance of the class. - /// - /// If the filter is a match. - /// The change. - protected readonly struct UpdateWithFilter(bool isMatch, Change change) +/// +/// Initializes a new instance of the struct. +/// Initializes a new instance of the class. +/// +/// If the filter is a match. +/// The change. +protected readonly struct UpdateWithFilter(bool isMatch, Change change) { + /// + /// Gets the Change value. + /// public Change Change { get; } = change; + /// + /// Gets the IsMatch value. + /// public bool IsMatch { get; } = isMatch; } } diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index 224e33bd7..4e5dc7640 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs @@ -11,15 +11,31 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the AnonymousObservableCache class. +/// +/// The type of the TObject value. +/// The type of the TKey value. [DebuggerDisplay("AnonymousObservableCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] internal sealed class AnonymousObservableCache : IObservableCache where TObject : notnull where TKey : notnull { + /// + /// The _cache field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed through _cleanUp")] private readonly IObservableCache _cache; + + /// + /// The _cleanUp field. + /// private readonly IDisposable _cleanUp; + /// + /// Initializes a new instance of the class. + /// + /// The source value. public AnonymousObservableCache(IObservable> source) { ArgumentExceptionHelper.ThrowIfNull(source); @@ -29,6 +45,10 @@ public AnonymousObservableCache(IObservable> source) _cleanUp = _cache; } + /// + /// Initializes a new instance of the class. + /// + /// The cache value. public AnonymousObservableCache(IObservableCache cache) { ArgumentExceptionHelper.ThrowIfNull(cache); @@ -37,24 +57,63 @@ public AnonymousObservableCache(IObservableCache cache) _cleanUp = Disposable.Empty; } + /// + /// Gets the Count value. + /// public int Count => _cache.Count; + /// + /// Gets the CountChanged value. + /// public IObservable CountChanged => _cache.CountChanged; + /// + /// Gets the Items value. + /// public IReadOnlyList Items => _cache.Items; + /// + /// Gets the Keys value. + /// public IReadOnlyList Keys => _cache.Keys; + /// + /// Gets the KeyValues value. + /// public IReadOnlyDictionary KeyValues => _cache.KeyValues; + /// + /// Executes the Connect operation. + /// + /// The predicate value. + /// The suppressEmptyChangeSets value. + /// The result of the operation. public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => _cache.Connect(predicate, suppressEmptyChangeSets); + /// + /// Executes the Lookup operation. + /// + /// The key value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TKey key) => _cache.Lookup(key); + /// + /// Executes the Preview operation. + /// + /// The predicate value. + /// The result of the operation. public IObservable> Preview(Func? predicate = null) => _cache.Preview(predicate); + /// + /// Executes the Watch operation. + /// + /// The key value. + /// The result of the operation. public IObservable> Watch(TKey key) => _cache.Watch(key); + /// + /// Executes the Dispose operation. + /// public void Dispose() => _cleanUp.Dispose(); } diff --git a/src/DynamicData/Cache/Internal/AnonymousQuery.cs b/src/DynamicData/Cache/Internal/AnonymousQuery.cs index 35f88cfb5..292cabffe 100644 --- a/src/DynamicData/Cache/Internal/AnonymousQuery.cs +++ b/src/DynamicData/Cache/Internal/AnonymousQuery.cs @@ -9,19 +9,45 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the AnonymousQuery class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The cache value. internal sealed class AnonymousQuery(Cache cache) : IQuery where TObject : notnull where TKey : notnull { + /// + /// The _cache field. + /// private readonly Cache _cache = cache.Clone(); + /// + /// Gets the Count value. + /// public int Count => _cache.Count; + /// + /// Gets the Items value. + /// public IEnumerable Items => _cache.Items; + /// + /// Gets the Keys value. + /// public IEnumerable Keys => _cache.Keys; + /// + /// Gets the KeyValues value. + /// public IEnumerable> KeyValues => _cache.KeyValues; + /// + /// Executes the Lookup operation. + /// + /// The key value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TKey key) => _cache.Lookup(key); } diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index ae92cac5e..bfc39888b 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs @@ -8,12 +8,23 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif - #if SUPPORTS_ASYNC_DISPOSABLE + +/// +/// Provides members for the AsyncDisposeMany class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal static class AsyncDisposeMany where TObject : notnull where TKey : notnull { + /// + /// Executes the Create operation. + /// + /// The source value. + /// The disposalsCompletedAccessor value. + /// The result of the operation. public static IObservable> Create( IObservable> source, Action> disposalsCompletedAccessor) diff --git a/src/DynamicData/Cache/Internal/AutoRefresh.cs b/src/DynamicData/Cache/Internal/AutoRefresh.cs index 176dd9bb3..59f94fa37 100644 --- a/src/DynamicData/Cache/Internal/AutoRefresh.cs +++ b/src/DynamicData/Cache/Internal/AutoRefresh.cs @@ -9,16 +9,39 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the AutoRefresh class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TAny value. +/// The source value. +/// The reEvaluator value. +/// The buffer value. +/// The scheduler value. internal sealed class AutoRefresh(IObservable> source, Func> reEvaluator, TimeSpan? buffer = null, IScheduler? scheduler = null) where TObject : notnull where TKey : notnull { + /// + /// The _reEvaluator field. + /// private readonly Func> _reEvaluator = reEvaluator ?? throw new ArgumentNullException(nameof(reEvaluator)); + /// + /// The _scheduler field. + /// private readonly IScheduler _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/BatchIf.cs b/src/DynamicData/Cache/Internal/BatchIf.cs index 1da3ea31a..e4853d6f8 100644 --- a/src/DynamicData/Cache/Internal/BatchIf.cs +++ b/src/DynamicData/Cache/Internal/BatchIf.cs @@ -9,16 +9,40 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the BatchIf class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The pauseIfTrueSelector value. +/// The timeOut value. +/// The initialPauseState value. +/// The intervalTimer value. +/// The scheduler value. internal sealed class BatchIf(IObservable> source, IObservable pauseIfTrueSelector, TimeSpan? timeOut, bool initialPauseState = false, IObservable? intervalTimer = null, IScheduler? scheduler = null) where TObject : notnull where TKey : notnull { + /// + /// The _pauseIfTrueSelector field. + /// private readonly IObservable _pauseIfTrueSelector = pauseIfTrueSelector ?? throw new ArgumentNullException(nameof(pauseIfTrueSelector)); + /// + /// The _scheduler field. + /// private readonly IScheduler _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/Cache.cs b/src/DynamicData/Cache/Internal/Cache.cs index f0398072a..d5415dc28 100644 --- a/src/DynamicData/Cache/Internal/Cache.cs +++ b/src/DynamicData/Cache/Internal/Cache.cs @@ -11,34 +11,81 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the Cache class. +/// +/// The type of the TObject value. +/// The type of the TKey value. [DebuggerDisplay("Cache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] internal sealed class Cache : ICache where TObject : notnull where TKey : notnull { + /// + /// The Empty field. + /// public static readonly Cache Empty = new(); + /// + /// The _data field. + /// private readonly Dictionary _data; + /// + /// Initializes a new instance of the class. + /// + /// The capacity value. public Cache(int capacity = -1) => _data = capacity > 1 ? new Dictionary(capacity) : []; + /// + /// Initializes a new instance of the class. + /// + /// The data value. public Cache(Dictionary data) => _data = data; + /// + /// Gets the Count value. + /// public int Count => _data.Count; + /// + /// Gets the Items value. + /// public IEnumerable Items => _data.Values; + /// + /// Gets the Keys value. + /// public IEnumerable Keys => _data.Keys; + /// + /// Gets the KeyValues value. + /// public IEnumerable> KeyValues => _data; + /// + /// Executes the AddOrUpdate operation. + /// + /// The item value. + /// The key value. public void AddOrUpdate(TObject item, TKey key) => _data[key] = item; + /// + /// Executes the Clear operation. + /// public void Clear() => _data.Clear(); + /// + /// Executes the Clone operation. + /// + /// The result of the operation. public Cache Clone() => new(new Dictionary(_data)); + /// + /// Executes the Clone operation. + /// + /// The changes value. public void Clone(IChangeSet changes) { ArgumentExceptionHelper.ThrowIfNull(changes); @@ -62,6 +109,11 @@ public void Clone(IChangeSet changes) } } + /// + /// Executes the Lookup operation. + /// + /// The key value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TKey key) => _data.Lookup(key); /// @@ -87,6 +139,10 @@ public void Refresh(TKey key) { } + /// + /// Executes the Remove operation. + /// + /// The keys value. public void Remove(IEnumerable keys) { if (keys is IList list) @@ -105,5 +161,9 @@ public void Remove(IEnumerable keys) } } + /// + /// Executes the Remove operation. + /// + /// The key value. public void Remove(TKey key) => _data.Remove(key); } diff --git a/src/DynamicData/Cache/Internal/CacheEx.cs b/src/DynamicData/Cache/Internal/CacheEx.cs index 2831fa34b..a00adc1dd 100644 --- a/src/DynamicData/Cache/Internal/CacheEx.cs +++ b/src/DynamicData/Cache/Internal/CacheEx.cs @@ -9,8 +9,18 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the CacheEx class. +/// internal static class CacheEx { + /// + /// Executes the Clone operation. + /// + /// The type of the TKey value. + /// The type of the TObject value. + /// The source value. + /// The changes value. public static void Clone(this IDictionary source, IChangeSet changes) where TKey : notnull where TObject : notnull @@ -31,6 +41,14 @@ public static void Clone(this IDictionary source, } } + /// + /// Executes the GetInitialUpdates operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The filter value. + /// The result of the operation. public static IChangeSet GetInitialUpdates(this ChangeAwareCache source, Func? filter = null) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/Internal/CacheUpdater.cs b/src/DynamicData/Cache/Internal/CacheUpdater.cs index 3926dfc13..9ac68e160 100644 --- a/src/DynamicData/Cache/Internal/CacheUpdater.cs +++ b/src/DynamicData/Cache/Internal/CacheUpdater.cs @@ -9,20 +9,41 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the CacheUpdater class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class CacheUpdater : ISourceUpdater where TObject : notnull where TKey : notnull { + /// + /// The _cache field. + /// private readonly ICache _cache; + /// + /// The _keySelector field. + /// private readonly Func? _keySelector; + /// + /// Initializes a new instance of the class. + /// + /// The cache value. + /// The keySelector value. public CacheUpdater(ICache cache, Func? keySelector = null) { _cache = cache ?? throw new ArgumentNullException(nameof(cache)); _keySelector = keySelector; } + /// + /// Initializes a new instance of the class. + /// + /// The data value. + /// The keySelector value. public CacheUpdater(Dictionary data, Func? keySelector = null) { ArgumentExceptionHelper.ThrowIfNull(data); @@ -31,14 +52,30 @@ public CacheUpdater(Dictionary data, Func? keySele _keySelector = keySelector; } + /// + /// Gets the Count value. + /// public int Count => _cache.Count; + /// + /// Gets the Items value. + /// public IEnumerable Items => _cache.Items; + /// + /// Gets the Keys value. + /// public IEnumerable Keys => _cache.Keys; + /// + /// Gets the KeyValues value. + /// public IEnumerable> KeyValues => _cache.KeyValues; + /// + /// Executes the AddOrUpdate operation. + /// + /// The items value. public void AddOrUpdate(IEnumerable items) { ArgumentExceptionHelper.ThrowIfNull(items); @@ -65,6 +102,11 @@ public void AddOrUpdate(IEnumerable items) } } + /// + /// Executes the AddOrUpdate operation. + /// + /// The items value. + /// The comparer value. public void AddOrUpdate(IEnumerable items, IEqualityComparer comparer) { ArgumentExceptionHelper.ThrowIfNull(items); @@ -112,6 +154,10 @@ void AddOrUpdateImpl(TObject item) } } + /// + /// Executes the AddOrUpdate operation. + /// + /// The item value. public void AddOrUpdate(TObject item) { if (_keySelector is null) @@ -123,6 +169,11 @@ public void AddOrUpdate(TObject item) _cache.AddOrUpdate(item, key); } + /// + /// Executes the AddOrUpdate operation. + /// + /// The item value. + /// The comparer value. public void AddOrUpdate(TObject item, IEqualityComparer comparer) { if (_keySelector is null) @@ -146,6 +197,10 @@ public void AddOrUpdate(TObject item, IEqualityComparer comparer) _cache.AddOrUpdate(item, key); } + /// + /// Executes the AddOrUpdate operation. + /// + /// The itemsPairs value. public void AddOrUpdate(IEnumerable> itemsPairs) { if (itemsPairs is IList> list) @@ -165,14 +220,35 @@ public void AddOrUpdate(IEnumerable> itemsPairs) } } + /// + /// Executes the AddOrUpdate operation. + /// + /// The item value. public void AddOrUpdate(KeyValuePair item) => _cache.AddOrUpdate(item.Value, item.Key); + /// + /// Executes the AddOrUpdate operation. + /// + /// The item value. + /// The key value. public void AddOrUpdate(TObject item, TKey key) => _cache.AddOrUpdate(item, key); + /// + /// Executes the Clear operation. + /// public void Clear() => _cache.Clear(); + /// + /// Executes the Clone operation. + /// + /// The changes value. public void Clone(IChangeSet changes) => _cache.Clone(changes); + /// + /// Executes the GetKey operation. + /// + /// The item value. + /// The result of the operation. public TKey GetKey(TObject item) { if (_keySelector is null) @@ -183,6 +259,11 @@ public TKey GetKey(TObject item) return _keySelector(item); } + /// + /// Executes the GetKeyValues operation. + /// + /// The items value. + /// The result of the operation. public IEnumerable> GetKeyValues(IEnumerable items) { if (_keySelector is null) @@ -193,6 +274,10 @@ public IEnumerable> GetKeyValues(IEnumerable new KeyValuePair(_keySelector(t), t)); } + /// + /// Executes the Load operation. + /// + /// The items value. public void Load(IEnumerable items) { ArgumentExceptionHelper.ThrowIfNull(items); @@ -201,12 +286,22 @@ public void Load(IEnumerable items) AddOrUpdate(items); } + /// + /// Executes the Lookup operation. + /// + /// The key value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TKey key) { var item = _cache.Lookup(key); return item.HasValue ? item.Value : ReactiveUI.Primitives.Optional.None; } + /// + /// Executes the Lookup operation. + /// + /// The item value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TObject item) { if (_keySelector is null) @@ -218,8 +313,15 @@ public ReactiveUI.Primitives.Optional Lookup(TObject item) return Lookup(key); } + /// + /// Executes the Refresh operation. + /// public void Refresh() => _cache.Refresh(); + /// + /// Executes the Refresh operation. + /// + /// The items value. public void Refresh(IEnumerable items) { ArgumentExceptionHelper.ThrowIfNull(items); @@ -241,6 +343,10 @@ public void Refresh(IEnumerable items) } } + /// + /// Executes the Refresh operation. + /// + /// The keys value. public void Refresh(IEnumerable keys) { ArgumentExceptionHelper.ThrowIfNull(keys); @@ -262,6 +368,10 @@ public void Refresh(IEnumerable keys) } } + /// + /// Executes the Refresh operation. + /// + /// The item value. public void Refresh(TObject item) { if (_keySelector is null) @@ -273,8 +383,16 @@ public void Refresh(TObject item) _cache.Refresh(key); } + /// + /// Executes the Refresh operation. + /// + /// The key value. public void Refresh(TKey key) => _cache.Refresh(key); + /// + /// Executes the Remove operation. + /// + /// The items value. public void Remove(IEnumerable items) { ArgumentExceptionHelper.ThrowIfNull(items); @@ -296,6 +414,10 @@ public void Remove(IEnumerable items) } } + /// + /// Executes the Remove operation. + /// + /// The keys value. public void Remove(IEnumerable keys) { ArgumentExceptionHelper.ThrowIfNull(keys); @@ -317,6 +439,10 @@ public void Remove(IEnumerable keys) } } + /// + /// Executes the Remove operation. + /// + /// The item value. public void Remove(TObject item) { if (_keySelector is null) @@ -328,8 +454,16 @@ public void Remove(TObject item) _cache.Remove(key); } + /// + /// Executes the Remove operation. + /// + /// The key value. public void Remove(TKey key) => _cache.Remove(key); + /// + /// Executes the Remove operation. + /// + /// The items value. public void Remove(IEnumerable> items) { ArgumentExceptionHelper.ThrowIfNull(items); @@ -351,10 +485,22 @@ public void Remove(IEnumerable> items) } } + /// + /// Executes the Remove operation. + /// + /// The item value. public void Remove(KeyValuePair item) => Remove(item.Key); + /// + /// Executes the RemoveKey operation. + /// + /// The key value. public void RemoveKey(TKey key) => Remove(key); + /// + /// Executes the RemoveKeys operation. + /// + /// The keys value. public void RemoveKeys(IEnumerable keys) { ArgumentExceptionHelper.ThrowIfNull(keys); @@ -362,5 +508,9 @@ public void RemoveKeys(IEnumerable keys) _cache.Remove(keys); } + /// + /// Executes the Update operation. + /// + /// The changes value. public void Update(IChangeSet changes) => _cache.Clone(changes); } diff --git a/src/DynamicData/Cache/Internal/Cast.cs b/src/DynamicData/Cache/Internal/Cast.cs index ca5daecb4..bb8462854 100644 --- a/src/DynamicData/Cache/Internal/Cast.cs +++ b/src/DynamicData/Cache/Internal/Cast.cs @@ -9,15 +9,33 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the Cast class. +/// +/// The type of the TSource value. +/// The type of the TKey value. +/// The type of the TDestination value. +/// The source value. +/// The converter value. internal sealed class Cast(IObservable> source, Func converter) where TSource : notnull where TKey : notnull where TDestination : notnull { + /// + /// The _converter field. + /// private readonly Func _converter = converter ?? throw new ArgumentNullException(nameof(converter)); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => _source.Select( changes => { diff --git a/src/DynamicData/Cache/Internal/ChangeSetCache.cs b/src/DynamicData/Cache/Internal/ChangeSetCache.cs index 4aa01912c..c19443a7c 100644 --- a/src/DynamicData/Cache/Internal/ChangeSetCache.cs +++ b/src/DynamicData/Cache/Internal/ChangeSetCache.cs @@ -18,10 +18,20 @@ internal sealed class ChangeSetCache where TObject : notnull where TKey : notnull { + /// + /// Initializes a new instance of the class. + /// + /// The source value. public ChangeSetCache(IObservable> source) => Source = source.Do(Cache.Clone); + /// + /// Gets the Cache value. + /// public Cache Cache { get; } = new(); + /// + /// Gets the Source value. + /// public IObservable> Source { get; } } diff --git a/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs b/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs index 5b797fb92..cd30a46ed 100644 --- a/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs +++ b/src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs @@ -9,16 +9,43 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the ChangeSetMergeTracker class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The selectCaches value. +/// The comparer value. +/// The equalityComparer value. internal sealed class ChangeSetMergeTracker(Func>> selectCaches, IComparer? comparer, IEqualityComparer? equalityComparer) where TObject : notnull where TKey : notnull { + /// + /// The _resultCache field. + /// private readonly ChangeAwareCache _resultCache = new(); + + /// + /// The _equalityComparer field. + /// private readonly IEqualityComparer _equalityComparer = equalityComparer ?? EqualityComparer.Default; + + /// + /// The _hasCompleted field. + /// private bool _hasCompleted; + /// + /// Executes the MarkComplete operation. + /// public void MarkComplete() => _hasCompleted = true; + /// + /// Executes the RemoveItems operation. + /// + /// The items value. + /// The observer value. public void RemoveItems(IEnumerable> items, IObserver>? observer = null) { var sourceCaches = selectCaches().ToArray(); @@ -46,6 +73,11 @@ public void RemoveItems(IEnumerable> items, IObserve } } + /// + /// Executes the RefreshItems operation. + /// + /// The keys value. + /// The observer value. public void RefreshItems(IEnumerable keys, IObserver>? observer = null) { var sourceCaches = selectCaches().ToArray(); @@ -73,6 +105,11 @@ public void RefreshItems(IEnumerable keys, IObserver + /// Executes the ProcessChangeSet operation. + /// + /// The changes value. + /// The observer value. public void ProcessChangeSet(IChangeSet changes, IObserver>? observer = null) { var sourceCaches = selectCaches().ToArray(); @@ -105,6 +142,10 @@ public void ProcessChangeSet(IChangeSet changes, IObserver + /// Executes the EmitChanges operation. + /// + /// The observer value. public void EmitChanges(IObserver> observer) { var changeSet = _resultCache.CaptureChanges(); @@ -119,6 +160,11 @@ public void EmitChanges(IObserver> observer) } } + /// + /// Executes the OnItemAdded operation. + /// + /// The item value. + /// The key value. private void OnItemAdded(TObject item, TKey key) { var cached = _resultCache.Lookup(key); @@ -134,6 +180,12 @@ private void OnItemAdded(TObject item, TKey key) } } + /// + /// Executes the OnItemRemoved operation. + /// + /// The sourceCaches value. + /// The item value. + /// The key value. private void OnItemRemoved(ChangeSetCache[] sourceCaches, TObject item, TKey key) { var cached = _resultCache.Lookup(key); @@ -146,6 +198,13 @@ private void OnItemRemoved(ChangeSetCache[] sourceCaches, TObject } } + /// + /// Executes the OnItemUpdated operation. + /// + /// The sources value. + /// The item value. + /// The key value. + /// The prev value. private void OnItemUpdated(ChangeSetCache[] sources, TObject item, TKey key, in ReactiveUI.Primitives.Optional prev) { var cached = _resultCache.Lookup(key); @@ -190,6 +249,12 @@ private void OnItemUpdated(ChangeSetCache[] sources, TObject item } } + /// + /// Executes the OnItemRefreshed operation. + /// + /// The sources value. + /// The item value. + /// The key value. private void OnItemRefreshed(ChangeSetCache[] sources, TObject item, TKey key) { var cached = _resultCache.Lookup(key); @@ -210,6 +275,11 @@ private void OnItemRefreshed(ChangeSetCache[] sources, TObject it } } + /// + /// Executes the ForceEvaluate operation. + /// + /// The sources value. + /// The key value. private void ForceEvaluate(ChangeSetCache[] sources, TKey key) { var cached = _resultCache.Lookup(key); @@ -224,6 +294,13 @@ private void ForceEvaluate(ChangeSetCache[] sources, TKey key) UpdateToBestValue(sources, key, cached); } + /// + /// Executes the UpdateToBestValue operation. + /// + /// The sources value. + /// The key value. + /// The current value. + /// The result of the operation. private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key, in ReactiveUI.Primitives.Optional current) { // Determine which value should be the one seen downstream @@ -253,6 +330,12 @@ private bool UpdateToBestValue(ChangeSetCache[] sources, TKey key return true; } + /// + /// Executes the LookupBestValue operation. + /// + /// The sources value. + /// The key value. + /// The result of the operation. private ReactiveUI.Primitives.Optional LookupBestValue(ChangeSetCache[] sources, TKey key) { if (sources.Length == 0) @@ -270,10 +353,22 @@ private ReactiveUI.Primitives.Optional LookupBestValue(ChangeSetCache + /// Executes the CheckEquality operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. private bool CheckEquality(TObject left, TObject right) => _equalityComparer.Equals(left, right); - // Return true if candidate should replace current as the observed downstream value + + /// + /// Executes the ShouldReplace operation. + /// + /// The candidate value. + /// The current value. + /// The result of the operation. private bool ShouldReplace(TObject candidate, TObject current) => comparer?.Compare(candidate, current) < 0; } diff --git a/src/DynamicData/Cache/Internal/Combiner.cs b/src/DynamicData/Cache/Internal/Combiner.cs index ba14195cd..7d1391cb9 100644 --- a/src/DynamicData/Cache/Internal/Combiner.cs +++ b/src/DynamicData/Cache/Internal/Combiner.cs @@ -12,16 +12,34 @@ namespace DynamicData.Cache.Internal; /// /// Combines multiple caches using logical operators. /// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type value. +/// The updatedCallback value. internal sealed class Combiner(CombineOperator type, Action> updatedCallback) where TObject : notnull where TKey : notnull { + /// + /// The _combinedCache field. + /// private readonly ChangeAwareCache _combinedCache = new(); + /// + /// The _locker field. + /// private readonly Lock _locker = new(); + /// + /// The _sourceCaches field. + /// private readonly IList> _sourceCaches = []; + /// + /// Executes the Subscribe operation. + /// + /// The source value. + /// The result of the operation. public IDisposable Subscribe(IObservable>[] source) { // subscribe @@ -41,6 +59,11 @@ public IDisposable Subscribe(IObservable>[] source) return disposable; } + /// + /// Executes the MatchesConstraint operation. + /// + /// The key value. + /// The result of the operation. private bool MatchesConstraint(TKey key) { switch (type) @@ -72,6 +95,11 @@ private bool MatchesConstraint(TKey key) } } + /// + /// Executes the Update operation. + /// + /// The cache value. + /// The updates value. private void Update(Cache cache, IChangeSet updates) { ChangeSet notifications; @@ -91,6 +119,11 @@ private void Update(Cache cache, IChangeSet update } } + /// + /// Executes the UpdateCombined operation. + /// + /// The updates value. + /// The result of the operation. private ChangeSet UpdateCombined(IChangeSet updates) { // child caches have been updated before we reached this point. diff --git a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs index 7abc790f9..96b281085 100644 --- a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs @@ -9,12 +9,24 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the DeferUntilLoaded class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class DeferUntilLoaded where TObject : notnull where TKey : notnull { + /// + /// The _result field. + /// private readonly IObservable> _result; + /// + /// Initializes a new instance of the class. + /// + /// The source value. public DeferUntilLoaded(IObservableCache source) { ArgumentExceptionHelper.ThrowIfNull(source); @@ -22,7 +34,15 @@ public DeferUntilLoaded(IObservableCache source) _result = source.CountChanged.Where(count => count != 0).Take(1).Select(_ => new ChangeSet()).Concat(source.Connect()).NotEmpty(); } + /// + /// Initializes a new instance of the class. + /// + /// The source value. public DeferUntilLoaded(IObservable> source) => _result = source.MonitorStatus().Where(status => status == ConnectionStatus.Loaded).Take(1).Select(_ => new ChangeSet()).Concat(source).NotEmpty(); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => _result; } diff --git a/src/DynamicData/Cache/Internal/DictionaryExtensions.cs b/src/DynamicData/Cache/Internal/DictionaryExtensions.cs index b921fd116..1cacfd769 100644 --- a/src/DynamicData/Cache/Internal/DictionaryExtensions.cs +++ b/src/DynamicData/Cache/Internal/DictionaryExtensions.cs @@ -9,8 +9,19 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the DictionaryExtensions class. +/// internal static class DictionaryExtensions { + /// + /// Executes the GetOrEmpty operation. + /// + /// The type of the TDictKey value. + /// The type of the T value. + /// The dict value. + /// The key value. + /// The result of the operation. internal static IEnumerable GetOrEmpty(this IDictionary> dict, TDictKey key) => dict.TryGetValue(key, out var value) ? value : []; } diff --git a/src/DynamicData/Cache/Internal/DisposeMany.cs b/src/DynamicData/Cache/Internal/DisposeMany.cs index 90bac3f00..ed18ea5ef 100644 --- a/src/DynamicData/Cache/Internal/DisposeMany.cs +++ b/src/DynamicData/Cache/Internal/DisposeMany.cs @@ -9,12 +9,25 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the DisposeMany class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. internal sealed class DisposeMany(IObservable> source) where TObject : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source = source; + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => { diff --git a/src/DynamicData/Cache/Internal/DistinctCalculator.cs b/src/DynamicData/Cache/Internal/DistinctCalculator.cs index 98b748230..df7e67da0 100644 --- a/src/DynamicData/Cache/Internal/DistinctCalculator.cs +++ b/src/DynamicData/Cache/Internal/DistinctCalculator.cs @@ -9,20 +9,50 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the DistinctCalculator class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TValue value. +/// The source value. +/// The valueSelector value. internal sealed class DistinctCalculator(IObservable> source, Func valueSelector) where TObject : notnull where TKey : notnull where TValue : notnull { + /// + /// The _itemCache field. + /// private readonly Dictionary _itemCache = []; + /// + /// The _keyCounters field. + /// private readonly Dictionary _keyCounters = []; + + /// + /// The _valueCounters field. + /// private readonly Dictionary _valueCounters = []; + /// + /// The _valueSelector field. + /// private readonly Func _valueSelector = valueSelector ?? throw new ArgumentNullException(nameof(valueSelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => source.Select(Calculate).Where(updates => updates.Count != 0); + /// + /// Executes the Calculate operation. + /// + /// The changes value. + /// The result of the operation. private DistinctChangeSet Calculate(IChangeSet changes) { var result = new DistinctChangeSet(); diff --git a/src/DynamicData/Cache/Internal/DynamicCombiner.cs b/src/DynamicData/Cache/Internal/DynamicCombiner.cs index 8fd3c85d0..aae48656f 100644 --- a/src/DynamicData/Cache/Internal/DynamicCombiner.cs +++ b/src/DynamicData/Cache/Internal/DynamicCombiner.cs @@ -9,12 +9,26 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the DynamicCombiner class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The type value. internal sealed class DynamicCombiner(IObservableList>> source, CombineOperator type) where TObject : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly IObservableList>> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -84,6 +98,12 @@ public IObservable> Run() => Observable.Create + /// Executes the MatchesConstraint operation. + /// + /// The sources value. + /// The key value. + /// The result of the operation. private bool MatchesConstraint(MergeContainer[] sources, TKey key) { if (sources.Length == 0) @@ -120,6 +140,12 @@ private bool MatchesConstraint(MergeContainer[] sources, TKey key) } } + /// + /// Executes the ProcessChanges operation. + /// + /// The target value. + /// The sourceLists value. + /// The items value. private void ProcessChanges(ChangeAwareCache target, MergeContainer[] sourceLists, IEnumerable> items) { // check whether the item should be removed from the list (or in the case of And, added) @@ -140,6 +166,13 @@ private void ProcessChanges(ChangeAwareCache target, MergeContain } } + /// + /// Executes the ProcessItem operation. + /// + /// The target value. + /// The sourceLists value. + /// The item value. + /// The key value. private void ProcessItem(ChangeAwareCache target, MergeContainer[] sourceLists, TObject item, TKey key) { var cached = target.Lookup(key); @@ -162,6 +195,12 @@ private void ProcessItem(ChangeAwareCache target, MergeContainer[ } } + /// + /// Executes the UpdateResultList operation. + /// + /// The target value. + /// The sourceLists value. + /// The changes value. private void UpdateResultList(ChangeAwareCache target, MergeContainer[] sourceLists, IChangeSet changes) { foreach (var change in changes.ToConcreteType()) @@ -170,14 +209,31 @@ private void UpdateResultList(ChangeAwareCache target, MergeConta } } - private sealed class MergeContainer +/// +/// Provides members for the MergeContainer class. +/// +private sealed class MergeContainer { + /// + /// Initializes a new instance of the class. + /// + /// The source value. public MergeContainer(IObservable> source) => Source = source.Do(Clone); + /// + /// Gets the Cache value. + /// public Cache Cache { get; } = new(); + /// + /// Gets the Source value. + /// public IObservable> Source { get; } + /// + /// Executes the Clone operation. + /// + /// The changes value. private void Clone(IChangeSet changes) => Cache.Clone(changes); } } diff --git a/src/DynamicData/Cache/Internal/DynamicGrouper.cs b/src/DynamicData/Cache/Internal/DynamicGrouper.cs index 8c7277624..99f0ad204 100644 --- a/src/DynamicData/Cache/Internal/DynamicGrouper.cs +++ b/src/DynamicData/Cache/Internal/DynamicGrouper.cs @@ -11,17 +11,50 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the DynamicGrouper class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroupKey value. +/// The groupSelector value. internal sealed class DynamicGrouper(Func? groupSelector = null) : IDisposable where TObject : notnull where TKey : notnull where TGroupKey : notnull { + /// + /// The _groupCache field. + /// private readonly ChangeAwareCache, TGroupKey> _groupCache = new(); + + /// + /// The _groupKeys field. + /// private readonly Dictionary _groupKeys = []; + + /// + /// The _emptyGroups field. + /// private readonly HashSet> _emptyGroups = []; + + /// + /// The _suspendTracker field. + /// private readonly SuspendTracker _suspendTracker = new(); + + /// + /// The _groupSelector field. + /// private Func? _groupSelector = groupSelector; + /// + /// Executes the AddOrUpdate operation. + /// + /// The key value. + /// The groupKey value. + /// The item value. + /// The observer value. public void AddOrUpdate(TKey key, TGroupKey groupKey, TObject item, IObserver>? observer = null) { // If not emitting the changes, then suspend the notifications @@ -34,6 +67,11 @@ public void AddOrUpdate(TKey key, TGroupKey groupKey, TObject item, IObserver + /// Executes the ProcessChangeSet operation. + /// + /// The changeSet value. + /// The observer value. public void ProcessChangeSet(IChangeSet changeSet, IObserver>? observer = null) { var suspendTracker = (observer, changeSet.Count) switch @@ -57,8 +95,17 @@ public void ProcessChangeSet(IChangeSet changeSet, IObserver + /// Executes the ProcessChange operation. + /// + /// The change value. public void ProcessChange(Change change) => ProcessChange(change, _suspendTracker); + /// + /// Executes the ProcessChange operation. + /// + /// The change value. + /// The suspendTracker value. private void ProcessChange(Change change, SuspendTracker? suspendTracker) { switch (change.Reason) @@ -88,9 +135,13 @@ private void ProcessChange(Change change, SuspendTracker? suspend break; } } - // Re-evaluate the GroupSelector for each item and apply the changes so that each group only emits a single changset // Perform all the adds/removes for each group in a single step + + /// + /// Executes the RegroupAll operation. + /// + /// The observer value. public void RegroupAll(IObserver> observer) { if (_groupSelector == null) @@ -123,12 +174,23 @@ public void RegroupAll(IObserver> obse EmitChanges(observer); } + /// + /// Executes the SetGroupSelector operation. + /// + /// The groupSelector value. + /// The observer value. public void SetGroupSelector(Func groupSelector, IObserver> observer) { _groupSelector = groupSelector; RegroupAll(observer); } + /// + /// Executes the Initialize operation. + /// + /// The initialValues value. + /// The groupSelector value. + /// The observer value. public void Initialize(IEnumerable> initialValues, Func groupSelector, IObserver> observer) { if (_groupSelector != null) @@ -147,6 +209,10 @@ public void Initialize(IEnumerable> initialValues, F EmitChanges(observer); } + /// + /// Executes the EmitChanges operation. + /// + /// The observer value. public void EmitChanges(IObserver> observer) { // Verify logic doesn't capture any non-empty groups @@ -177,12 +243,21 @@ public void EmitChanges(IObserver> obs } } + /// + /// Executes the Dispose operation. + /// public void Dispose() { _suspendTracker.Dispose(); _groupCache.Items.ForEach(group => (group as ManagedGroup)?.Dispose()); } + /// + /// Executes the PerformGroupRefresh operation. + /// + /// The key value. + /// The optionalGroup value. + /// The suspendTracker value. private static void PerformGroupRefresh(TKey key, in ReactiveUI.Primitives.Optional> optionalGroup, SuspendTracker? suspendTracker = null) { if (optionalGroup.HasValue) @@ -196,12 +271,27 @@ private static void PerformGroupRefresh(TKey key, in ReactiveUI.Primitives.Optio } } + /// + /// Executes the LookupGroup operation. + /// + /// The key value. + /// The result of the operation. private ReactiveUI.Primitives.Optional> LookupGroup(TKey key) => _groupKeys.Lookup(key).Convert(LookupGroup); + /// + /// Executes the LookupGroup operation. + /// + /// The groupKey value. + /// The result of the operation. private ReactiveUI.Primitives.Optional> LookupGroup(TGroupKey groupKey) => _groupCache.Lookup(groupKey).Convert(static grp => (grp as ManagedGroup)!); + /// + /// Executes the GetOrAddGroup operation. + /// + /// The groupKey value. + /// The result of the operation. private ManagedGroup GetOrAddGroup(TGroupKey groupKey) => LookupGroup(groupKey).ValueOr(() => { @@ -210,6 +300,13 @@ private ManagedGroup GetOrAddGroup(TGroupKey groupKey) return newGroup; }); + /// + /// Executes the PerformAddOrUpdate operation. + /// + /// The key value. + /// The groupKey value. + /// The item value. + /// The suspendTracker value. private void PerformAddOrUpdate(TKey key, TGroupKey groupKey, TObject item, SuspendTracker? suspendTracker = null) { // See if this item already has been grouped @@ -240,6 +337,13 @@ private void PerformAddOrUpdate(TKey key, TGroupKey groupKey, TObject item, Susp PerformGroupAddOrUpdate(key, groupKey, item, suspendTracker); } + /// + /// Executes the PerformGroupAddOrUpdate operation. + /// + /// The key value. + /// The groupKey value. + /// The item value. + /// The suspendTracker value. private void PerformGroupAddOrUpdate(TKey key, TGroupKey groupKey, TObject item, SuspendTracker? suspendTracker = null) { var group = GetOrAddGroup(groupKey); @@ -251,9 +355,21 @@ private void PerformGroupAddOrUpdate(TKey key, TGroupKey groupKey, TObject item, _emptyGroups.Remove(group); } + /// + /// Executes the PerformRefresh operation. + /// + /// The key value. + /// The suspendTracker value. private void PerformRefresh(TKey key, SuspendTracker? suspendTracker = null) => PerformGroupRefresh(key, LookupGroup(key), suspendTracker); - // When the GroupKey is available, check then and move the group if it changed + + /// + /// Executes the PerformRefresh operation. + /// + /// The key value. + /// The newGroupKey value. + /// The item value. + /// The suspendTracker value. private void PerformRefresh(TKey key, TGroupKey newGroupKey, TObject item, SuspendTracker? suspendTracker = null) { if (_groupKeys.TryGetValue(key, out var groupKey)) @@ -277,6 +393,11 @@ private void PerformRefresh(TKey key, TGroupKey newGroupKey, TObject item, Suspe } } + /// + /// Executes the PerformRemove operation. + /// + /// The key value. + /// The suspendTracker value. private void PerformRemove(TKey key, SuspendTracker? suspendTracker = null) { if (_groupKeys.TryGetValue(key, out var groupKey)) @@ -290,6 +411,12 @@ private void PerformRemove(TKey key, SuspendTracker? suspendTracker = null) } } + /// + /// Executes the PerformRemove operation. + /// + /// The key value. + /// The groupKey value. + /// The suspendTracker value. private void PerformRemove(TKey key, TGroupKey groupKey, SuspendTracker? suspendTracker = null) { var optionalGroup = LookupGroup(groupKey); @@ -311,18 +438,40 @@ private void PerformRemove(TKey key, TGroupKey groupKey, SuspendTracker? suspend Debug.Fail("Should not receive a Remove Event for an unknown Group Key"); } } - // Without the new group key, all that can be done is remove the old value // Consumer of the Grouper is resonsible for Adding the New Value. + + /// + /// Executes the PerformUpdate operation. + /// + /// The key value. + /// The suspendTracker value. private void PerformUpdate(TKey key, SuspendTracker? suspendTracker = null) => PerformRemove(key, suspendTracker); - private sealed class SuspendTracker : IDisposable +/// +/// Provides members for the SuspendTracker class. +/// +private sealed class SuspendTracker : IDisposable { + /// + /// The _trackedKeys field. + /// private readonly HashSet _trackedKeys = []; + + /// + /// The _disposables field. + /// private CompositeDisposable _disposables = []; + /// + /// Gets the HasItems value. + /// public bool HasItems => _disposables.Count > 0; + /// + /// Executes the Add operation. + /// + /// The managedGroup value. public void Add(ManagedGroup managedGroup) { if (_trackedKeys.Add(managedGroup.Key)) @@ -331,6 +480,9 @@ public void Add(ManagedGroup managedGroup) } } + /// + /// Executes the Reset operation. + /// public void Reset() { if (_disposables.Count > 0) @@ -341,6 +493,9 @@ public void Reset() } } + /// + /// Executes the Dispose operation. + /// public void Dispose() => _disposables.Dispose(); } } diff --git a/src/DynamicData/Cache/Internal/EditDiff.cs b/src/DynamicData/Cache/Internal/EditDiff.cs index b1a4c4576..ca56e0a20 100644 --- a/src/DynamicData/Cache/Internal/EditDiff.cs +++ b/src/DynamicData/Cache/Internal/EditDiff.cs @@ -9,16 +9,36 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the EditDiff class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The areEqual value. internal sealed class EditDiff(ISourceCache source, Func areEqual) where TObject : notnull where TKey : notnull { + /// + /// The _areEqual field. + /// private readonly Func _areEqual = areEqual ?? throw new ArgumentNullException(nameof(areEqual)); + /// + /// The _keyComparer field. + /// private readonly IEqualityComparer> _keyComparer = new KeyComparer(); + /// + /// The _source field. + /// private readonly ISourceCache _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Edit operation. + /// + /// The items value. public void Edit(IEnumerable items) => _source.Edit( innerCache => { diff --git a/src/DynamicData/Cache/Internal/EditDiffChangeSet.cs b/src/DynamicData/Cache/Internal/EditDiffChangeSet.cs index 22bbc48f9..bc054cf08 100644 --- a/src/DynamicData/Cache/Internal/EditDiffChangeSet.cs +++ b/src/DynamicData/Cache/Internal/EditDiffChangeSet.cs @@ -9,16 +9,37 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the EditDiffChangeSet class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The keySelector value. +/// The equalityComparer value. internal sealed class EditDiffChangeSet(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) where TObject : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// The _equalityComparer field. + /// private readonly IEqualityComparer _equalityComparer = equalityComparer ?? EqualityComparer.Default; + /// + /// The _keySelector field. + /// private readonly Func _keySelector = keySelector ?? throw new ArgumentNullException(nameof(keySelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => ObservableChangeSet.Create( cache => _source.Subscribe(items => cache.EditDiff(items, _equalityComparer), () => cache.Dispose()), diff --git a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs index 67c7db55a..3f7734c41 100644 --- a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs +++ b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs @@ -9,16 +9,37 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the EditDiffChangeSetOptional class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The keySelector value. +/// The equalityComparer value. internal sealed class EditDiffChangeSetOptional(IObservable> source, Func keySelector, IEqualityComparer? equalityComparer) where TObject : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// The _equalityComparer field. + /// private readonly IEqualityComparer _equalityComparer = equalityComparer ?? EqualityComparer.Default; + /// + /// The _keySelector field. + /// private readonly Func _keySelector = keySelector ?? throw new ArgumentNullException(nameof(keySelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => { var previous = ReactiveUI.Primitives.Optional.None; @@ -50,6 +71,12 @@ public IObservable> Run() => Observable.Create + /// Executes the CreateUpdateChanges operation. + /// + /// The prev value. + /// The curr value. + /// The result of the operation. private Change[] CreateUpdateChanges(in ValueContainer prev, in ValueContainer curr) { if (EqualityComparer.Default.Equals(prev.Key, curr.Key)) @@ -71,10 +98,21 @@ private Change[] CreateUpdateChanges(in ValueContainer prev, in V ]; } - private readonly struct ValueContainer(TObject obj, TKey key) +/// +/// Represents the ValueContainer value. +/// +/// The obj value. +/// The key value. +private readonly struct ValueContainer(TObject obj, TKey key) { + /// + /// Gets the Object value. + /// public TObject Object { get; } = obj; + /// + /// Gets the Key value. + /// public TKey Key { get; } = key; } } diff --git a/src/DynamicData/Cache/Internal/ExpirableItem.cs b/src/DynamicData/Cache/Internal/ExpirableItem.cs index 4e77daa5b..11cdf6052 100644 --- a/src/DynamicData/Cache/Internal/ExpirableItem.cs +++ b/src/DynamicData/Cache/Internal/ExpirableItem.cs @@ -9,9 +9,19 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Represents the ExpirableItem record. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The Value value. +/// The Key value. +/// The ExpireAt value. +/// The Index value. internal readonly record struct ExpirableItem(TObject Value, TKey Key, DateTime ExpireAt, long Index = 0) { /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -20,5 +30,9 @@ public override int GetHashCode() } } + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"Key: {Key}, Expire At: {ExpireAt}"; } diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs index 7e9c05ed9..10b93a6a4 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs @@ -9,12 +9,28 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the ExpireAfter class. +/// internal static partial class ExpireAfter { - public static class ForSource +/// +/// Provides members for the ForSource class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +public static class ForSource where TObject : notnull where TKey : notnull { + /// + /// Executes the Create operation. + /// + /// The source value. + /// The timeSelector value. + /// The pollingInterval value. + /// The scheduler value. + /// The result of the operation. public static IObservable>> Create( ISourceCache source, Func timeSelector, @@ -38,22 +54,74 @@ public static IObservable>> Create( timeSelector: timeSelector)); } - private abstract class SubscriptionBase +/// +/// Provides members for the SubscriptionBase class. +/// +private abstract class SubscriptionBase : IDisposable { + /// + /// The _expirationDueTimesByKey field. + /// private readonly Dictionary _expirationDueTimesByKey; + + /// + /// The _observer field. + /// private readonly IObserver>> _observer; + + /// + /// The _onEditingSource field. + /// private readonly Action> _onEditingSource; + + /// + /// The _proposedExpirationsQueue field. + /// private readonly List _proposedExpirationsQueue; + + /// + /// The _removedItemsBuffer field. + /// private readonly List> _removedItemsBuffer; + + /// + /// The _scheduler field. + /// private readonly IScheduler _scheduler; + + /// + /// The _source field. + /// private readonly ISourceCache _source; + + /// + /// The _sourceSubscription field. + /// private readonly IDisposable _sourceSubscription; + + /// + /// The _timeSelector field. + /// private readonly Func _timeSelector; + /// + /// The _hasSourceCompleted field. + /// private bool _hasSourceCompleted; + + /// + /// The _nextScheduledManagement field. + /// private ScheduledManagement? _nextScheduledManagement; + /// + /// Initializes a new instance of the class. + /// + /// The observer value. + /// The scheduler value. + /// The source value. + /// The timeSelector value. protected SubscriptionBase( IObserver>> observer, IScheduler? scheduler, @@ -83,6 +151,9 @@ protected SubscriptionBase( onCompleted: OnSourceCompleted); } + /// + /// Executes the Dispose operation. + /// public void Dispose() { lock (SynchronizationGate) @@ -93,28 +164,53 @@ public void Dispose() } } + /// + /// Gets the Scheduler value. + /// protected IScheduler Scheduler => _scheduler; - // Instead of using a dedicated _synchronizationGate object, we can save an allocation by using any object that is never exposed to public consumers. + + /// + /// Gets the SynchronizationGate value. + /// protected object SynchronizationGate => _expirationDueTimesByKey; + /// + /// Executes the GetNextManagementDueTime operation. + /// + /// The result of the operation. protected abstract DateTimeOffset? GetNextManagementDueTime(); + /// + /// Executes the GetNextProposedExpirationDueTime operation. + /// + /// The result of the operation. protected DateTimeOffset? GetNextProposedExpirationDueTime() => _proposedExpirationsQueue.Count is 0 ? null : _proposedExpirationsQueue[0].DueTime; + /// + /// Executes the OnExpirationsManaged operation. + /// + /// The dueTime value. protected abstract void OnExpirationsManaged(DateTimeOffset dueTime); + /// + /// Executes the ClearExpiration operation. + /// + /// The key value. private void ClearExpiration(TKey key) // This is what puts the "proposed" in _proposedExpirationsQueue. // Finding the position of the item to remove from the queue would be O(log n), at best, // so just leave it and flush it later during normal processing of the queue. => _expirationDueTimesByKey.Remove(key); + /// + /// Executes the ManageExpirations operation. + /// private void ManageExpirations() { // This check is needed, to make sure we don't try and call .Edit() on a disposed _source, @@ -131,6 +227,10 @@ private void ManageExpirations() _source.Edit(_onEditingSource); } + /// + /// Executes the OnEditingSource operation. + /// + /// The updater value. private void OnEditingSource(ISourceUpdater updater) { lock (SynchronizationGate) @@ -192,6 +292,9 @@ private void OnEditingSource(ISourceUpdater updater) } } + /// + /// Executes the OnExpirationsChanged operation. + /// private void OnExpirationsChanged() { // Clear out any expirations at the front of the queue that are no longer valid. @@ -232,6 +335,9 @@ private void OnExpirationsChanged() } } + /// + /// Executes the OnSourceCompleted operation. + /// private void OnSourceCompleted() { // If the source completes, we can no longer remove items from it, so any pending expirations are moot. @@ -240,6 +346,10 @@ private void OnSourceCompleted() _observer.OnCompleted(); } + /// + /// Executes the OnSourceError operation. + /// + /// The error value. private void OnSourceError(Exception error) { TryCancelNextScheduledManagement(); @@ -247,6 +357,10 @@ private void OnSourceError(Exception error) _observer.OnError(error); } + /// + /// Executes the OnSourceNext operation. + /// + /// The changes value. private void OnSourceNext(IChangeSet changes) { try @@ -304,12 +418,21 @@ private void OnSourceNext(IChangeSet changes) } } + /// + /// Executes the TryCancelNextScheduledManagement operation. + /// private void TryCancelNextScheduledManagement() { _nextScheduledManagement?.Cancellation.Dispose(); _nextScheduledManagement = null; } + /// + /// Executes the TrySetExpiration operation. + /// + /// The key value. + /// The dueTime value. + /// The result of the operation. private bool TrySetExpiration( TKey key, DateTimeOffset dueTime) @@ -341,22 +464,47 @@ private bool TrySetExpiration( return true; } - private readonly struct ProposedExpiration +/// +/// Represents the ProposedExpiration value. +/// +private readonly struct ProposedExpiration { + /// + /// Gets or sets the DueTime value. + /// public required DateTimeOffset DueTime { get; init; } + /// + /// Gets or sets the Key value. + /// public required TKey Key { get; init; } } - private readonly struct ScheduledManagement +/// +/// Represents the ScheduledManagement value. +/// +private readonly struct ScheduledManagement { + /// + /// Gets or sets the Cancellation value. + /// public required IDisposable Cancellation { get; init; } + /// + /// Gets or sets the DueTime value. + /// public required DateTimeOffset DueTime { get; init; } } } - private sealed class OnDemandSubscription( +/// +/// Provides members for the OnDemandSubscription class. +/// +/// The observer value. +/// The scheduler value. +/// The source value. +/// The timeSelector value. +private sealed class OnDemandSubscription( IObserver>> observer, IScheduler? scheduler, ISourceCache source, @@ -367,21 +515,46 @@ private sealed class OnDemandSubscription( source, timeSelector) { + /// + /// Executes the GetNextManagementDueTime operation. + /// + /// The result of the operation. protected override DateTimeOffset? GetNextManagementDueTime() => GetNextProposedExpirationDueTime(); + /// + /// Executes the OnExpirationsManaged operation. + /// + /// The dueTime value. protected override void OnExpirationsManaged(DateTimeOffset dueTime) { } } - private sealed class PollingSubscription +/// +/// Provides members for the PollingSubscription class. +/// +private sealed class PollingSubscription : SubscriptionBase { + /// + /// The _pollingInterval field. + /// private readonly TimeSpan _pollingInterval; + /// + /// The _lastManagementDueTime field. + /// private DateTimeOffset _lastManagementDueTime; + /// + /// Initializes a new instance of the class. + /// + /// The observer value. + /// The pollingInterval value. + /// The scheduler value. + /// The source value. + /// The timeSelector value. public PollingSubscription( IObserver>> observer, TimeSpan pollingInterval, @@ -399,6 +572,10 @@ public PollingSubscription( _lastManagementDueTime = Scheduler.Now; } + /// + /// Executes the GetNextManagementDueTime operation. + /// + /// The result of the operation. protected override DateTimeOffset? GetNextManagementDueTime() { var now = Scheduler.Now; @@ -410,6 +587,10 @@ public PollingSubscription( : now; } + /// + /// Executes the OnExpirationsManaged operation. + /// + /// The dueTime value. protected override void OnExpirationsManaged(DateTimeOffset dueTime) => _lastManagementDueTime = dueTime; } diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs index c74a7d421..f825e2f70 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -9,12 +9,28 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the ExpireAfter class. +/// internal static partial class ExpireAfter { - public static class ForStream +/// +/// Provides members for the ForStream class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +public static class ForStream where TObject : notnull where TKey : notnull { + /// + /// Executes the Create operation. + /// + /// The source value. + /// The timeSelector value. + /// The pollingInterval value. + /// The scheduler value. + /// The result of the operation. public static IObservable> Create( IObservable> source, Func timeSelector, @@ -38,20 +54,64 @@ public static IObservable> Create( timeSelector: timeSelector)); } - private abstract class SubscriptionBase +/// +/// Provides members for the SubscriptionBase class. +/// +private abstract class SubscriptionBase : IDisposable { + /// + /// The _expirationDueTimesByKey field. + /// private readonly Dictionary _expirationDueTimesByKey; + + /// + /// The _itemsCache field. + /// private readonly ChangeAwareCache _itemsCache; + + /// + /// The _observer field. + /// private readonly IObserver> _observer; + + /// + /// The _proposedExpirationsQueue field. + /// private readonly List _proposedExpirationsQueue; + + /// + /// The _scheduler field. + /// private readonly IScheduler _scheduler; + + /// + /// The _sourceSubscription field. + /// private readonly IDisposable _sourceSubscription; + + /// + /// The _timeSelector field. + /// private readonly Func _timeSelector; + /// + /// The _hasSourceCompleted field. + /// private bool _hasSourceCompleted; + + /// + /// The _nextScheduledManagement field. + /// private ScheduledManagement? _nextScheduledManagement; + /// + /// Initializes a new instance of the class. + /// + /// The observer value. + /// The scheduler value. + /// The source value. + /// The timeSelector value. protected SubscriptionBase( IObserver> observer, IScheduler? scheduler, @@ -75,6 +135,9 @@ protected SubscriptionBase( onCompleted: OnSourceCompleted); } + /// + /// Executes the Dispose operation. + /// public void Dispose() { lock (SynchronizationGate) @@ -85,28 +148,53 @@ public void Dispose() } } + /// + /// Gets the Scheduler value. + /// protected IScheduler Scheduler => _scheduler; - // Instead of using a dedicated _synchronizationGate object, we can save an allocation by using any object that is never exposed to public consumers. + + /// + /// Gets the SynchronizationGate value. + /// protected object SynchronizationGate => _expirationDueTimesByKey; + /// + /// Executes the GetNextManagementDueTime operation. + /// + /// The result of the operation. protected abstract DateTimeOffset? GetNextManagementDueTime(); + /// + /// Executes the GetNextProposedExpirationDueTime operation. + /// + /// The result of the operation. protected DateTimeOffset? GetNextProposedExpirationDueTime() => _proposedExpirationsQueue.Count is 0 ? null : _proposedExpirationsQueue[0].DueTime; + /// + /// Executes the OnExpirationsManaged operation. + /// + /// The dueTime value. protected abstract void OnExpirationsManaged(DateTimeOffset dueTime); + /// + /// Executes the ClearExpiration operation. + /// + /// The key value. private void ClearExpiration(TKey key) // This is what puts the "proposed" in _proposedExpirationsQueue. // Finding the position of the item to remove from the queue would be O(log n), at best, // so just leave it and flush it later during normal processing of the queue. => _expirationDueTimesByKey.Remove(key); + /// + /// Executes the ManageExpirations operation. + /// private void ManageExpirations() { lock (SynchronizationGate) @@ -153,6 +241,9 @@ private void ManageExpirations() } } + /// + /// Executes the OnExpirationsChanged operation. + /// private void OnExpirationsChanged() { // Clear out any expirations at the front of the queue that are no longer valid. @@ -203,6 +294,9 @@ private void OnExpirationsChanged() } } + /// + /// Executes the OnSourceCompleted operation. + /// private void OnSourceCompleted() { _hasSourceCompleted = true; @@ -216,6 +310,10 @@ private void OnSourceCompleted() } } + /// + /// Executes the OnSourceError operation. + /// + /// The error value. private void OnSourceError(Exception error) { TryCancelNextScheduledManagement(); @@ -223,6 +321,10 @@ private void OnSourceError(Exception error) _observer.OnError(error); } + /// + /// Executes the OnSourceNext operation. + /// + /// The upstreamChanges value. private void OnSourceNext(IChangeSet upstreamChanges) { try @@ -293,12 +395,21 @@ private void OnSourceNext(IChangeSet upstreamChanges) } } + /// + /// Executes the TryCancelNextScheduledManagement operation. + /// private void TryCancelNextScheduledManagement() { _nextScheduledManagement?.Cancellation.Dispose(); _nextScheduledManagement = null; } + /// + /// Executes the TrySetExpiration operation. + /// + /// The key value. + /// The dueTime value. + /// The result of the operation. private bool TrySetExpiration( TKey key, DateTimeOffset dueTime) @@ -330,22 +441,47 @@ private bool TrySetExpiration( return true; } - private readonly struct ProposedExpiration +/// +/// Represents the ProposedExpiration value. +/// +private readonly struct ProposedExpiration { + /// + /// Gets or sets the DueTime value. + /// public required DateTimeOffset DueTime { get; init; } + /// + /// Gets or sets the Key value. + /// public required TKey Key { get; init; } } - private readonly struct ScheduledManagement +/// +/// Represents the ScheduledManagement value. +/// +private readonly struct ScheduledManagement { + /// + /// Gets or sets the Cancellation value. + /// public required IDisposable Cancellation { get; init; } + /// + /// Gets or sets the DueTime value. + /// public required DateTimeOffset DueTime { get; init; } } } - private sealed class OnDemandSubscription( +/// +/// Provides members for the OnDemandSubscription class. +/// +/// The observer value. +/// The scheduler value. +/// The source value. +/// The timeSelector value. +private sealed class OnDemandSubscription( IObserver> observer, IScheduler? scheduler, IObservable> source, @@ -356,21 +492,46 @@ private sealed class OnDemandSubscription( source, timeSelector) { + /// + /// Executes the GetNextManagementDueTime operation. + /// + /// The result of the operation. protected override DateTimeOffset? GetNextManagementDueTime() => GetNextProposedExpirationDueTime(); + /// + /// Executes the OnExpirationsManaged operation. + /// + /// The dueTime value. protected override void OnExpirationsManaged(DateTimeOffset dueTime) { } } - private sealed class PollingSubscription +/// +/// Provides members for the PollingSubscription class. +/// +private sealed class PollingSubscription : SubscriptionBase { + /// + /// The _pollingInterval field. + /// private readonly TimeSpan _pollingInterval; + /// + /// The _lastManagementDueTime field. + /// private DateTimeOffset _lastManagementDueTime; + /// + /// Initializes a new instance of the class. + /// + /// The observer value. + /// The pollingInterval value. + /// The scheduler value. + /// The source value. + /// The timeSelector value. public PollingSubscription( IObserver> observer, TimeSpan pollingInterval, @@ -388,6 +549,10 @@ public PollingSubscription( _lastManagementDueTime = Scheduler.Now; } + /// + /// Executes the GetNextManagementDueTime operation. + /// + /// The result of the operation. protected override DateTimeOffset? GetNextManagementDueTime() { var now = Scheduler.Now; @@ -399,6 +564,10 @@ public PollingSubscription( : now; } + /// + /// Executes the OnExpirationsManaged operation. + /// + /// The dueTime value. protected override void OnExpirationsManaged(DateTimeOffset dueTime) => _lastManagementDueTime = dueTime; } diff --git a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs index 0719ec2bb..fffc04030 100644 --- a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs @@ -9,12 +9,30 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the Filter class. +/// internal static partial class Filter { - public static class Dynamic +/// +/// Provides members for the Dynamic class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TState value. +public static class Dynamic where TObject : notnull where TKey : notnull { + /// + /// Executes the Create operation. + /// + /// The source value. + /// The predicateState value. + /// The predicate value. + /// The reapplyFilter value. + /// The suppressEmptyChangeSets value. + /// The result of the operation. public static IObservable> Create( IObservable> source, IObservable predicateState, @@ -36,28 +54,101 @@ public static IObservable> Create( suppressEmptyChangeSets: suppressEmptyChangeSets)); } - private sealed class Subscription +/// +/// Provides members for the Subscription class. +/// +private sealed class Subscription : IDisposable { + /// + /// The _downstreamChangesBuffer field. + /// private readonly List> _downstreamChangesBuffer; + + /// + /// The _downstreamObserver field. + /// private readonly IObserver> _downstreamObserver; + + /// + /// The _itemStatesByKey field. + /// private readonly Dictionary _itemStatesByKey; + + /// + /// The _predicate field. + /// private readonly Func _predicate; + + /// + /// The _predicateStateSubscription field. + /// private readonly IDisposable? _predicateStateSubscription; + + /// + /// The _reapplyFilterSubscription field. + /// private readonly IDisposable? _reapplyFilterSubscription; + + /// + /// The _sourceSubscription field. + /// private readonly IDisposable? _sourceSubscription; + + /// + /// The _suppressEmptyChangeSets field. + /// private readonly bool _suppressEmptyChangeSets; + /// + /// The _downstreamGate field. + /// private readonly Lock _downstreamGate = new(); + + /// + /// The _upstreamGate field. + /// private readonly Lock _upstreamGate = new(); + /// + /// The _hasInitialized field. + /// private bool _hasInitialized; + + /// + /// The _hasPredicateStateCompleted field. + /// private bool _hasPredicateStateCompleted; + + /// + /// The _hasReapplyFilterCompleted field. + /// private bool _hasReapplyFilterCompleted; + + /// + /// The _hasSourceCompleted field. + /// private bool _hasSourceCompleted; + + /// + /// The _isLatestPredicateStateValid field. + /// private bool _isLatestPredicateStateValid; + + /// + /// The _latestPredicateState field. + /// private TState _latestPredicateState; + /// + /// Initializes a new instance of the class. + /// + /// The downstreamObserver value. + /// The predicate value. + /// The predicateState value. + /// The reapplyFilter value. + /// The source value. + /// The suppressEmptyChangeSets value. public Subscription( IObserver> downstreamObserver, Func predicate, @@ -113,6 +204,9 @@ public Subscription( } } + /// + /// Executes the Dispose operation. + /// public void Dispose() { _predicateStateSubscription?.Dispose(); @@ -120,12 +214,22 @@ public void Dispose() _sourceSubscription?.Dispose(); } + /// + /// Gets the DownstreamSynchronizationGate value. + /// private Lock DownstreamSynchronizationGate => _downstreamGate; + /// + /// Gets the UpstreamSynchronizationGate value. + /// private Lock UpstreamSynchronizationGate => _upstreamGate; + /// + /// Executes the AssembleDownstreamChanges operation. + /// + /// The result of the operation. private ChangeSet AssembleDownstreamChanges() { if (_downstreamChangesBuffer.Count is 0) @@ -137,6 +241,10 @@ private ChangeSet AssembleDownstreamChanges() return downstreamChanges; } + /// + /// Executes the OnError operation. + /// + /// The error value. private void OnError(Exception error) { using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); @@ -149,6 +257,9 @@ private void OnError(Exception error) _downstreamObserver.OnError(error); } + /// + /// Executes the OnPredicateStateCompleted operation. + /// private void OnPredicateStateCompleted() { using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); @@ -167,6 +278,10 @@ private void OnPredicateStateCompleted() } } + /// + /// Executes the OnPredicateStateNext operation. + /// + /// The predicateState value. private void OnPredicateStateNext(TState predicateState) { using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); @@ -185,6 +300,9 @@ private void OnPredicateStateNext(TState predicateState) } } + /// + /// Executes the OnReapplyFilterCompleted operation. + /// private void OnReapplyFilterCompleted() { using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); @@ -200,6 +318,10 @@ private void OnReapplyFilterCompleted() } } + /// + /// Executes the OnReapplyFilterNext operation. + /// + /// The value value. private void OnReapplyFilterNext(Unit value) { using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); @@ -216,6 +338,9 @@ private void OnReapplyFilterNext(Unit value) } } + /// + /// Executes the OnSourceCompleted operation. + /// private void OnSourceCompleted() { using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); @@ -235,6 +360,10 @@ private void OnSourceCompleted() } } + /// + /// Executes the OnSourceNext operation. + /// + /// The upstreamChanges value. private void OnSourceNext(IChangeSet upstreamChanges) { using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); @@ -367,6 +496,10 @@ private void OnSourceNext(IChangeSet upstreamChanges) } } + /// + /// Executes the ReFilter operation. + /// + /// The predicateState value. private void ReFilter(TState predicateState) { #if SUPPORTS_DICTIONARY_MUTATION_DURING_ENUMERATION @@ -403,10 +536,19 @@ private void ReFilter(TState predicateState) } } - private readonly struct ItemState +/// +/// Represents the ItemState value. +/// +private readonly struct ItemState { + /// + /// Gets or sets the IsIncluded value. + /// public required bool IsIncluded { get; init; } + /// + /// Gets or sets the Item value. + /// public required TObject Item { get; init; } } } diff --git a/src/DynamicData/Cache/Internal/Filter.Static.cs b/src/DynamicData/Cache/Internal/Filter.Static.cs index 679a243eb..b7e6a3885 100644 --- a/src/DynamicData/Cache/Internal/Filter.Static.cs +++ b/src/DynamicData/Cache/Internal/Filter.Static.cs @@ -9,12 +9,27 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the Filter class. +/// internal static partial class Filter { - public static class Static +/// +/// Provides members for the Static class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +public static class Static where TObject : notnull where TKey : notnull { + /// + /// Executes the Create operation. + /// + /// The source value. + /// The filter value. + /// The suppressEmptyChangeSets value. + /// The result of the operation. public static IObservable> Create( IObservable> source, Func filter, diff --git a/src/DynamicData/Cache/Internal/FilterEx.cs b/src/DynamicData/Cache/Internal/FilterEx.cs index 85b7fdb84..77798b0f5 100644 --- a/src/DynamicData/Cache/Internal/FilterEx.cs +++ b/src/DynamicData/Cache/Internal/FilterEx.cs @@ -9,8 +9,19 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the FilterEx class. +/// internal static class FilterEx { + /// + /// Executes the FilterChanges operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The cache value. + /// The changes value. + /// The predicate value. public static void FilterChanges(this ChangeAwareCache cache, IChangeSet changes, Func predicate) where TObject : notnull where TKey : notnull @@ -75,6 +86,15 @@ public static void FilterChanges(this ChangeAwareCache + /// Executes the RefreshFilteredFrom operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The filtered value. + /// The allData value. + /// The predicate value. + /// The result of the operation. public static IChangeSet RefreshFilteredFrom(this ChangeAwareCache filtered, Cache allData, Func predicate) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/Internal/FilterImmutable.cs b/src/DynamicData/Cache/Internal/FilterImmutable.cs index 1219ea375..337fc33cf 100644 --- a/src/DynamicData/Cache/Internal/FilterImmutable.cs +++ b/src/DynamicData/Cache/Internal/FilterImmutable.cs @@ -9,14 +9,36 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the FilterImmutable class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class FilterImmutable where TObject : notnull where TKey : notnull { + /// + /// The _onNextInvoker field. + /// private readonly Action>, IChangeSet> _onNextInvoker; + + /// + /// The _predicate field. + /// private readonly Func _predicate; + + /// + /// The _source field. + /// private readonly IObservable> _source; + /// + /// Initializes a new instance of the class. + /// + /// The predicate value. + /// The source value. + /// The suppressEmptyChangeSets value. public FilterImmutable( Func predicate, IObservable> source, @@ -37,6 +59,10 @@ public FilterImmutable( : (observer, changes) => observer.OnNext(changes); } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => _source .SubscribeSafe(Observer.Create>( diff --git a/src/DynamicData/Cache/Internal/FilterOnObservable.cs b/src/DynamicData/Cache/Internal/FilterOnObservable.cs index 78987c41b..9bb18d922 100644 --- a/src/DynamicData/Cache/Internal/FilterOnObservable.cs +++ b/src/DynamicData/Cache/Internal/FilterOnObservable.cs @@ -9,13 +9,33 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the FilterOnObservable class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The filterFactory value. +/// The buffer value. +/// The scheduler value. internal sealed class FilterOnObservable(IObservable> source, Func> filterFactory, TimeSpan? buffer = null, IScheduler? scheduler = null) where TObject : notnull where TKey : notnull { + /// + /// The _filterFactory field. + /// private readonly Func> _filterFactory = filterFactory ?? throw new ArgumentNullException(nameof(filterFactory)); + + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => _source .Transform((val, key) => new FilterProxy(val, _filterFactory(val, key))) @@ -23,12 +43,26 @@ public IObservable> Run() => .Filter(proxy => proxy.PassesFilter) .TransformImmutable(proxy => proxy.Value); - private sealed class FilterProxy(TObject obj, IObservable observable) +/// +/// Provides members for the FilterProxy class. +/// +/// The obj value. +/// The observable value. +private sealed class FilterProxy(TObject obj, IObservable observable) { + /// + /// Gets the Value value. + /// public TObject Value { get; } = obj; + /// + /// Gets or sets the PassesFilter value. + /// public bool PassesFilter { get; private set; } + /// + /// Gets the FilterObservable value. + /// public IObservable FilterObservable => observable.DistinctUntilChanged().Do(filterValue => PassesFilter = filterValue); } } diff --git a/src/DynamicData/Cache/Internal/FilteredIndexCalculator.cs b/src/DynamicData/Cache/Internal/FilteredIndexCalculator.cs index bbfa7879f..14b439e8b 100644 --- a/src/DynamicData/Cache/Internal/FilteredIndexCalculator.cs +++ b/src/DynamicData/Cache/Internal/FilteredIndexCalculator.cs @@ -9,10 +9,22 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the FilteredIndexCalculator class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal static class FilteredIndexCalculator where TObject : notnull where TKey : notnull { + /// + /// Executes the Calculate operation. + /// + /// The currentItems value. + /// The previousItems value. + /// The sourceUpdates value. + /// The result of the operation. public static IList> Calculate(IKeyValueCollection currentItems, IKeyValueCollection previousItems, IChangeSet? sourceUpdates) { if (currentItems.SortReason == SortReason.ComparerChanged || currentItems.SortReason == SortReason.InitialLoad) @@ -135,6 +147,13 @@ public static IList> Calculate(IKeyValueCollection + /// Executes the GetInsertPositionLinear operation. + /// + /// The list value. + /// The item value. + /// The comparer value. + /// The result of the operation. private static int GetInsertPositionLinear(List> list, KeyValuePair item, IComparer> comparer) { for (var i = 0; i < list.Count; i++) diff --git a/src/DynamicData/Cache/Internal/FinallySafe.cs b/src/DynamicData/Cache/Internal/FinallySafe.cs index 2ef71658c..91cb497d7 100644 --- a/src/DynamicData/Cache/Internal/FinallySafe.cs +++ b/src/DynamicData/Cache/Internal/FinallySafe.cs @@ -9,12 +9,28 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the FinallySafe class. +/// +/// The type of the T value. +/// The source value. +/// The finallyAction value. internal sealed class FinallySafe(IObservable source, Action finallyAction) { + /// + /// The _finallyAction field. + /// private readonly Action _finallyAction = finallyAction ?? throw new ArgumentNullException(nameof(finallyAction)); + /// + /// The _source field. + /// private readonly IObservable _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable Run() => Observable.Create( o => { diff --git a/src/DynamicData/Cache/Internal/FullJoin.cs b/src/DynamicData/Cache/Internal/FullJoin.cs index a8e484fef..5be021403 100644 --- a/src/DynamicData/Cache/Internal/FullJoin.cs +++ b/src/DynamicData/Cache/Internal/FullJoin.cs @@ -9,6 +9,18 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the FullJoin class. +/// +/// The type of the TLeft value. +/// The type of the TLeftKey value. +/// The type of the TRight value. +/// The type of the TRightKey value. +/// The type of the TDestination value. +/// The left value. +/// The right value. +/// The rightKeySelector value. +/// The resultSelector value. internal sealed class FullJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, ReactiveUI.Primitives.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -16,14 +28,30 @@ internal sealed class FullJoin where TRightKey : notnull where TDestination : notnull { + /// + /// The _left field. + /// private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); + /// + /// The _resultSelector field. + /// private readonly Func, ReactiveUI.Primitives.Optional, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + /// + /// The _right field. + /// private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); + /// + /// The _rightKeySelector field. + /// private readonly Func _rightKeySelector = rightKeySelector ?? throw new ArgumentNullException(nameof(rightKeySelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/FullJoinMany.cs b/src/DynamicData/Cache/Internal/FullJoinMany.cs index cbf095fba..02eca05bd 100644 --- a/src/DynamicData/Cache/Internal/FullJoinMany.cs +++ b/src/DynamicData/Cache/Internal/FullJoinMany.cs @@ -9,6 +9,18 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the FullJoinMany class. +/// +/// The type of the TLeft value. +/// The type of the TLeftKey value. +/// The type of the TRight value. +/// The type of the TRightKey value. +/// The type of the TDestination value. +/// The left value. +/// The right value. +/// The rightKeySelector value. +/// The resultSelector value. internal sealed class FullJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -16,14 +28,30 @@ internal sealed class FullJoinMany + /// The _left field. + /// private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); + /// + /// The _resultSelector field. + /// private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + /// + /// The _right field. + /// private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); + /// + /// The _rightKeySelector field. + /// private readonly Func _rightKeySelector = rightKeySelector ?? throw new ArgumentNullException(nameof(rightKeySelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() { var emptyCache = Cache.Empty; diff --git a/src/DynamicData/Cache/Internal/GroupOn.cs b/src/DynamicData/Cache/Internal/GroupOn.cs index 9e7140aff..3e8e6d62f 100644 --- a/src/DynamicData/Cache/Internal/GroupOn.cs +++ b/src/DynamicData/Cache/Internal/GroupOn.cs @@ -9,17 +9,39 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the GroupOn class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroupKey value. +/// The source value. +/// The groupSelectorKey value. +/// The regrouper value. internal sealed class GroupOn(IObservable> source, Func groupSelectorKey, IObservable? regrouper) where TObject : notnull where TKey : notnull where TGroupKey : notnull { + /// + /// The _groupSelectorKey field. + /// private readonly Func _groupSelectorKey = groupSelectorKey ?? throw new ArgumentNullException(nameof(groupSelectorKey)); + /// + /// The _regrouper field. + /// private readonly IObservable _regrouper = regrouper ?? Observable.Never(); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -39,11 +61,26 @@ public IObservable> Run() => Observabl return new CompositeDisposable(connected, disposer, subscriber, queue); }); - private sealed class Grouper(Func groupSelectorKey) +/// +/// Provides members for the Grouper class. +/// +/// The groupSelectorKey value. +private sealed class Grouper(Func groupSelectorKey) { + /// + /// The _groupCache field. + /// private readonly Dictionary> _groupCache = []; + + /// + /// The _itemCache field. + /// private readonly Dictionary _itemCache = []; + /// + /// Executes the Regroup operation. + /// + /// The result of the operation. public IGroupChangeSet Regroup() { // re-evaluate all items in the group @@ -51,8 +88,18 @@ public IGroupChangeSet Regroup() return HandleUpdates(new ChangeSet(items), true); } + /// + /// Executes the Update operation. + /// + /// The updates value. + /// The result of the operation. public IGroupChangeSet Update(IChangeSet updates) => HandleUpdates(updates); + /// + /// Executes the GetCache operation. + /// + /// The key value. + /// The result of the operation. private (ManagedGroup group, bool wasCreated) GetCache(TGroupKey key) { var cache = _groupCache.Lookup(key); @@ -66,6 +113,12 @@ public IGroupChangeSet Regroup() return (newcache, true); } + /// + /// Executes the HandleUpdates operation. + /// + /// The changes value. + /// The isRegrouping value. + /// The result of the operation. private GroupChangeSet HandleUpdates(IEnumerable> changes, bool isRegrouping = false) { var result = new List, TGroupKey>>(); @@ -217,34 +270,95 @@ private GroupChangeSet HandleUpdates(IEnumerable(result); } - private readonly struct ChangeWithGroup(Change change, Func keySelector) : IEquatable +/// +/// Represents the ChangeWithGroup value. +/// +/// The change value. +/// The keySelector value. +private readonly struct ChangeWithGroup(Change change, Func keySelector) : IEquatable { + /// + /// Gets the Item value. + /// public TObject Item { get; } = change.Current; + /// + /// Gets the Key value. + /// public TKey Key { get; } = change.Key; + /// + /// Gets the GroupKey value. + /// public TGroupKey GroupKey { get; } = keySelector(change.Current); + /// + /// Gets the Reason value. + /// public ChangeReason Reason { get; } = change.Reason; + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(in ChangeWithGroup left, in ChangeWithGroup right) => left.Equals(right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(in ChangeWithGroup left, in ChangeWithGroup right) => !left.Equals(right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(ChangeWithGroup other) => EqualityComparer.Default.Equals(Key, other.Key); + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is ChangeWithGroup group && Equals(group); + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => Key.GetHashCode(); + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"Key: {Key}, GroupKey: {GroupKey}, Item: {Item}"; } - private sealed class SuspendTracker : IDisposable +/// +/// Provides members for the SuspendTracker class. +/// +private sealed class SuspendTracker : IDisposable { + /// + /// The _trackedKeys field. + /// private readonly HashSet _trackedKeys = []; + + /// + /// The _disposables field. + /// private readonly CompositeDisposable _disposables = []; + /// + /// Executes the Add operation. + /// + /// The managedGroup value. public void Add(ManagedGroup managedGroup) { if (_trackedKeys.Add(managedGroup.Key)) @@ -253,6 +367,9 @@ public void Add(ManagedGroup managedGroup) } } + /// + /// Executes the Dispose operation. + /// public void Dispose() => _disposables.Dispose(); } } diff --git a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs index b82ebfa80..dcca310a0 100644 --- a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs +++ b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs @@ -9,11 +9,24 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the GroupOnDynamic class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroupKey value. +/// The source value. +/// The selectGroupObservable value. +/// The regrouper value. internal sealed class GroupOnDynamic(IObservable> source, IObservable> selectGroupObservable, IObservable? regrouper = null) where TObject : notnull where TKey : notnull where TGroupKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => { var dynamicGrouper = new DynamicGrouper(); diff --git a/src/DynamicData/Cache/Internal/GroupOnImmutable.cs b/src/DynamicData/Cache/Internal/GroupOnImmutable.cs index b210dc1d2..763e04f9c 100644 --- a/src/DynamicData/Cache/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/Cache/Internal/GroupOnImmutable.cs @@ -9,17 +9,39 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the GroupOnImmutable class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroupKey value. +/// The source value. +/// The groupSelectorKey value. +/// The regrouper value. internal sealed class GroupOnImmutable(IObservable> source, Func groupSelectorKey, IObservable? regrouper) where TObject : notnull where TKey : notnull where TGroupKey : notnull { + /// + /// The _groupSelectorKey field. + /// private readonly Func _groupSelectorKey = groupSelectorKey ?? throw new ArgumentNullException(nameof(groupSelectorKey)); + /// + /// The _regrouper field. + /// private readonly IObservable _regrouper = regrouper ?? Observable.Never(); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -33,11 +55,26 @@ public IObservable> Run() => return new CompositeDisposable(groups.Merge(regroup).SubscribeSafe(observer), queue); }); - private sealed class Grouper(Func groupSelectorKey) +/// +/// Provides members for the Grouper class. +/// +/// The groupSelectorKey value. +private sealed class Grouper(Func groupSelectorKey) { + /// + /// The _allGroupings field. + /// private readonly Dictionary _allGroupings = []; + + /// + /// The _itemCache field. + /// private readonly Dictionary _itemCache = []; + /// + /// Executes the Regroup operation. + /// + /// The result of the operation. public IImmutableGroupChangeSet Regroup() { // re-evaluate all items in the group @@ -45,18 +82,45 @@ public IImmutableGroupChangeSet Regroup() return HandleUpdates(new ChangeSet(items)); } + /// + /// Executes the Update operation. + /// + /// The updates value. + /// The result of the operation. public IImmutableGroupChangeSet Update(IChangeSet updates) => HandleUpdates(updates); + /// + /// Executes the CreateMissingKeyException operation. + /// + /// The reason value. + /// The key value. + /// The result of the operation. private static MissingKeyException CreateMissingKeyException(ChangeReason reason, TKey key) { var message = $"{key} is missing from previous group on {reason}.{Environment.NewLine}Object type {typeof(TObject)}, Key type {typeof(TKey)}, Group key type {typeof(TGroupKey)}"; return new MissingKeyException(message); } + /// + /// Executes the GetGroupState operation. + /// + /// The grouping value. + /// The result of the operation. private static ImmutableGroup GetGroupState(GroupCache grouping) => new(grouping.Key, grouping.Cache); + /// + /// Executes the GetGroupState operation. + /// + /// The key value. + /// The cache value. + /// The result of the operation. private static ImmutableGroup GetGroupState(TGroupKey key, ICache cache) => new(key, cache); + /// + /// Executes the CreateChangeSet operation. + /// + /// The initialGroupState value. + /// The result of the operation. private ImmutableGroupChangeSet CreateChangeSet(IDictionary> initialGroupState) { var result = new List, TGroupKey>>(); @@ -88,6 +152,11 @@ private ImmutableGroupChangeSet CreateChangeSet(IDicti return new ImmutableGroupChangeSet(result); } + /// + /// Executes the GetCache operation. + /// + /// The key value. + /// The result of the operation. private Tuple GetCache(TGroupKey key) { var cache = _allGroupings.Lookup(key); @@ -101,6 +170,11 @@ private Tuple GetCache(TGroupKey key) return Tuple.Create(newcache, true); } + /// + /// Executes the HandleUpdates operation. + /// + /// The changes value. + /// The result of the operation. private ImmutableGroupChangeSet HandleUpdates(IEnumerable> changes) { // need to keep track of effected groups to calculate correct notifications @@ -202,6 +276,12 @@ private ImmutableGroupChangeSet HandleUpdates(IEnumera return CreateChangeSet(initialStateOfGroups); } + /// + /// Executes the RemoveFromOldGroup operation. + /// + /// The groupState value. + /// The groupKey value. + /// The currentKey value. private void RemoveFromOldGroup(Dictionary> groupState, TGroupKey groupKey, TKey currentKey) => _allGroupings.Lookup(groupKey).IfHasValue( g => @@ -214,35 +294,92 @@ private void RemoveFromOldGroup(Dictionary change, Func keySelector) : IEquatable +/// +/// Represents the ChangeWithGroup value. +/// +/// The change value. +/// The keySelector value. +private readonly struct ChangeWithGroup(Change change, Func keySelector) : IEquatable { + /// + /// Gets the Item value. + /// public TObject Item { get; } = change.Current; + /// + /// Gets the Key value. + /// public TKey Key { get; } = change.Key; + /// + /// Gets the GroupKey value. + /// public TGroupKey GroupKey { get; } = keySelector(change.Current); + /// + /// Gets the Reason value. + /// public ChangeReason Reason { get; } = change.Reason; + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(in ChangeWithGroup left, in ChangeWithGroup right) => left.Equals(right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(in ChangeWithGroup left, in ChangeWithGroup right) => !left.Equals(right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(ChangeWithGroup other) => Key.Equals(other.Key); + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is ChangeWithGroup changeGroup && Equals(changeGroup); + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => Key.GetHashCode(); + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"Key: {Key}, GroupKey: {GroupKey}, Item: {Item}"; } - private sealed class GroupCache(TGroupKey key) +/// +/// Provides members for the GroupCache class. +/// +/// The key value. +private sealed class GroupCache(TGroupKey key) { + /// + /// Gets the Cache value. + /// public Cache Cache { get; } = new Cache(); + /// + /// Gets the Key value. + /// public TGroupKey Key { get; } = key; } } diff --git a/src/DynamicData/Cache/Internal/GroupOnObservable.cs b/src/DynamicData/Cache/Internal/GroupOnObservable.cs index 314b8c7cd..9d71fbde5 100644 --- a/src/DynamicData/Cache/Internal/GroupOnObservable.cs +++ b/src/DynamicData/Cache/Internal/GroupOnObservable.cs @@ -9,20 +9,48 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the GroupOnObservable class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroupKey value. +/// The source value. +/// The selectGroup value. internal sealed class GroupOnObservable(IObservable> source, Func> selectGroup) where TObject : notnull where TKey : notnull where TGroupKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => new Subscription(source, selectGroup, observer)); - // Maintains state for a single subscription - private sealed class Subscription : CacheParentSubscription> + +/// +/// Provides members for the Subscription class. +/// +private sealed class Subscription : CacheParentSubscription> { + /// + /// The _grouper field. + /// private readonly DynamicGrouper _grouper = new(); + + /// + /// The _selectGroup field. + /// private readonly Func> _selectGroup; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The selectGroup value. + /// The observer value. public Subscription(IObservable> source, Func> selectGroup, IObserver> observer) : base(observer) { @@ -30,6 +58,10 @@ public Subscription(IObservable> source, Func + /// Executes the ParentOnNext operation. + /// + /// The changes value. protected override void ParentOnNext(IChangeSet changes) { // Process all the changes at once to preserve the changeset order @@ -53,18 +85,36 @@ protected override void ParentOnNext(IChangeSet changes) } } + /// + /// Executes the ChildOnNext operation. + /// + /// The tuple value. + /// The parentKey value. protected override void ChildOnNext((TGroupKey, TObject) tuple, TKey parentKey) => _grouper.AddOrUpdate(parentKey, tuple.Item1, tuple.Item2); + /// + /// Executes the EmitChanges operation. + /// + /// The observer value. protected override void EmitChanges(IObserver> observer) => _grouper.EmitChanges(observer); + /// + /// Executes the Dispose operation. + /// + /// The disposing value. protected override void Dispose(bool disposing) { _grouper.Dispose(); base.Dispose(disposing); } + /// + /// Executes the AddGroupSubscription operation. + /// + /// The obj value. + /// The key value. private void AddGroupSubscription(TObject obj, TKey key) => AddChildSubscription(MakeChildObservable(_selectGroup(obj, key).DistinctUntilChanged().Select(groupKey => (groupKey, obj))), key); } diff --git a/src/DynamicData/Cache/Internal/GroupOnProperty.cs b/src/DynamicData/Cache/Internal/GroupOnProperty.cs index 11e2efc86..975c70200 100644 --- a/src/DynamicData/Cache/Internal/GroupOnProperty.cs +++ b/src/DynamicData/Cache/Internal/GroupOnProperty.cs @@ -11,14 +11,35 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the GroupOnProperty class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroup value. +/// The source value. +/// The groupSelectorKey value. +/// The throttle value. +/// The scheduler value. internal sealed class GroupOnProperty(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged where TKey : notnull where TGroup : notnull { + /// + /// The _groupSelector field. + /// private readonly Func _groupSelector = groupSelectorKey.Compile(); + + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => _source.Publish( shared => { diff --git a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs index a2957db97..8d3273142 100644 --- a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs @@ -11,16 +11,40 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the GroupOnPropertyWithImmutableState class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroup value. +/// The source value. +/// The groupSelectorKey value. +/// The throttle value. +/// The scheduler value. internal sealed class GroupOnPropertyWithImmutableState(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged where TKey : notnull where TGroup : notnull { + /// + /// The _groupSelector field. + /// private readonly Func _groupSelector = groupSelectorKey.Compile(); + + /// + /// The _scheduler field. + /// private readonly IScheduler _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => _source.Publish( shared => { diff --git a/src/DynamicData/Cache/Internal/ImmutableGroup.cs b/src/DynamicData/Cache/Internal/ImmutableGroup.cs index 91e4a270a..3ec11d10b 100644 --- a/src/DynamicData/Cache/Internal/ImmutableGroup.cs +++ b/src/DynamicData/Cache/Internal/ImmutableGroup.cs @@ -9,13 +9,27 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the ImmutableGroup class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroupKey value. internal sealed class ImmutableGroup : IGrouping, IEquatable> where TObject : notnull where TKey : notnull where TGroupKey : notnull { + /// + /// The _cache field. + /// private readonly Cache _cache; + /// + /// Initializes a new instance of the class. + /// + /// The key value. + /// The cache value. internal ImmutableGroup(TGroupKey key, ICache cache) { Key = key; @@ -23,20 +37,52 @@ internal ImmutableGroup(TGroupKey key, ICache cache) cache.KeyValues.ForEach(kvp => _cache.AddOrUpdate(kvp.Value, kvp.Key)); } + /// + /// Gets the Count value. + /// public int Count => _cache.Count; + /// + /// Gets the Items value. + /// public IEnumerable Items => _cache.Items; + /// + /// Gets the Key value. + /// public TGroupKey Key { get; } + /// + /// Gets the Keys value. + /// public IEnumerable Keys => _cache.Keys; + /// + /// Gets the KeyValues value. + /// public IEnumerable> KeyValues => _cache.KeyValues; + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(ImmutableGroup left, ImmutableGroup right) => Equals(left, right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(ImmutableGroup left, ImmutableGroup right) => !Equals(left, right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(ImmutableGroup? other) { if (ReferenceEquals(this, other)) @@ -47,11 +93,29 @@ public bool Equals(ImmutableGroup? other) return other is not null && EqualityComparer.Default.Equals(Key, other.Key); } + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is ImmutableGroup value && Equals(value); + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => EqualityComparer.Default.GetHashCode(Key); + /// + /// Executes the Lookup operation. + /// + /// The key value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TKey key) => _cache.Lookup(key); + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"Grouping for: {Key} ({Count} items)"; } diff --git a/src/DynamicData/Cache/Internal/ImmutableGroupChangeSet.cs b/src/DynamicData/Cache/Internal/ImmutableGroupChangeSet.cs index 60700744c..57af027ab 100644 --- a/src/DynamicData/Cache/Internal/ImmutableGroupChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ImmutableGroupChangeSet.cs @@ -9,18 +9,34 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the ImmutableGroupChangeSet class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroupKey value. internal sealed class ImmutableGroupChangeSet : ChangeSet, TGroupKey>, IImmutableGroupChangeSet where TObject : notnull where TKey : notnull where TGroupKey : notnull { + /// + /// The Empty field. + /// public static new readonly IImmutableGroupChangeSet Empty = new ImmutableGroupChangeSet(); + /// + /// Initializes a new instance of the class. + /// + /// The items value. public ImmutableGroupChangeSet(IEnumerable, TGroupKey>> items) : base(items) { } + /// + /// Initializes a new instance of the class. + /// private ImmutableGroupChangeSet() { } diff --git a/src/DynamicData/Cache/Internal/IndexAndNode.cs b/src/DynamicData/Cache/Internal/IndexAndNode.cs index db348a6df..1da0dc3ab 100644 --- a/src/DynamicData/Cache/Internal/IndexAndNode.cs +++ b/src/DynamicData/Cache/Internal/IndexAndNode.cs @@ -9,15 +9,37 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the IndexAndNode class. +/// internal static class IndexAndNode { + /// + /// Executes the Create operation. + /// + /// The type of the TNodeValue value. + /// The index value. + /// The value value. + /// The result of the operation. public static IndexAndNode Create(int index, LinkedListNode value) => new(index, value); } +/// +/// Provides members for the IndexAndNode class. +/// +/// The type of the TNodeValue value. +/// The index value. +/// The node value. [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Same class name, different generics.")] internal sealed class IndexAndNode(int index, LinkedListNode node) { + /// + /// Gets the Index value. + /// public int Index { get; } = index; + /// + /// Gets the Node value. + /// public LinkedListNode Node { get; } = node; } diff --git a/src/DynamicData/Cache/Internal/IndexCalculator.cs b/src/DynamicData/Cache/Internal/IndexCalculator.cs index 0fa5899b9..622023a01 100644 --- a/src/DynamicData/Cache/Internal/IndexCalculator.cs +++ b/src/DynamicData/Cache/Internal/IndexCalculator.cs @@ -21,14 +21,25 @@ namespace DynamicData.Cache.Internal; /// /// The comparer to use. /// Selected indexing optimisations. +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class IndexCalculator(KeyValueComparer comparer, SortOptimisations optimisations) where TObject : notnull where TKey : notnull { + /// + /// The _comparer field. + /// private KeyValueComparer _comparer = comparer; + /// + /// Gets the Comparer value. + /// public IComparer> Comparer => _comparer; + /// + /// Gets the List value. + /// public List> List { get; private set; } = []; /// @@ -132,6 +143,11 @@ public IChangeSet Calculate(IChangeSet changes) return new ChangeSet(result); } + /// + /// Executes the ChangeComparer operation. + /// + /// The comparer value. + /// The result of the operation. public IChangeSet ChangeComparer(KeyValueComparer comparer) { _comparer = comparer; @@ -152,6 +168,10 @@ public IChangeSet Load(ChangeAwareCache cache) return new ChangeSet(initialItems); } + /// + /// Executes the Reorder operation. + /// + /// The result of the operation. public IChangeSet Reorder() { var result = new List>(); @@ -194,6 +214,11 @@ public IChangeSet Reorder() /// The cache. public void Reset(ChangeAwareCache cache) => List = [.. cache.KeyValues.OrderBy(kv => kv, _comparer)]; + /// + /// Executes the GetCurrentPosition operation. + /// + /// The item value. + /// The result of the operation. private int GetCurrentPosition(KeyValuePair item) { int index; @@ -220,6 +245,11 @@ private int GetCurrentPosition(KeyValuePair item) return index; } + /// + /// Executes the GetInsertPositionBinary operation. + /// + /// The item value. + /// The result of the operation. private int GetInsertPositionBinary(KeyValuePair item) { var index = List.BinarySearch(item, _comparer); @@ -237,6 +267,12 @@ private int GetInsertPositionBinary(KeyValuePair item) return ~index; } + /// + /// Executes the GetInsertPositionLinear operation. + /// + /// The list value. + /// The item value. + /// The result of the operation. private int GetInsertPositionLinear(List> list, KeyValuePair item) { for (var i = 0; i < list.Count; i++) diff --git a/src/DynamicData/Cache/Internal/InnerJoin.cs b/src/DynamicData/Cache/Internal/InnerJoin.cs index bbeb6d711..018dd9ae2 100644 --- a/src/DynamicData/Cache/Internal/InnerJoin.cs +++ b/src/DynamicData/Cache/Internal/InnerJoin.cs @@ -9,6 +9,18 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the InnerJoin class. +/// +/// The type of the TLeft value. +/// The type of the TLeftKey value. +/// The type of the TRight value. +/// The type of the TRightKey value. +/// The type of the TDestination value. +/// The left value. +/// The right value. +/// The rightKeySelector value. +/// The resultSelector value. internal sealed class InnerJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func<(TLeftKey leftKey, TRightKey rightKey), TLeft, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -16,14 +28,30 @@ internal sealed class InnerJoin + /// The _left field. + /// private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); + /// + /// The _resultSelector field. + /// private readonly Func<(TLeftKey leftKey, TRightKey rightKey), TLeft, TRight, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + /// + /// The _right field. + /// private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); + /// + /// The _rightKeySelector field. + /// private readonly Func _rightKeySelector = rightKeySelector ?? throw new ArgumentNullException(nameof(rightKeySelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/InnerJoinMany.cs b/src/DynamicData/Cache/Internal/InnerJoinMany.cs index 0b1994762..a52998888 100644 --- a/src/DynamicData/Cache/Internal/InnerJoinMany.cs +++ b/src/DynamicData/Cache/Internal/InnerJoinMany.cs @@ -9,6 +9,18 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the InnerJoinMany class. +/// +/// The type of the TLeft value. +/// The type of the TLeftKey value. +/// The type of the TRight value. +/// The type of the TRightKey value. +/// The type of the TDestination value. +/// The left value. +/// The right value. +/// The rightKeySelector value. +/// The resultSelector value. internal sealed class InnerJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -16,14 +28,30 @@ internal sealed class InnerJoinMany + /// The _left field. + /// private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); + /// + /// The _resultSelector field. + /// private readonly Func, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + /// + /// The _right field. + /// private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); + /// + /// The _rightKeySelector field. + /// private readonly Func _rightKeySelector = rightKeySelector ?? throw new ArgumentNullException(nameof(rightKeySelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() { var rightGrouped = _right.GroupWithImmutableState(_rightKeySelector); diff --git a/src/DynamicData/Cache/Internal/KeyComparer.cs b/src/DynamicData/Cache/Internal/KeyComparer.cs index df3b7ca10..2b76cbf83 100644 --- a/src/DynamicData/Cache/Internal/KeyComparer.cs +++ b/src/DynamicData/Cache/Internal/KeyComparer.cs @@ -9,9 +9,25 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the KeyComparer class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class KeyComparer : IEqualityComparer> { + /// + /// Executes the Equals operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public bool Equals(KeyValuePair x, KeyValuePair y) => x.Key?.Equals(y.Key) ?? false; + /// + /// Executes the GetHashCode operation. + /// + /// The obj value. + /// The result of the operation. public int GetHashCode(KeyValuePair obj) => obj.Key is null ? 0 : obj.Key.GetHashCode(); } diff --git a/src/DynamicData/Cache/Internal/KeySelector.cs b/src/DynamicData/Cache/Internal/KeySelector.cs index 7d83f8097..b77f876b7 100644 --- a/src/DynamicData/Cache/Internal/KeySelector.cs +++ b/src/DynamicData/Cache/Internal/KeySelector.cs @@ -9,13 +9,30 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the KeySelector class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The keySelector value. internal sealed class KeySelector(Func keySelector) : IKeySelector { + /// + /// The _keySelector field. + /// private readonly Func _keySelector = keySelector ?? throw new ArgumentNullException(nameof(keySelector)); + /// + /// Gets the Type value. + /// [SuppressMessage("Design", "CA1822: Member can be static", Justification = "Backwards compatibilty")] public Type Type => typeof(TObject); + /// + /// Executes the GetKey operation. + /// + /// The item value. + /// The result of the operation. public TKey GetKey(TObject item) { try diff --git a/src/DynamicData/Cache/Internal/KeyValueCollection.cs b/src/DynamicData/Cache/Internal/KeyValueCollection.cs index 8a6a03947..4e2b8c72c 100644 --- a/src/DynamicData/Cache/Internal/KeyValueCollection.cs +++ b/src/DynamicData/Cache/Internal/KeyValueCollection.cs @@ -9,10 +9,25 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the KeyValueCollection class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class KeyValueCollection : IKeyValueCollection { + /// + /// The _items field. + /// private readonly IReadOnlyCollection> _items; + /// + /// Initializes a new instance of the class. + /// + /// The items value. + /// The comparer value. + /// The sortReason value. + /// The optimisations value. public KeyValueCollection(IReadOnlyCollection> items, IComparer> comparer, SortReason sortReason, SortOptimisations optimisations) { _items = items ?? throw new ArgumentNullException(nameof(items)); @@ -21,6 +36,9 @@ public KeyValueCollection(IReadOnlyCollection> items Optimisations = optimisations; } + /// + /// Initializes a new instance of the class. + /// public KeyValueCollection() { Optimisations = SortOptimisations.None; @@ -36,15 +54,36 @@ public KeyValueCollection() /// public IComparer> Comparer { get; } + /// + /// Gets the Count value. + /// public int Count => _items.Count; + /// + /// Gets the Optimisations value. + /// public SortOptimisations Optimisations { get; } + /// + /// Gets the SortReason value. + /// public SortReason SortReason { get; } + /// + /// Gets or sets the indexed value. + /// + /// The index value. public KeyValuePair this[int index] => _items.ElementAt(index); + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. public IEnumerator> GetEnumerator() => _items.GetEnumerator(); + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/Cache/Internal/KeyValueComparer.cs b/src/DynamicData/Cache/Internal/KeyValueComparer.cs index 37a7e03dd..cc3a96d4f 100644 --- a/src/DynamicData/Cache/Internal/KeyValueComparer.cs +++ b/src/DynamicData/Cache/Internal/KeyValueComparer.cs @@ -9,8 +9,20 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the KeyValueComparer class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The comparer value. internal sealed class KeyValueComparer(IComparer? comparer = null) : IComparer> { + /// + /// Executes the Compare operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public int Compare(KeyValuePair x, KeyValuePair y) { if (comparer is not null) diff --git a/src/DynamicData/Cache/Internal/LeftJoin.cs b/src/DynamicData/Cache/Internal/LeftJoin.cs index 0386031d5..aebe2ea78 100644 --- a/src/DynamicData/Cache/Internal/LeftJoin.cs +++ b/src/DynamicData/Cache/Internal/LeftJoin.cs @@ -9,6 +9,18 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the LeftJoin class. +/// +/// The type of the TLeft value. +/// The type of the TLeftKey value. +/// The type of the TRight value. +/// The type of the TRightKey value. +/// The type of the TDestination value. +/// The left value. +/// The right value. +/// The rightKeySelector value. +/// The resultSelector value. internal sealed class LeftJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -16,14 +28,30 @@ internal sealed class LeftJoin where TRightKey : notnull where TDestination : notnull { + /// + /// The _left field. + /// private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); + /// + /// The _resultSelector field. + /// private readonly Func, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + /// + /// The _right field. + /// private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); + /// + /// The _rightKeySelector field. + /// private readonly Func _rightKeySelector = rightKeySelector ?? throw new ArgumentNullException(nameof(rightKeySelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/LeftJoinMany.cs b/src/DynamicData/Cache/Internal/LeftJoinMany.cs index bc321b643..d9df78498 100644 --- a/src/DynamicData/Cache/Internal/LeftJoinMany.cs +++ b/src/DynamicData/Cache/Internal/LeftJoinMany.cs @@ -9,6 +9,18 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the LeftJoinMany class. +/// +/// The type of the TLeft value. +/// The type of the TLeftKey value. +/// The type of the TRight value. +/// The type of the TRightKey value. +/// The type of the TDestination value. +/// The left value. +/// The right value. +/// The rightKeySelector value. +/// The resultSelector value. internal sealed class LeftJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -16,14 +28,30 @@ internal sealed class LeftJoinMany + /// The _left field. + /// private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); + /// + /// The _resultSelector field. + /// private readonly Func, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + /// + /// The _right field. + /// private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); + /// + /// The _rightKeySelector field. + /// private readonly Func _rightKeySelector = rightKeySelector ?? throw new ArgumentNullException(nameof(rightKeySelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() { var emptyCache = Cache.Empty; diff --git a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs index abf271529..a67a6fed2 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs @@ -22,19 +22,37 @@ public sealed class LockFreeObservableCache : IObservableCache + /// The _changes field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly Signal> _changes = new(); + /// + /// The _changesPreview field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly Signal> _changesPreview = new(); + /// + /// The _countChanged field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly Signal _countChanged = new(); + /// + /// The _cleanUp field. + /// private readonly IDisposable _cleanUp; + /// + /// The _innerCache field. + /// private readonly ChangeAwareCache _innerCache = new(); + /// + /// The _updater field. + /// private readonly ICacheUpdater _updater; /// @@ -95,6 +113,9 @@ public LockFreeObservableCache() public IReadOnlyDictionary KeyValues => new Dictionary(_innerCache.GetDictionary()); /// + /// The predicate value. + /// The suppressEmptyChangeSets value. + /// The result of the operation. public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => Observable.Defer( () => { @@ -139,6 +160,8 @@ public void Edit(Action> editAction) public ReactiveUI.Primitives.Optional Lookup(TKey key) => _innerCache.Lookup(key); /// + /// The predicate value. + /// The result of the operation. public IObservable> Preview(Func? predicate = null) => predicate is null ? _changesPreview : _changesPreview.Filter(predicate); /// diff --git a/src/DynamicData/Cache/Internal/ManagedGroup.cs b/src/DynamicData/Cache/Internal/ManagedGroup.cs index f573190d2..47a7a6817 100644 --- a/src/DynamicData/Cache/Internal/ManagedGroup.cs +++ b/src/DynamicData/Cache/Internal/ManagedGroup.cs @@ -9,20 +9,46 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the ManagedGroup class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroupKey value. +/// The groupKey value. internal sealed class ManagedGroup(TGroupKey groupKey) : IGroup, IDisposable where TObject : notnull where TKey : notnull { + /// + /// The _cache field. + /// private readonly IntermediateCache _cache = new(); + /// + /// Gets the Cache value. + /// public IObservableCache Cache => _cache; + /// + /// Gets the Key value. + /// public TGroupKey Key { get; } = groupKey; + /// + /// Gets the Count value. + /// internal int Count => _cache.Count; + /// + /// Executes the Dispose operation. + /// public void Dispose() => _cache.Dispose(); + /// + /// Executes the SuspendNotifications operation. + /// + /// The result of the operation. public IDisposable SuspendNotifications() => _cache.SuspendNotifications(); /// @@ -63,9 +89,22 @@ public override bool Equals(object? obj) /// public override string ToString() => $"Group: {Key}"; + /// + /// Executes the GetInitialUpdates operation. + /// + /// The result of the operation. internal IChangeSet GetInitialUpdates() => _cache.GetInitialUpdates(); + /// + /// Executes the Update operation. + /// + /// The updateAction value. internal void Update(Action> updateAction) => _cache.Edit(updateAction); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. private bool Equals(ManagedGroup other) => EqualityComparer.Default.Equals(Key, other.Key); } diff --git a/src/DynamicData/Cache/Internal/MergeChangeSets.cs b/src/DynamicData/Cache/Internal/MergeChangeSets.cs index 05192616e..d13c9cb54 100644 --- a/src/DynamicData/Cache/Internal/MergeChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeChangeSets.cs @@ -12,15 +12,32 @@ namespace DynamicData.Cache.Internal; /// /// Operator that is similiar to Merge but intelligently handles Cache ChangeSets. /// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The equalityComparer value. +/// The comparer value. internal sealed class MergeChangeSets(IObservable>> source, IEqualityComparer? equalityComparer, IComparer? comparer) where TObject : notnull where TKey : notnull { + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The equalityComparer value. + /// The comparer value. + /// The completable value. + /// The scheduler value. public MergeChangeSets(IEnumerable>> source, IEqualityComparer? equalityComparer, IComparer? comparer, bool completable, IScheduler? scheduler = null) : this(CreateObservable(source, completable, scheduler), equalityComparer, comparer) { } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -40,16 +57,36 @@ public IObservable> Run() => Observable.Create + /// Executes the CreateChange operation. + /// + /// The source value. + /// The index value. + /// The queue value. + /// The result of the operation. private static Change, int> CreateChange(IObservable> source, int index, SharedDeliveryQueue queue) => new(ChangeReason.Add, index, new ChangeSetCache(source.IgnoreSameReferenceUpdate().SynchronizeSafe(queue))); - // Create a ChangeSet Observable that produces ChangeSets with a single Add event for each new sub-observable + + /// + /// Executes the CreateContainerObservable operation. + /// + /// The source value. + /// The queue value. + /// The result of the operation. private static IObservable, int>> CreateContainerObservable(IObservable>> source, SharedDeliveryQueue queue) => source.Select((src, index) => new ChangeSet, int>(new[] { CreateChange(src, index, queue) })); - // Create a ChangeSet Observable with a single event that adds all the values in the enum (and then completes, maybe) + + /// + /// Executes the CreateObservable operation. + /// + /// The source value. + /// The completable value. + /// The scheduler value. + /// The result of the operation. private static IObservable>> CreateObservable(IEnumerable>> source, bool completable, IScheduler? scheduler = null) { var obs = (scheduler != null) ? source.ToObservable(scheduler) : source.ToObservable(); diff --git a/src/DynamicData/Cache/Internal/MergeMany.cs b/src/DynamicData/Cache/Internal/MergeMany.cs index 048edd21f..cd4f34bbf 100644 --- a/src/DynamicData/Cache/Internal/MergeMany.cs +++ b/src/DynamicData/Cache/Internal/MergeMany.cs @@ -9,20 +9,42 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the MergeMany class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TDestination value. internal sealed class MergeMany where TObject : notnull where TKey : notnull { + /// + /// The _observableSelector field. + /// private readonly Func> _observableSelector; + /// + /// The _source field. + /// private readonly IObservable> _source; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The observableSelector value. public MergeMany(IObservable> source, Func> observableSelector) { _source = source ?? throw new ArgumentNullException(nameof(source)); _observableSelector = observableSelector ?? throw new ArgumentNullException(nameof(observableSelector)); } + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The observableSelector value. public MergeMany(IObservable> source, Func> observableSelector) { ArgumentExceptionHelper.ThrowIfNull(observableSelector); @@ -31,6 +53,10 @@ public MergeMany(IObservable> source, Func observableSelector(t); } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable Run() => Observable.Create( observer => { @@ -52,6 +78,11 @@ public IObservable Run() => Observable.Create( .Subscribe(static _ => { }, observer.OnError)); }); + /// + /// Executes the CheckCompleted operation. + /// + /// The counter value. + /// The queue value. private static void CheckCompleted(StrongBox counter, DeliveryQueue queue) { if (Interlocked.Decrement(ref counter.Value) == 0 && !queue.IsTerminated) diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs index e786ba2db..0d3a1e07d 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs @@ -12,21 +12,51 @@ namespace DynamicData.Cache.Internal; /// /// Operator that is similiar to MergeMany but intelligently handles Cache ChangeSets. /// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TDestination value. +/// The type of the TDestinationKey value. +/// The source value. +/// The changeSetSelector value. +/// The equalityComparer value. +/// The comparer value. internal sealed class MergeManyCacheChangeSets(IObservable> source, Func>> changeSetSelector, IEqualityComparer? equalityComparer, IComparer? comparer) where TObject : notnull where TKey : notnull where TDestination : notnull where TDestinationKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => new Subscription(source, changeSetSelector, observer, equalityComparer, comparer)); - // Maintains state for a single subscription - private sealed class Subscription : CacheParentSubscription, TKey, IChangeSet, IChangeSet> + +/// +/// Provides members for the Subscription class. +/// +private sealed class Subscription : CacheParentSubscription, TKey, IChangeSet, IChangeSet> { + /// + /// The _cache field. + /// private readonly Cache, TKey> _cache = new(); + + /// + /// The _changeSetMergeTracker field. + /// private readonly ChangeSetMergeTracker _changeSetMergeTracker; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The changeSetSelector value. + /// The observer value. + /// The equalityComparer value. + /// The comparer value. public Subscription( IObservable> source, Func>> changeSetSelector, @@ -42,7 +72,11 @@ public Subscription( new ChangeSetCache(MakeChildObservable(changeSetSelector(obj, key).IgnoreSameReferenceUpdate())))); } - protected override void ParentOnNext(IChangeSet, TKey> changes) + /// + /// Executes the ParentOnNext operation. + /// + /// The changes value. + protected override void ParentOnNext(IChangeSet, TKey> changes) { // Process all the changes at once to preserve the changeset order foreach (var change in changes.ToConcreteType()) @@ -70,9 +104,18 @@ protected override void ParentOnNext(IChangeSet + /// Executes the ChildOnNext operation. + /// + /// The changes value. + /// The parentKey value. protected override void ChildOnNext(IChangeSet changes, TKey parentKey) => _changeSetMergeTracker.ProcessChangeSet(changes, null); + /// + /// Executes the EmitChanges operation. + /// + /// The observer value. protected override void EmitChanges(IObserver> observer) => _changeSetMergeTracker.EmitChanges(observer); } diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs index 7e6238826..65d5fea48 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs @@ -13,29 +13,75 @@ namespace DynamicData.Cache.Internal; /// Alternate version of MergeManyCacheChangeSets that uses a Comparer of the source, not the destination type /// So that items from the most important source go into the resulting changeset. /// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TDestination value. +/// The type of the TDestinationKey value. +/// The source value. +/// The selector value. +/// The parentCompare value. +/// The equalityComparer value. +/// The childCompare value. +/// The reevalOnRefresh value. internal sealed class MergeManyCacheChangeSetsSourceCompare(IObservable> source, Func>> selector, IComparer parentCompare, IEqualityComparer? equalityComparer, IComparer? childCompare, bool reevalOnRefresh = false) where TObject : notnull where TKey : notnull where TDestination : notnull where TDestinationKey : notnull { + /// + /// The _changeSetSelector field. + /// private readonly Func>> _changeSetSelector = (obj, key) => selector(obj, key).Transform(dest => new ParentChildEntry(obj, dest)); + /// + /// The _comparer field. + /// private readonly IComparer _comparer = (childCompare is null) ? new ParentOnlyCompare(parentCompare) : new ParentChildCompare(parentCompare, childCompare); + /// + /// The _equalityComparer field. + /// private readonly IEqualityComparer? _equalityComparer = (equalityComparer != null) ? new ParentChildEqualityCompare(equalityComparer) : null; + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => new Subscription(source, _changeSetSelector, observer, _comparer, _equalityComparer, reevalOnRefresh)) .TransformImmutable(entry => entry.Child); - // Maintains state for a single subscription - private sealed class Subscription : CacheParentSubscription, TKey, IChangeSet, IChangeSet> + +/// +/// Provides members for the Subscription class. +/// +private sealed class Subscription : CacheParentSubscription, TKey, IChangeSet, IChangeSet> { + /// + /// The _cache field. + /// private readonly Cache, TKey> _cache = new(); + + /// + /// The _changeSetMergeTracker field. + /// private readonly ChangeSetMergeTracker _changeSetMergeTracker; + + /// + /// The _reevalOnRefresh field. + /// private readonly bool _reevalOnRefresh; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The changeSetSelector value. + /// The observer value. + /// The comparer value. + /// The equalityComparer value. + /// The reevalOnRefresh value. public Subscription( IObservable> source, Func>> changeSetSelector, @@ -53,6 +99,10 @@ public Subscription( new ChangeSetCache(MakeChildObservable(changeSetSelector(obj, key).IgnoreSameReferenceUpdate())))); } + /// + /// Executes the ParentOnNext operation. + /// + /// The changes value. protected override void ParentOnNext(IChangeSet, TKey> changes) { // Process all the changes at once to preserve the changeset order @@ -88,17 +138,42 @@ protected override void ParentOnNext(IChangeSet + /// Executes the ChildOnNext operation. + /// + /// The changes value. + /// The parentKey value. protected override void ChildOnNext(IChangeSet changes, TKey parentKey) => _changeSetMergeTracker.ProcessChangeSet(changes, null); + /// + /// Executes the EmitChanges operation. + /// + /// The observer value. protected override void EmitChanges(IObserver> observer) => _changeSetMergeTracker.EmitChanges(observer); } + /// + /// Represents the ParentChildEntry record. + /// + /// The Parent value. + /// The Child value. private sealed record ParentChildEntry(TObject Parent, TDestination Child); - private sealed class ParentChildCompare(IComparer comparerParent, IComparer comparerChild) : Comparer +/// +/// Provides members for the ParentChildCompare class. +/// +/// The comparerParent value. +/// The comparerChild value. +private sealed class ParentChildCompare(IComparer comparerParent, IComparer comparerChild) : Comparer { + /// + /// Executes the Compare operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public override int Compare(ParentChildEntry? x, ParentChildEntry? y) => (x, y) switch { (not null, not null) => comparerParent.Compare(x.Parent, y.Parent) switch @@ -112,8 +187,18 @@ private sealed class ParentChildCompare(IComparer comparerParent, IComp }; } - private sealed class ParentOnlyCompare(IComparer comparer) : Comparer +/// +/// Provides members for the ParentOnlyCompare class. +/// +/// The comparer value. +private sealed class ParentOnlyCompare(IComparer comparer) : Comparer { + /// + /// Executes the Compare operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public override int Compare(ParentChildEntry? x, ParentChildEntry? y) => (x, y) switch { (not null, not null) => comparer.Compare(x.Parent, y.Parent), @@ -123,8 +208,18 @@ private sealed class ParentOnlyCompare(IComparer comparer) : Comparer

comparer) : EqualityComparer +///

+/// Provides members for the ParentChildEqualityCompare class. +/// +/// The comparer value. +private sealed class ParentChildEqualityCompare(IEqualityComparer comparer) : EqualityComparer { + /// + /// Executes the Equals operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public override bool Equals(ParentChildEntry? x, ParentChildEntry? y) => (x, y) switch { (not null, not null) => comparer.Equals(x.Child, y.Child), @@ -132,6 +227,11 @@ private sealed class ParentChildEqualityCompare(IEqualityComparer _ => false, }; + /// + /// Executes the GetHashCode operation. + /// + /// The obj value. + /// The result of the operation. public override int GetHashCode(ParentChildEntry obj) => comparer.GetHashCode(obj.Child); } } diff --git a/src/DynamicData/Cache/Internal/MergeManyItems.cs b/src/DynamicData/Cache/Internal/MergeManyItems.cs index 3cf5a75b5..c6bd5e001 100644 --- a/src/DynamicData/Cache/Internal/MergeManyItems.cs +++ b/src/DynamicData/Cache/Internal/MergeManyItems.cs @@ -9,14 +9,31 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the MergeManyItems class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TDestination value. internal sealed class MergeManyItems where TObject : notnull where TKey : notnull { + /// + /// The _observableSelector field. + /// private readonly Func> _observableSelector; + /// + /// The _source field. + /// private readonly IObservable> _source; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The observableSelector value. public MergeManyItems(IObservable> source, Func> observableSelector) { ArgumentExceptionHelper.ThrowIfNull(source); @@ -26,6 +43,11 @@ public MergeManyItems(IObservable> source, Func + /// Initializes a new instance of the class. + ///
+ /// The source value. + /// The observableSelector value. public MergeManyItems(IObservable> source, Func> observableSelector) { ArgumentExceptionHelper.ThrowIfNull(source); @@ -35,5 +57,9 @@ public MergeManyItems(IObservable> source, Func observableSelector(t); } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => _source.SubscribeMany((t, v) => _observableSelector(t, v).Select(z => new ItemWithValue(t, z)).SubscribeSafe(observer)).Subscribe()); } diff --git a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs index 56987292c..0f72e9329 100644 --- a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs @@ -19,19 +19,42 @@ namespace DynamicData.Cache.Internal; /// /// Operator that is similiar to MergeMany but intelligently handles List ChangeSets. /// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TDestination value. +/// The source value. +/// The selector value. +/// The equalityComparer value. internal sealed class MergeManyListChangeSets(IObservable> source, Func>> selector, IEqualityComparer? equalityComparer) where TObject : notnull where TKey : notnull where TDestination : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => new Subscription(source, selector, observer, equalityComparer)); - // Maintains state for a single subscription - private sealed class Subscription : CacheParentSubscription, TKey, IChangeSet, IChangeSet> + +/// +/// Provides members for the Subscription class. +/// +private sealed class Subscription : CacheParentSubscription, TKey, IChangeSet, IChangeSet> { + /// + /// The _changeSetMergeTracker field. + /// private readonly ChangeSetMergeTracker _changeSetMergeTracker = new(); + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The selector value. + /// The observer value. + /// The equalityComparer value. public Subscription( IObservable> source, Func>> selector, @@ -44,6 +67,10 @@ public Subscription( new ClonedListChangeSet(MakeChildObservable(selector(obj, key).RemoveIndex()), equalityComparer))); } + /// + /// Executes the ParentOnNext operation. + /// + /// The changes value. protected override void ParentOnNext(IChangeSet, TKey> changes) { // Process all the changes at once to preserve the changeset order @@ -70,9 +97,18 @@ protected override void ParentOnNext(IChangeSet + /// Executes the ChildOnNext operation. + ///
+ /// The child value. + /// The parentKey value. protected override void ChildOnNext(IChangeSet child, TKey parentKey) => _changeSetMergeTracker.ProcessChangeSet(child, null); + /// + /// Executes the EmitChanges operation. + /// + /// The observer value. protected override void EmitChanges(IObserver> observer) => _changeSetMergeTracker.EmitChanges(observer); } diff --git a/src/DynamicData/Cache/Internal/ObservableWithValue.cs b/src/DynamicData/Cache/Internal/ObservableWithValue.cs index 09626adf3..a651e2e85 100644 --- a/src/DynamicData/Cache/Internal/ObservableWithValue.cs +++ b/src/DynamicData/Cache/Internal/ObservableWithValue.cs @@ -9,18 +9,37 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the ObservableWithValue class. +/// +/// The type of the TObject value. +/// The type of the TValue value. internal sealed class ObservableWithValue where TValue : notnull { + /// + /// Initializes a new instance of the class. + /// + /// The item value. + /// The source value. public ObservableWithValue(TObject item, IObservable source) { Item = item; Observable = source.Do(value => LatestValue = value); } + /// + /// Gets the Item value. + /// public TObject Item { get; } + /// + /// Gets the LatestValue value. + /// public ReactiveUI.Primitives.Optional LatestValue { get; private set; } = ReactiveUI.Primitives.Optional.None; + /// + /// Gets the Observable value. + /// public IObservable Observable { get; } } diff --git a/src/DynamicData/Cache/Internal/OfType.cs b/src/DynamicData/Cache/Internal/OfType.cs index f3192d364..02a183662 100644 --- a/src/DynamicData/Cache/Internal/OfType.cs +++ b/src/DynamicData/Cache/Internal/OfType.cs @@ -9,11 +9,23 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the OfType class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TDestination value. +/// The source value. +/// The suppressEmptyChangeSets value. internal sealed class OfType(IObservable> source, bool suppressEmptyChangeSets) where TObject : notnull where TKey : notnull where TDestination : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => source .SubscribeSafe( diff --git a/src/DynamicData/Cache/Internal/OnBeingRemoved.cs b/src/DynamicData/Cache/Internal/OnBeingRemoved.cs index 0c47a65a5..5ab4bcd8b 100644 --- a/src/DynamicData/Cache/Internal/OnBeingRemoved.cs +++ b/src/DynamicData/Cache/Internal/OnBeingRemoved.cs @@ -9,13 +9,31 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the OnBeingRemoved class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The removeAction value. internal sealed class OnBeingRemoved(IObservable> source, Action removeAction) where TObject : notnull where TKey : notnull { + /// + /// The _removeAction field. + /// private readonly Action _removeAction = removeAction ?? throw new ArgumentNullException(nameof(removeAction)); + + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -33,6 +51,11 @@ public IObservable> Run() => Observable.Create + /// Executes the RegisterForRemoval operation. + ///
+ /// The changes value. + /// The cache value. private void RegisterForRemoval(IChangeSet changes, Cache cache) { changes.ForEach( diff --git a/src/DynamicData/Cache/Internal/Page.cs b/src/DynamicData/Cache/Internal/Page.cs index 4c4706a1b..ed87ac4f7 100644 --- a/src/DynamicData/Cache/Internal/Page.cs +++ b/src/DynamicData/Cache/Internal/Page.cs @@ -9,10 +9,21 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the Page class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The pageRequests value. internal sealed class Page(IObservable> source, IObservable pageRequests) where TObject : notnull where TKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -27,22 +38,45 @@ public IObservable> Run() => Observable.Create +/// Provides members for the Paginator class. +///
+private sealed class Paginator { + /// + /// The _all field. + /// private IKeyValueCollection _all = new KeyValueCollection(); + /// + /// The _current field. + /// private KeyValueCollection _current = new(); + /// + /// The _isLoaded field. + /// private bool _isLoaded; + /// + /// The _request field. + /// private IPageRequest _request; + /// + /// Initializes a new instance of the class. + /// public Paginator() { _request = PageRequest.Default; _isLoaded = false; } + /// + /// Executes the Paginate operation. + /// + /// The parameters value. + /// The result of the operation. public IPagedChangeSet? Paginate(IPageRequest? parameters) { if (parameters is null || parameters.Page < 0 || parameters.Size < 1) @@ -60,6 +94,11 @@ public Paginator() return Paginate(); } + /// + /// Executes the Update operation. + /// + /// The updates value. + /// The result of the operation. public IPagedChangeSet? Update(ISortedChangeSet updates) { _isLoaded = true; @@ -67,6 +106,10 @@ public Paginator() return Paginate(updates); } + /// + /// Executes the CalculatePages operation. + /// + /// The result of the operation. private int CalculatePages() { if (_request.Size >= _all.Count) @@ -85,6 +128,11 @@ private int CalculatePages() return pages + 1; } + /// + /// Executes the Paginate operation. + /// + /// The updates value. + /// The result of the operation. private PagedChangeSet? Paginate(ISortedChangeSet? updates = null) { if (!_isLoaded) diff --git a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs index 778ac6f5f..45c96fad8 100644 --- a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs @@ -9,12 +9,27 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the QueryWhenChanged class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TValue value. +/// The source value. +/// The itemChangedTrigger value. internal sealed class QueryWhenChanged(IObservable> source, Func>? itemChangedTrigger = null) where TObject : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() { if (itemChangedTrigger is null) diff --git a/src/DynamicData/Cache/Internal/ReaderWriter.cs b/src/DynamicData/Cache/Internal/ReaderWriter.cs index 41b3b3cac..f9ca51f99 100644 --- a/src/DynamicData/Cache/Internal/ReaderWriter.cs +++ b/src/DynamicData/Cache/Internal/ReaderWriter.cs @@ -9,16 +9,34 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the ReaderWriter class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The keySelector value. internal sealed class ReaderWriter(Func? keySelector = null) where TObject : notnull where TKey : notnull { + /// + /// The _locker field. + /// private readonly Lock _locker = new(); + /// + /// The _activeUpdater field. + /// private CacheUpdater? _activeUpdater; + /// + /// The _data field. + /// private Dictionary _data = []; // could do with priming this on first time load + /// + /// Gets the Count value. + /// public int Count { get @@ -30,6 +48,9 @@ public int Count } } + /// + /// Gets the Items value. + /// public TObject[] Items { get @@ -41,6 +62,9 @@ public TObject[] Items } } + /// + /// Gets the Keys value. + /// public TKey[] Keys { get @@ -52,6 +76,9 @@ public TKey[] Keys } } + /// + /// Gets the KeyValues value. + /// public IReadOnlyDictionary KeyValues { get @@ -63,6 +90,11 @@ public IReadOnlyDictionary KeyValues } } + /// + /// Executes the GetInitialUpdates operation. + /// + /// The filter value. + /// The result of the operation. public ChangeSet GetInitialUpdates(Func? filter = null) { lock (_locker) @@ -88,6 +120,11 @@ public ChangeSet GetInitialUpdates(Func? filter = } } + /// + /// Executes the Lookup operation. + /// + /// The key value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TKey key) { lock (_locker) @@ -96,6 +133,13 @@ public ReactiveUI.Primitives.Optional Lookup(TKey key) } } + /// + /// Executes the Write operation. + /// + /// The changes value. + /// The previewHandler value. + /// The collectChanges value. + /// The result of the operation. public ChangeSet Write(IChangeSet changes, Action>? previewHandler, bool collectChanges) { ArgumentExceptionHelper.ThrowIfNull(changes); @@ -103,6 +147,13 @@ public ChangeSet Write(IChangeSet changes, Action< return DoUpdate(updater => updater.Clone(changes), previewHandler, collectChanges); } + /// + /// Executes the Write operation. + /// + /// The updateAction value. + /// The previewHandler value. + /// The collectChanges value. + /// The result of the operation. public ChangeSet Write(Action> updateAction, Action>? previewHandler, bool collectChanges) { ArgumentExceptionHelper.ThrowIfNull(updateAction); @@ -110,6 +161,13 @@ public ChangeSet Write(Action> updat return DoUpdate(updateAction, previewHandler, collectChanges); } + /// + /// Executes the Write operation. + /// + /// The updateAction value. + /// The previewHandler value. + /// The collectChanges value. + /// The result of the operation. public ChangeSet Write(Action> updateAction, Action>? previewHandler, bool collectChanges) { ArgumentExceptionHelper.ThrowIfNull(updateAction); @@ -117,6 +175,10 @@ public ChangeSet Write(Action> upda return DoUpdate(updateAction, previewHandler, collectChanges); } + /// + /// Executes the WriteNested operation. + /// + /// The updateAction value. public void WriteNested(Action> updateAction) { lock (_locker) @@ -130,6 +192,13 @@ public void WriteNested(Action> updateAction) } } + /// + /// Executes the DoUpdate operation. + /// + /// The updateAction value. + /// The previewHandler value. + /// The collectChanges value. + /// The result of the operation. private ChangeSet DoUpdate(Action> updateAction, Action>? previewHandler, bool collectChanges) { lock (_locker) diff --git a/src/DynamicData/Cache/Internal/RefCount.cs b/src/DynamicData/Cache/Internal/RefCount.cs index 3cad3f23b..23786b347 100644 --- a/src/DynamicData/Cache/Internal/RefCount.cs +++ b/src/DynamicData/Cache/Internal/RefCount.cs @@ -9,18 +9,40 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the RefCount class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. internal sealed class RefCount(IObservable> source) where TObject : notnull where TKey : notnull { + /// + /// The _locker field. + /// private readonly Lock _locker = new(); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// The _cache field. + /// private IObservableCache? _cache; + /// + /// The _refCount field. + /// private int _refCount; + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs b/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs index 3beb0c7f9..2ca548b1b 100644 --- a/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs +++ b/src/DynamicData/Cache/Internal/RemoveKeyEnumerator.cs @@ -9,23 +9,28 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif -/// Initializes a new instance of the class.Converts a to . +/// Initializes a new instance of the class.Converts a Change<TObject, TKey> to ChangeSet<TObject>. /// The change set with a key. /// /// An optional list, if provided it allows the refresh from a key based cache to find the index for the resulting list based refresh. /// If not provided a refresh will dropdown to a replace which may ultimately result in a remove+add change downstream. /// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class RemoveKeyEnumerator(IChangeSet source, IExtendedList? list = null) : IEnumerable> where TObject : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly IChangeSet _source = source ?? throw new ArgumentNullException(nameof(source)); /// /// Returns an enumerator that iterates through the collection. /// /// - /// A that can be used to iterate through the collection. + /// A IEnumerator<T> that can be used to iterate through the collection. /// public IEnumerator> GetEnumerator() { @@ -75,5 +80,9 @@ public IEnumerator> GetEnumerator() } } + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/Cache/Internal/RightJoin.cs b/src/DynamicData/Cache/Internal/RightJoin.cs index 621b65f50..257e43775 100644 --- a/src/DynamicData/Cache/Internal/RightJoin.cs +++ b/src/DynamicData/Cache/Internal/RightJoin.cs @@ -9,6 +9,18 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the RightJoin class. +/// +/// The type of the TLeft value. +/// The type of the TLeftKey value. +/// The type of the TRight value. +/// The type of the TRightKey value. +/// The type of the TDestination value. +/// The left value. +/// The right value. +/// The rightKeySelector value. +/// The resultSelector value. internal sealed class RightJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -16,14 +28,30 @@ internal sealed class RightJoin + /// The _left field. + ///
private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); + /// + /// The _resultSelector field. + /// private readonly Func, TRight, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + /// + /// The _right field. + /// private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); + /// + /// The _rightKeySelector field. + /// private readonly Func _rightKeySelector = rightKeySelector ?? throw new ArgumentNullException(nameof(rightKeySelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/RightJoinMany.cs b/src/DynamicData/Cache/Internal/RightJoinMany.cs index fdba67e77..0bdff2e97 100644 --- a/src/DynamicData/Cache/Internal/RightJoinMany.cs +++ b/src/DynamicData/Cache/Internal/RightJoinMany.cs @@ -9,6 +9,18 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the RightJoinMany class. +/// +/// The type of the TLeft value. +/// The type of the TLeftKey value. +/// The type of the TRight value. +/// The type of the TRightKey value. +/// The type of the TDestination value. +/// The left value. +/// The right value. +/// The rightKeySelector value. +/// The resultSelector value. internal sealed class RightJoinMany(IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -16,14 +28,30 @@ internal sealed class RightJoinMany + /// The _left field. + ///
private readonly IObservable> _left = left ?? throw new ArgumentNullException(nameof(left)); + /// + /// The _resultSelector field. + /// private readonly Func, IGrouping, TDestination> _resultSelector = resultSelector ?? throw new ArgumentNullException(nameof(resultSelector)); + /// + /// The _right field. + /// private readonly IObservable> _right = right ?? throw new ArgumentNullException(nameof(right)); + /// + /// The _rightKeySelector field. + /// private readonly Func _rightKeySelector = rightKeySelector ?? throw new ArgumentNullException(nameof(rightKeySelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() { var rightGrouped = _right.GroupWithImmutableState(_rightKeySelector); diff --git a/src/DynamicData/Cache/Internal/SizeExpirer.cs b/src/DynamicData/Cache/Internal/SizeExpirer.cs index 6d546dfa8..4a104a10b 100644 --- a/src/DynamicData/Cache/Internal/SizeExpirer.cs +++ b/src/DynamicData/Cache/Internal/SizeExpirer.cs @@ -9,14 +9,30 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the SizeExpirer class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class SizeExpirer where TObject : notnull where TKey : notnull { + /// + /// The _size field. + /// private readonly int _size; + /// + /// The _source field. + /// private readonly IObservable> _source; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The size value. public SizeExpirer(IObservable> source, int size) { if (size <= 0) @@ -28,6 +44,10 @@ public SizeExpirer(IObservable> source, int size) _size = size; } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/SizeLimiter.cs b/src/DynamicData/Cache/Internal/SizeLimiter.cs index 88eacde9d..a72935bc7 100644 --- a/src/DynamicData/Cache/Internal/SizeLimiter.cs +++ b/src/DynamicData/Cache/Internal/SizeLimiter.cs @@ -9,12 +9,26 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the SizeLimiter class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The size value. internal sealed class SizeLimiter(int size) where TObject : notnull where TKey : notnull { + /// + /// The _cache field. + /// private readonly ChangeAwareCache, TKey> _cache = new(); + /// + /// Executes the Change operation. + /// + /// The updates value. + /// The result of the operation. public IChangeSet Change(IChangeSet, TKey> updates) { _cache.Clone(updates); @@ -32,6 +46,11 @@ public IChangeSet Change(IChangeSet, return new ChangeSet(changed); } + /// + /// Executes the CloneAndReturnExpiredOnly operation. + /// + /// The updates value. + /// The result of the operation. public KeyValuePair[] CloneAndReturnExpiredOnly(IChangeSet, TKey> updates) { _cache.Clone(updates); diff --git a/src/DynamicData/Cache/Internal/Sort.cs b/src/DynamicData/Cache/Internal/Sort.cs index bc85d35e5..e52e84893 100644 --- a/src/DynamicData/Cache/Internal/Sort.cs +++ b/src/DynamicData/Cache/Internal/Sort.cs @@ -9,22 +9,54 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the Sort class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class Sort where TObject : notnull where TKey : notnull { + /// + /// The _comparer field. + /// private readonly IComparer? _comparer; + /// + /// The _comparerChangedObservable field. + /// private readonly IObservable>? _comparerChangedObservable; + /// + /// The _resetThreshold field. + /// private readonly int _resetThreshold; + /// + /// The _resorter field. + /// private readonly IObservable? _resorter; + /// + /// The _sortOptimisations field. + /// private readonly SortOptimisations _sortOptimisations; + /// + /// The _source field. + /// private readonly IObservable> _source; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The comparer value. + /// The sortOptimisations value. + /// The comparerChangedObservable value. + /// The resorter value. + /// The resetThreshold value. public Sort(IObservable> source, IComparer? comparer, SortOptimisations sortOptimisations = SortOptimisations.None, IObservable>? comparerChangedObservable = null, IObservable? resorter = null, int resetThreshold = -1) { if (comparer is null && comparerChangedObservable is null) @@ -40,6 +72,10 @@ public Sort(IObservable> source, IComparer? c _resetThreshold = resetThreshold; } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -61,17 +97,42 @@ public IObservable> Run() => Observable.Create result is not null).Select(x => x!).SubscribeSafe(observer), queue); }); - private sealed class Sorter(SortOptimisations optimisations, IComparer? comparer = null, int resetThreshold = -1) +/// +/// Provides members for the Sorter class. +/// +/// The optimisations value. +/// The comparer value. +/// The resetThreshold value. +private sealed class Sorter(SortOptimisations optimisations, IComparer? comparer = null, int resetThreshold = -1) { + /// + /// The _cache field. + /// private readonly ChangeAwareCache _cache = new(); + + /// + /// The _calculator field. + /// private IndexCalculator? _calculator; + /// + /// The _comparer field. + /// private KeyValueComparer _comparer = new(comparer); + /// + /// The _haveReceivedData field. + /// private bool _haveReceivedData; + /// + /// The _initialised field. + /// private bool _initialised; + /// + /// The _sorted field. + /// private IKeyValueCollection _sorted = new KeyValueCollection(); /// diff --git a/src/DynamicData/Cache/Internal/SortAndPage.cs b/src/DynamicData/Cache/Internal/SortAndPage.cs index 5f5258bc8..fd89676cf 100644 --- a/src/DynamicData/Cache/Internal/SortAndPage.cs +++ b/src/DynamicData/Cache/Internal/SortAndPage.cs @@ -16,17 +16,47 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the SortAndPage class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class SortAndPage where TObject : notnull where TKey : notnull { + /// + /// The _keyComparer field. + /// private static readonly KeyComparer _keyComparer = new(); + /// + /// The _source field. + /// private readonly IObservable> _source; + + /// + /// The _comparerChanged field. + /// private readonly IObservable> _comparerChanged; + + /// + /// The _pageRequests field. + /// private readonly IObservable _pageRequests; + + /// + /// The _options field. + /// private readonly SortAndPageOptions _options; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The comparer value. + /// The virtualRequests value. + /// The options value. public SortAndPage(IObservable> source, IComparer comparer, IObservable virtualRequests, @@ -35,6 +65,13 @@ public SortAndPage(IObservable> source, { } + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The comparerChanged value. + /// The virtualRequests value. + /// The options value. public SortAndPage(IObservable> source, IObservable> comparerChanged, IObservable virtualRequests, @@ -46,8 +83,15 @@ public SortAndPage(IObservable> source, _pageRequests = virtualRequests ?? throw new ArgumentNullException(nameof(virtualRequests)); } + /// + /// The Empty field. + /// private static readonly ChangeSet> Empty = new(0, PageContext.Empty); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable>> Run() => Observable.Create>>( observer => @@ -167,8 +211,16 @@ static int CalculatePages(IPageRequest request, int totalCount) return pages + 1; } }); - // Calculates any changes within the paged range. + + /// + /// Executes the CalculatePageChanges operation. + /// + /// The context value. + /// The currentItems value. + /// The previousItems value. + /// The changes value. + /// The result of the operation. private static ChangeSet> CalculatePageChanges(PageContext context, List> currentItems, List> previousItems, diff --git a/src/DynamicData/Cache/Internal/SortAndVirtualize.cs b/src/DynamicData/Cache/Internal/SortAndVirtualize.cs index a8572cb5b..fcbf138c3 100644 --- a/src/DynamicData/Cache/Internal/SortAndVirtualize.cs +++ b/src/DynamicData/Cache/Internal/SortAndVirtualize.cs @@ -16,17 +16,47 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the SortAndVirtualize class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class SortAndVirtualize where TObject : notnull where TKey : notnull { + /// + /// The _keyComparer field. + /// private static readonly KeyComparer _keyComparer = new(); + /// + /// The _source field. + /// private readonly IObservable> _source; + + /// + /// The _comparerChanged field. + /// private readonly IObservable> _comparerChanged; + + /// + /// The _virtualRequests field. + /// private readonly IObservable _virtualRequests; + + /// + /// The _options field. + /// private readonly SortAndVirtualizeOptions _options; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The comparer value. + /// The virtualRequests value. + /// The options value. public SortAndVirtualize(IObservable> source, IComparer comparer, IObservable virtualRequests, @@ -35,6 +65,13 @@ public SortAndVirtualize(IObservable> source, { } + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The comparerChanged value. + /// The virtualRequests value. + /// The options value. public SortAndVirtualize(IObservable> source, IObservable> comparerChanged, IObservable virtualRequests, @@ -46,8 +83,15 @@ public SortAndVirtualize(IObservable> source, _virtualRequests = virtualRequests ?? throw new ArgumentNullException(nameof(virtualRequests)); } + /// + /// The Empty field. + /// private static readonly ChangeSet> Empty = new(0, VirtualContext.Empty); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable>> Run() => Observable.Create>>( observer => @@ -145,8 +189,16 @@ ChangeSet> ApplyVirtualChanges(IChangeSet return virtualChanges; } }); - // Calculates any changes within the virtualized range. + + /// + /// Executes the CalculateVirtualChanges operation. + /// + /// The context value. + /// The currentItems value. + /// The previousItems value. + /// The changes value. + /// The result of the operation. private static ChangeSet> CalculateVirtualChanges(VirtualContext context, List> currentItems, List> previousItems, diff --git a/src/DynamicData/Cache/Internal/SortExtensions.cs b/src/DynamicData/Cache/Internal/SortExtensions.cs index 9941074c0..10c0c5a5e 100644 --- a/src/DynamicData/Cache/Internal/SortExtensions.cs +++ b/src/DynamicData/Cache/Internal/SortExtensions.cs @@ -9,8 +9,20 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the SortExtensions class. +/// internal static class SortExtensions { + /// + /// Executes the GetCurrentPosition operation. + /// + /// The type of the TItem value. + /// The source value. + /// The item value. + /// The comparer value. + /// The useBinarySearch value. + /// The result of the operation. public static int GetCurrentPosition(this IList source, TItem item, IComparer comparer, bool useBinarySearch = false) { var index = useBinarySearch ? source.BinarySearch(item, comparer) : source.IndexOf(item); @@ -23,6 +35,15 @@ public static int GetCurrentPosition(this IList source, TItem item return index; } + /// + /// Executes the GetInsertPosition operation. + /// + /// The type of the T value. + /// The source value. + /// The item value. + /// The comparer value. + /// The useBinarySearch value. + /// The result of the operation. public static int GetInsertPosition(this IList source, T item, IComparer comparer, bool useBinarySearch = false) { return useBinarySearch @@ -30,6 +51,14 @@ public static int GetInsertPosition(this IList source, T item, IComparer + /// Executes the GetInsertPositionBinary operation. + /// + /// The type of the TItem value. + /// The list value. + /// The t value. + /// The c value. + /// The result of the operation. public static int GetInsertPositionBinary(this IList list, TItem t, IComparer c) { var index = list.BinarySearch(t, c); @@ -55,6 +84,14 @@ public static int GetInsertPositionBinary(this IList list, TItem t return insertIndex; } + /// + /// Executes the GetInsertPositionLinear operation. + /// + /// The type of the TItem value. + /// The list value. + /// The t value. + /// The c value. + /// The result of the operation. public static int GetInsertPositionLinear(this IList list, TItem t, IComparer c) { for (var i = 0; i < list.Count; i++) @@ -68,6 +105,14 @@ public static int GetInsertPositionLinear(this IList list, TItem t return list.Count; } + /// + /// Executes the Move operation. + /// + /// The type of the TItem value. + /// The list value. + /// The original value. + /// The destination value. + /// The item value. public static void Move(this IList list, int original, int destination, TItem item) { // If the list supports the Move method, use it instead of removing and inserting. diff --git a/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs b/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs index d1c055ea5..1424b24ef 100644 --- a/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs +++ b/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs @@ -15,22 +15,47 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif - /* * Object which maintains a sorted list of key value pair and produces a change set. * * Used by virtualise and page. */ + +/// +/// Provides members for the SortedKeyValueApplicator class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class SortedKeyValueApplicator where TObject : notnull where TKey : notnull { + /// + /// The _cache field. + /// private readonly Cache _cache = new(); + + /// + /// The _target field. + /// private readonly List> _target; + + /// + /// The _options field. + /// private readonly SortAndBindOptions _options; + /// + /// The _comparer field. + /// private KeyValueComparer _comparer; + /// + /// Initializes a new instance of the class. + /// + /// The target value. + /// The comparer value. + /// The options value. public SortedKeyValueApplicator(List> target, KeyValueComparer comparer, SortAndBindOptions options) @@ -40,6 +65,10 @@ public SortedKeyValueApplicator(List> target, _comparer = comparer; } + /// + /// Executes the ChangeComparer operation. + /// + /// The comparer value. public void ChangeComparer(KeyValueComparer comparer) { _comparer = comparer; @@ -47,6 +76,10 @@ public void ChangeComparer(KeyValueComparer comparer) _target.Sort(comparer); } + /// + /// Executes the ProcessChanges operation. + /// + /// The changes value. public void ProcessChanges(IChangeSet changes) { _cache.Clone(changes); @@ -63,6 +96,9 @@ public void ProcessChanges(IChangeSet changes) } } + /// + /// Executes the Reset operation. + /// public void Reset() { var sorted = _cache.KeyValues.OrderBy(t => t, _comparer); @@ -70,6 +106,10 @@ public void Reset() _target.AddRange(sorted); } + /// + /// Executes the ApplyChanges operation. + /// + /// The changes value. private void ApplyChanges(IChangeSet changes) { // iterate through collection, find sorted position and apply changes @@ -132,7 +172,17 @@ private void ApplyChanges(IChangeSet changes) } } + /// + /// Executes the GetCurrentPosition operation. + /// + /// The item value. + /// The result of the operation. private int GetCurrentPosition(KeyValuePair item) => _target.GetCurrentPosition(item, _comparer, _options.UseBinarySearch); + /// + /// Executes the GetInsertPosition operation. + /// + /// The item value. + /// The result of the operation. private int GetInsertPosition(KeyValuePair item) => _target.GetInsertPosition(item, _comparer, _options.UseBinarySearch); } diff --git a/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs b/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs index cb236f8a6..7d8f4e080 100644 --- a/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs +++ b/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs @@ -9,17 +9,39 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the SpecifiedGrouper class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TGroupKey value. +/// The source value. +/// The groupSelector value. +/// The resultGroupSource value. internal sealed class SpecifiedGrouper(IObservable> source, Func groupSelector, IObservable> resultGroupSource) where TObject : notnull where TKey : notnull where TGroupKey : notnull { + /// + /// The _groupSelector field. + /// private readonly Func _groupSelector = groupSelector ?? throw new ArgumentNullException(nameof(groupSelector)); + /// + /// The _resultGroupSource field. + /// private readonly IObservable> _resultGroupSource = resultGroupSource ?? throw new ArgumentNullException(nameof(resultGroupSource)); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/StatusMonitor.cs b/src/DynamicData/Cache/Internal/StatusMonitor.cs index 2596712cf..19b9d5d26 100644 --- a/src/DynamicData/Cache/Internal/StatusMonitor.cs +++ b/src/DynamicData/Cache/Internal/StatusMonitor.cs @@ -9,8 +9,17 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the StatusMonitor class. +/// +/// The type of the T value. +/// The source value. internal sealed class StatusMonitor(IObservable source) { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable Run() => Observable.Create( observer => { diff --git a/src/DynamicData/Cache/Internal/SubscribeMany.cs b/src/DynamicData/Cache/Internal/SubscribeMany.cs index 024e6d267..60899da49 100644 --- a/src/DynamicData/Cache/Internal/SubscribeMany.cs +++ b/src/DynamicData/Cache/Internal/SubscribeMany.cs @@ -9,14 +9,30 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the SubscribeMany class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class SubscribeMany where TObject : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source; + /// + /// The _subscriptionFactory field. + /// private readonly Func _subscriptionFactory; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The subscriptionFactory value. public SubscribeMany(IObservable> source, Func subscriptionFactory) { ArgumentExceptionHelper.ThrowIfNull(subscriptionFactory); @@ -25,12 +41,21 @@ public SubscribeMany(IObservable> source, Func subscriptionFactory(t); } + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The subscriptionFactory value. public SubscribeMany(IObservable> source, Func subscriptionFactory) { _source = source ?? throw new ArgumentNullException(nameof(source)); _subscriptionFactory = subscriptionFactory ?? throw new ArgumentNullException(nameof(subscriptionFactory)); } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/Switch.cs b/src/DynamicData/Cache/Internal/Switch.cs index dff25c48f..c8581e940 100644 --- a/src/DynamicData/Cache/Internal/Switch.cs +++ b/src/DynamicData/Cache/Internal/Switch.cs @@ -9,12 +9,25 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the Switch class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The sources value. internal sealed class Switch(IObservable>> sources) where TObject : notnull where TKey : notnull { + /// + /// The _sources field. + /// private readonly IObservable>> _sources = sources ?? throw new ArgumentNullException(nameof(sources)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs index 9b880f013..5f336eeae 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -9,10 +9,24 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the ToObservableChangeSet class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal static class ToObservableChangeSet where TObject : notnull where TKey : notnull { + /// + /// Executes the Create operation. + /// + /// The source value. + /// The keySelector value. + /// The expireAfter value. + /// The limitSizeTo value. + /// The scheduler value. + /// The result of the operation. public static IObservable> Create( IObservable source, Func keySelector, @@ -37,6 +51,15 @@ public static IObservable> Create( .SubscribeSafe(downstreamObserver); }); + /// + /// Executes the Create operation. + /// + /// The source value. + /// The keySelector value. + /// The expireAfter value. + /// The limitSizeTo value. + /// The scheduler value. + /// The result of the operation. public static IObservable> Create( IObservable> source, Func keySelector, @@ -51,25 +74,91 @@ public static IObservable> Create( scheduler: scheduler, source: source)); - private sealed class Subscription +/// +/// Provides members for the Subscription class. +/// +private sealed class Subscription : IDisposable { + /// + /// The _downstreamItems field. + /// private readonly ChangeAwareCache _downstreamItems; + + /// + /// The _downstreamObserver field. + /// private readonly IObserver> _downstreamObserver; + + /// + /// The _evictionQueue field. + /// private readonly Queue _evictionQueue; + + /// + /// The _expirationQueue field. + /// private readonly List _expirationQueue; + + /// + /// The _expireAfter field. + /// private readonly Func? _expireAfter; + + /// + /// The _expireAtsByKey field. + /// private readonly Dictionary _expireAtsByKey; + + /// + /// The _keySelector field. + /// private readonly Func _keySelector; + + /// + /// The _limitSizeTo field. + /// private readonly int _limitSizeTo; + + /// + /// The _scheduler field. + /// private readonly IScheduler _scheduler; + + /// + /// The _sourceSubscription field. + /// private readonly IDisposable _sourceSubscription; + + /// + /// The _synchronizationGate field. + /// private readonly Lock _synchronizationGate; + /// + /// The _hasInitialized field. + /// private bool _hasInitialized; + + /// + /// The _hasSourceCompleted field. + /// private bool _hasSourceCompleted; + + /// + /// The _scheduledExpiration field. + /// private ScheduledExpiration? _scheduledExpiration; + /// + /// Initializes a new instance of the class. + /// + /// The downstreamObserver value. + /// The expireAfter value. + /// The keySelector value. + /// The limitSizeTo value. + /// The scheduler value. + /// The source value. public Subscription( IObserver> downstreamObserver, Func? expireAfter, @@ -103,12 +192,20 @@ public Subscription( } } + /// + /// Executes the Dispose operation. + /// public void Dispose() { _sourceSubscription.Dispose(); _scheduledExpiration?.Cancellation.Dispose(); } + /// + /// Executes the OnScheduledExpirationInvoked operation. + /// + /// The intendedExpiration value. + /// The result of the operation. private IDisposable OnScheduledExpirationInvoked(Expiration intendedExpiration) { try @@ -162,6 +259,10 @@ private IDisposable OnScheduledExpirationInvoked(Expiration intendedExpiration) return Disposable.Empty; } + /// + /// Executes the OnSourceNext operation. + /// + /// The upstreamItems value. private void OnSourceNext(IEnumerable upstreamItems) { try @@ -229,6 +330,9 @@ private void OnSourceNext(IEnumerable upstreamItems) } } + /// + /// Executes the OnSourceCompleted operation. + /// private void OnSourceCompleted() { lock (_synchronizationGate) @@ -238,13 +342,18 @@ private void OnSourceCompleted() TryPublishCompletion(); } } - // This method must NOT be invoked under the umbrella of _synchronizationGate, // as some IScheduler implementations perform locking internally, which can result in deadlocking if we invoke the scheduler within our own lock. // // Additionally, some IScheduler implementations can invoke actions synchronously, // so it's important that scheduler invocation is only performed AFTER downstream changes have been processed. // Otherwise, downstream notifications can end up published out-of-order. + + /// + /// Executes the FinishSchedulingExpiration operation. + /// + /// The unfinishedExpiration value. + /// The scheduler value. private void FinishSchedulingExpiration( ScheduledExpiration unfinishedExpiration, IScheduler scheduler) @@ -264,6 +373,9 @@ private void FinishSchedulingExpiration( return Disposable.Empty; }); + /// + /// Executes the TryPublishCompletion operation. + /// private void TryPublishCompletion() { // There needs to be no possibility of a new changeset being emitted before we can call the stream complete. @@ -271,6 +383,9 @@ private void TryPublishCompletion() _downstreamObserver.OnCompleted(); } + /// + /// Executes the TryPublishDownstreamChanges operation. + /// private void TryPublishDownstreamChanges() { var downstreamChanges = _downstreamItems.CaptureChanges(); @@ -282,6 +397,10 @@ private void TryPublishDownstreamChanges() } } + /// + /// Executes the TryBeginSchedulingExpiration operation. + /// + /// The result of the operation. private ScheduledExpiration? TryBeginSchedulingExpiration() { // If there's no expirations currently queued up, we don't need to schedule anything. @@ -307,20 +426,43 @@ private void TryPublishDownstreamChanges() } } - private readonly struct ScheduledExpiration +/// +/// Represents the ScheduledExpiration value. +/// +private readonly struct ScheduledExpiration { + /// + /// Gets or sets the Cancellation value. + /// public required SingleAssignmentDisposable Cancellation { get; init; } + /// + /// Gets or sets the Expiration value. + /// public required Expiration Expiration { get; init; } } - private readonly record struct Expiration +/// +/// Represents the Expiration record. +/// +private readonly record struct Expiration : IComparable { + /// + /// Gets or sets the ExpireAt value. + /// public required DateTimeOffset ExpireAt { get; init; } + /// + /// Gets or sets the Key value. + /// public required TKey Key { get; init; } + /// + /// Executes the CompareTo operation. + /// + /// The other value. + /// The result of the operation. public int CompareTo(Expiration other) => ExpireAt.CompareTo(other.ExpireAt); } diff --git a/src/DynamicData/Cache/Internal/ToObservableOptional.cs b/src/DynamicData/Cache/Internal/ToObservableOptional.cs index 7c405f839..e8d7078ad 100644 --- a/src/DynamicData/Cache/Internal/ToObservableOptional.cs +++ b/src/DynamicData/Cache/Internal/ToObservableOptional.cs @@ -9,14 +9,37 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the ToObservableOptional class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The key value. +/// The equalityComparer value. internal sealed class ToObservableOptional(IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull { + /// + /// The _equalityComparer field. + /// private readonly IEqualityComparer _equalityComparer = equalityComparer ?? EqualityComparer.Default; + + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + + /// + /// The _key field. + /// private readonly TKey _key = key; + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => { var lastValue = ReactiveUI.Primitives.Optional.None; @@ -27,6 +50,13 @@ internal sealed class ToObservableOptional(IObservable + /// Executes the EmitChanges operation. + ///
+ /// The changes value. + /// The observer value. + /// The lastValue value. + /// The result of the operation. private ReactiveUI.Primitives.Optional EmitChanges(IChangeSet changes, IObserver> observer, ReactiveUI.Primitives.Optional lastValue) { foreach (var change in changes.ToConcreteType()) diff --git a/src/DynamicData/Cache/Internal/Transform.cs b/src/DynamicData/Cache/Internal/Transform.cs index c80c87f6a..a7202804e 100644 --- a/src/DynamicData/Cache/Internal/Transform.cs +++ b/src/DynamicData/Cache/Internal/Transform.cs @@ -9,13 +9,31 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the Transform class. +/// +/// The type of the TDestination value. +/// The type of the TSource value. +/// The type of the TKey value. +/// The source value. +/// The transformFactory value. +/// The exceptionCallback value. +/// The transformOnRefresh value. internal sealed class Transform(IObservable> source, Func, TKey, TDestination> transformFactory, Action>? exceptionCallback = null, bool transformOnRefresh = false) where TDestination : notnull where TSource : notnull where TKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Defer(RunImpl); + /// + /// Executes the RunImpl operation. + /// + /// The result of the operation. private IObservable> RunImpl() => source.Scan( (ChangeAwareCache?)null, (cache, changes) => diff --git a/src/DynamicData/Cache/Internal/TransformAsync.cs b/src/DynamicData/Cache/Internal/TransformAsync.cs index a63a721a8..85a2af653 100644 --- a/src/DynamicData/Cache/Internal/TransformAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformAsync.cs @@ -9,6 +9,18 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the TransformAsync class. +/// +/// The type of the TDestination value. +/// The type of the TSource value. +/// The type of the TKey value. +/// The source value. +/// The transformFactory value. +/// The exceptionCallback value. +/// The forceTransform value. +/// The maximumConcurrency value. +/// The transformOnRefresh value. internal class TransformAsync( IObservable> source, Func, TKey, Task> transformFactory, @@ -20,6 +32,10 @@ internal class TransformAsync( where TSource : notnull where TKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => { @@ -41,6 +57,12 @@ public IObservable> Run() => return transformer.SubscribeSafe(observer); }); + /// + /// Executes the DoTransform operation. + /// + /// The cache value. + /// The shouldTransform value. + /// The result of the operation. private IObservable> DoTransform(ChangeAwareCache cache, Func shouldTransform) { var toTransform = cache.KeyValues.Where(kvp => shouldTransform(kvp.Value.Source, kvp.Key)).Select(kvp => @@ -52,6 +74,12 @@ private IObservable> DoTransform(ChangeAwareCache .Select(transformed => ProcessUpdates(cache, transformed)); } + /// + /// Executes the DoTransform operation. + /// + /// The cache value. + /// The changes value. + /// The result of the operation. private IObservable> DoTransform( ChangeAwareCache cache, IChangeSet changes) { @@ -61,6 +89,12 @@ private IObservable> DoTransform( .Select(transformed => ProcessUpdates(cache, transformed)); } + /// + /// Executes the ProcessUpdates operation. + /// + /// The cache value. + /// The transformedItems value. + /// The result of the operation. private ChangeSet ProcessUpdates(ChangeAwareCache cache, TransformResult[] transformedItems) { // check for errors and callback if a handler has been specified @@ -106,6 +140,11 @@ private ChangeSet ProcessUpdates(ChangeAwareCache(transformed); } + /// + /// Executes the Transform operation. + /// + /// The change value. + /// The result of the operation. private async Task Transform(Change change) { try @@ -131,15 +170,34 @@ private async Task Transform(Change change) } } - private readonly struct TransformedItemContainer(TSource source, TDestination destination) +/// +/// Represents the TransformedItemContainer value. +/// +/// The source value. +/// The destination value. +private readonly struct TransformedItemContainer(TSource source, TDestination destination) { + /// + /// Gets the Destination value. + /// public TDestination Destination { get; } = destination; + /// + /// Gets the Source value. + /// public TSource Source { get; } = source; } - private sealed class TransformResult +/// +/// Provides members for the TransformResult class. +/// +private sealed class TransformResult { + /// + /// Initializes a new instance of the class. + /// + /// The change value. + /// The container value. public TransformResult(in Change change, in TransformedItemContainer container) { Change = change; @@ -148,6 +206,10 @@ public TransformResult(in Change change, in TransformedItemContai Key = change.Key; } + /// + /// Initializes a new instance of the class. + /// + /// The change value. public TransformResult(in Change change) { Change = change; @@ -156,6 +218,11 @@ public TransformResult(in Change change) Key = change.Key; } + /// + /// Initializes a new instance of the class. + /// + /// The change value. + /// The error value. public TransformResult(in Change change, Exception error) { Change = change; @@ -164,14 +231,29 @@ public TransformResult(in Change change, Exception error) Key = change.Key; } + /// + /// Gets the Change value. + /// public Change Change { get; } + /// + /// Gets the Container value. + /// public ReactiveUI.Primitives.Optional Container { get; } + /// + /// Gets the Error value. + /// public Exception? Error { get; } + /// + /// Gets the Key value. + /// public TKey Key { get; } + /// + /// Gets the Success value. + /// public bool Success { get; } } } diff --git a/src/DynamicData/Cache/Internal/TransformImmutable.cs b/src/DynamicData/Cache/Internal/TransformImmutable.cs index d01c82666..38fe3c38c 100644 --- a/src/DynamicData/Cache/Internal/TransformImmutable.cs +++ b/src/DynamicData/Cache/Internal/TransformImmutable.cs @@ -9,14 +9,32 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the TransformImmutable class. +/// +/// The type of the TDestination value. +/// The type of the TSource value. +/// The type of the TKey value. internal sealed class TransformImmutable where TDestination : notnull where TSource : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source; + + /// + /// The _transformFactory field. + /// private readonly Func _transformFactory; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The transformFactory value. public TransformImmutable( IObservable> source, Func transformFactory) @@ -25,6 +43,10 @@ public TransformImmutable( _transformFactory = transformFactory; } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => _source .SubscribeSafe(Observer.Create>( diff --git a/src/DynamicData/Cache/Internal/TransformMany.cs b/src/DynamicData/Cache/Internal/TransformMany.cs index 2732ec87f..25e4b554c 100644 --- a/src/DynamicData/Cache/Internal/TransformMany.cs +++ b/src/DynamicData/Cache/Internal/TransformMany.cs @@ -1,235 +1,327 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. -#if REACTIVE_SHIM - -using DynamicData.Reactive.Binding; -#else - -using DynamicData.Binding; +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else + +using DynamicData.Binding; #endif -#if REACTIVE_SHIM - -namespace DynamicData.Reactive.Cache.Internal; -#else - -namespace DynamicData.Cache.Internal; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.Cache.Internal; +#else + +namespace DynamicData.Cache.Internal; #endif - -internal sealed class TransformMany(IObservable> source, Func> manySelector, Func keySelector, Func>>? childChanges = null) - where TDestination : notnull - where TDestinationKey : notnull - where TSource : notnull - where TSourceKey : notnull -{ - public TransformMany(IObservable> source, Func> manySelector, Func keySelector) - : this( - source, - manySelector, - keySelector, - t => Observable.Defer( - () => - { - var subsequentChanges = manySelector(t).ToObservableChangeSet(keySelector); - - if (manySelector(t).Count > 0) - { - return subsequentChanges; - } - - return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); - })) - { - } - - public TransformMany(IObservable> source, Func> manySelector, Func keySelector) - : this( - source, - manySelector, - keySelector, - t => Observable.Defer( - () => - { - var subsequentChanges = manySelector(t).ToObservableChangeSet(keySelector); - - if (manySelector(t).Count > 0) - { - return subsequentChanges; - } - - return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); - })) - { - } - - public TransformMany(IObservable> source, Func> manySelector, Func keySelector) - : this( - source, - x => manySelector(x).Items, - keySelector, - t => Observable.Defer( - () => - { - var subsequentChanges = Observable.Create>(o => manySelector(t).Connect().Subscribe(o)); - - if (manySelector(t).Count > 0) - { - return subsequentChanges; - } - - return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); - })) - { - } - - public IObservable> Run() => childChanges is null ? Create() : CreateWithChangeSet(); - - private IObservable> Create() => source.Transform( - (t, _) => - { - var destination = manySelector(t).Select(m => new DestinationContainer(m, keySelector(m))).ToArray(); - return new ManyContainer(() => destination); - }, - true).Select(changes => new ChangeSet(new DestinationEnumerator(changes))); - - private IObservable> CreateWithChangeSet() - { - if (childChanges is null) - { - throw new InvalidOperationException("The childChanges is null and should not be."); - } - - return Observable.Create>( - observer => - { - var result = new ChangeAwareCache(); - - var transformed = source.Transform( - (t, _) => - { - // Only skip initial for first time Adds where there is initial data records - var locker = InternalEx.NewLock(); - var changes = childChanges(t).Synchronize(locker).Skip(1); - return new ManyContainer( - () => - { - var collection = manySelector(t); - lock (locker) - { - return collection.Select(m => new DestinationContainer(m, keySelector(m))).ToArray(); - } - }, - changes); - }).Publish(); - - var queue = new SharedDeliveryQueue(); - var initial = transformed.SynchronizeSafe(queue).Select(changes => new ChangeSet(new DestinationEnumerator(changes))); - - var subsequent = transformed.MergeMany(x => x.Changes).SynchronizeSafe(queue); - - var allChanges = initial.Merge(subsequent).Select( - changes => - { - result.Clone(changes); - return result.CaptureChanges(); - }); - - return new CompositeDisposable(allChanges.SubscribeSafe(observer), transformed.Connect(), queue); - }); - } - - private sealed class DestinationContainer(TDestination item, TDestinationKey key) - { - public static IEqualityComparer KeyComparer { get; } = new KeyEqualityComparer(); - - public TDestination Item { get; } = item; - - public TDestinationKey Key { get; } = key; - - private sealed class KeyEqualityComparer : IEqualityComparer - { - public bool Equals(DestinationContainer? x, DestinationContainer? y) - { - if (x is null && y is null) - { - return true; - } - - if (x is null || y is null) - { - return false; - } - - return EqualityComparer.Default.Equals(x.Key, y.Key); - } - - public int GetHashCode(DestinationContainer obj) => EqualityComparer.Default.GetHashCode(obj.Key); - } - } - - private sealed class DestinationEnumerator(IChangeSet changes) : IEnumerable> - { - public IEnumerator> GetEnumerator() - { - foreach (var change in changes.ToConcreteType()) - { - switch (change.Reason) - { - case ChangeReason.Add: - case ChangeReason.Remove: - case ChangeReason.Refresh: - { - foreach (var destination in change.Current.Destination) - { - yield return new Change(change.Reason, destination.Key, destination.Item); - } - } - - break; - case ChangeReason.Update: - { - var previousItems = change.Previous.Value.Destination.AsArray(); - var currentItems = change.Current.Destination.AsArray(); - - var removes = previousItems.Except(currentItems, DestinationContainer.KeyComparer); - var adds = currentItems.Except(previousItems, DestinationContainer.KeyComparer); - var updates = currentItems.Intersect(previousItems, DestinationContainer.KeyComparer); - - foreach (var destination in removes) - { - yield return new Change(ChangeReason.Remove, destination.Key, destination.Item); - } - - foreach (var destination in adds) - { - yield return new Change(ChangeReason.Add, destination.Key, destination.Item); - } - - foreach (var destination in updates) - { - var current = currentItems.First(d => d.Key.Equals(destination.Key)); - var previous = previousItems.First(d => d.Key.Equals(destination.Key)); - - // Do not update is items are the same reference - if (!ReferenceEquals(current.Item, previous.Item)) - { - yield return new Change(ChangeReason.Update, destination.Key, current.Item, previous.Item); - } - } - } - - break; - } - } - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - } - - private sealed class ManyContainer(Func> initial, IObservable>? changes = null) - { - public IObservable> Changes { get; } = changes ?? Observable.Empty>(); - - public IEnumerable Destination => initial(); - } -} + +/// +/// Provides members for the TransformMany class. +/// +/// The type of the TDestination value. +/// The type of the TDestinationKey value. +/// The type of the TSource value. +/// The type of the TSourceKey value. +/// The source value. +/// The manySelector value. +/// The keySelector value. +/// The childChanges value. +internal sealed class TransformMany(IObservable> source, Func> manySelector, Func keySelector, Func>>? childChanges = null) + where TDestination : notnull + where TDestinationKey : notnull + where TSource : notnull + where TSourceKey : notnull +{ + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The manySelector value. + /// The keySelector value. + public TransformMany(IObservable> source, Func> manySelector, Func keySelector) + : this( + source, + manySelector, + keySelector, + t => Observable.Defer( + () => + { + var subsequentChanges = manySelector(t).ToObservableChangeSet(keySelector); + + if (manySelector(t).Count > 0) + { + return subsequentChanges; + } + + return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); + })) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The manySelector value. + /// The keySelector value. + public TransformMany(IObservable> source, Func> manySelector, Func keySelector) + : this( + source, + manySelector, + keySelector, + t => Observable.Defer( + () => + { + var subsequentChanges = manySelector(t).ToObservableChangeSet(keySelector); + + if (manySelector(t).Count > 0) + { + return subsequentChanges; + } + + return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); + })) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The manySelector value. + /// The keySelector value. + public TransformMany(IObservable> source, Func> manySelector, Func keySelector) + : this( + source, + x => manySelector(x).Items, + keySelector, + t => Observable.Defer( + () => + { + var subsequentChanges = Observable.Create>(o => manySelector(t).Connect().Subscribe(o)); + + if (manySelector(t).Count > 0) + { + return subsequentChanges; + } + + return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); + })) + { + } + + /// + /// Executes the Run operation. + /// + /// The result of the operation. + public IObservable> Run() => childChanges is null ? Create() : CreateWithChangeSet(); + + /// + /// Executes the Create operation. + /// + /// The result of the operation. + private IObservable> Create() => source.Transform( + (t, _) => + { + var destination = manySelector(t).Select(m => new DestinationContainer(m, keySelector(m))).ToArray(); + return new ManyContainer(() => destination); + }, + true).Select(changes => new ChangeSet(new DestinationEnumerator(changes))); + + /// + /// Executes the CreateWithChangeSet operation. + /// + /// The result of the operation. + private IObservable> CreateWithChangeSet() + { + if (childChanges is null) + { + throw new InvalidOperationException("The childChanges is null and should not be."); + } + + return Observable.Create>( + observer => + { + var result = new ChangeAwareCache(); + + var transformed = source.Transform( + (t, _) => + { + // Only skip initial for first time Adds where there is initial data records + var locker = InternalEx.NewLock(); + var changes = childChanges(t).Synchronize(locker).Skip(1); + return new ManyContainer( + () => + { + var collection = manySelector(t); + lock (locker) + { + return collection.Select(m => new DestinationContainer(m, keySelector(m))).ToArray(); + } + }, + changes); + }).Publish(); + + var queue = new SharedDeliveryQueue(); + var initial = transformed.SynchronizeSafe(queue).Select(changes => new ChangeSet(new DestinationEnumerator(changes))); + + var subsequent = transformed.MergeMany(x => x.Changes).SynchronizeSafe(queue); + + var allChanges = initial.Merge(subsequent).Select( + changes => + { + result.Clone(changes); + return result.CaptureChanges(); + }); + + return new CompositeDisposable(allChanges.SubscribeSafe(observer), transformed.Connect(), queue); + }); + } + +/// +/// Provides members for the DestinationContainer class. +/// +/// The item value. +/// The key value. +private sealed class DestinationContainer(TDestination item, TDestinationKey key) + { + /// + /// Gets the KeyComparer value. + /// + public static IEqualityComparer KeyComparer { get; } = new KeyEqualityComparer(); + + /// + /// Gets the Item value. + /// + public TDestination Item { get; } = item; + + /// + /// Gets the Key value. + /// + public TDestinationKey Key { get; } = key; + +/// +/// Provides members for the KeyEqualityComparer class. +/// +private sealed class KeyEqualityComparer : IEqualityComparer + { + /// + /// Executes the Equals operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. + public bool Equals(DestinationContainer? x, DestinationContainer? y) + { + if (x is null && y is null) + { + return true; + } + + if (x is null || y is null) + { + return false; + } + + return EqualityComparer.Default.Equals(x.Key, y.Key); + } + + /// + /// Executes the GetHashCode operation. + /// + /// The obj value. + /// The result of the operation. + public int GetHashCode(DestinationContainer obj) => EqualityComparer.Default.GetHashCode(obj.Key); + } + } + +/// +/// Provides members for the DestinationEnumerator class. +/// +/// The changes value. +private sealed class DestinationEnumerator(IChangeSet changes) : IEnumerable> + { + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. + public IEnumerator> GetEnumerator() + { + foreach (var change in changes.ToConcreteType()) + { + switch (change.Reason) + { + case ChangeReason.Add: + case ChangeReason.Remove: + case ChangeReason.Refresh: + { + foreach (var destination in change.Current.Destination) + { + yield return new Change(change.Reason, destination.Key, destination.Item); + } + } + + break; + case ChangeReason.Update: + { + var previousItems = change.Previous.Value.Destination.AsArray(); + var currentItems = change.Current.Destination.AsArray(); + + var removes = previousItems.Except(currentItems, DestinationContainer.KeyComparer); + var adds = currentItems.Except(previousItems, DestinationContainer.KeyComparer); + var updates = currentItems.Intersect(previousItems, DestinationContainer.KeyComparer); + + foreach (var destination in removes) + { + yield return new Change(ChangeReason.Remove, destination.Key, destination.Item); + } + + foreach (var destination in adds) + { + yield return new Change(ChangeReason.Add, destination.Key, destination.Item); + } + + foreach (var destination in updates) + { + var current = currentItems.First(d => d.Key.Equals(destination.Key)); + var previous = previousItems.First(d => d.Key.Equals(destination.Key)); + + // Do not update is items are the same reference + if (!ReferenceEquals(current.Item, previous.Item)) + { + yield return new Change(ChangeReason.Update, destination.Key, current.Item, previous.Item); + } + } + } + + break; + } + } + } + + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + } + +/// +/// Provides members for the ManyContainer class. +/// +/// The initial value. +/// The changes value. +private sealed class ManyContainer(Func> initial, IObservable>? changes = null) + { + /// + /// Gets the Changes value. + /// + public IObservable> Changes { get; } = changes ?? Observable.Empty>(); + + /// + /// Gets the Destination value. + /// + public IEnumerable Destination => initial(); + } +} diff --git a/src/DynamicData/Cache/Internal/TransformManyAsync.cs b/src/DynamicData/Cache/Internal/TransformManyAsync.cs index b7ce4e292..eafc2504c 100644 --- a/src/DynamicData/Cache/Internal/TransformManyAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformManyAsync.cs @@ -9,21 +9,56 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the TransformManyAsync class. +/// +/// The type of the TSource value. +/// The type of the TKey value. +/// The type of the TDestination value. +/// The type of the TDestinationKey value. +/// The source value. +/// The transformer value. +/// The equalityComparer value. +/// The comparer value. +/// The errorHandler value. internal sealed class TransformManyAsync(IObservable> source, Func>>> transformer, IEqualityComparer? equalityComparer, IComparer? comparer, Action>? errorHandler = null) where TSource : notnull where TKey : notnull where TDestination : notnull where TDestinationKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => new Subscription(source, transformer, observer, equalityComparer, comparer, errorHandler)); - // Maintains state for a single subscription - private sealed class Subscription : CacheParentSubscription, TKey, IChangeSet, IChangeSet> + +/// +/// Provides members for the Subscription class. +/// +private sealed class Subscription : CacheParentSubscription, TKey, IChangeSet, IChangeSet> { + /// + /// The _cache field. + /// private readonly Cache, TKey> _cache = new(); + + /// + /// The _changeSetMergeTracker field. + /// private readonly ChangeSetMergeTracker _changeSetMergeTracker; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The transform value. + /// The observer value. + /// The equalityComparer value. + /// The comparer value. + /// The errorHandler value. public Subscription(IObservable> source, Func>>> transform, IObserver> observer, IEqualityComparer? equalityComparer, IComparer? comparer, Action>? errorHandler = null) : base(observer) { @@ -59,6 +94,10 @@ ChangeSetCache SafeTransformer(TSource obj, TKey } } + /// + /// Executes the ParentOnNext operation. + /// + /// The changes value. protected override void ParentOnNext(IChangeSet, TKey> changes) { // Process all the changes at once to preserve the changeset order @@ -87,9 +126,18 @@ protected override void ParentOnNext(IChangeSet + /// Executes the ChildOnNext operation. + ///
+ /// The child value. + /// The parentKey value. protected override void ChildOnNext(IChangeSet child, TKey parentKey) => _changeSetMergeTracker.ProcessChangeSet(child); + /// + /// Executes the EmitChanges operation. + /// + /// The observer value. protected override void EmitChanges(IObserver> observer) => _changeSetMergeTracker.EmitChanges(observer); } diff --git a/src/DynamicData/Cache/Internal/TransformOnObservable.cs b/src/DynamicData/Cache/Internal/TransformOnObservable.cs index c1feaad96..210104e31 100644 --- a/src/DynamicData/Cache/Internal/TransformOnObservable.cs +++ b/src/DynamicData/Cache/Internal/TransformOnObservable.cs @@ -9,21 +9,55 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the TransformOnObservable class. +/// +/// The type of the TSource value. +/// The type of the TKey value. +/// The type of the TDestination value. +/// The source value. +/// The transform value. +/// The transformOnRefresh value. internal sealed class TransformOnObservable(IObservable> source, Func> transform, bool transformOnRefresh = false) where TSource : notnull where TKey : notnull where TDestination : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => new Subscription(source, transform, observer, transformOnRefresh)); - // Maintains state for a single subscription - private sealed class Subscription : CacheParentSubscription> + +/// +/// Provides members for the Subscription class. +/// +private sealed class Subscription : CacheParentSubscription> { + /// + /// The _cache field. + /// private readonly ChangeAwareCache _cache = new(); + + /// + /// The _transform field. + /// private readonly Func> _transform; + + /// + /// The _transformOnRefresh field. + /// private readonly bool _transformOnRefresh; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The transform value. + /// The observer value. + /// The transformOnRefresh value. public Subscription(IObservable> source, Func> transform, IObserver> observer, bool transformOnRefresh) : base(observer) { @@ -32,6 +66,10 @@ public Subscription(IObservable> source, Func + /// Executes the ParentOnNext operation. + ///
+ /// The changes value. protected override void ParentOnNext(IChangeSet changes) { // Process all the changes at once to preserve the changeset order @@ -66,9 +104,18 @@ protected override void ParentOnNext(IChangeSet changes) } } + /// + /// Executes the ChildOnNext operation. + /// + /// The child value. + /// The parentKey value. protected override void ChildOnNext(TDestination child, TKey parentKey) => _cache.AddOrUpdate(child, parentKey); + /// + /// Executes the EmitChanges operation. + /// + /// The observer value. protected override void EmitChanges(IObserver> observer) { var changes = _cache.CaptureChanges(); @@ -78,6 +125,11 @@ protected override void EmitChanges(IObserver> ob } } + /// + /// Executes the AddTransformSubscription operation. + /// + /// The obj value. + /// The key value. private void AddTransformSubscription(TSource obj, TKey key) => AddChildSubscription(MakeChildObservable(_transform(obj, key).DistinctUntilChanged()), key); } diff --git a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs index 2a99b5dac..e056fcf75 100644 --- a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs +++ b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs @@ -9,11 +9,25 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the TransformWithForcedTransform class. +/// +/// The type of the TDestination value. +/// The type of the TSource value. +/// The type of the TKey value. +/// The source value. +/// The transformFactory value. +/// The forceTransform value. +/// The exceptionCallback value. internal sealed class TransformWithForcedTransform(IObservable> source, Func, TKey, TDestination> transformFactory, IObservable> forceTransform, Action>? exceptionCallback = null) where TDestination : notnull where TSource : notnull where TKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -35,6 +49,12 @@ public IObservable> Run() => Observable.Create + /// Executes the CaptureChanges operation. + ///
+ /// The cache value. + /// The shouldTransform value. + /// The result of the operation. private static IEnumerable> CaptureChanges(Cache cache, Func shouldTransform) => cache.KeyValues.Where(kvp => shouldTransform(kvp.Value, kvp.Key)).Select(kvp => new Change(ChangeReason.Refresh, kvp.Key, kvp.Value)); } diff --git a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs index ce0b643e5..217b38d8f 100644 --- a/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/Internal/TransformWithInlineUpdate.cs @@ -9,6 +9,17 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the TransformWithInlineUpdate class. +/// +/// The type of the TDestination value. +/// The type of the TSource value. +/// The type of the TKey value. +/// The source value. +/// The transformFactory value. +/// The updateAction value. +/// The exceptionCallback value. +/// The transformOnRefresh value. internal sealed class TransformWithInlineUpdate(IObservable> source, Func transformFactory, Action updateAction, @@ -18,8 +29,16 @@ internal sealed class TransformWithInlineUpdate(IOb where TSource : notnull where TKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Defer(RunImpl); + /// + /// Executes the RunImpl operation. + /// + /// The result of the operation. private IObservable> RunImpl() => source.Scan( (ChangeAwareCache?)null, (cache, changes) => @@ -65,6 +84,11 @@ private IObservable> RunImpl() => source.Scan( .Where(x => x is not null) .Select(cache => cache!.CaptureChanges()); + /// + /// Executes the Transform operation. + /// + /// The cache value. + /// The change value. private void Transform(ChangeAwareCache cache, in Change change) { TDestination transformed; @@ -87,6 +111,11 @@ private void Transform(ChangeAwareCache cache, in Change + /// Executes the InlineUpdate operation. + ///
+ /// The cache value. + /// The change value. private void InlineUpdate(ChangeAwareCache cache, Change change) { var previous = cache.Lookup(change.Key) diff --git a/src/DynamicData/Cache/Internal/TreeBuilder.cs b/src/DynamicData/Cache/Internal/TreeBuilder.cs index 3e911e01a..9ab405db2 100644 --- a/src/DynamicData/Cache/Internal/TreeBuilder.cs +++ b/src/DynamicData/Cache/Internal/TreeBuilder.cs @@ -9,18 +9,42 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the TreeBuilder class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The pivotOn value. +/// The predicateChanged value. internal sealed class TreeBuilder(IObservable> source, Func pivotOn, IObservable, bool>>? predicateChanged) where TObject : class where TKey : notnull { + /// + /// The _pivotOn field. + /// private readonly Func _pivotOn = pivotOn ?? throw new ArgumentNullException(nameof(pivotOn)); + /// + /// The _predicateChanged field. + /// private readonly IObservable, bool>> _predicateChanged = predicateChanged ?? Observable.Return(DefaultPredicate); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Gets the DefaultPredicate value. + /// private static Func, bool> DefaultPredicate => node => node.IsRoot; + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable, TKey>> Run() => Observable.Create, TKey>>( observer => { diff --git a/src/DynamicData/Cache/Internal/TrueFor.cs b/src/DynamicData/Cache/Internal/TrueFor.cs index 565c7f5db..d3447619a 100644 --- a/src/DynamicData/Cache/Internal/TrueFor.cs +++ b/src/DynamicData/Cache/Internal/TrueFor.cs @@ -9,17 +9,39 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the TrueFor class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The type of the TValue value. +/// The source value. +/// The observableSelector value. +/// The collectionMatcher value. internal sealed class TrueFor(IObservable> source, Func> observableSelector, Func>, bool> collectionMatcher) where TObject : notnull where TKey : notnull where TValue : notnull { + /// + /// The _collectionMatcher field. + /// private readonly Func>, bool> _collectionMatcher = collectionMatcher ?? throw new ArgumentNullException(nameof(collectionMatcher)); + /// + /// The _observableSelector field. + /// private readonly Func> _observableSelector = observableSelector ?? throw new ArgumentNullException(nameof(observableSelector)); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable Run() => Observable.Create(observer => { diff --git a/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs b/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs index 6bcb16218..a5d3d6ef7 100644 --- a/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs +++ b/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs @@ -9,10 +9,20 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the UniquenessEnforcer class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. internal sealed class UniquenessEnforcer(IObservable> source) where TObject : notnull where TKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => /* For refresh, we need to check whether there was a previous add or update in the batch. If not use refresh, diff --git a/src/DynamicData/Cache/Internal/Virtualise.cs b/src/DynamicData/Cache/Internal/Virtualise.cs index 9c2a4b157..1d750b5df 100644 --- a/src/DynamicData/Cache/Internal/Virtualise.cs +++ b/src/DynamicData/Cache/Internal/Virtualise.cs @@ -9,14 +9,31 @@ namespace DynamicData.Reactive.Cache.Internal; namespace DynamicData.Cache.Internal; #endif +/// +/// Provides members for the Virtualise class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The virtualRequests value. internal sealed class Virtualise(IObservable> source, IObservable virtualRequests) where TObject : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// The _virtualRequests field. + /// private readonly IObservable _virtualRequests = virtualRequests ?? throw new ArgumentNullException(nameof(virtualRequests)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -28,16 +45,37 @@ public IObservable> Run() => Observable.Create< return new CompositeDisposable(request.Merge(dataChange).Where(updates => updates is not null).SubscribeSafe(observer), queue); }); - private sealed class Virtualiser(VirtualRequest? request = null) +/// +/// Provides members for the Virtualiser class. +/// +/// The request value. +private sealed class Virtualiser(VirtualRequest? request = null) { + /// + /// The _all field. + /// private IKeyValueCollection _all = new KeyValueCollection(); + /// + /// The _current field. + /// private KeyValueCollection _current = new(); + /// + /// The _isLoaded field. + /// private bool _isLoaded; + /// + /// The _parameters field. + /// private IVirtualRequest _parameters = request ?? new VirtualRequest(); + /// + /// Executes the Update operation. + /// + /// The updates value. + /// The result of the operation. public IVirtualChangeSet? Update(ISortedChangeSet updates) { _isLoaded = true; @@ -45,6 +83,11 @@ private sealed class Virtualiser(VirtualRequest? request = null) return Virtualise(updates); } + /// + /// Executes the Virtualise operation. + /// + /// The parameters value. + /// The result of the operation. public IVirtualChangeSet? Virtualise(IVirtualRequest? parameters) { if (parameters is null || parameters.StartIndex < 0 || parameters.Size < 1) @@ -61,6 +104,11 @@ private sealed class Virtualiser(VirtualRequest? request = null) return Virtualise(); } + /// + /// Executes the Virtualise operation. + /// + /// The updates value. + /// The result of the operation. private VirtualChangeSet? Virtualise(ISortedChangeSet? updates = null) { if (!_isLoaded) diff --git a/src/DynamicData/Cache/Node.cs b/src/DynamicData/Cache/Node.cs index 14ae79fa2..5d53c30d8 100644 --- a/src/DynamicData/Cache/Node.cs +++ b/src/DynamicData/Cache/Node.cs @@ -18,11 +18,20 @@ public class Node : IDisposable, IEquatable> where TObject : class where TKey : notnull { + /// + /// The _children field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly SourceCache, TKey> _children = new(n => n.Key); + /// + /// The _cleanUp field. + /// private readonly CompositeDisposable _cleanUp; + /// + /// The _isDisposed field. + /// private bool _isDisposed; /// @@ -181,6 +190,10 @@ public override string ToString() return $"{Item}{count}"; } + /// + /// Executes the Update operation. + /// + /// The updateAction value. internal void Update(Action, TKey>> updateAction) => _children.Edit(updateAction); /// diff --git a/src/DynamicData/Cache/ObservableCache.cs b/src/DynamicData/Cache/ObservableCache.cs index 512526843..03d584b9b 100644 --- a/src/DynamicData/Cache/ObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCache.cs @@ -21,36 +21,78 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the ObservableCache class. +/// +/// The type of the TObject value. +/// The type of the TKey value. [DebuggerDisplay("ObservableCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] internal sealed class ObservableCache : IObservableCache, INotifyCollectionChangedSuspender where TObject : notnull where TKey : notnull { + /// + /// The _changes field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly Signal> _changes = new(); + /// + /// The _changesPreview field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly Signal> _changesPreview = new(); + /// + /// The _cleanUp field. + /// private readonly IDisposable _cleanUp; + /// + /// The _countChanged field. + /// private readonly Lazy> _countChanged = new(() => new Signal()); + /// + /// The _suspensionTracker field. + /// private readonly Lazy _suspensionTracker; + /// + /// The _locker field. + /// private readonly Lock _locker = new(); + /// + /// The _readerWriter field. + /// private readonly ReaderWriter _readerWriter; + /// + /// The _notifications field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Terminated via NotifyCompleted in _cleanUp")] private readonly DeliveryQueue _notifications; + /// + /// The _editLevel field. + /// private int _editLevel; // The level of recursion in editing. + /// + /// The _currentVersion field. + /// private long _currentVersion; // Monotonic counter incremented under lock for each enqueued change notification. + /// + /// The _currentDeliveryVersion field. + /// private long _currentDeliveryVersion; // Version of the item currently being delivered. Set before _changes.OnNext. + /// + /// Initializes a new instance of the class. + /// + /// The source value. public ObservableCache(IObservable> source) { _readerWriter = new ReaderWriter(); @@ -81,6 +123,10 @@ public ObservableCache(IObservable> source) }); } + /// + /// Initializes a new instance of the class. + /// + /// The keySelector value. public ObservableCache(Func? keySelector = null) { _readerWriter = new ReaderWriter(keySelector); @@ -90,8 +136,14 @@ public ObservableCache(Func? keySelector = null) _cleanUp = Disposable.Create(NotifyCompleted); } + /// + /// Gets the Count value. + /// public int Count => _readerWriter.Count; + /// + /// Gets the CountChanged value. + /// public IObservable CountChanged => Observable.Create( observer => @@ -107,12 +159,27 @@ public ObservableCache(Func? keySelector = null) return source.SubscribeSafe(observer); }); + /// + /// Gets the Items value. + /// public IReadOnlyList Items => _readerWriter.Items; + /// + /// Gets the Keys value. + /// public IReadOnlyList Keys => _readerWriter.Keys; + /// + /// Gets the KeyValues value. + /// public IReadOnlyDictionary KeyValues => _readerWriter.KeyValues; + /// + /// Executes the Connect operation. + /// + /// The predicate value. + /// The suppressEmptyChangeSets value. + /// The result of the operation. public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => Observable.Create>(observer => { @@ -131,12 +198,30 @@ public IObservable> Connect(Func? predi } }); + /// + /// Executes the Dispose operation. + /// public void Dispose() => _cleanUp.Dispose(); + /// + /// Executes the Lookup operation. + /// + /// The key value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TKey key) => _readerWriter.Lookup(key); + /// + /// Executes the Preview operation. + /// + /// The predicate value. + /// The result of the operation. public IObservable> Preview(Func? predicate = null) => predicate is null ? _changesPreview : _changesPreview.Filter(predicate); + /// + /// Executes the Watch operation. + /// + /// The key value. + /// The result of the operation. public IObservable> Watch(TKey key) => Observable.Create>(observer => { @@ -155,6 +240,10 @@ public IObservable> Watch(TKey key) => } }); + /// + /// Executes the SuspendCount operation. + /// + /// The result of the operation. public IDisposable SuspendCount() { lock (_locker) @@ -164,6 +253,10 @@ public IDisposable SuspendCount() } } + /// + /// Executes the SuspendNotifications operation. + /// + /// The result of the operation. public IDisposable SuspendNotifications() { lock (_locker) @@ -173,8 +266,17 @@ public IDisposable SuspendNotifications() } } + /// + /// Executes the GetInitialUpdates operation. + /// + /// The filter value. + /// The result of the operation. internal ChangeSet GetInitialUpdates(Func? filter = null) => _readerWriter.GetInitialUpdates(filter); + /// + /// Executes the UpdateFromIntermediate operation. + /// + /// The updateAction value. internal void UpdateFromIntermediate(Action> updateAction) { ArgumentExceptionHelper.ThrowIfNull(updateAction); @@ -202,6 +304,10 @@ internal void UpdateFromIntermediate(Action> update } } + /// + /// Executes the UpdateFromSource operation. + /// + /// The updateAction value. internal void UpdateFromSource(Action> updateAction) { ArgumentExceptionHelper.ThrowIfNull(updateAction); @@ -229,6 +335,12 @@ internal void UpdateFromSource(Action> updateActio } } + /// + /// Executes the CreateConnectObservable operation. + /// + /// The predicate value. + /// The suppressEmptyChangeSets value. + /// The result of the operation. private IObservable> CreateConnectObservable(Func? predicate, bool suppressEmptyChangeSets) => Observable.Create>( observer => @@ -259,6 +371,11 @@ private IObservable> CreateConnectObservable(Func + /// Executes the CreateWatchObservable operation. + /// + /// The key value. + /// The result of the operation. private IObservable> CreateWatchObservable(TKey key) => Observable.Create>( observer => @@ -298,6 +415,7 @@ private IObservable> CreateWatchObservable(TKey key) => /// called by ReaderWriter during a write, between two data swaps, so it MUST /// fire under the lock with the pre-write state visible to subscribers. /// + /// The changes value. private void InvokePreview(ChangeSet changes) { if (changes.Count != 0 && !_notifications.IsTerminated) @@ -306,12 +424,19 @@ private void InvokePreview(ChangeSet changes) } } + /// + /// Executes the NotifyCompleted operation. + /// private void NotifyCompleted() { using var notifications = _notifications.AcquireLock(); notifications.EnqueueCompleted(); } + /// + /// Executes the NotifyError operation. + /// + /// The ex value. private void NotifyError(Exception ex) { using var notifications = _notifications.AcquireLock(); @@ -321,7 +446,7 @@ private void NotifyError(Exception ex) /// /// Delivers a single notification to subscribers. This method is the delivery /// callback for and must never be called directly. - /// It is invoked by the after releasing the + /// It is invoked by the DeliveryQueue<TItem> after releasing the /// lock, which guarantees that no lock is held when subscriber code runs. The /// queue's single-deliverer token ensures this method is never called concurrently, /// preserving the Rx serialization contract across all subjects. @@ -339,6 +464,9 @@ private void ResumeCount() } } + /// + /// Executes the ResumeNotifications operation. + /// private void ResumeNotifications() { using var notifications = _notifications.AcquireLock(); @@ -359,14 +487,22 @@ private void ResumeNotifications() /// /// The notification payload for cache delivery. Null Changes = count-only notification. /// + /// The Changes value. + /// The Count value. + /// The Version value. private readonly record struct CacheUpdate(ChangeSet? Changes, int Count, long Version = 0); - /// - /// Observer that dispatches items to the cache's - /// downstream subjects. Used as the delivery target for . - /// - private sealed class CacheUpdateObserver(ObservableCache cache) : IObserver +/// +/// Observer that dispatches items to the cache's +/// downstream subjects. Used as the delivery target for . +/// +/// The cache value. +private sealed class CacheUpdateObserver(ObservableCache cache) : IObserver { + /// + /// Executes the OnNext operation. + /// + /// The value value. public void OnNext(CacheUpdate value) { if (value.Changes is not null) @@ -378,6 +514,10 @@ public void OnNext(CacheUpdate value) EmitCount(value.Count); } + /// + /// Executes the OnError operation. + /// + /// The error value. public void OnError(Exception error) { cache._changesPreview.OnError(error); @@ -394,6 +534,9 @@ public void OnError(Exception error) } } + /// + /// Executes the OnCompleted operation. + /// public void OnCompleted() { cache._changes.OnCompleted(); @@ -410,6 +553,10 @@ public void OnCompleted() } } + /// + /// Executes the EmitChanges operation. + /// + /// The changes value. private void EmitChanges(ChangeSet changes) { if (cache._suspensionTracker.IsValueCreated) @@ -427,6 +574,10 @@ private void EmitChanges(ChangeSet changes) cache._changes.OnNext(changes); } + /// + /// Executes the EmitCount operation. + /// + /// The count value. private void EmitCount(int count) { if (cache._suspensionTracker.IsValueCreated) @@ -447,22 +598,50 @@ private void EmitCount(int count) } } - private sealed class SuspensionTracker : IDisposable +/// +/// Provides members for the SuspensionTracker class. +/// +private sealed class SuspensionTracker : IDisposable { + /// + /// The _areNotificationsSuspended field. + /// private readonly BehaviorSignal _areNotificationsSuspended = new(false); + /// + /// The _pendingChanges field. + /// private List> _pendingChanges = []; + /// + /// The _countSuspendCount field. + /// private int _countSuspendCount; + /// + /// The _notifySuspendCount field. + /// private int _notifySuspendCount; + /// + /// Gets the IsCountSuspended value. + /// public bool IsCountSuspended => _countSuspendCount > 0; + /// + /// Gets the AreNotificationsSuspended value. + /// public bool AreNotificationsSuspended => _notifySuspendCount > 0; + /// + /// Gets the NotificationsSuspendedObservable value. + /// public IObservable NotificationsSuspendedObservable => _areNotificationsSuspended; + /// + /// Executes the EnqueueChanges operation. + /// + /// The changes value. public void EnqueueChanges(IEnumerable> changes) { Debug.Assert(changes is not null, "Don't pass in a null Enumerable"); @@ -470,6 +649,9 @@ public void EnqueueChanges(IEnumerable> changes) _pendingChanges.AddRange(changes); } + /// + /// Executes the SuspendNotifications operation. + /// public void SuspendNotifications() { if (++_notifySuspendCount == 1) @@ -480,10 +662,21 @@ public void SuspendNotifications() } } + /// + /// Executes the SuspendCount operation. + /// public void SuspendCount() => ++_countSuspendCount; + /// + /// Executes the ResumeCount operation. + /// + /// The result of the operation. public bool ResumeCount() => --_countSuspendCount == 0; + /// + /// Executes the ResumeNotifications operation. + /// + /// The result of the operation. public (ChangeSet? Changes, bool EmitResume) ResumeNotifications() { if (--_notifySuspendCount == 0 && !_areNotificationsSuspended.IsDisposed) @@ -503,8 +696,14 @@ public void SuspendNotifications() return (null, false); } + /// + /// Executes the EmitResumeNotification operation. + /// public void EmitResumeNotification() => _areNotificationsSuspended.OnNext(false); + /// + /// Executes the Dispose operation. + /// public void Dispose() { _areNotificationsSuspended.OnCompleted(); diff --git a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs index 9f4d8ecf2..28d155f56 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs @@ -24,13 +24,13 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Injects a side effect into the changeset stream by calling . + /// Injects a side effect into the changeset stream by calling .IChangeSetAdaptor<TObject, TKey>.Adapt(IChangeSet<TObject, TKey>) /// for every changeset, then forwarding it downstream unchanged. /// /// The type of items in the cache. /// The type of the key. - /// The source to observe and adapt. - /// The whose Adapt method is called for each changeset. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe and adapt. + /// The IChangeSetAdaptor<TObject, TKey> whose Adapt method is called for each changeset. /// An observable that emits the same changesets as , after the adaptor has processed each one. /// /// @@ -39,8 +39,8 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// - /// + /// Adapt<TObject, TKey>(IObservable<ISortedChangeSet<TObject, TKey>>, ISortedChangeSetAdaptor<TObject, TKey>) + /// Bind<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservableCollection<TObject>, IObservableCollectionAdaptor<TObject, TKey>) public static IObservable> Adapt(this IObservable> source, IChangeSetAdaptor adaptor) where TObject : notnull where TKey : notnull @@ -51,10 +51,15 @@ public static IObservable> Adapt(this I return source.Do(adaptor.Adapt); } - /// - /// The source to observe and adapt. - /// The whose Adapt method is called for each changeset. - /// This overload operates on . Delegates to Rx's Do operator. + /// + /// Provides an overload of Adapt for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to observe and adapt. + /// The ISortedChangeSetAdaptor<TObject, TKey> whose Adapt method is called for each changeset. + /// The resulting observable sequence. + /// This overload operates on ISortedChangeSet<TObject, TKey>. Delegates to Rx's Do operator. public static IObservable> Adapt(this IObservable> source, ISortedChangeSetAdaptor adaptor) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs index 0fa92faf6..a8dafbbba 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs @@ -17,6 +17,15 @@ namespace DynamicData; public static partial class ObservableCacheEx { // TODO: Apply the Adapter to more places + + /// + /// Executes the AdaptSelector operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The type of the TResult value. + /// The other value. + /// The result of the operation. private static Func AdaptSelector(Func other) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs index d70effc77..2f2204782 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs @@ -22,10 +22,10 @@ public static partial class ObservableCacheEx /// /// The type of the object. /// The type of the key. - /// The to add or update items in. + /// The ISourceCache<TObject, TKey> to add or update items in. /// The item to add or update. /// - /// Convenience method that wraps a single-item mutation inside . + /// Convenience method that wraps a single-item mutation inside ISourceCache<TObject,TKey>.Edit. /// /// EventBehavior /// AddProduced when the key does not already exist in the cache. @@ -35,8 +35,8 @@ public static partial class ObservableCacheEx /// /// /// is . - /// - /// + /// EditDiff<TObject, TKey>(ISourceCache<TObject, TKey>, IEnumerable<TObject>, IEqualityComparer<TObject>) + /// Remove<TObject, TKey>(ISourceCache<TObject, TKey>, TObject) public static void AddOrUpdate(this ISourceCache source, TObject item) where TObject : notnull where TKey : notnull @@ -47,10 +47,14 @@ public static void AddOrUpdate(this ISourceCache s source.Edit(updater => updater.AddOrUpdate(item)); } - /// - /// The to add or update items in. + /// + /// Provides an overload of AddOrUpdate for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The ISourceCache<TObject, TKey> to add or update items in. /// The item to add or update. - /// The used to determine whether a new item is the same as an existing cached item. When equal, the update is skipped. + /// The IEqualityComparer<TObject> used to determine whether a new item is the same as an existing cached item. When equal, the update is skipped. /// This overload uses to suppress no-op updates when the new value equals the existing one. public static void AddOrUpdate(this ISourceCache source, TObject item, IEqualityComparer equalityComparer) where TObject : notnull @@ -63,10 +67,14 @@ public static void AddOrUpdate(this ISourceCache s source.Edit(updater => updater.AddOrUpdate(item, equalityComparer)); } - /// - /// The to add or update items in. - /// The of items to add or update. - /// Batch overload. All items are added/updated inside a single call, producing one changeset. + /// + /// Provides an overload of AddOrUpdate for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The ISourceCache<TObject, TKey> to add or update items in. + /// The IEnumerable<TObject> of items to add or update. + /// Batch overload. All items are added/updated inside a single ISourceCache<TObject,TKey>.Edit call, producing one changeset. public static void AddOrUpdate(this ISourceCache source, IEnumerable items) where TObject : notnull where TKey : notnull @@ -77,11 +85,15 @@ public static void AddOrUpdate(this ISourceCache s source.Edit(updater => updater.AddOrUpdate(items)); } - /// - /// The to add or update items in. - /// The of items to add or update. - /// The used to determine whether a new item is the same as an existing cached item. When equal, the update is skipped. - /// Batch overload with equality comparison. All items are added/updated inside a single call. + /// + /// Provides an overload of AddOrUpdate for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The ISourceCache<TObject, TKey> to add or update items in. + /// The IEnumerable<TObject> of items to add or update. + /// The IEqualityComparer<TObject> used to determine whether a new item is the same as an existing cached item. When equal, the update is skipped. + /// Batch overload with equality comparison. All items are added/updated inside a single ISourceCache<TObject,TKey>.Edit call. public static void AddOrUpdate(this ISourceCache source, IEnumerable items, IEqualityComparer equalityComparer) where TObject : notnull where TKey : notnull @@ -93,11 +105,15 @@ public static void AddOrUpdate(this ISourceCache s source.Edit(updater => updater.AddOrUpdate(items, equalityComparer)); } - /// - /// The to add or update items in. + /// + /// Provides an overload of AddOrUpdate for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The IIntermediateCache<TObject, TKey> to add or update items in. /// The item to add or update. /// The key to associate with the item. - /// This overload operates on , which requires an explicit key parameter. + /// This overload operates on IIntermediateCache<TObject, TKey>, which requires an explicit key parameter. public static void AddOrUpdate(this IIntermediateCache source, TObject item, TKey key) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.And.cs b/src/DynamicData/Cache/ObservableCacheEx.And.cs index a79d2b925..95c91039c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.And.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.And.cs @@ -29,11 +29,11 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to combine. - /// The additional streams to combine with. + /// The source IObservable<IChangeSet<TObject, TKey>> to combine. + /// The additional IObservable<IChangeSet<TObject, TKey>> streams to combine with. /// An observable which emits change sets. /// source or others. - /// + /// ObservableListEx.And public static IObservable> And(this IObservable> source, params IObservable>[] others) where TObject : notnull where TKey : notnull @@ -50,7 +50,7 @@ public static IObservable> And(this IOb ///
/// The type of the object. /// The type of the key. - /// The of streams to combine. + /// The ICollection<T> of streams to combine. /// An observable which emits change sets. /// /// source @@ -72,7 +72,7 @@ public static IObservable> And(this ICo ///
/// The type of the object. /// The type of the key. - /// The of streams to combine. + /// The IObservableList<T> of streams to combine. /// An observable which emits change sets. public static IObservable> And(this IObservableList>> sources) where TObject : notnull @@ -89,7 +89,7 @@ public static IObservable> And(this IOb ///
/// The type of the object. /// The type of the key. - /// The of changeset streams to combine. + /// The IObservableList<IObservableCache<TObject, TKey>> of changeset streams to combine. /// An observable which emits change sets. public static IObservable> And(this IObservableList> sources) where TObject : notnull @@ -106,7 +106,7 @@ public static IObservable> And(this IOb ///
/// The type of the object. /// The type of the key. - /// The of changeset streams to combine. + /// The IObservableList<ISourceCache<TObject, TKey>> of changeset streams to combine. /// An observable which emits change sets. public static IObservable> And(this IObservableList> sources) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs index 896540c13..9b571d6a2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs @@ -24,14 +24,14 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Wraps an in a read-only facade, hiding the mutable API. + /// Wraps an IObservableCache<TObject, TKey> in a read-only facade, hiding the mutable API. /// /// The type of the object. /// The type of the key. - /// The to operate on. - /// A read-only . + /// The IObservableCache<TObject, TKey> to operate on. + /// A read-only IObservableCache<TObject, TKey>. /// is . - /// + /// AsObservableCache<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, bool) public static IObservableCache AsObservableCache(this IObservableCache source) where TObject : notnull where TKey : notnull @@ -42,12 +42,12 @@ public static IObservableCache AsObservableCache(t } /// - /// Materializes a changeset stream into a queryable, read-only . + /// Materializes a changeset stream into a queryable, read-only IObservableCache<TObject, TKey>. /// The cache subscribes to the source on first access and maintains a live snapshot of all items. /// /// The type of the object. /// The type of the key. - /// The source to materialize into a read-only cache. + /// The source IObservable<IChangeSet<TObject, TKey>> to materialize into a read-only cache. /// If (default), all cache operations are synchronized. Set to when the caller guarantees single-threaded access. /// A read-only observable cache that reflects the current state of the pipeline. /// @@ -55,11 +55,11 @@ public static IObservableCache AsObservableCache(t /// Disposing the returned cache unsubscribes from the source stream. The cache's Connect() /// method provides a changeset stream of its own, which re-emits the current state on each new subscriber. /// - /// When is , a is used internally. + /// When is , a LockFreeObservableCache<TObject, TKey> is used internally. /// /// is . - /// - /// + /// AsObservableCache<TObject, TKey>(IObservableCache<TObject, TKey>) + /// PopulateInto<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, ISourceCache<TObject, TKey>) public static IObservableCache AsObservableCache(this IObservable> source, bool applyLocking = true) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs index e6c36bb9e..95499d53c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs @@ -28,10 +28,10 @@ public static partial class ObservableCacheEx ///
/// The type of items in the cache. /// The type of the key. - /// The source to track for async disposal on removal. + /// The source IObservable<IChangeSet<TObject, TKey>> to track for async disposal on removal. /// /// - /// Invoked once per subscription, providing an that signals when all + /// Invoked once per subscription, providing an IObservable<Unit> that signals when all /// calls have finished. The signal emits a single value /// and then completes. /// @@ -59,7 +59,7 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// + /// DisposeMany<TObject,TKey> public static IObservable> AsyncDisposeMany( this IObservable> source, Action> disposalsCompletedAccessor) diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs index 036ec3e1f..2590e9b64 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs @@ -28,12 +28,12 @@ public static partial class ObservableCacheEx ///
/// The object of the change set. /// The key of the change set. - /// The source to monitor for property-driven refresh signals. + /// The source IObservable<IChangeSet<TObject, TKey>> to monitor for property-driven refresh signals. /// An optional buffer duration. Batches multiple refresh signals into a single changeset, improving performance when many elements change in quick succession. This greatly increases performance when many elements have successive property changes. /// An optional throttle applied to each item's property change notifications, preventing excessive refresh invocations. /// An optional for scheduling work. /// An observable change set with additional refresh changes. - /// + /// ObservableListEx.AutoRefresh public static IObservable> AutoRefresh(this IObservable> source, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged where TKey : notnull @@ -60,8 +60,8 @@ public static IObservable> AutoRefresh( /// The object of the change set. /// The key of the change set. /// The type of the property. - /// The source to monitor for property-driven refresh signals. - /// A that specify a property to observe changes. When it changes a Refresh is invoked. + /// The source IObservable<IChangeSet<TObject, TKey>> to monitor for property-driven refresh signals. + /// A Expression<TDelegate> that specify a property to observe changes. When it changes a Refresh is invoked. /// An optional buffer duration. Batches multiple refresh signals into a single changeset, improving performance when many elements change in quick succession. This greatly increases performance when many elements have successive property changes. /// An optional throttle applied to each item's property change notifications, preventing excessive refresh invocations. /// An optional for scheduling work. diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs index a7068174f..7b685c324 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs @@ -29,12 +29,12 @@ public static partial class ObservableCacheEx /// The object of the change set. /// The key of the change set. /// The type of evaluation. - /// The source to monitor for observable-driven refresh signals. - /// The observable which acts on items within the collection and produces a value when the item should be refreshed. + /// The source IObservable<IChangeSet<TObject, TKey>> to monitor for observable-driven refresh signals. + /// The Func<TObject, IObservable<TAny>> observable which acts on items within the collection and produces a value when the item should be refreshed. /// An optional buffer duration. Batches multiple refresh signals into a single changeset, improving performance when many elements change in quick succession. This greatly increases performance when many elements require a refresh. /// An optional for scheduling work. /// An observable change set with additional refresh changes. - /// + /// ObservableListEx.AutoRefreshOnObservable public static IObservable> AutoRefreshOnObservable(this IObservable> source, Func> reevaluator, TimeSpan? changeSetBuffer = null, IScheduler? scheduler = null) where TObject : notnull where TKey : notnull => source.AutoRefreshOnObservable((t, _) => reevaluator(t), changeSetBuffer, scheduler); @@ -45,8 +45,8 @@ public static IObservable> AutoRefreshOnObservableThe object of the change set. /// The key of the change set. /// The type of evaluation. - /// The source to monitor for observable-driven refresh signals. - /// The observable which acts on items within the collection and produces a value when the item should be refreshed. + /// The source IObservable<IChangeSet<TObject, TKey>> to monitor for observable-driven refresh signals. + /// The Func<TObject, TKey, IObservable<TAny>> observable which acts on items within the collection and produces a value when the item should be refreshed. /// An optional buffer duration. Batches multiple refresh signals into a single changeset, improving performance when many elements change in quick succession. This greatly increases performance when many elements require a refresh. /// An optional for scheduling work. /// An observable change set with additional refresh changes. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs index 3d580284e..bb0f6bdfe 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs @@ -18,11 +18,11 @@ public static partial class ObservableCacheEx { /// /// Collects changesets emitted within a time window and merges them into a single changeset. - /// Uses Rx's Buffer operator followed by . + /// Uses Rx's Buffer operator followed by FlattenBufferResult<TObject, TKey>. /// /// The type of the object. /// The type of the key. - /// The source to batch. + /// The source IObservable<IChangeSet<TObject, TKey>> to batch. /// The time window for batching. /// The scheduler for timing. Defaults to . /// An observable that emits merged changesets, one per time window. @@ -42,8 +42,8 @@ public static partial class ObservableCacheEx /// Worth noting: The merged changeset may contain contradictory changes (e.g., Add then Remove for the same key). Downstream operators handle this correctly, but raw inspection of the changeset may be surprising. /// /// is . - /// - /// + /// BatchIf<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<bool>, bool, TimeSpan?, IScheduler?) + /// BufferInitial<TObject, TKey> public static IObservable> Batch(this IObservable> source, TimeSpan timeSpan, IScheduler? scheduler = null) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs index d663a8d72..437db418e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs @@ -23,19 +23,45 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// + /// + /// Provides an overload of BatchIf for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The pauseIfTrueSelector value. + /// The scheduler value. + /// The resulting observable sequence. /// This overload delegates to the primary overload with initialPauseState: false. public static IObservable> BatchIf(this IObservable> source, IObservable pauseIfTrueSelector, IScheduler? scheduler = null) where TObject : notnull where TKey : notnull => BatchIf(source, pauseIfTrueSelector, false, scheduler); - /// + /// + /// Provides an overload of Run for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The pauseIfTrueSelector value. + /// The initialPauseState value. + /// The scheduler value. + /// The resulting observable sequence. /// This overload delegates to the primary overload with default initialPauseState: false. public static IObservable> BatchIf(this IObservable> source, IObservable pauseIfTrueSelector, bool initialPauseState = false, IScheduler? scheduler = null) where TObject : notnull where TKey : notnull => new BatchIf(source, pauseIfTrueSelector, null, initialPauseState, scheduler: scheduler).Run(); - /// + /// + /// Provides an overload of BatchIf for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The pauseIfTrueSelector value. + /// The timeOut value. + /// The scheduler value. + /// The resulting observable sequence. /// This overload omits initialPauseState (defaults to ) but accepts a timeout. public static IObservable> BatchIf(this IObservable> source, IObservable pauseIfTrueSelector, TimeSpan? timeOut = null, IScheduler? scheduler = null) where TObject : notnull @@ -47,8 +73,8 @@ public static IObservable> BatchIf(this ///
/// The type of the object. /// The type of the key. - /// The source to conditionally buffer. - /// An that when , buffering begins. When , the buffer is flushed. + /// The source IObservable<IChangeSet<TObject, TKey>> to conditionally buffer. + /// An IObservable<bool> that when , buffering begins. When , the buffer is flushed. /// If , starts in a paused (buffering) state. /// A that maximum time the buffer stays open. When elapsed, the buffer is flushed regardless of pause state. /// The for timeout timing. @@ -70,8 +96,8 @@ public static IObservable> BatchIf(this /// Worth noting: If the source completes while paused, buffered data IS flushed before OnCompleted. However, if the source errors while paused, buffered data is lost. /// /// or is . - /// - /// + /// Batch<TObject, TKey> + /// BufferInitial<TObject, TKey> public static IObservable> BatchIf(this IObservable> source, IObservable pauseIfTrueSelector, bool initialPauseState = false, TimeSpan? timeOut = null, IScheduler? scheduler = null) where TObject : notnull where TKey : notnull @@ -82,12 +108,17 @@ public static IObservable> BatchIf(this return new BatchIf(source, pauseIfTrueSelector, timeOut, initialPauseState, scheduler: scheduler).Run(); } - /// - /// The source to conditionally buffer. - /// An that controls buffering: begins buffering, flushes the buffer. + /// + /// Provides an overload of Run for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to conditionally buffer. + /// An IObservable<bool> that controls buffering: begins buffering, flushes the buffer. /// If , starts in a paused (buffering) state. - /// An optional timer. The buffer is flushed each time the timer produces a value, and buffering ceases when it completes. + /// An optional IObservable<Unit> timer. The buffer is flushed each time the timer produces a value, and buffering ceases when it completes. /// An optional for scheduling work. + /// The resulting observable sequence. /// This overload accepts an explicit timer observable instead of a timeout. public static IObservable> BatchIf(this IObservable> source, IObservable pauseIfTrueSelector, bool initialPauseState = false, IObservable? timer = null, IScheduler? scheduler = null) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs index 87839ef1d..06bc2f86b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs @@ -28,12 +28,12 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to bind to a collection. - /// The that will receive the changes. + /// The source IObservable<IChangeSet<TObject, TKey>> to bind to a collection. + /// The IObservableCollection<TObject> that will receive the changes. /// The number of changes before a reset notification is triggered. /// An observable which will emit change sets. /// source. - /// + /// ObservableListEx.Bind public static IObservable> Bind(this IObservable> source, IObservableCollection destination, int refreshThreshold = BindingOptions.DefaultResetThreshold) where TObject : notnull where TKey : notnull @@ -56,8 +56,8 @@ public static IObservable> Bind(this IO ///
/// The type of the object. /// The type of the key. - /// The source to bind to a collection. - /// The that will receive the changes. + /// The source IObservable<IChangeSet<TObject, TKey>> to bind to a collection. + /// The IObservableCollection<TObject> that will receive the changes. /// The that controls binding behavior. /// An observable which will emit change sets. /// source. @@ -75,9 +75,9 @@ public static IObservable> Bind(this IO ///
/// The type of the object. /// The type of the key. - /// The source to bind to a collection. - /// The that will receive the changes. - /// The that applies changes to the bound collection. + /// The source IObservable<IChangeSet<TObject, TKey>> to bind to a collection. + /// The IObservableCollection<TObject> that will receive the changes. + /// The IObservableCollectionAdaptor<TObject, TKey> that applies changes to the bound collection. /// An observable which will emit change sets. /// source. public static IObservable> Bind(this IObservable> source, IObservableCollection destination, IObservableCollectionAdaptor updater) @@ -103,8 +103,8 @@ public static IObservable> Bind(this IO ///
/// The type of the object. /// The type of the key. - /// The source to bind to a collection. - /// The output that will be populated with the results. + /// The source IObservable<IChangeSet<TObject, TKey>> to bind to a collection. + /// The output ReadOnlyObservableCollection<TObject> that will be populated with the results. /// The that controls binding behavior. /// An observable which will emit change sets. /// source. @@ -124,11 +124,11 @@ public static IObservable> Bind(this IO ///
/// The type of the object. /// The type of the key. - /// The source to bind to a collection. - /// The output that will be populated with the results. + /// The source IObservable<IChangeSet<TObject, TKey>> to bind to a collection. + /// The output ReadOnlyObservableCollection<TObject> that will be populated with the results. /// The number of changes before a reset notification is triggered. /// When , uses Replace instead of Remove/Add for updates in the bound collection. Not all platforms support replace notifications. - /// An optional that controls how the target collection is updated. + /// An optional IObservableCollectionAdaptor<TObject, TKey> that controls how the target collection is updated. /// An observable which will emit change sets. /// source. public static IObservable> Bind(this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = BindingOptions.DefaultResetThreshold, bool useReplaceForUpdates = BindingOptions.DefaultUseReplaceForUpdates, IObservableCollectionAdaptor? adaptor = null) @@ -160,8 +160,8 @@ public static IObservable> Bind(this IO ///
/// The type of the object. /// The type of the key. - /// The source to bind to a collection. - /// The that will receive the changes. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to bind to a collection. + /// The IObservableCollection<TObject> that will receive the changes. /// An observable which will emit change sets. /// source. public static IObservable> Bind(this IObservable> source, IObservableCollection destination) @@ -179,8 +179,8 @@ public static IObservable> Bind(t ///
/// The type of the object. /// The type of the key. - /// The source to bind to a collection. - /// The that will receive the changes. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to bind to a collection. + /// The IObservableCollection<TObject> that will receive the changes. /// The that controls binding behavior. /// An observable which will emit change sets. /// source. @@ -200,9 +200,9 @@ public static IObservable> Bind(t ///
/// The type of the object. /// The type of the key. - /// The source to bind to a collection. - /// The that will receive the changes. - /// The that applies changes to the bound collection. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to bind to a collection. + /// The IObservableCollection<TObject> that will receive the changes. + /// The ISortedObservableCollectionAdaptor<TObject, TKey> that applies changes to the bound collection. /// An observable which will emit change sets. /// source. public static IObservable> Bind(this IObservable> source, IObservableCollection destination, ISortedObservableCollectionAdaptor updater) @@ -228,8 +228,8 @@ public static IObservable> Bind(t ///
/// The type of the object. /// The type of the key. - /// The source to bind to a collection. - /// The output that will be populated with the results. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to bind to a collection. + /// The output ReadOnlyObservableCollection<TObject> that will be populated with the results. /// The that controls binding behavior. /// An observable which will emit change sets. /// source. @@ -251,11 +251,11 @@ public static IObservable> Bind(this IO ///
/// The type of the object. /// The type of the key. - /// The source to bind to a collection. - /// The output that will be populated with the results. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to bind to a collection. + /// The output ReadOnlyObservableCollection<TObject> that will be populated with the results. /// The number of changes before a reset event is called on the observable collection. /// When , uses Replace instead of Remove/Add for updates in the bound collection. Not all platforms support replace notifications. - /// An that specify an adaptor to change the algorithm to update the target collection. + /// An IChangeSetAdaptor<TObject, TKey> that specify an adaptor to change the algorithm to update the target collection. /// An observable which will emit change sets. /// source. public static IObservable> Bind(this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = BindingOptions.DefaultResetThreshold, bool useReplaceForUpdates = BindingOptions.DefaultUseReplaceForUpdates, ISortedObservableCollectionAdaptor? adaptor = null) @@ -277,15 +277,15 @@ public static IObservable> Bind(this IO readOnlyObservableCollection = new ReadOnlyObservableCollection(target); return source.Bind(target, adaptor); } - #if SUPPORTS_BINDINGLIST + /// /// Binds a clone of the observable change set to the target observable collection. /// /// The object type. /// The key type. - /// The source to bind to a collection. - /// The that will receive the changes. + /// The source IObservable<IChangeSet<TObject, TKey>> to bind to a collection. + /// The BindingList<TObject> that will receive the changes. /// The reset threshold. /// An observable which will emit change sets. /// @@ -308,8 +308,8 @@ public static IObservable> Bind(this IO ///
/// The object type. /// The key type. - /// The source to bind to a collection. - /// The that will receive the changes. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to bind to a collection. + /// The BindingList<TObject> that will receive the changes. /// The reset threshold. /// An observable which will emit change sets. /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs index 567d3ba04..7db16f95d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs @@ -22,7 +22,7 @@ public static partial class ObservableCacheEx ///
/// The object type. /// The type of the key. - /// The source to buffer during the initial loading period. + /// The source IObservable<IChangeSet<TObject, TKey>> to buffer during the initial loading period. /// The time window to buffer, measured from when the first changeset arrives. /// The scheduler for timing. Defaults to . /// An observable that emits one merged changeset for the initial burst, then passthrough for the rest. @@ -31,10 +31,10 @@ public static partial class ObservableCacheEx /// Useful for aggregating the initial snapshot (which may arrive as many small changesets) into a /// single changeset for efficient downstream processing, while leaving subsequent live updates untouched. /// - /// Internally uses , Rx Buffer, and . + /// Internally uses DeferUntilLoaded<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>), Rx Buffer, and FlattenBufferResult<TObject, TKey>. /// - /// - /// + /// Batch<TObject, TKey> + /// DeferUntilLoaded<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>) public static IObservable> BufferInitial(this IObservable> source, TimeSpan initialBuffer, IScheduler? scheduler = null) where TObject : notnull where TKey : notnull => source.DeferUntilLoaded().Publish( diff --git a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs index 41df889bd..3d6214ed9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs @@ -25,14 +25,14 @@ public static partial class ObservableCacheEx { /// /// Casts each item in the changeset to a new type using the provided converter function. - /// Equivalent to + /// Equivalent to Transform<TDestination, TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TDestination>, bool) /// but named for discoverability when a simple type cast or conversion is needed. /// /// The type of the source object. /// The type of the key. /// The type of the destination object. - /// The source to cast. - /// The conversion function applied to each item. + /// The source IObservable<IChangeSet<TSource, TKey>> to cast. + /// The Func<TSource, TDestination> conversion function applied to each item. /// An observable changeset of converted items. /// /// @@ -43,7 +43,7 @@ public static partial class ObservableCacheEx /// RefreshForwarded as Refresh. The converter is not called. /// /// - /// + /// OfType<TObject, TKey, TDestination> public static IObservable> Cast(this IObservable> source, Func converter) where TSource : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs index d69030ade..19f1792db 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs @@ -23,8 +23,8 @@ public static partial class ObservableCacheEx /// The type of the object. /// The type of the source key. /// The type of the destination key. - /// The source to re-key. - /// The that computes the destination key from the item, e.g. (item) => item.NewId. + /// The source IObservable<IChangeSet<TObject, TSourceKey>> to re-key. + /// The Func<TObject, TDestinationKey> that computes the destination key from the item, e.g. (item) => item.NewId. /// An observable changeset with items re-keyed using . /// /// @@ -35,7 +35,7 @@ public static partial class ObservableCacheEx /// Refresh is called on the item. A Refresh is emitted with the destination key. /// /// - /// + /// Transform<TDestination, TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TDestination>, bool) public static IObservable> ChangeKey(this IObservable> source, Func keySelector) where TObject : notnull where TSourceKey : notnull @@ -52,7 +52,15 @@ public static IObservable> ChangeKey + /// + /// Provides an overload of ChangeKey for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TSourceKey value. + /// The type of the TDestinationKey value. + /// The source value. + /// The keySelector value. + /// The resulting observable sequence. /// /// This overload also provides the source key to , /// allowing the destination key to be derived from both the item and its original key. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs index ddb09abf2..4751870ab 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs @@ -28,7 +28,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The to clear. + /// The ISourceCache<TObject, TKey> to clear. /// /// /// EventBehavior @@ -48,7 +48,12 @@ public static void Clear(this ISourceCache source) source.Edit(updater => updater.Clear()); } - /// + /// + /// Provides an overload of Clear for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. public static void Clear(this IIntermediateCache source) where TObject : notnull where TKey : notnull @@ -58,7 +63,12 @@ public static void Clear(this IIntermediateCache s source.Edit(updater => updater.Clear()); } - /// + /// + /// Provides an overload of Clear for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. public static void Clear(this LockFreeObservableCache source) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs index 5947f9c88..f775c4bbb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs @@ -22,8 +22,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to clone. - /// The target collection to which changes are applied. + /// The source IObservable<IChangeSet<TObject, TKey>> to clone. + /// The ICollection<TObject> target collection to which changes are applied. /// An observable that forwards all changesets from unchanged. /// /// @@ -31,7 +31,7 @@ public static partial class ObservableCacheEx /// AddThe item is added to . Forwarded as Add. /// UpdateThe previous item is removed from and the current item is added. Forwarded as Update. /// RemoveThe item is removed from . Forwarded as Remove. - /// RefreshIgnored ( has no concept of refresh). Forwarded as Refresh. + /// RefreshIgnored (ICollection<T> has no concept of refresh). Forwarded as Refresh. /// /// public static IObservable> Clone(this IObservable> source, ICollection target) diff --git a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs index 88b0da390..733ad710c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs @@ -23,6 +23,14 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { + /// + /// Executes the Combine operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The type value. + /// The result of the operation. private static IObservable> Combine(this IObservableList> source, CombineOperator type) where TObject : notnull where TKey : notnull @@ -38,6 +46,14 @@ private static IObservable> Combine(thi }); } + /// + /// Executes the Combine operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The type value. + /// The result of the operation. private static IObservable> Combine(this IObservableList> source, CombineOperator type) where TObject : notnull where TKey : notnull @@ -53,6 +69,14 @@ private static IObservable> Combine(thi }); } + /// + /// Executes the Combine operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The type value. + /// The result of the operation. private static IObservable> Combine(this IObservableList>> source, CombineOperator type) where TObject : notnull where TKey : notnull @@ -62,6 +86,14 @@ private static IObservable> Combine(thi return new DynamicCombiner(source, type).Run(); } + /// + /// Executes the Combine operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The sources value. + /// The type value. + /// The result of the operation. private static IObservable> Combine(this ICollection>> sources, CombineOperator type) where TObject : notnull where TKey : notnull @@ -99,6 +131,15 @@ void UpdateAction(IChangeSet updates) }); } + /// + /// Executes the Combine operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The type value. + /// The combineTarget value. + /// The result of the operation. private static IObservable> Combine(this IObservable> source, CombineOperator type, params IObservable>[] combineTarget) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs index e2ddc645a..7ddb8e0b4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs @@ -17,13 +17,13 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Obsolete: use instead. + /// Obsolete: use Transform<TDestination, TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TDestination>, bool) instead. /// /// The type of the object. /// The type of the key. /// The type of the destination. - /// The source to convert. - /// The conversion factory. + /// The source IObservable<IChangeSet<TObject, TKey>> to convert. + /// The Func<TObject, TDestination> conversion factory. /// An observable which emits change sets. [Obsolete("This was an experiment that did not work. Use Transform instead")] public static IObservable> Convert(this IObservable> source, Func conversionFactory) diff --git a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs index 97102f6ac..5611ef3a1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs @@ -23,12 +23,33 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { + /// + /// Executes the CreateChangeSetTransformer operation. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The manySelector value. + /// The keySelector value. + /// The result of the operation. private static Func>>> CreateChangeSetTransformer(Func>> manySelector, Func keySelector) where TDestination : notnull where TDestinationKey : notnull where TSource : notnull where TSourceKey : notnull => async (val, key) => (await manySelector(val, key).ConfigureAwait(false)).AsObservableChangeSet(keySelector); + /// + /// Executes the CreateChangeSetTransformer operation. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The type of the TCollection value. + /// The manySelector value. + /// The keySelector value. + /// The result of the operation. private static Func>>> CreateChangeSetTransformer(Func> manySelector, Func keySelector) where TDestination : notnull where TDestinationKey : notnull @@ -36,6 +57,15 @@ private static Func => async (val, key) => (await manySelector(val, key).ConfigureAwait(false)).ToObservableChangeSet().AddKey(keySelector); + /// + /// Executes the CreateChangeSetTransformer operation. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The manySelector value. + /// The result of the operation. private static Func>>> CreateChangeSetTransformer(Func>> manySelector) where TDestination : notnull where TDestinationKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs index 4c54778aa..5cff70429 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs @@ -29,12 +29,12 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to defer until the first changeset arrives. + /// The source IObservable<IChangeSet<TObject, TKey>> to defer until the first changeset arrives. /// An observable that begins emitting changesets once the first non-empty changeset is received. /// /// Worth noting: Blocks indefinitely if the cache or stream never receives any data. Ensure the source will eventually emit at least one changeset. /// - /// + /// SkipInitial<TObject, TKey> public static IObservable> DeferUntilLoaded(this IObservable> source) where TObject : notnull where TKey : notnull @@ -44,7 +44,13 @@ public static IObservable> DeferUntilLoaded(source).Run(); } - /// + /// + /// Provides an overload of DeferUntilLoaded for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The resulting observable sequence. public static IObservable> DeferUntilLoaded(this IObservableCache source) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs index 273ca2965..7249b5589 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs @@ -35,7 +35,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to track for disposal on removal. + /// The source IObservable<IChangeSet<TObject, TKey>> to track for disposal on removal. /// A stream that forwards all changesets from unchanged. /// /// @@ -51,13 +51,13 @@ public static partial class ObservableCacheEx /// /// On stream completion, error, or subscription disposal, all remaining tracked items are disposed. /// All disposal is synchronous via . - /// For items that implement , use instead. + /// For items that implement , use AsyncDisposeMany<TObject,TKey> instead. /// /// /// is . - /// - /// - /// + /// AsyncDisposeMany<TObject,TKey> + /// SubscribeMany<TObject,TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IDisposable>) + /// ObservableListEx.DisposeMany public static IObservable> DisposeMany(this IObservable> source) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs index b5f7d0eaf..4e17cf1b2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs @@ -29,15 +29,15 @@ public static partial class ObservableCacheEx /// The type object from which the distinct values are selected. /// The type of the key. /// The type of the value. - /// The source to extract distinct values. - /// The value selector. + /// The source IObservable<IChangeSet<TObject, TKey>> to extract distinct values. + /// The Func<TObject, TValue> value selector. /// An observable which will emit distinct change sets. /// /// Due to it's nature only adds or removes can be returned. /// Worth noting: Reference counting assumes value equality is transitive. Mutable value objects with inconsistent Equals implementations can corrupt ref counts. /// /// source. - /// + /// ObservableListEx.DistinctValues public static IObservable> DistinctValues(this IObservable> source, Func valueSelector) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs index 7e590a6a0..066338838 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs @@ -23,12 +23,16 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// The to diff and update. - /// The representing the complete desired state to diff against the cache. - /// An used to determine whether a new item is the same as an existing cached item. + /// + /// Provides an overload of EditDiff for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The ISourceCache<TObject, TKey> to diff and update. + /// The IEnumerable<TObject> representing the complete desired state to diff against the cache. + /// An IEqualityComparer<TObject> used to determine whether a new item is the same as an existing cached item. /// - /// This overload uses an instead of a delegate + /// This overload uses an IEqualityComparer<T> instead of a Func<T, T, TResult> delegate /// to determine item equality. /// public static void EditDiff(this ISourceCache source, IEnumerable allItems, IEqualityComparer equalityComparer) @@ -48,9 +52,9 @@ public static void EditDiff(this ISourceCache sour ///
/// The type of the object. /// The type of the key. - /// The to diff and update. - /// The representing the complete desired state. - /// The that returns when the current and previous items are considered equal, e.g. (current, previous) => current.Version == previous.Version. + /// The ISourceCache<TObject, TKey> to diff and update. + /// The IEnumerable<TObject> representing the complete desired state. + /// The Func<TObject, TObject, bool> that returns when the current and previous items are considered equal, e.g. (current, previous) => current.Version == previous.Version. /// /// /// EventBehavior @@ -74,15 +78,15 @@ public static void EditDiff(this ISourceCache sour } /// - /// Converts an of into a changeset stream by diffing each + /// Converts an IObservable<T> of IEnumerable<T> into a changeset stream by diffing each /// emission against the previous one. Each emission replaces the entire dataset. - /// Counterpart to . + /// Counterpart to ToCollection<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>). /// /// The type of the object. /// The type of the key. - /// The source to convert into a keyed changeset stream. - /// The that extracts the unique key from each item. - /// An optional for comparing items. Uses default equality if . + /// The source IObservable<IEnumerable<TObject>> to convert into a keyed changeset stream. + /// The Func<TObject, TKey> that extracts the unique key from each item. + /// An optional IEqualityComparer<TObject> for comparing items. Uses default equality if . /// An observable changeset representing the incremental differences between successive snapshots. /// /// @@ -94,7 +98,7 @@ public static void EditDiff(this ISourceCache sour /// /// /// or is . - /// + /// ToCollection<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>) public static IObservable> EditDiff(this IObservable> source, Func keySelector, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull @@ -106,14 +110,14 @@ public static IObservable> EditDiff(thi } /// - /// Converts an of into a changeset stream that tracks + /// Converts an IObservable<T> of Optional<T> into a changeset stream that tracks /// a single item: Some produces an Add or Update, and None produces a Remove. /// /// The type of the object. /// The type of the key. - /// The source to convert into a keyed changeset stream. - /// The that extracts the unique key from each item. - /// An optional for comparing items. Uses default equality if . + /// The source IObservable<Optional<TObject>> to convert into a keyed changeset stream. + /// The Func<TObject, TKey> that extracts the unique key from each item. + /// An optional IEqualityComparer<TObject> for comparing items. Uses default equality if . /// An observable changeset tracking the single optional item. /// /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs index 5207f4c87..7e932a483 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs @@ -29,7 +29,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to validate for unique keys. + /// The source IObservable<IChangeSet<TObject, TKey>> to validate for unique keys. /// A changeset stream guaranteed to contain unique keys per changeset. /// /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.Except.cs b/src/DynamicData/Cache/ObservableCacheEx.Except.cs index 2166cc332..06bf43ddf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Except.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Except.cs @@ -29,15 +29,15 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to combine. - /// The additional streams to combine with. + /// The source IObservable<IChangeSet<TObject, TKey>> to combine. + /// The additional IObservable<IChangeSet<TObject, TKey>> streams to combine with. /// An observable which emits change sets. /// /// source /// or /// others. /// - /// + /// ObservableListEx.Except public static IObservable> Except(this IObservable> source, params IObservable>[] others) where TObject : notnull where TKey : notnull @@ -58,7 +58,7 @@ public static IObservable> Except(this ///
/// The type of the object. /// The type of the key. - /// The of streams to combine. + /// The ICollection<T> of streams to combine. /// An observable which emits change sets. /// /// source @@ -80,7 +80,7 @@ public static IObservable> Except(this ///
/// The type of the object. /// The type of the key. - /// The of streams to combine. + /// The IObservableList<T> of streams to combine. /// An observable which emits change sets. public static IObservable> Except(this IObservableList>> sources) where TObject : notnull @@ -97,7 +97,7 @@ public static IObservable> Except(this ///
/// The type of the object. /// The type of the key. - /// The of changeset streams to combine. + /// The IObservableList<IObservableCache<TObject, TKey>> of changeset streams to combine. /// An observable which emits change sets. public static IObservable> Except(this IObservableList> sources) where TObject : notnull @@ -114,7 +114,7 @@ public static IObservable> Except(this ///
/// The type of the object. /// The type of the key. - /// The of changeset streams to combine. + /// The IObservableList<ISourceCache<TObject, TKey>> of changeset streams to combine. /// An observable which emits change sets. public static IObservable> Except(this IObservableList> sources) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs index a88be4055..304930368 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs @@ -22,8 +22,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to apply time-based expiration to. - /// An optional that returns the expiration timeout for each item, or for no expiration. + /// The source IObservable<IChangeSet<TObject, TKey>> to apply time-based expiration to. + /// An optional Func<T, TResult> that returns the expiration timeout for each item, or for no expiration. /// An observable changeset that includes timer-driven Remove changes for expired items. /// /// When a timer fires, a Remove is emitted for the expired item. @@ -48,10 +48,15 @@ public static IObservable> ExpireAfter( source: source, timeSelector: timeSelector); - /// - /// The source to apply time-based expiration to. - /// An optional that returns the expiration timeout for each item, or for no expiration. + /// + /// Provides an overload of ExpireAfter for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to apply time-based expiration to. + /// An optional Func<T, TResult> that returns the expiration timeout for each item, or for no expiration. /// The used to schedule expiration timers. + /// The resulting observable sequence. public static IObservable> ExpireAfter( this IObservable> source, Func timeSelector, @@ -63,10 +68,15 @@ public static IObservable> ExpireAfter( timeSelector: timeSelector, scheduler: scheduler); - /// - /// The source to apply time-based expiration to. - /// An optional that returns the expiration timeout for each item, or for no expiration. + /// + /// Provides an overload of ExpireAfter for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to apply time-based expiration to. + /// An optional Func<T, TResult> that returns the expiration timeout for each item, or for no expiration. /// An optional polling interval. If specified, items are expired on a polling interval rather than per-item timers. Less accurate but more efficient when many items share similar expiration times. + /// The resulting observable sequence. /// /// This overload uses periodic polling instead of per-item timers. Expired items are removed on the next /// poll after their timeout elapses, which trades accuracy for reduced timer overhead. @@ -82,11 +92,16 @@ public static IObservable> ExpireAfter( timeSelector: timeSelector, pollingInterval: pollingInterval); - /// - /// The source to apply time-based expiration to. - /// An optional that returns the expiration timeout for each item, or for no expiration. + /// + /// Provides an overload of ExpireAfter for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to apply time-based expiration to. + /// An optional Func<T, TResult> that returns the expiration timeout for each item, or for no expiration. /// An optional if specified, items are expired on a polling interval rather than per-item timers. /// The used to schedule polling and expiration timers. + /// The resulting observable sequence. public static IObservable> ExpireAfter( this IObservable> source, Func timeSelector, @@ -101,19 +116,19 @@ public static IObservable> ExpireAfter( scheduler: scheduler); /// - /// Automatically removes items from the after the timeout returned + /// Automatically removes items from the ISourceCache<TObject, TKey> after the timeout returned /// by . Returns an observable of the removed key-value pairs (not a changeset stream). /// /// The type of the object. /// The type of the key. - /// The to operate on. - /// An optional that returns the expiration timeout for each item, or for no expiration. + /// The ISourceCache<TObject, TKey> to operate on. + /// An optional Func<T, TResult> that returns the expiration timeout for each item, or for no expiration. /// An optional if specified, items are expired on a polling interval rather than per-item timers. /// The scheduler used to schedule expiration timers. Defaults to if . /// An observable that emits the key-value pairs of items removed from the cache by expiration. /// - /// Unlike the stream-based overloads, this operates directly on the - /// and returns the removed items as collections, + /// Unlike the stream-based overloads, this operates directly on the ISourceCache<TObject, TKey> + /// and returns the removed items as KeyValuePair<TKey, TObject> collections, /// not as a changeset stream. /// /// or is . diff --git a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs index b267f45fe..595b802a4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs @@ -22,8 +22,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to filter. - /// The predicate used to determine whether each item is included. + /// The source IObservable<IChangeSet<TObject, TKey>> to filter. + /// The Func<TObject, bool> predicate used to determine whether each item is included. /// When (default), empty changesets are suppressed for performance. Set to to emit empty changesets, which can be useful for monitoring loading status. /// An observable changeset containing only items that satisfy . /// @@ -34,11 +34,11 @@ public static partial class ObservableCacheEx /// RemoveIf the item was included downstream, a Remove is emitted. Otherwise dropped. /// RefreshThe predicate is re-evaluated. If the item now passes but previously did not, an Add is emitted. If it still passes, a Refresh is forwarded. If it no longer passes, a Remove is emitted. If it still fails, the change is dropped. /// - /// Worth noting: Refresh events trigger re-evaluation, which can promote or demote items. Pair with for property-change-driven filtering. + /// Worth noting: Refresh events trigger re-evaluation, which can promote or demote items. Pair with AutoRefresh<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TimeSpan?, TimeSpan?, IScheduler?) for property-change-driven filtering. /// - /// - /// - /// + /// FilterImmutable<TObject, TKey> + /// FilterOnObservable<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IObservable<bool>>, TimeSpan?, IScheduler?) + /// ObservableListEx.Filter public static IObservable> Filter( this IObservable> source, Func filter, @@ -50,10 +50,18 @@ public static IObservable> Filter( filter: filter, suppressEmptyChangeSets: suppressEmptyChangeSets); - /// + /// + /// Provides an overload of Filter for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The predicateChanged value. + /// The suppressEmptyChangeSets value. + /// The resulting observable sequence. /// /// This overload does not accept a reapplyFilter signal. It is equivalent to calling the - /// full dynamic overload with as the reapply observable. + /// full dynamic overload with Observable.Empty<TResult>() as the reapply observable. /// public static IObservable> Filter( this IObservable> source, @@ -73,9 +81,9 @@ public static IObservable> Filter( /// The type of the object. /// The type of the key. /// The type of state value required by . - /// The source to filter. - /// The stream of state values to be passed to . - /// The predicate that receives the current state and an item, returning to include or to exclude. + /// The source IObservable<IChangeSet<TObject, TKey>> to filter. + /// The IObservable<TState> stream of state values to be passed to . + /// The Func<TState, TObject, bool> predicate that receives the current state and an item, returning to include or to exclude. /// When (default), empty changesets are suppressed for performance. Set to to emit empty changesets. /// An observable changeset containing only items satisfying for the latest state. /// , , or is . @@ -88,7 +96,7 @@ public static IObservable> Filter( /// /// EventBehavior /// AddEvaluated against the current state. If it passes, an Add is emitted. Otherwise dropped. - /// UpdateRe-evaluated. Four outcomes as with the static overload. + /// UpdateRe-evaluated. Four outcomes as with the static Filter<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, bool>, bool) overload. /// RemoveIf the item was included downstream, a Remove is emitted. Otherwise dropped. /// RefreshRe-evaluated against the current state. May produce Add, Refresh, Remove, or be dropped. /// @@ -108,13 +116,18 @@ public static IObservable> Filter(), suppressEmptyChangeSets: suppressEmptyChangeSets); - /// - /// The source to filter. - /// The that emits new predicates. Each emission replaces the current predicate and triggers a full re-evaluation of all items. - /// The that, when it emits, triggers a full re-evaluation of all items against the current predicate. Useful when filtering on mutable item properties. + /// + /// Provides an overload of Filter for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to filter. + /// The IObservable<Func<TObject, bool>> that emits new predicates. Each emission replaces the current predicate and triggers a full re-evaluation of all items. + /// The IObservable<Unit> that, when it emits, triggers a full re-evaluation of all items against the current predicate. Useful when filtering on mutable item properties. /// When (default), empty changesets are suppressed for performance. + /// The resulting observable sequence. /// - /// In addition to the per-item behavior described in the static overload, + /// In addition to the per-item behavior described in the static Filter<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, bool>, bool) overload, /// emissions from replace the predicate and trigger full re-filtering, /// while emissions from re-evaluate all items against the current predicate. /// Worth noting: No items are included until the predicate observable emits its first value. diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs index e121a0723..393ce24b8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs @@ -28,14 +28,14 @@ public static partial class ObservableCacheEx ///
/// The type of collection items to be filtered. /// The type of the key values of each collection item. - /// The source to filter (items assumed immutable). - /// The filtering predicate to be applied to each item. + /// The source IObservable<IChangeSet<TObject, TKey>> to filter (items assumed immutable). + /// The Func<TObject, bool> filtering predicate to be applied to each item. /// A flag indicating whether the created stream should emit empty changesets. Empty changesets are suppressed by default, for performance. Set to ensure that a downstream changeset occurs for every upstream changeset. /// A stream of collection changesets where upstream collection items are filtered by the given predicate. /// /// The goal of this operator is to optimize a common use-case of reactive programming, where data values flowing through a stream are immutable, and state changes are distributed by publishing new immutable items as replacements, instead of mutating the items directly. /// In addition to assuming that all collection items are immutable, this operator also assumes that the given filter predicate is deterministic, such that the result it returns will always be the same each time a specific input is passed to it. In other words, the predicate itself also contains no mutable state. - /// Under these assumptions, this operator can bypass the need to keep track of every collection item that passes through it, which the normal operator must do, in order to re-evaluate the filtering status of items, during a refresh operation. + /// Under these assumptions, this operator can bypass the need to keep track of every collection item that passes through it, which the normal Filter<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, bool>, bool) operator must do, in order to re-evaluate the filtering status of items, during a refresh operation. /// Consider using this operator when the following are true: /// /// Your collection items are immutable, and changes are published by replacing entire items diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs index e13836609..3623da521 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs @@ -24,13 +24,13 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Filters items using a per-item that controls inclusion. + /// Filters items using a per-item IObservable<Boolean> that controls inclusion. /// Each item's observable is created by and toggles the item in or out of the downstream stream. /// /// The type of the object. /// The type of the key. - /// The source to filter using per-item observables. - /// A factory that creates an for each item and its key. When the observable emits , the item is included; when , it is excluded. + /// The source IObservable<IChangeSet<TObject, TKey>> to filter using per-item observables. + /// A factory that creates an IObservable<Boolean> for each item and its key. When the observable emits , the item is included; when , it is excluded. /// A that optional time window to buffer inclusion changes from per-item observables before re-evaluating. /// An that optional scheduler used for buffering. /// An observable changeset containing only items whose per-item observable most recently emitted . @@ -65,8 +65,8 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// - /// + /// Filter<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, bool>, bool) + /// ObservableListEx.FilterOnObservable public static IObservable> FilterOnObservable(this IObservable> source, Func> filterFactory, TimeSpan? buffer = null, IScheduler? scheduler = null) where TObject : notnull where TKey : notnull @@ -77,7 +77,16 @@ public static IObservable> FilterOnObservable(source, filterFactory, buffer, scheduler).Run(); } - /// + /// + /// Provides an overload of FilterOnObservable for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The filterFactory value. + /// The buffer value. + /// The scheduler value. + /// The resulting observable sequence. /// /// This overload does not provide the key to ; only the item is passed. /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs index 9f54b3b58..0652cfd33 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs @@ -27,7 +27,7 @@ public static partial class ObservableCacheEx /// Obsolete: do not use. This can cause unhandled exception issues. Use the standard Rx Finally operator instead. ///
/// The type contained within the observables. - /// The source to attach a finally action to. + /// The source IObservable<T> to attach a finally action to. /// The to invoke when the subscription terminates. /// An observable which has always a finally action applied. [Obsolete("This can cause unhandled exception issues so do not use")] diff --git a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs index b91f7bdb7..949b81a7f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs @@ -17,15 +17,15 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Unwraps each into individual - /// values via . + /// Unwraps each IChangeSet<TObject, TKey> into individual Change<TObject, TKey> + /// values via Observable.SelectMany<TSource, TResult>(IObservable<TSource>, Func<TSource, IEnumerable<TResult>>). /// /// The type of the object. /// The type of the key. - /// The source to flatten into individual changes. - /// An observable of individual values. + /// The source IObservable<IChangeSet<TObject, TKey>> to flatten into individual changes. + /// An observable of individual Change<TObject, TKey> values. /// is . - /// + /// ForEachChange<TObject, TKey> public static IObservable> Flatten(this IObservable> source) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs index 385151e38..9741b27a6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs @@ -22,7 +22,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to flatten. + /// The source IObservable<T> to flatten. /// An observable changeset combining all changes from each buffer into a single emission. /// is . public static IObservable> FlattenBufferResult(this IObservable>> source) diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs index 3f6ed6ad7..2c3d15ee5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs @@ -17,21 +17,21 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Invokes for every individual in each changeset, + /// Invokes for every individual Change<TObject,TKey> in each changeset, /// regardless of change reason. The changeset is forwarded downstream unchanged. /// /// The type of the object. /// The type of the key. - /// The source to observe each individual change in. - /// The action to invoke for each change. Receives the full struct, including , , , and . + /// The source IObservable<IChangeSet<TObject, TKey>> to observe each individual change in. + /// The action to invoke for each change. Receives the full Change<TObject,TKey> struct, including Change<TObject,TKey>.Reason, Change<TObject,TKey>.Key, Change<TObject,TKey>.Current, and Change<TObject,TKey>.Previous. /// A stream that forwards all changesets from unchanged. /// /// /// All change reasons (Add, Update, Remove, Refresh) trigger the callback. - /// Use , - /// , - /// , or - /// + /// Use OnItemAdded<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>, Action<TObject,TKey>), + /// OnItemUpdated<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>, Action<TObject,TObject,TKey>), + /// OnItemRemoved<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>, Action<TObject,TKey>, bool), or + /// OnItemRefreshed<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>, Action<TObject,TKey>) /// to target a specific reason. /// /// @@ -40,7 +40,7 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// + /// ObservableListEx.ForEachChange public static IObservable> ForEachChange(this IObservable> source, Action> action) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs index bb2bd3e90..ee97660f1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs @@ -16,6 +16,13 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { + /// + /// Executes the ForForced operation. + /// + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The result of the operation. private static IObservable>? ForForced(this IObservable? source) where TKey : notnull => source?.Select( _ => @@ -24,6 +31,13 @@ public static partial class ObservableCacheEx return (Func)Transformer; }); + /// + /// Executes the ForForced operation. + /// + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The result of the operation. private static IObservable>? ForForced(this IObservable>? source) where TKey : notnull => source?.Select( condition => diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs index f5c89ed40..1904f4641 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs @@ -23,12 +23,20 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the optional left and right values into a destination object. The key is not provided in this overload. - /// Overload that omits the key from the result selector. Delegates to . + /// + /// Provides an overload of FullJoin for the supplied arguments. + /// + /// The type of the TLeft value. + /// The type of the TLeftKey value. + /// The type of the TRight value. + /// The type of the TRightKey value. + /// The type of the TDestination value. + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the optional left and right values into a destination object. The key is not provided in this overload. + /// The resulting observable sequence. + /// Overload that omits the key from the result selector. Delegates to FullJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, Optional<TRight>, TDestination>). public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, ReactiveUI.Primitives.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -46,7 +54,7 @@ public static IObservable> FullJoin /// Joins two changeset streams, producing a result for every key that appears on either side (or both). - /// Both sides are because a given key may only exist on one side at any point. + /// Both sides are Optional<T> because a given key may only exist on one side at any point. /// Equivalent to SQL FULL OUTER JOIN. ///
/// The item type of the left source. @@ -54,19 +62,19 @@ public static IObservable> FullJoinThe item type of the right source. /// The key type of the right source. /// The type produced by . - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the key, optional left, and optional right into a destination object. Example: (key, left, right) => new Result(key, left, right). + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the key, optional left, and optional right into a destination object. Example: (key, left, right) => new Result(key, left, right). /// An observable changeset keyed by . /// /// /// Left-side change handling: /// /// EventBehavior - /// AddEmits with the left value and the matching right (or if no right exists). + /// AddEmits with the left value and the matching right (or ReactiveUI.Primitives.Optional.None<T> if no right exists). /// UpdateRe-invokes with the new left value and current right (if any). - /// RemoveIf a right match still exists, re-invokes the selector with left as . If neither side remains, removes the joined result. + /// RemoveIf a right match still exists, re-invokes the selector with left as ReactiveUI.Primitives.Optional.None<T>. If neither side remains, removes the joined result. /// RefreshForwarded as Refresh on the joined result. /// /// @@ -74,19 +82,19 @@ public static IObservable> FullJoinRight-side change handling: /// /// EventBehavior - /// AddEmits with the matching left (or ) and the right value. + /// AddEmits with the matching left (or ReactiveUI.Primitives.Optional.None<T>) and the right value. /// UpdateRe-invokes selector with current left (if any) and the new right value. - /// RemoveIf a left match still exists, re-invokes the selector with right as . If neither side remains, removes the joined result. + /// RemoveIf a left match still exists, re-invokes the selector with right as ReactiveUI.Primitives.Optional.None<T>. If neither side remains, removes the joined result. /// RefreshForwarded as Refresh on the joined result. /// /// /// Both sources are serialized through a shared lock held during downstream delivery. Avoid blocking operations in subscribers. /// /// Any argument is . - /// - /// - /// - /// + /// InnerJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<ValueTuple<TLeftKey, TRightKey>, TLeft, TRight, TDestination>) + /// LeftJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, Optional<TRight>, TDestination>) + /// RightJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TRightKey, Optional<TLeft>, TRight, TDestination>) + /// FullJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) public static IObservable> FullJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, ReactiveUI.Primitives.Optional, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs index 56da40b0b..e14eea2b9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs @@ -23,12 +23,20 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the optional left value and the right group into a destination object. The key is not provided in this overload. - /// Overload that omits the key from the result selector. Delegates to . + /// + /// Provides an overload of FullJoinMany for the supplied arguments. + /// + /// The type of the TLeft value. + /// The type of the TLeftKey value. + /// The type of the TRight value. + /// The type of the TRightKey value. + /// The type of the TDestination value. + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the optional left value and the right group into a destination object. The key is not provided in this overload. + /// The resulting observable sequence. + /// Overload that omits the key from the result selector. Delegates to FullJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>). public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -47,7 +55,7 @@ public static IObservable> FullJoinMany /// Groups right-side items by their mapped key, then full-joins each group to the left source. /// A result is produced for every key that appears on either side (or both). The left value is - /// because only the right side may have entries for a given key. + /// Optional<T> because only the right side may have entries for a given key. /// Equivalent to SQL FULL OUTER JOIN with the right side grouped. ///
/// The item type of the left source. @@ -55,10 +63,10 @@ public static IObservable> FullJoinManyThe item type of the right source. /// The key type of the right source. /// The type produced by . - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the key, optional left value, and the right group into a destination object. Example: (key, left, group) => new Result(key, left, group). + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the key, optional left value, and the right group into a destination object. Example: (key, left, group) => new Result(key, left, group). /// An observable changeset keyed by . /// /// @@ -67,7 +75,7 @@ public static IObservable> FullJoinManyEventBehavior /// AddEmits with the left value and the current right group for that key (may be empty). /// UpdateRe-invokes with the new left value and current right group. - /// RemoveIf the right group is non-empty, re-invokes with left as . If both sides are empty, removes the result. + /// RemoveIf the right group is non-empty, re-invokes with left as ReactiveUI.Primitives.Optional.None<T>. If both sides are empty, removes the result. /// RefreshForwarded as Refresh on the joined result. /// /// @@ -84,10 +92,10 @@ public static IObservable> FullJoinManyBoth sources are serialized through a shared lock held during downstream delivery. Avoid blocking operations in subscribers. /// /// Any argument is . - /// - /// - /// - /// + /// FullJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, Optional<TRight>, TDestination>) + /// InnerJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) + /// LeftJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) + /// RightJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) public static IObservable> FullJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Group.cs b/src/DynamicData/Cache/ObservableCacheEx.Group.cs index 68dab2c72..c4c6deafc 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Group.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Group.cs @@ -30,9 +30,9 @@ public static partial class ObservableCacheEx /// The type of the object. /// The type of the key. /// The type of the group key. - /// The source to group. - /// The group selector factory. - /// An of used to determine which groups appear in the result. + /// The source IObservable<IChangeSet<TObject, TKey>> to group. + /// The Func<TObject, TGroupKey> group selector factory. + /// An IObservable<IDistinctChangeSet<TGroupKey>> of IDistinctChangeSet<TGroupKey> used to determine which groups appear in the result. /// /// Useful for parent-child collection when the parent and child are soured from different streams. /// @@ -56,8 +56,8 @@ public static IObservable> GroupThe type of the object. /// The type of the key. /// The type of the group key. - /// The source to group. - /// A that extracts the group key from each item. + /// The source IObservable<IChangeSet<TObject, TKey>> to group. + /// A Func<T, TResult> that extracts the group key from each item. /// An observable that emits group changesets. Each group exposes a sub-cache of its members. /// /// @@ -77,9 +77,9 @@ public static IObservable> Group /// - /// - /// - /// + /// GroupWithImmutableState<TObject, TKey, TGroupKey> + /// GroupOnObservable<TObject, TKey, TGroupKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IObservable<TGroupKey>>, TimeSpan?, IScheduler?) + /// GroupOnProperty<TObject, TKey, TGroupKey> public static IObservable> Group(this IObservable> source, Func groupSelectorKey) where TObject : notnull where TKey : notnull @@ -91,10 +91,15 @@ public static IObservable> Group(source, groupSelectorKey, null).Run(); } - /// - /// The source to group. - /// A that extracts the group key from each item. - /// An that, when it emits, all items are re-evaluated against the group selector, potentially moving items between groups. + /// + /// Provides an overload of Group for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The type of the TGroupKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to group. + /// A Func<T, TResult> that extracts the group key from each item. + /// An IObservable<Unit> that, when it emits, all items are re-evaluated against the group selector, potentially moving items between groups. /// An observable that emits group changesets. /// This overload adds a signal. When it fires, every item in the cache is re-grouped using the current selector, which is useful when the grouping depends on mutable item state. public static IObservable> Group(this IObservable> source, Func groupSelectorKey, IObservable regrouper) @@ -116,9 +121,9 @@ public static IObservable> GroupThe type of the object. /// The type of the key. /// The type of the group key. - /// The source to group. - /// The that emits group selector functions. Each emission triggers a full re-grouping of all items. - /// An that optional signal to force re-evaluation of all items against the current selector. + /// The source IObservable<IChangeSet<TObject, TKey>> to group. + /// The IObservable<Func<TObject, TKey, TGroupKey>> that emits group selector functions. Each emission triggers a full re-grouping of all items. + /// An IObservable<Unit> that optional signal to force re-evaluation of all items against the current selector. /// An observable that emits group changesets. /// /// @@ -134,8 +139,8 @@ public static IObservable> GroupRefreshGroup key re-evaluated. Item may move between groups. /// /// - /// - /// + /// Group<TObject, TKey, TGroupKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TGroupKey>) + /// GroupOnObservable<TObject, TKey, TGroupKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IObservable<TGroupKey>>, TimeSpan?, IScheduler?) public static IObservable> Group(this IObservable> source, IObservable> groupSelectorKeyObservable, IObservable? regrouper = null) where TObject : notnull where TKey : notnull @@ -147,10 +152,16 @@ public static IObservable> Group(source, groupSelectorKeyObservable, regrouper).Run(); } - /// - /// The source to group. - /// The of selector functions that take only the item (not the key). - /// An optional signal to force re-evaluation. + /// + /// Provides an overload of Group for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The type of the TGroupKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to group. + /// The IObservable<Func<TObject, TGroupKey>> of selector functions that take only the item (not the key). + /// An optional IObservable<Unit> signal to force re-evaluation. + /// The resulting observable sequence. /// This overload accepts a selector that does not receive the key. Delegates to the overload accepting Func<TObject, TKey, TGroupKey>. public static IObservable> Group(this IObservable> source, IObservable> groupSelectorKeyObservable, IObservable? regrouper = null) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs index df4231cce..91d231e9c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs @@ -30,12 +30,12 @@ public static partial class ObservableCacheEx /// The type of the object. /// The type of the key. /// The type of the group key. - /// The source to group using per-item observables. - /// A factory that creates a group key observable for each item and its key. + /// The source IObservable<IChangeSet<TObject, TKey>> to group using per-item observables. + /// A Func<T, TResult> factory that creates a group key observable for each item and its key. /// An observable that emits group changesets. Each group is a live sub-cache of its members. /// /// - /// Unlike which evaluates + /// Unlike Group<TObject, TKey, TGroupKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TGroupKey>) which evaluates /// the group key synchronously, this operator defers group assignment until the per-item observable emits. /// /// @@ -66,10 +66,10 @@ public static partial class ObservableCacheEx /// also completed. /// /// - /// - /// - /// - /// + /// Group<TObject, TKey, TGroupKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TGroupKey>) + /// GroupOnProperty<TObject, TKey, TGroupKey> + /// FilterOnObservable<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IObservable<bool>>, TimeSpan?, IScheduler?) + /// TransformOnObservable<TSource, TKey, TDestination>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, TKey, IObservable<TDestination>>) public static IObservable> GroupOnObservable(this IObservable> source, Func> groupObservableSelector) where TObject : notnull where TKey : notnull @@ -87,8 +87,8 @@ public static IObservable> GroupOnObse /// The type of the object. /// The type of the key. /// The type of the group key. - /// The source to group using per-item observables. - /// The group selector key. + /// The source IObservable<IChangeSet<TObject, TKey>> to group using per-item observables. + /// The Func<TObject, IObservable<TGroupKey>> group selector key. /// An observable which will emit group change sets. public static IObservable> GroupOnObservable(this IObservable> source, Func> groupObservableSelector) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs index ba2b40f07..78ed5c1af 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs @@ -30,8 +30,8 @@ public static partial class ObservableCacheEx /// The type of the object. /// The type of the key. /// The type of the group key. - /// The source to group by a property value. - /// The property selector used to group the items. + /// The source IObservable<IChangeSet<TObject, TKey>> to group by a property value. + /// The Expression<Func<TObject, TGroupKey>> property selector used to group the items. /// An optional a time span that indicates the throttle to wait for property change events. /// An optional for scheduling work. /// An observable which will emit immutable group change sets. diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs index 71fc48355..9b216305d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs @@ -30,8 +30,8 @@ public static partial class ObservableCacheEx /// The type of the object. /// The type of the key. /// The type of the group key. - /// The source to group by a property value with immutable snapshots. - /// The property selector used to group the items. + /// The source IObservable<IChangeSet<TObject, TKey>> to group by a property value with immutable snapshots. + /// The Expression<Func<TObject, TGroupKey>> property selector used to group the items. /// An optional a time span that indicates the throttle to wait for property change events. /// An optional for scheduling work. /// An observable which will emit immutable group change sets. diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs index ad0194fd9..e0a2779d0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs @@ -30,13 +30,13 @@ public static partial class ObservableCacheEx /// The type of the object. /// The type of the key. /// The type of the group key. - /// The source to group with immutable snapshots. - /// A that extracts the group key from each item. - /// An that optional signal to force re-evaluation of all items against the group selector. + /// The source IObservable<IChangeSet<TObject, TKey>> to group with immutable snapshots. + /// A Func<T, TResult> that extracts the group key from each item. + /// An IObservable<Unit> that optional signal to force re-evaluation of all items against the group selector. /// An observable that emits immutable group changesets. /// /// - /// Behaves identically to + /// Behaves identically to Group<TObject, TKey, TGroupKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TGroupKey>) /// in terms of how items are assigned to groups, but each group emission is an immutable snapshot. /// This makes it safe for parallel processing and eliminates race conditions on group state. /// The tradeoff is higher memory usage, since each change produces a new snapshot of the affected group. @@ -49,8 +49,8 @@ public static partial class ObservableCacheEx /// RefreshGroup key re-evaluated. If changed, item moves; affected group snapshots emitted. /// /// - /// - /// + /// Group<TObject, TKey, TGroupKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TGroupKey>) + /// GroupOnPropertyWithImmutableState<TObject, TKey, TGroupKey> public static IObservable> GroupWithImmutableState(this IObservable> source, Func groupSelectorKey, IObservable? regrouper = null) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs index acbfcff4d..bf90b05a5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs @@ -21,7 +21,7 @@ public static partial class ObservableCacheEx ///
/// The object of the change set. /// The key of the change set. - /// The source to suppress same-reference updates in. + /// The source IObservable<IChangeSet<TObject, TKey>> to suppress same-reference updates in. /// An observable which emits change sets and ignores equal value changes. public static IObservable> IgnoreSameReferenceUpdate(this IObservable> source) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs index 2f4c88f36..33b37e0bd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs @@ -22,8 +22,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to selectively suppress updates in. - /// The ignore function (current,previous)=>{ return true to ignore }. + /// The source IObservable<IChangeSet<TObject, TKey>> to selectively suppress updates in. + /// The Func<TObject, TObject, bool> ignore function (current,previous)=>{ return true to ignore }. /// An observable which emits change sets and ignores updates equal to the lambda. public static IObservable> IgnoreUpdateWhen(this IObservable> source, Func ignoreFunction) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs index b82ba7c80..17ea8683f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs @@ -22,8 +22,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to selectively include updates in. - /// The include function (current,previous)=>{ return true to include }. + /// The source IObservable<IChangeSet<TObject, TKey>> to selectively include updates in. + /// The Func<TObject, TObject, bool> include function (current,previous)=>{ return true to include }. /// An observable which emits change sets and ignores updates equal to the lambda. public static IObservable> IncludeUpdateWhen(this IObservable> source, Func includeFunction) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs index afcd0f103..7b5e5e612 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs @@ -23,12 +23,20 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the left and right values into a destination object. The composite key is not provided in this overload. - /// Overload that omits the composite key from the result selector. Delegates to . + /// + /// Joins two changeset streams and projects matching left and right values without exposing the composite key to the selector. + /// + /// The item type of the left source. + /// The key type of the left source. + /// The item type of the right source. + /// The key type of the right source. + /// The type produced by . + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the left and right values into a destination object. The composite key is not provided in this overload. + /// An observable changeset keyed by a composite (TLeftKey, TRightKey) tuple. + /// Overload that omits the composite key from the result selector. Delegates to InnerJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<ValueTuple<TLeftKey, TRightKey>, TLeft, TRight, TDestination>). public static IObservable> InnerJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -53,10 +61,10 @@ public static partial class ObservableCacheEx /// The item type of the right source. /// The key type of the right source. /// The type produced by . - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the composite key, left value, and right value into a destination object. Example: ((leftKey, rightKey), left, right) => new Result(leftKey, rightKey, left, right). + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the composite key, left value, and right value into a destination object. Example: ((leftKey, rightKey), left, right) => new Result(leftKey, rightKey, left, right). /// An observable changeset keyed by a composite (TLeftKey, TRightKey) tuple. /// /// @@ -83,10 +91,10 @@ public static partial class ObservableCacheEx /// Both sources are serialized through a shared lock held during downstream delivery. Avoid blocking operations in subscribers. /// /// Any argument is . - /// - /// - /// - /// + /// LeftJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, Optional<TRight>, TDestination>) + /// RightJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TRightKey, Optional<TLeft>, TRight, TDestination>) + /// FullJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, Optional<TRight>, TDestination>) + /// InnerJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) public static IObservable> InnerJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func<(TLeftKey leftKey, TRightKey rightKey), TLeft, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs index 4fb3df0c2..a186f9f74 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs @@ -23,12 +23,20 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the left value and the right group into a destination object. The key is not provided in this overload. - /// Overload that omits the key from the result selector. Delegates to . + /// + /// Provides an overload of InnerJoinMany for the supplied arguments. + /// + /// The type of the TLeft value. + /// The type of the TLeftKey value. + /// The type of the TRight value. + /// The type of the TRightKey value. + /// The type of the TDestination value. + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the left value and the right group into a destination object. The key is not provided in this overload. + /// The resulting observable sequence. + /// Overload that omits the key from the result selector. Delegates to InnerJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>). public static IObservable> InnerJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -54,10 +62,10 @@ public static IObservable> InnerJoinManyThe item type of the right source. /// The key type of the right source. /// The type produced by . - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the key, left value, and right group into a destination object. Example: (key, left, group) => new Result(key, left, group). + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the key, left value, and right group into a destination object. Example: (key, left, group) => new Result(key, left, group). /// An observable changeset keyed by . /// /// @@ -83,10 +91,10 @@ public static IObservable> InnerJoinManyBoth sources are serialized through a shared lock held during downstream delivery. Avoid blocking operations in subscribers. /// /// Any argument is . - /// - /// - /// - /// + /// InnerJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<ValueTuple<TLeftKey, TRightKey>, TLeft, TRight, TDestination>) + /// LeftJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) + /// RightJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) + /// FullJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) public static IObservable> InnerJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs index 0d30a208f..e28de5485 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs @@ -29,7 +29,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to trigger re-evaluation on. + /// The source IObservable<IChangeSet<TObject, TKey>> to trigger re-evaluation on. /// An observable that emits the same changesets as , unchanged. /// /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs index 6136761c7..fa246e0e3 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs @@ -23,12 +23,20 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the left value and the optional right into a destination object. The key is not provided in this overload. - /// Overload that omits the key from the result selector. Delegates to . + /// + /// Provides an overload of LeftJoin for the supplied arguments. + /// + /// The type of the TLeft value. + /// The type of the TLeftKey value. + /// The type of the TRight value. + /// The type of the TRightKey value. + /// The type of the TDestination value. + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the left value and the optional right into a destination object. The key is not provided in this overload. + /// The resulting observable sequence. + /// Overload that omits the key from the result selector. Delegates to LeftJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, Optional<TRight>, TDestination>). public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -46,7 +54,7 @@ public static IObservable> LeftJoin /// Joins two changeset streams, producing a result for every left-side key. The right side is - /// because a matching right item may or may not exist. All left items + /// Optional<T> because a matching right item may or may not exist. All left items /// appear in the output regardless. Equivalent to SQL LEFT OUTER JOIN. ///
/// The item type of the left source. @@ -54,17 +62,17 @@ public static IObservable> LeftJoinThe item type of the right source. /// The key type of the right source. /// The type produced by . - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the key, left value, and optional right into a destination object. Example: (key, left, right) => new Result(key, left, right). + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the key, left value, and optional right into a destination object. Example: (key, left, right) => new Result(key, left, right). /// An observable changeset keyed by . /// /// /// Left-side change handling: /// /// EventBehavior - /// AddAlways emits. Invokes with the left value and matching right (or ). + /// AddAlways emits. Invokes with the left value and matching right (or ReactiveUI.Primitives.Optional.None<T>). /// UpdateRe-invokes the selector with the new left value and current right (if any). /// RemoveRemoves the joined result. /// RefreshForwarded as Refresh on the joined result. @@ -83,10 +91,10 @@ public static IObservable> LeftJoinBoth sources are serialized through a shared lock held during downstream delivery. Avoid blocking operations in subscribers. /// /// Any argument is . - /// - /// - /// - /// + /// InnerJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<ValueTuple<TLeftKey, TRightKey>, TLeft, TRight, TDestination>) + /// RightJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TRightKey, Optional<TLeft>, TRight, TDestination>) + /// FullJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, Optional<TRight>, TDestination>) + /// LeftJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) public static IObservable> LeftJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs index 85025513e..ed93ff37d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs @@ -23,12 +23,20 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the left value and the right group into a destination object. The key is not provided in this overload. - /// Overload that omits the key from the result selector. Delegates to . + /// + /// Provides an overload of LeftJoinMany for the supplied arguments. + /// + /// The type of the TLeft value. + /// The type of the TLeftKey value. + /// The type of the TRight value. + /// The type of the TRightKey value. + /// The type of the TDestination value. + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the left value and the right group into a destination object. The key is not provided in this overload. + /// The resulting observable sequence. + /// Overload that omits the key from the result selector. Delegates to LeftJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>). public static IObservable> LeftJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -54,10 +62,10 @@ public static IObservable> LeftJoinManyThe item type of the right source. /// The key type of the right source. /// The type produced by . - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the key, left value, and right group into a destination object. Example: (key, left, group) => new Result(key, left, group). + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the key, left value, and right group into a destination object. Example: (key, left, group) => new Result(key, left, group). /// An observable changeset keyed by . /// /// @@ -83,10 +91,10 @@ public static IObservable> LeftJoinManyBoth sources are serialized through a shared lock held during downstream delivery. Avoid blocking operations in subscribers. /// /// Any argument is . - /// - /// - /// - /// + /// LeftJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, Optional<TRight>, TDestination>) + /// InnerJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) + /// RightJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) + /// FullJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) public static IObservable> LeftJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs index e01078e86..c374c90e1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs @@ -29,7 +29,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to apply size limits to. + /// The source IObservable<IChangeSet<TObject, TKey>> to apply size limits to. /// The maximum number of items allowed. Must be greater than zero. /// An observable changeset stream with size-limited contents. /// @@ -58,12 +58,12 @@ public static IObservable> LimitSizeTo( } /// - /// Operates directly on a , removing the oldest items when the cache + /// Operates directly on a ISourceCache<TObject, TKey>, removing the oldest items when the cache /// exceeds . Returns an observable of the evicted key-value pairs (not a changeset stream). /// /// The type of the object. /// The type of the key. - /// The to operate on. + /// The ISourceCache<TObject, TKey> to operate on. /// The maximum number of items allowed. Must be greater than zero. /// An optional for observing changes. Defaults to . /// An observable that emits batches of evicted key-value pairs whenever the cache exceeds the size limit. diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs index 62f4bb898..195996299 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs @@ -31,23 +31,23 @@ public static partial class ObservableCacheEx ///
/// The type of items in the changesets. /// The type of the key identifying items. - /// An that emits changeset streams. Each inner stream is subscribed as it appears. + /// An IObservable<T> that emits changeset streams. Each inner stream is subscribed as it appears. /// A unified changeset stream containing changes from all active source streams. /// /// /// Each inner changeset stream is independently tracked in its own cache. When multiple sources provide the same key, /// this overload uses first-in-wins semantics: the value from whichever source added the key first is /// the one published downstream. To control which value wins for duplicate keys, use an overload that - /// accepts an , which selects the lowest-ordered value across all sources. - /// An can be provided separately to suppress no-op updates when + /// accepts an IComparer<T>, which selects the lowest-ordered value across all sources. + /// An IEqualityComparer<T> can be provided separately to suppress no-op updates when /// the new value equals the currently published value for a key. /// /// /// Overload families: MergeChangeSets has 16 overloads organized along three axes: /// (1) Source type: dynamic (IObservable<IObservable<IChangeSet>>, sources arrive at runtime), - /// pair (source + other, exactly two streams), or static (, all sources known up front). - /// (2) Conflict resolution: none (first-in-wins), (lowest-ordered wins), - /// (suppresses duplicate updates), or both. + /// pair (source + other, exactly two streams), or static (IEnumerable<T>, all sources known up front). + /// (2) Conflict resolution: none (first-in-wins), IComparer<T> (lowest-ordered wins), + /// IEqualityComparer<T> (suppresses duplicate updates), or both. /// (3) Completion: static overloads accept a completable flag; when , the output never completes /// even after all sources finish (useful for "live" merge scenarios). /// @@ -67,9 +67,9 @@ public static partial class ObservableCacheEx /// /// /// is . - /// - /// - /// + /// MergeMany<TObject, TKey, TDestination>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<TDestination>>) + /// MergeManyChangeSets<TObject, TKey, TDestination, TDestinationKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IObservable<IChangeSet<TDestination, TDestinationKey>>>, IComparer<TDestination>, IEqualityComparer<TDestination>) + /// ObservableListEx.MergeChangeSets public static IObservable> MergeChangeSets(this IObservable>> source) where TObject : notnull where TKey : notnull @@ -86,8 +86,8 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// An that emits changeset streams. Each inner stream is subscribed as it appears. - /// An that comparer to determine which value wins when multiple sources provide the same key. The lowest-ordered value is published. + /// An IObservable<T> that emits changeset streams. Each inner stream is subscribed as it appears. + /// An IComparer<TObject> that comparer to determine which value wins when multiple sources provide the same key. The lowest-ordered value is published. /// A unified changeset stream containing changes from all active source streams. /// or is null. public static IObservable> MergeChangeSets(this IObservable>> source, IComparer comparer) @@ -107,8 +107,8 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// An that emits changeset streams. Each inner stream is subscribed as it appears. - /// An that equality comparer to detect duplicate values for the same key, suppressing no-op updates. + /// An IObservable<T> that emits changeset streams. Each inner stream is subscribed as it appears. + /// An IEqualityComparer<TObject> that equality comparer to detect duplicate values for the same key, suppressing no-op updates. /// A unified changeset stream containing changes from all active source streams. /// or is null. public static IObservable> MergeChangeSets(this IObservable>> source, IEqualityComparer equalityComparer) @@ -127,9 +127,9 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// An that emits changeset streams. Each inner stream is subscribed as it appears. - /// An that equality comparer to detect duplicate values for the same key, suppressing no-op updates. - /// An that comparer to determine which value wins when multiple sources provide the same key. The lowest-ordered value is published. + /// An IObservable<T> that emits changeset streams. Each inner stream is subscribed as it appears. + /// An IEqualityComparer<TObject> that equality comparer to detect duplicate values for the same key, suppressing no-op updates. + /// An IComparer<TObject> that comparer to determine which value wins when multiple sources provide the same key. The lowest-ordered value is published. /// A unified changeset stream containing changes from all active source streams. /// , , or is null. public static IObservable> MergeChangeSets(this IObservable>> source, IEqualityComparer equalityComparer, IComparer comparer) @@ -149,8 +149,8 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// The second to merge with . + /// The source IObservable<IChangeSet<TObject, TKey>> to merge. + /// The second IObservable<IChangeSet<TObject, TKey>> to merge with . /// An optional used when subscribing to the source streams. /// If (default), the output completes when both streams complete. If , the output never completes. /// A unified changeset stream containing changes from both sources. @@ -170,9 +170,9 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// The second to merge with . - /// An that comparer to determine which value wins when both sources provide the same key. + /// The source IObservable<IChangeSet<TObject, TKey>> to merge. + /// The second IObservable<IChangeSet<TObject, TKey>> to merge with . + /// An IComparer<TObject> that comparer to determine which value wins when both sources provide the same key. /// An optional used when subscribing to the source streams. /// If (default), the output completes when both streams complete. If , the output never completes. /// A unified changeset stream containing changes from both sources. @@ -193,9 +193,9 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// The second to merge with . - /// An that equality comparer to detect duplicate values for the same key. + /// The source IObservable<IChangeSet<TObject, TKey>> to merge. + /// The second IObservable<IChangeSet<TObject, TKey>> to merge with . + /// An IEqualityComparer<TObject> that equality comparer to detect duplicate values for the same key. /// An optional used when subscribing to the source streams. /// If (default), the output completes when both streams complete. If , the output never completes. /// A unified changeset stream containing changes from both sources. @@ -216,10 +216,10 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// The second to merge with . - /// An that equality comparer to detect duplicate values for the same key. - /// An that comparer to determine which value wins when both sources provide the same key. + /// The source IObservable<IChangeSet<TObject, TKey>> to merge. + /// The second IObservable<IChangeSet<TObject, TKey>> to merge with . + /// An IEqualityComparer<TObject> that equality comparer to detect duplicate values for the same key. + /// An IComparer<TObject> that comparer to determine which value wins when both sources provide the same key. /// An optional used when subscribing to the source streams. /// If (default), the output completes when both streams complete. If , the output never completes. /// A unified changeset stream containing changes from both sources. @@ -242,8 +242,8 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// The additional streams to merge with . + /// The source IObservable<IChangeSet<TObject, TKey>> to merge. + /// The additional IObservable<IChangeSet<TObject, TKey>> streams to merge with . /// An optional used when subscribing to the source streams. /// If (default), the output completes when all streams complete. If , the output never completes. /// A unified changeset stream containing changes from all sources. @@ -263,9 +263,9 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// The additional streams to merge with . - /// An that comparer to determine which value wins when multiple sources provide the same key. + /// The source IObservable<IChangeSet<TObject, TKey>> to merge. + /// The additional IObservable<IChangeSet<TObject, TKey>> streams to merge with . + /// An IComparer<TObject> that comparer to determine which value wins when multiple sources provide the same key. /// An optional used when subscribing to the source streams. /// If (default), the output completes when all streams complete. If , the output never completes. /// A unified changeset stream containing changes from all sources. @@ -286,9 +286,9 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// The additional streams to merge with . - /// An that equality comparer to detect duplicate values for the same key. + /// The source IObservable<IChangeSet<TObject, TKey>> to merge. + /// The additional IObservable<IChangeSet<TObject, TKey>> streams to merge with . + /// An IEqualityComparer<TObject> that equality comparer to detect duplicate values for the same key. /// An optional used when subscribing to the source streams. /// If (default), the output completes when all streams complete. If , the output never completes. /// A unified changeset stream containing changes from all sources. @@ -309,10 +309,10 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// The additional streams to merge with . - /// An that equality comparer to detect duplicate values for the same key. - /// An that comparer to determine which value wins when multiple sources provide the same key. + /// The source IObservable<IChangeSet<TObject, TKey>> to merge. + /// The additional IObservable<IChangeSet<TObject, TKey>> streams to merge with . + /// An IEqualityComparer<TObject> that equality comparer to detect duplicate values for the same key. + /// An IComparer<TObject> that comparer to determine which value wins when multiple sources provide the same key. /// An optional used when subscribing to the source streams. /// If (default), the output completes when all streams complete. If , the output never completes. /// A unified changeset stream containing changes from all sources. @@ -335,7 +335,7 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. + /// The source IEnumerable<T> to merge. /// An optional used when subscribing to the source streams. /// If (default), the output completes when all source streams have completed. If , the output never completes. /// A unified changeset stream containing changes from all source streams. @@ -344,7 +344,7 @@ public static IObservable> MergeChangeSets. + /// that accepts an IComparer<T>. /// /// /// An error from any source terminates the entire merged output. @@ -367,8 +367,8 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// An that comparer to determine which value wins when multiple sources provide the same key. The lowest-ordered value is published. + /// The source IEnumerable<T> to merge. + /// An IComparer<TObject> that comparer to determine which value wins when multiple sources provide the same key. The lowest-ordered value is published. /// An optional used when subscribing to the source streams. /// If (default), the output completes when all source streams have completed. If , the output never completes. /// A unified changeset stream containing changes from all source streams. @@ -390,8 +390,8 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// An that equality comparer to detect duplicate values for the same key, suppressing no-op updates. + /// The source IEnumerable<T> to merge. + /// An IEqualityComparer<TObject> that equality comparer to detect duplicate values for the same key, suppressing no-op updates. /// An optional used when subscribing to the source streams. /// If (default), the output completes when all source streams have completed. If , the output never completes. /// A unified changeset stream containing changes from all source streams. @@ -412,9 +412,9 @@ public static IObservable> MergeChangeSets /// The type of items in the changesets. /// The type of the key identifying items. - /// The source to merge. - /// An that equality comparer to detect duplicate values for the same key, suppressing no-op updates. - /// An that comparer to determine which value wins when multiple sources provide the same key. The lowest-ordered value is published. + /// The source IEnumerable<T> to merge. + /// An IEqualityComparer<TObject> that equality comparer to detect duplicate values for the same key, suppressing no-op updates. + /// An IComparer<TObject> that comparer to determine which value wins when multiple sources provide the same key. The lowest-ordered value is published. /// An optional used when subscribing to the source streams. /// If (default), the output completes when all source streams have completed. If , the output never completes. /// A unified changeset stream containing changes from all source streams. diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs index dd2ac15ed..9dbde938b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs @@ -25,15 +25,15 @@ public static partial class ObservableCacheEx { /// /// Subscribes to a child observable for each item in the source cache changeset stream and merges all child - /// emissions into a single . When an item is added, + /// emissions into a single IObservable<T>. When an item is added, /// creates its child subscription. When updated, the previous child subscription is disposed and a new one is created. /// When removed, its child subscription is disposed. Refresh changes have no effect on subscriptions. /// /// The type of items in the source cache. /// The type of the key identifying source cache items. /// The type of values emitted by child observables. - /// The source whose items each produce an observable. - /// A factory function that produces a child observable for each source item. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce an observable. + /// A Func<T, TResult> factory function that produces a child observable for each source item. /// An observable that emits values from all active child observables, interleaved by arrival order. /// /// @@ -49,13 +49,13 @@ public static partial class ObservableCacheEx /// RefreshNo effect on subscriptions. The child observable continues unchanged. /// OnErrorErrors from child observables are silently swallowed (the child is unsubscribed). Errors from the source changeset stream terminate the merged output. /// - /// Worth noting: The output is a plain , not a changeset stream. If you need merged changesets, use instead. + /// Worth noting: The output is a plain IObservable<TDestination>, not a changeset stream. If you need merged changesets, use MergeManyChangeSets<TObject, TKey, TDestination, TDestinationKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IObservable<IChangeSet<TDestination, TDestinationKey>>>, IComparer<TDestination>, IEqualityComparer<TDestination>) instead. /// /// or is null. - /// - /// - /// - /// + /// MergeManyChangeSets<TObject, TKey, TDestination, TDestinationKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IObservable<IChangeSet<TDestination, TDestinationKey>>>, IComparer<TDestination>, IEqualityComparer<TDestination>) + /// MergeChangeSets<TObject, TKey>(IObservable<IObservable<IChangeSet<TObject, TKey>>>) + /// SubscribeMany<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IDisposable>) + /// ObservableListEx.MergeMany public static IObservable MergeMany(this IObservable> source, Func> observableSelector) where TObject : notnull where TKey : notnull @@ -66,9 +66,15 @@ public static IObservable MergeMany(t return new MergeMany(source, observableSelector).Run(); } - /// - /// The source whose items each produce an observable. - /// A factory function that receives both the item and its key, and returns a child observable. + /// + /// Provides an overload of MergeMany for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The type of the TDestination value. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce an observable. + /// A Func<T, TResult> factory function that receives both the item and its key, and returns a child observable. + /// The resulting observable sequence. public static IObservable MergeMany(this IObservable> source, Func> observableSelector) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs index 9415a37dc..df5f51d1f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs @@ -32,12 +32,12 @@ public static partial class ObservableCacheEx /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and returns a child cache changeset stream. - /// An that comparer to resolve key conflicts when multiple child streams provide items with the same destination key. The lowest-ordered item wins. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and returns a child cache changeset stream. + /// An IComparer<TDestination> that comparer to resolve key conflicts when multiple child streams provide items with the same destination key. The lowest-ordered item wins. /// A merged changeset stream containing items from all active child streams. /// or is null. - /// + /// ObservableListEx.MergeManyChangeSets public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IComparer comparer) where TObject : notnull where TKey : notnull @@ -57,9 +57,9 @@ public static IObservable> MergeManyCh /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and its key, and returns a child cache changeset stream. - /// An that comparer to resolve key conflicts when multiple child streams provide items with the same destination key. The lowest-ordered item wins. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and its key, and returns a child cache changeset stream. + /// An IComparer<TDestination> that comparer to resolve key conflicts when multiple child streams provide items with the same destination key. The lowest-ordered item wins. /// A merged changeset stream containing items from all active child streams. /// , , or is null. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IComparer comparer) @@ -83,10 +83,10 @@ public static IObservable> MergeManyCh /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and returns a child cache changeset stream. - /// An that optional equality comparer to suppress updates when the incoming child value equals the current value for a destination key. - /// An that optional comparer to resolve key conflicts when multiple child streams provide items with the same destination key. The lowest-ordered item wins. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and returns a child cache changeset stream. + /// An IEqualityComparer<TDestination> that optional equality comparer to suppress updates when the incoming child value equals the current value for a destination key. + /// An IComparer<TDestination> that optional comparer to resolve key conflicts when multiple child streams provide items with the same destination key. The lowest-ordered item wins. /// A merged changeset stream containing items from all active child streams. /// or is null. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) @@ -110,14 +110,14 @@ public static IObservable> MergeManyCh /// The type of the key identifying parent items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a parent item and its key, and returns a child cache changeset stream. Called once per parent Add/Update. - /// An that optional equality comparer to suppress no-op child updates. When a child key's new value equals the current value per this comparer, the update is not emitted. - /// An that optional comparer to resolve child key conflicts when multiple parents contribute children with the same destination key. The lowest-ordered child value wins. Without a comparer, the first parent to provide a key retains priority. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a parent item and its key, and returns a child cache changeset stream. Called once per parent Add/Update. + /// An IEqualityComparer<TDestination> that optional equality comparer to suppress no-op child updates. When a child key's new value equals the current value per this comparer, the update is not emitted. + /// An IComparer<TDestination> that optional comparer to resolve child key conflicts when multiple parents contribute children with the same destination key. The lowest-ordered child value wins. Without a comparer, the first parent to provide a key retains priority. /// A merged changeset stream containing all child items from all active parent subscriptions. /// /// - /// This is the changeset-aware counterpart to . + /// This is the changeset-aware counterpart to MergeMany<TObject, TKey, TDestination>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<TDestination>>). /// Where MergeMany produces a flat IObservable<T>, MergeManyChangeSets produces an IObservable<IChangeSet> /// that tracks the full lifecycle of child items, including key conflict resolution across parents. /// @@ -146,7 +146,7 @@ public static IObservable> MergeManyCh /// /// /// EventBehavior - /// OnErrorAn error from the source (parent) stream or from any child changeset stream terminates the entire output. Unlike , child errors are NOT swallowed. + /// OnErrorAn error from the source (parent) stream or from any child changeset stream terminates the entire output. Unlike MergeMany<TObject, TKey, TDestination>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<TDestination>>), child errors are NOT swallowed. /// OnCompletedThe output completes when the source (parent) stream completes and all active child changeset streams have also completed. /// /// @@ -158,9 +158,9 @@ public static IObservable> MergeManyCh /// /// /// or is . - /// - /// - /// + /// MergeMany<TObject, TKey, TDestination>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<TDestination>>) + /// MergeChangeSets<TObject, TKey>(IObservable<IObservable<IChangeSet<TObject, TKey>>>) + /// TransformMany<TDestination, TDestinationKey, TSource, TSourceKey>(IObservable<IChangeSet<TSource, TSourceKey>>, Func<TSource, IObservable<IChangeSet<TDestination, TDestinationKey>>>, Func<TDestination, TDestinationKey>) public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) where TObject : notnull where TKey : notnull @@ -183,10 +183,10 @@ public static IObservable> MergeManyCh /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and returns a child cache changeset stream. - /// An that comparer to prioritize between source items when their children produce the same destination key. Lower-ordered source wins. - /// An that fallback comparer to resolve destination key conflicts when source items compare equal. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and returns a child cache changeset stream. + /// An IComparer<TObject> that comparer to prioritize between source items when their children produce the same destination key. Lower-ordered source wins. + /// An IComparer<TDestination> that fallback comparer to resolve destination key conflicts when source items compare equal. /// A merged changeset stream with conflicts resolved by source priority. /// or is null. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IComparer sourceComparer, IComparer childComparer) @@ -210,10 +210,10 @@ public static IObservable> MergeManyCh /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and its key, and returns a child cache changeset stream. - /// An that comparer to prioritize between source items when their children produce the same destination key. Lower-ordered source wins. - /// An that fallback comparer to resolve destination key conflicts when source items compare equal. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and its key, and returns a child cache changeset stream. + /// An IComparer<TObject> that comparer to prioritize between source items when their children produce the same destination key. Lower-ordered source wins. + /// An IComparer<TDestination> that fallback comparer to resolve destination key conflicts when source items compare equal. /// A merged changeset stream with conflicts resolved by source priority. /// or is null. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IComparer sourceComparer, IComparer childComparer) @@ -230,11 +230,11 @@ public static IObservable> MergeManyCh /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and returns a child cache changeset stream. - /// An that comparer to prioritize between source items when their children produce the same destination key. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and returns a child cache changeset stream. + /// An IComparer<TObject> that comparer to prioritize between source items when their children produce the same destination key. /// If , a Refresh in the source stream re-evaluates source priorities. If , Refresh events are ignored for priority recalculation. - /// An that fallback comparer to resolve destination key conflicts when source items compare equal. + /// An IComparer<TDestination> that fallback comparer to resolve destination key conflicts when source items compare equal. /// A merged changeset stream with conflicts resolved by source priority. /// or is null. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IComparer sourceComparer, bool resortOnSourceRefresh, IComparer childComparer) @@ -257,11 +257,11 @@ public static IObservable> MergeManyCh /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and its key, and returns a child cache changeset stream. - /// An that comparer to prioritize between source items when their children produce the same destination key. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and its key, and returns a child cache changeset stream. + /// An IComparer<TObject> that comparer to prioritize between source items when their children produce the same destination key. /// If , a Refresh in the source stream re-evaluates source priorities. If , Refresh events are ignored for priority recalculation. - /// An that fallback comparer to resolve destination key conflicts when source items compare equal. + /// An IComparer<TDestination> that fallback comparer to resolve destination key conflicts when source items compare equal. /// A merged changeset stream with conflicts resolved by source priority. /// or is null. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IComparer sourceComparer, bool resortOnSourceRefresh, IComparer childComparer) @@ -279,11 +279,11 @@ public static IObservable> MergeManyCh /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and returns a child cache changeset stream. - /// An that comparer to prioritize between source items when their children produce the same destination key. - /// An that optional equality comparer to suppress updates when the incoming child value equals the current value. - /// An that optional fallback comparer for destination key conflicts when source items compare equal. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and returns a child cache changeset stream. + /// An IComparer<TObject> that comparer to prioritize between source items when their children produce the same destination key. + /// An IEqualityComparer<TDestination> that optional equality comparer to suppress updates when the incoming child value equals the current value. + /// An IComparer<TDestination> that optional fallback comparer for destination key conflicts when source items compare equal. /// A merged changeset stream with conflicts resolved by source priority. /// or is null. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IComparer sourceComparer, IEqualityComparer? equalityComparer = null, IComparer? childComparer = null) @@ -306,11 +306,11 @@ public static IObservable> MergeManyCh /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and its key, and returns a child cache changeset stream. - /// An that comparer to prioritize between source items when their children produce the same destination key. - /// An that optional equality comparer to suppress updates when the incoming child value equals the current value. - /// An that optional fallback comparer for destination key conflicts when source items compare equal. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and its key, and returns a child cache changeset stream. + /// An IComparer<TObject> that comparer to prioritize between source items when their children produce the same destination key. + /// An IEqualityComparer<TDestination> that optional equality comparer to suppress updates when the incoming child value equals the current value. + /// An IComparer<TDestination> that optional fallback comparer for destination key conflicts when source items compare equal. /// A merged changeset stream with conflicts resolved by source priority. /// or is null. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IComparer sourceComparer, IEqualityComparer? equalityComparer = null, IComparer? childComparer = null) @@ -327,12 +327,12 @@ public static IObservable> MergeManyCh /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and returns a child cache changeset stream. - /// An that comparer to prioritize between source items when their children produce the same destination key. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and returns a child cache changeset stream. + /// An IComparer<TObject> that comparer to prioritize between source items when their children produce the same destination key. /// If , a Refresh in the source stream re-evaluates source priorities. If , Refresh events are ignored for priority recalculation. - /// An that optional equality comparer to suppress updates when the incoming child value equals the current value. - /// An that optional fallback comparer for destination key conflicts when source items compare equal. + /// An IEqualityComparer<TDestination> that optional equality comparer to suppress updates when the incoming child value equals the current value. + /// An IComparer<TDestination> that optional fallback comparer for destination key conflicts when source items compare equal. /// A merged changeset stream with conflicts resolved by source priority. /// or is null. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IComparer sourceComparer, bool resortOnSourceRefresh, IEqualityComparer? equalityComparer = null, IComparer? childComparer = null) @@ -357,12 +357,12 @@ public static IObservable> MergeManyCh /// The type of the key identifying source cache items. /// The type of items in the child changeset streams. /// The type of the key identifying child items. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and its key, and returns a child cache changeset stream. - /// An that comparer to prioritize between source items when their children produce the same destination key. Lower-ordered source wins. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and its key, and returns a child cache changeset stream. + /// An IComparer<TObject> that comparer to prioritize between source items when their children produce the same destination key. Lower-ordered source wins. /// If (default), a Refresh in the source stream re-evaluates source priorities. If , Refresh events are ignored for priority recalculation. - /// An that optional equality comparer to suppress updates when the incoming child value equals the current value for a destination key. - /// An that optional fallback comparer to resolve destination key conflicts when source items compare equal. + /// An IEqualityComparer<TDestination> that optional equality comparer to suppress updates when the incoming child value equals the current value for a destination key. + /// An IComparer<TDestination> that optional fallback comparer to resolve destination key conflicts when source items compare equal. /// A merged changeset stream containing items from all active child streams, with conflicts resolved by source priority. /// /// @@ -396,9 +396,9 @@ public static IObservable> MergeManyCh /// The type of items in the source cache. /// The type of the key identifying source cache items. /// The type of items in the child list changeset streams. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and its key, and returns a child list changeset stream. - /// An that optional equality comparer to detect duplicate items in the merged list output. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and its key, and returns a child list changeset stream. + /// An IEqualityComparer<TDestination> that optional equality comparer to detect duplicate items in the merged list output. /// A merged list changeset stream containing items from all active child streams. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IEqualityComparer? equalityComparer = null) where TObject : notnull @@ -418,9 +418,9 @@ public static IObservable> MergeManyChangeSetsThe type of items in the source cache. /// The type of the key identifying source cache items. /// The type of items in the child list changeset streams. - /// The source whose items each produce a child changeset stream. - /// A factory function that receives a source item and returns a child list changeset stream. - /// An that optional equality comparer to detect duplicate items in the merged list output. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce a child changeset stream. + /// A Func<T, TResult> factory function that receives a source item and returns a child list changeset stream. + /// An IEqualityComparer<TDestination> that optional equality comparer to detect duplicate items in the merged list output. /// A merged list changeset stream containing items from all active child streams. public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IEqualityComparer? equalityComparer = null) where TObject : notnull @@ -431,5 +431,8 @@ public static IObservable> MergeManyChangeSets observableSelector(obj), equalityComparer); } + /// + /// The DefaultResortOnSourceRefresh field. + /// private const bool DefaultResortOnSourceRefresh = true; } diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs index 23b7a50c7..333bab75e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs @@ -24,16 +24,16 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Like , - /// but wraps each emitted value as an , pairing the source item + /// Like MergeMany<TObject, TKey, TDestination>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<TDestination>>), + /// but wraps each emitted value as an ItemWithValue<TObject, TValue>, pairing the source item /// with the value it produced. This lets you identify which source item is responsible for each emission. /// /// The type of items in the source cache. /// The type of the key identifying source cache items. /// The type of values emitted by child observables. - /// The source whose items each produce an observable. - /// A factory function that produces a child observable for each source item. - /// An observable of pairing each emission with its source item. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce an observable. + /// A Func<T, TResult> factory function that produces a child observable for each source item. + /// An observable of ItemWithValue<TObject, TValue> pairing each emission with its source item. /// or is null. public static IObservable> MergeManyItems(this IObservable> source, Func> observableSelector) where TObject : notnull @@ -45,9 +45,15 @@ public static IObservable> MergeManyItems(source, observableSelector).Run(); } - /// - /// The source whose items each produce an observable. - /// A factory function that receives both the item and its key, and returns a child observable. + /// + /// Provides an overload of MergeManyItems for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The type of the TDestination value. + /// The source IObservable<IChangeSet<TObject, TKey>> whose items each produce an observable. + /// A Func<T, TResult> factory function that receives both the item and its key, and returns a child observable. + /// The resulting observable sequence. public static IObservable> MergeManyItems(this IObservable> source, Func> observableSelector) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs index 5c3fd7e1c..330da7bff 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs @@ -29,9 +29,9 @@ public static partial class ObservableCacheEx /// This is not a changeset operator. ///
/// The type of the source observable. - /// The source to monitor for connection status. + /// The source IObservable<T> to monitor for connection status. /// An observable that emits values reflecting the source's lifecycle. /// is . - /// + /// DeferUntilLoaded<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>) public static IObservable MonitorStatus(this IObservable source) => new StatusMonitor(source).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs index 2cd057957..6efbfbad7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs @@ -21,10 +21,10 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to suppress empty changesets. + /// The source IObservable<IChangeSet<TObject, TKey>> to suppress empty changesets. /// An observable that emits only non-empty changesets. /// is . - /// + /// StartWithEmpty<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>) public static IObservable> NotEmpty(this IObservable> source) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs index 96ac16dcf..51a5cd785 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs @@ -30,7 +30,7 @@ public static partial class ObservableCacheEx /// The type of the objects in the source changeset. /// The type of the key. /// The destination type to filter and cast to. - /// The source to filter by type. + /// The source IObservable<IChangeSet<TObject, TKey>> to filter by type. /// If , changesets that become empty after filtering are suppressed. /// An observable changeset of items. /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs index e06781744..97bb8ad5f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs @@ -16,6 +16,15 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { + /// + /// Executes the OnChangeAction operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The predicate value. + /// The changeAction value. + /// The result of the operation. private static IObservable> OnChangeAction(this IObservable> source, Predicate> predicate, Action> changeAction) where TObject : notnull where TKey : notnull @@ -34,6 +43,15 @@ private static IObservable> OnChangeAction + /// Executes the OnChangeAction operation. + ///
+ /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The reason value. + /// The action value. + /// The result of the operation. private static IObservable> OnChangeAction(this IObservable> source, ChangeReason reason, Action action) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs index 103b06cf4..ef19609f0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs @@ -21,8 +21,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to observe item additions in. - /// The callback invoked for each added item. Receives the new item and its key. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe item additions in. + /// The Action<TObject, TKey> callback invoked for each added item. Receives the new item and its key. /// A stream that forwards all changesets from unchanged. /// /// @@ -40,10 +40,10 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// - /// - /// - /// + /// OnItemUpdated<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>, Action<TObject,TObject,TKey>) + /// OnItemRemoved<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>, Action<TObject,TKey>, bool) + /// ForEachChange<TObject,TKey> + /// ObservableListEx.OnItemAdded public static IObservable> OnItemAdded(this IObservable> source, Action addAction) where TObject : notnull where TKey : notnull @@ -54,10 +54,15 @@ public static IObservable> OnItemAdded( return source.OnChangeAction(ChangeReason.Add, addAction); } - /// - /// The source to observe item additions in. - /// The callback invoked for each added item. Receives only the item (no key). - /// Overload that omits the key from the callback. Delegates to . + /// + /// Provides an overload of addAction for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe item additions in. + /// The Action<TObject> callback invoked for each added item. Receives only the item (no key). + /// The resulting observable sequence. + /// Overload that omits the key from the callback. Delegates to OnItemAdded<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Action<TObject, TKey>). public static IObservable> OnItemAdded(this IObservable> source, Action addAction) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs index 8b05b3ce5..2de302775 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs @@ -21,8 +21,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to observe item refresh events in. - /// The callback invoked for each refreshed item. Receives the item and its key. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe item refresh events in. + /// The Action<TObject, TKey> callback invoked for each refreshed item. Receives the item and its key. /// A stream that forwards all changesets from unchanged. /// /// @@ -40,8 +40,8 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// - /// + /// AutoRefresh<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>, TimeSpan?, TimeSpan?, IScheduler?) + /// ObservableListEx.OnItemRefreshed public static IObservable> OnItemRefreshed(this IObservable> source, Action refreshAction) where TObject : notnull where TKey : notnull @@ -52,10 +52,15 @@ public static IObservable> OnItemRefreshed - /// The source to observe item refresh events in. - /// The callback invoked for each refreshed item. Receives only the item (no key). - /// Overload that omits the key from the callback. Delegates to . + /// + /// Provides an overload of refreshAction for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe item refresh events in. + /// The Action<TObject> callback invoked for each refreshed item. Receives only the item (no key). + /// The resulting observable sequence. + /// Overload that omits the key from the callback. Delegates to OnItemRefreshed<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Action<TObject, TKey>). public static IObservable> OnItemRefreshed(this IObservable> source, Action refreshAction) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs index 54b2841f5..306876816 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs @@ -29,8 +29,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to observe item removals in. - /// The callback invoked for each removed item. Receives the removed item and its key. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe item removals in. + /// The Action<TObject, TKey> callback invoked for each removed item. Receives the removed item and its key. /// /// When (the default), the callback is also invoked for every item still in the cache /// when the subscription is disposed. When , only inline Remove changes trigger the callback. @@ -60,9 +60,9 @@ public static partial class ObservableCacheEx /// Worth noting: The action also fires for ALL remaining items when the subscription is disposed (unless invokeOnUnsubscribe is ). The action runs under a lock; avoid calling into other caches from within it. /// /// or is . - /// - /// - /// + /// DisposeMany<TObject,TKey> + /// SubscribeMany<TObject,TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IDisposable>) + /// ObservableListEx.OnItemRemoved public static IObservable> OnItemRemoved(this IObservable> source, Action removeAction, bool invokeOnUnsubscribe = true) where TObject : notnull where TKey : notnull @@ -78,11 +78,16 @@ public static IObservable> OnItemRemoved - /// The source to observe item removals in. - /// The callback invoked for each removed item. Receives only the item (no key). + /// + /// Provides an overload of removeAction for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe item removals in. + /// The Action<TObject> callback invoked for each removed item. Receives only the item (no key). /// When (the default), also invoked for all remaining items on disposal. - /// Overload that omits the key from the callback. Delegates to . + /// The resulting observable sequence. + /// Overload that omits the key from the callback. Delegates to OnItemRemoved<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Action<TObject, TKey>, bool). public static IObservable> OnItemRemoved(this IObservable> source, Action removeAction, bool invokeOnUnsubscribe = true) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs index 500aff82b..fd77095f5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs @@ -22,8 +22,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to observe item updates in. - /// The callback invoked for each updated item. Receives the current value, previous value, and key. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe item updates in. + /// The Action<TObject, TObject, TKey> callback invoked for each updated item. Receives the current value, previous value, and key. /// A stream that forwards all changesets from unchanged. /// /// @@ -41,8 +41,8 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// - /// + /// OnItemAdded<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>, Action<TObject,TKey>) + /// ForEachChange<TObject,TKey> public static IObservable> OnItemUpdated(this IObservable> source, Action updateAction) where TObject : notnull where TKey : notnull @@ -53,10 +53,15 @@ public static IObservable> OnItemUpdated change.Reason == ChangeReason.Update, change => updateAction(change.Current, change.Previous.Value, change.Key)); } - /// - /// The source to observe item updates in. - /// The callback invoked for each updated item. Receives only the current and previous values (no key). - /// Overload that omits the key from the callback. Delegates to . + /// + /// Provides an overload of updateAction for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe item updates in. + /// The Action<TObject, TObject> callback invoked for each updated item. Receives only the current and previous values (no key). + /// The resulting observable sequence. + /// Overload that omits the key from the callback. Delegates to OnItemUpdated<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Action<TObject, TObject, TKey>). public static IObservable> OnItemUpdated(this IObservable> source, Action updateAction) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Or.cs b/src/DynamicData/Cache/ObservableCacheEx.Or.cs index e1476c173..e8633b51a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Or.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Or.cs @@ -28,8 +28,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to combine. - /// The additional streams to combine with. + /// The source IObservable<IChangeSet<TObject, TKey>> to combine. + /// The additional IObservable<IChangeSet<TObject, TKey>> streams to combine with. /// A changeset stream containing items present in any of the sources. /// /// @@ -45,11 +45,11 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// - /// - /// - /// - /// + /// And<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IChangeSet<TObject, TKey>>[]) + /// Except<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IChangeSet<TObject, TKey>>[]) + /// Xor<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IChangeSet<TObject, TKey>>[]) + /// MergeChangeSets<TObject, TKey>(IObservable<IObservable<IChangeSet<TObject, TKey>>>) + /// ObservableListEx.Or public static IObservable> Or(this IObservable> source, params IObservable>[] others) where TObject : notnull where TKey : notnull @@ -64,8 +64,13 @@ public static IObservable> Or(this IObs return source.Combine(CombineOperator.Or, others); } - /// - /// The of streams to combine. + /// + /// Provides an overload of Or for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The ICollection<T> of streams to combine. + /// The resulting observable sequence. /// This overload accepts a pre-built collection of sources instead of a params array. public static IObservable> Or(this ICollection>> sources) where TObject : notnull @@ -82,7 +87,7 @@ public static IObservable> Or(this ICol ///
/// The type of the object. /// The type of the key. - /// The of streams to combine. + /// The IObservableList<T> of streams to combine. /// An observable which emits change sets. public static IObservable> Or(this IObservableList>> sources) where TObject : notnull @@ -99,7 +104,7 @@ public static IObservable> Or(this IObs ///
/// The type of the object. /// The type of the key. - /// The of changeset streams to combine. + /// The IObservableList<IObservableCache<TObject, TKey>> of changeset streams to combine. /// An observable which emits change sets. public static IObservable> Or(this IObservableList> sources) where TObject : notnull @@ -116,7 +121,7 @@ public static IObservable> Or(this IObs ///
/// The type of the object. /// The type of the key. - /// The of changeset streams to combine. + /// The IObservableList<ISourceCache<TObject, TKey>> of changeset streams to combine. /// An observable which emits change sets. public static IObservable> Or(this IObservableList> sources) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs index adc8d02e0..ad571e2c4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs @@ -21,15 +21,15 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The to operate on. - /// The that emits batches of items. + /// The ISourceCache<TObject, TKey> to operate on. + /// The IObservable<IEnumerable<TObject>> that emits batches of items. /// An that, when disposed, unsubscribes from . /// - /// Each emission from is passed to , producing one changeset per emission containing Add or Update events for each item. Errors from propagate and terminate the subscription. Completion ends the subscription; the cache retains all items. + /// Each emission from is passed to AddOrUpdate<TObject, TKey>(ISourceCache<TObject, TKey>, IEnumerable<TObject>), producing one changeset per emission containing Add or Update events for each item. Errors from propagate and terminate the subscription. Completion ends the subscription; the cache retains all items. /// /// or is . - /// - /// + /// PopulateInto<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, ISourceCache<TObject, TKey>) + /// ToObservableChangeSet<TObject, TKey>(IObservable<IEnumerable<TObject>>, Func<TObject, TKey>, Func<TObject, TimeSpan?>, int, IScheduler?) public static IDisposable PopulateFrom(this ISourceCache source, IObservable> observable) where TObject : notnull where TKey : notnull @@ -45,8 +45,8 @@ public static IDisposable PopulateFrom(this ISourceCache /// The type of the object. /// The type of the key. - /// The to operate on. - /// The that emits individual items. + /// The ISourceCache<TObject, TKey> to operate on. + /// The IObservable<TObject> that emits individual items. /// An that, when disposed, unsubscribes from . /// or is . public static IDisposable PopulateFrom(this ISourceCache source, IObservable observable) diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs index 5009c71a1..eea3046b4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs @@ -28,8 +28,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to pipe into a target cache. - /// The that will receive the changes. + /// The source IObservable<IChangeSet<TObject, TKey>> to pipe into a target cache. + /// The ISourceCache<TObject, TKey> that will receive the changes. /// An that, when disposed, unsubscribes from the source. /// /// @@ -46,9 +46,9 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// - /// - /// + /// PopulateFrom<TObject, TKey>(ISourceCache<TObject, TKey>, IObservable<IEnumerable<TObject>>) + /// AsObservableCache<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, bool) + /// ObservableListEx.PopulateInto<T>(IObservable<IChangeSet<T>>, ISourceList<T>) public static IDisposable PopulateInto(this IObservable> source, ISourceCache destination) where TObject : notnull where TKey : notnull @@ -59,10 +59,15 @@ public static IDisposable PopulateInto(this IObservable destination.Edit(updater => updater.Clone(changes))); } - /// - /// The source to pipe into a target cache. - /// The that will receive the changes. - /// Overload that targets an . + /// + /// Provides an overload of PopulateInto for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to pipe into a target cache. + /// The IIntermediateCache<TObject, TKey> that will receive the changes. + /// The resulting observable sequence. + /// Overload that targets an IIntermediateCache<TObject, TKey>. public static IDisposable PopulateInto(this IObservable> source, IIntermediateCache destination) where TObject : notnull where TKey : notnull @@ -73,10 +78,15 @@ public static IDisposable PopulateInto(this IObservable destination.Edit(updater => updater.Clone(changes))); } - /// - /// The source to pipe into a target cache. - /// The that will receive the changes. - /// Overload that targets a . + /// + /// Provides an overload of PopulateInto for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to pipe into a target cache. + /// The LockFreeObservableCache<TObject, TKey> that will receive the changes. + /// The resulting observable sequence. + /// Overload that targets a LockFreeObservableCache<TObject, TKey>. public static IDisposable PopulateInto(this IObservable> source, LockFreeObservableCache destination) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs index 80849ad61..ce3e853d0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs @@ -35,16 +35,16 @@ public static partial class ObservableCacheEx /// The type of the object. /// The type of the key. /// The type of the destination. - /// The source to project on each change. - /// A function that projects the current snapshot to a result value. + /// The source IObservable<IChangeSet<TObject, TKey>> to project on each change. + /// A function that projects the current IQuery<TObject, TKey> snapshot to a result value. /// An observable that emits a projected value after each changeset. /// - /// Worth noting: The selector is called on every changeset, which can be chatty. The exposes the full cache state for LINQ-style queries. + /// Worth noting: The selector is called on every changeset, which can be chatty. The IQuery<TObject, TKey> exposes the full cache state for LINQ-style queries. /// /// or is . - /// - /// - /// + /// ToCollection<TObject, TKey> + /// ToSortedCollection<TObject, TKey, TSortKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TSortKey>, SortDirection) + /// ObservableListEx.QueryWhenChanged public static IObservable QueryWhenChanged(this IObservable> source, Func, TDestination> resultSelector) where TObject : notnull where TKey : notnull @@ -60,7 +60,7 @@ public static IObservable QueryWhenChanged /// The type of the object. /// The type of the key. - /// The source to project on each change. + /// The source IObservable<IChangeSet<TObject, TKey>> to project on each change. /// An observable which emits the query. /// source. public static IObservable> QueryWhenChanged(this IObservable> source) @@ -78,8 +78,8 @@ public static IObservable> QueryWhenChanged /// The type of the object. /// The type of the key. /// The type of the value. - /// The source to project on each change. - /// A that should the query be triggered for observables on individual items. + /// The source IObservable<IChangeSet<TObject, TKey>> to project on each change. + /// A Func<T, TResult> that should the query be triggered for observables on individual items. /// An observable that emits the query. /// source. public static IObservable> QueryWhenChanged(this IObservable> source, Func> itemChangedTrigger) diff --git a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs index 4789a19fc..f0aa881e9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs @@ -29,9 +29,9 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to share via reference counting. + /// The source IObservable<IChangeSet<TObject, TKey>> to share via reference counting. /// A ref-counted observable changeset stream. - /// + /// AsObservableCache<TObject,TKey>(IObservable<IChangeSet<TObject, TKey>>, bool) public static IObservable> RefCount(this IObservable> source) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs index 012d26934..428eb4ea6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs @@ -21,14 +21,14 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The to signal re-evaluation on. + /// The ISourceCache<TObject, TKey> to signal re-evaluation on. /// The item to refresh. /// - /// Convenience method that wraps a Refresh inside . A Refresh does not change data in the cache; it signals downstream operators (such as or ) to re-evaluate the item. + /// Convenience method that wraps a Refresh inside ISourceCache<TObject,TKey>.Edit. A Refresh does not change data in the cache; it signals downstream operators (such as Filter<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, bool>, bool) or Sort<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IComparer<TObject>, SortOptimisations, int)) to re-evaluate the item. /// /// is . - /// - /// + /// AutoRefresh<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TimeSpan?, TimeSpan?, IScheduler?) + /// SuppressRefresh<TObject, TKey> public static void Refresh(this ISourceCache source, TObject item) where TObject : notnull where TKey : notnull @@ -43,8 +43,8 @@ public static void Refresh(this ISourceCache sourc ///
/// The type of the object. /// The type of the key. - /// The to signal re-evaluation on. - /// The of items to refresh. + /// The ISourceCache<TObject, TKey> to signal re-evaluation on. + /// The IEnumerable<TObject> of items to refresh. /// is . public static void Refresh(this ISourceCache source, IEnumerable items) where TObject : notnull @@ -60,7 +60,7 @@ public static void Refresh(this ISourceCache sourc ///
/// The type of the object. /// The type of the key. - /// The to signal re-evaluation on. + /// The ISourceCache<TObject, TKey> to signal re-evaluation on. /// is . public static void Refresh(this ISourceCache source) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs index 5e4caa4a6..f82c2e02f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs @@ -21,15 +21,15 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The from which to remove items. + /// The ISourceCache<TObject, TKey> from which to remove items. /// The item to remove. /// - /// Convenience method that wraps a single-item removal inside . The key is extracted from the item using the cache's key selector. + /// Convenience method that wraps a single-item removal inside ISourceCache<TObject,TKey>.Edit. The key is extracted from the item using the cache's key selector. /// /// is . - /// - /// - /// + /// AddOrUpdate<TObject, TKey>(ISourceCache<TObject, TKey>, TObject) + /// Clear<TObject, TKey>(ISourceCache<TObject, TKey>) + /// RemoveKeys<TObject, TKey>(ISourceCache<TObject, TKey>, IEnumerable<TKey>) public static void Remove(this ISourceCache source, TObject item) where TObject : notnull where TKey : notnull @@ -44,7 +44,7 @@ public static void Remove(this ISourceCache source ///
/// The type of the object. /// The type of the key. - /// The from which to remove items. + /// The ISourceCache<TObject, TKey> from which to remove items. /// The key of the item to remove. /// is . public static void Remove(this ISourceCache source, TKey key) @@ -62,8 +62,8 @@ public static void Remove(this ISourceCache source ///
/// The type of the object. /// The type of the key. - /// The from which to remove items. - /// The of items to remove. + /// The ISourceCache<TObject, TKey> from which to remove items. + /// The IEnumerable<TObject> of items to remove. /// is . public static void Remove(this ISourceCache source, IEnumerable items) where TObject : notnull @@ -80,8 +80,8 @@ public static void Remove(this ISourceCache source ///
/// The type of the object. /// The type of the key. - /// The from which to remove items. - /// The keys to remove. + /// The ISourceCache<TObject, TKey> from which to remove items. + /// The IEnumerable<TKey> keys to remove. /// is . public static void Remove(this ISourceCache source, IEnumerable keys) where TObject : notnull @@ -92,10 +92,14 @@ public static void Remove(this ISourceCache source source.Edit(updater => updater.Remove(keys)); } - /// - /// The from which to remove items. + /// + /// Provides an overload of Remove for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The IIntermediateCache<TObject, TKey> from which to remove items. /// The key of the item to remove. - /// Overload that targets an . + /// Overload that targets an IIntermediateCache<TObject, TKey>. public static void Remove(this IIntermediateCache source, TKey key) where TObject : notnull where TKey : notnull @@ -105,10 +109,14 @@ public static void Remove(this IIntermediateCache source.Edit(updater => updater.Remove(key)); } - /// - /// The from which to remove items. - /// The keys to remove. - /// Overload that targets an . + /// + /// Provides an overload of Remove for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The IIntermediateCache<TObject, TKey> from which to remove items. + /// The IEnumerable<TKey> keys to remove. + /// Overload that targets an IIntermediateCache<TObject, TKey>. public static void Remove(this IIntermediateCache source, IEnumerable keys) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs index 2f0804e3f..b6c243e66 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs @@ -24,15 +24,15 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Strips the key from a cache changeset, converting to - /// (list changeset). All indexed changes are dropped (sorting is not supported). + /// Strips the key from a cache changeset, converting IChangeSet<TObject, TKey> to + /// IChangeSet<TObject> (list changeset). All indexed changes are dropped (sorting is not supported). /// /// The type of the object. /// The type of the key. - /// The source to strip keys from, producing an unkeyed list changeset. + /// The source IObservable<IChangeSet<TObject, TKey>> to strip keys from, producing an unkeyed list changeset. /// A list changeset stream without key information. - /// - /// + /// ObservableListEx.AddKey<TObject, TKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TKey>) + /// ChangeKey<TObject, TSourceKey, TDestinationKey>(IObservable<IChangeSet<TObject, TSourceKey>>, Func<TObject, TDestinationKey>) public static IObservable> RemoveKey(this IObservable> source) where TObject : notnull where TKey : notnull @@ -52,7 +52,7 @@ public static IObservable> RemoveKey(this IOb ///
/// The type of the object. /// The type of the key. - /// The from which to remove a key. + /// The ISourceCache<TObject, TKey> from which to remove a key. /// The key to remove. /// is . public static void RemoveKey(this ISourceCache source, TKey key) diff --git a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs index 126957978..a516f6290 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs @@ -21,8 +21,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The from which to remove keys. - /// The keys to remove. + /// The ISourceCache<TObject, TKey> from which to remove keys. + /// The IEnumerable<TKey> keys to remove. /// is . public static void RemoveKeys(this ISourceCache source, IEnumerable keys) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs index 216b1f761..188981ae0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs @@ -23,12 +23,20 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the optional left and right values into a destination object. The key is not provided in this overload. - /// Overload that omits the key from the result selector. Delegates to . + /// + /// Provides an overload of RightJoin for the supplied arguments. + /// + /// The type of the TLeft value. + /// The type of the TLeftKey value. + /// The type of the TRight value. + /// The type of the TRightKey value. + /// The type of the TDestination value. + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the optional left and right values into a destination object. The key is not provided in this overload. + /// The resulting observable sequence. + /// Overload that omits the key from the result selector. Delegates to RightJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TRightKey, Optional<TLeft>, TRight, TDestination>). public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -46,7 +54,7 @@ public static IObservable> RightJoin /// Joins two changeset streams, producing a result for every right-side key. The left side is - /// because a matching left item may or may not exist. All right items + /// Optional<T> because a matching left item may or may not exist. All right items /// appear in the output regardless. Equivalent to SQL RIGHT OUTER JOIN. ///
/// The item type of the left source. @@ -54,17 +62,17 @@ public static IObservable> RightJoinThe item type of the right source. /// The key type of the right source. /// The type produced by . - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the right key, optional left, and right value into a destination object. Example: (rightKey, left, right) => new Result(rightKey, left, right). + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the right key, optional left, and right value into a destination object. Example: (rightKey, left, right) => new Result(rightKey, left, right). /// An observable changeset keyed by . /// /// /// Right-side change handling: /// /// EventBehavior - /// AddAlways emits. Invokes with the matching left (or ) and the right value. + /// AddAlways emits. Invokes with the matching left (or ReactiveUI.Primitives.Optional.None<T>) and the right value. /// UpdateRe-invokes the selector with current left (if any) and the new right value. /// RemoveRemoves the joined result. /// RefreshForwarded as Refresh on the joined result. @@ -83,10 +91,10 @@ public static IObservable> RightJoinBoth sources are serialized through a shared lock held during downstream delivery. Avoid blocking operations in subscribers. /// /// Any argument is . - /// - /// - /// - /// + /// InnerJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<ValueTuple<TLeftKey, TRightKey>, TLeft, TRight, TDestination>) + /// LeftJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, Optional<TRight>, TDestination>) + /// FullJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, Optional<TRight>, TDestination>) + /// RightJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) public static IObservable> RightJoin(this IObservable> left, IObservable> right, Func rightKeySelector, Func, TRight, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs index 7ffe70cda..0ac0a2ad1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs @@ -23,12 +23,20 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the optional left value and the right group into a destination object. The key is not provided in this overload. - /// Overload that omits the key from the result selector. Delegates to . + /// + /// Provides an overload of RightJoinMany for the supplied arguments. + /// + /// The type of the TLeft value. + /// The type of the TLeftKey value. + /// The type of the TRight value. + /// The type of the TRightKey value. + /// The type of the TDestination value. + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the optional left value and the right group into a destination object. The key is not provided in this overload. + /// The resulting observable sequence. + /// Overload that omits the key from the result selector. Delegates to RightJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>). public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull @@ -47,7 +55,7 @@ public static IObservable> RightJoinMany /// Groups right-side items by their mapped key, then right-joins each group to the left source. /// A result is produced for every key that has at least one right item. The left value is - /// because a matching left item may or may not exist. + /// Optional<T> because a matching left item may or may not exist. /// Equivalent to SQL RIGHT OUTER JOIN with the right side grouped. ///
/// The item type of the left source. @@ -55,10 +63,10 @@ public static IObservable> RightJoinManyThe item type of the right source. /// The key type of the right source. /// The type produced by . - /// The left to join. - /// The right to join. - /// A that maps each right item to the left key it should join on. - /// A that combines the key, optional left value, and right group into a destination object. Example: (key, left, group) => new Result(key, left, group). + /// The left IObservable<IChangeSet<TLeft, TLeftKey>> to join. + /// The right IObservable<IChangeSet<TRight, TRightKey>> to join. + /// A Func<T, TResult> that maps each right item to the left key it should join on. + /// A Func<T, TResult> that combines the key, optional left value, and right group into a destination object. Example: (key, left, group) => new Result(key, left, group). /// An observable changeset keyed by . /// /// @@ -84,10 +92,10 @@ public static IObservable> RightJoinManyBoth sources are serialized through a shared lock held during downstream delivery. Avoid blocking operations in subscribers. /// /// Any argument is . - /// - /// - /// - /// + /// RightJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TRightKey, Optional<TLeft>, TRight, TDestination>) + /// InnerJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) + /// LeftJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, TLeft, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) + /// FullJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>>, IObservable<IChangeSet<TRight, TRightKey>>, Func<TRight, TLeftKey>, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination>) public static IObservable> RightJoinMany(this IObservable> left, IObservable> right, Func rightKeySelector, Func, IGrouping, TDestination> resultSelector) where TLeft : notnull where TLeftKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs index 92fc7a08c..4f75bf341 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs @@ -22,11 +22,11 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to skip the initial changeset. + /// The source IObservable<IChangeSet<TObject, TKey>> to skip the initial changeset. /// An observable that skips the first changeset and forwards all others. /// is . - /// - /// + /// DeferUntilLoaded<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>) + /// StartWithEmpty<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>) public static IObservable> SkipInitial(this IObservable> source) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs index 494685824..491d7f9c1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs @@ -28,8 +28,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort. - /// The used to determine sort order. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort. + /// The IComparer<TObject> used to determine sort order. /// A that sort optimisation flags. Specify one or more sort optimisations. /// The number of updates before the entire list is resorted (rather than inline sort). /// An observable which emits change sets. @@ -38,7 +38,7 @@ public static partial class ObservableCacheEx /// or /// comparer. /// - /// + /// ObservableListEx.Sort [Obsolete(Constants.SortIsObsolete)] public static IObservable> Sort(this IObservable> source, IComparer comparer, SortOptimisations sortOptimisations = SortOptimisations.None, int resetThreshold = DefaultSortResetThreshold) where TObject : notnull @@ -55,8 +55,8 @@ public static IObservable> Sort(t ///
/// The type of the object. /// The type of the key. - /// The source to sort. - /// The comparer observable. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort. + /// The IObservable<IComparer<TObject>> comparer observable. /// The sort optimisations. /// The reset threshold. /// An observable which emits change sets. @@ -76,9 +76,9 @@ public static IObservable> Sort(t ///
/// The type of the object. /// The type of the key. - /// The source to sort. - /// The comparer observable. - /// An that signals the algorithm to re-sort the entire data set. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort. + /// The IObservable<IComparer<TObject>> comparer observable. + /// An IObservable<Unit> that signals the algorithm to re-sort the entire data set. /// The sort optimisations. /// The reset threshold. /// An observable which emits change sets. @@ -98,9 +98,9 @@ public static IObservable> Sort(t ///
/// The type of the object. /// The type of the key. - /// The source to sort. - /// The used to determine sort order. - /// An that signals the algorithm to re-sort the entire data set. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort. + /// The IComparer<TObject> used to determine sort order. + /// An IObservable<Unit> that signals the algorithm to re-sort the entire data set. /// The sort optimisations. /// The reset threshold. /// An observable which emits change sets. diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs index 3015acd09..d10c90647 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs @@ -26,10 +26,10 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort and bind. - /// The output that will be populated with the sorted results. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The output ReadOnlyObservableCollection<TObject> that will be populated with the sorted results. /// An observable which will emit change sets. - /// Creates a and delegates to . + /// Creates a ReadOnlyObservableCollection<T> and delegates to Bind<TObject, TKey>(IObservable<IChangeSet<TObject, TKey, PageContext<TObject>>>, IList<TObject>). public static IObservable> Bind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable>> source, out ReadOnlyObservableCollection readOnlyObservableCollection) @@ -47,11 +47,11 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort and bind. - /// The output that will be populated with the sorted results. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The output ReadOnlyObservableCollection<TObject> that will be populated with the sorted results. /// The with default settings. /// An observable which will emit change sets. - /// Creates a and delegates to . + /// Creates a ReadOnlyObservableCollection<T> and delegates to Bind<TObject, TKey>(IObservable<IChangeSet<TObject, TKey, PageContext<TObject>>>, IList<TObject>, SortAndBindOptions). public static IObservable> Bind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable>> source, out ReadOnlyObservableCollection readOnlyObservableCollection, @@ -70,8 +70,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort and bind. - /// The to bind sorted results to. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The IList<TObject> to bind sorted results to. /// An observable which will emit change sets. /// This is the primary Bind overload for paged data. It applies paged changeset mutations directly to the target list. public static IObservable> Bind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( @@ -86,8 +86,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort and bind. - /// The to bind sorted results to. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The IList<TObject> to bind sorted results to. /// The with default settings. /// An observable which will emit change sets. /// This overload accepts to control reset threshold behavior. @@ -104,10 +104,10 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort and bind. - /// The output that will be populated with the sorted results. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The output ReadOnlyObservableCollection<TObject> that will be populated with the sorted results. /// An observable which will emit change sets. - /// Creates a and delegates to . + /// Creates a ReadOnlyObservableCollection<T> and delegates to Bind<TObject, TKey>(IObservable<IChangeSet<TObject, TKey, VirtualContext<TObject>>>, IList<TObject>). public static IObservable> Bind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable>> source, out ReadOnlyObservableCollection readOnlyObservableCollection) @@ -125,11 +125,11 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort and bind. - /// The output that will be populated with the sorted results. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The output ReadOnlyObservableCollection<TObject> that will be populated with the sorted results. /// The with default settings. /// An observable which will emit change sets. - /// Creates a and delegates to . + /// Creates a ReadOnlyObservableCollection<T> and delegates to Bind<TObject, TKey>(IObservable<IChangeSet<TObject, TKey, VirtualContext<TObject>>>, IList<TObject>, SortAndBindOptions). public static IObservable> Bind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable>> source, out ReadOnlyObservableCollection readOnlyObservableCollection, @@ -148,8 +148,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort and bind. - /// The to bind sorted results to. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The IList<TObject> to bind sorted results to. /// An observable which will emit change sets. /// This is the primary Bind overload for virtualized data. It applies virtualized changeset mutations directly to the target list. public static IObservable> Bind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( @@ -164,8 +164,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort and bind. - /// The to bind sorted results to. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The IList<TObject> to bind sorted results to. /// The with default settings. /// An observable which will emit change sets. /// This overload accepts to control reset threshold behavior. @@ -177,8 +177,15 @@ public static partial class ObservableCacheEx where TKey : notnull => new BindVirtualized(source, targetList, options).Run(); - /// - /// This overload uses for types implementing . + /// + /// Provides an overload of SortAndBind for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The targetList value. + /// The resulting observable sequence. + /// This overload uses Comparer<T>.Default for types implementing IComparable<T>. public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, IList targetList) @@ -186,8 +193,16 @@ public static partial class ObservableCacheEx where TKey : notnull => source.SortAndBind(targetList, DynamicDataOptions.SortAndBind); - /// - /// This overload uses for types implementing . + /// + /// Provides an overload of SortAndBind for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The targetList value. + /// The options value. + /// The resulting observable sequence. + /// This overload uses Comparer<T>.Default for types implementing IComparable<T>. public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, IList targetList, @@ -196,7 +211,15 @@ public static partial class ObservableCacheEx where TKey : notnull => source.SortAndBind(targetList, Comparer.Default, options); - /// + /// + /// Provides an overload of SortAndBind for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The targetList value. + /// The comparer value. + /// The resulting observable sequence. public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, IList targetList, @@ -212,9 +235,9 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort and bind. - /// The to bind sorted results to. Items are inserted, removed, and moved in-place to maintain sort order. - /// The that determines sort order. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The IList<TObject> to bind sorted results to. Items are inserted, removed, and moved in-place to maintain sort order. + /// The IComparer<TObject> that determines sort order. /// The controlling reset threshold and initial capacity. /// An observable which will emit change sets. /// @@ -233,7 +256,7 @@ public static partial class ObservableCacheEx /// /// Worth noting: Large batches may trigger a full list reset (clear + re-add) instead of incremental moves, controlled by . This fires CollectionChanged with Reset action, which can be more efficient for UI virtualization but causes a visual flicker. /// - /// + /// SortAndBind<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IList<TObject>, IObservable<IComparer<TObject>>, SortAndBindOptions) public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, IList targetList, @@ -247,7 +270,15 @@ public static partial class ObservableCacheEx return new SortAndBind(source, comparer, options, targetList).Run(); } - /// + /// + /// Provides an overload of SortAndBind for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The targetList value. + /// The comparerChanged value. + /// The resulting observable sequence. public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, IList targetList, @@ -262,9 +293,9 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to sort and bind. - /// The to bind sorted results to. Items are inserted, removed, and moved in-place to maintain sort order. - /// An that emits new comparers to re-sort with. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The IList<TObject> to bind sorted results to. Items are inserted, removed, and moved in-place to maintain sort order. + /// An IObservable<IComparer<TObject>> that emits new comparers to re-sort with. /// The controlling reset threshold and initial capacity. /// An observable which will emit change sets. /// @@ -283,7 +314,7 @@ public static partial class ObservableCacheEx /// /// Worth noting: No data is emitted until the comparer observable produces its first value. Large batches or comparer changes may trigger a full list reset depending on . /// - /// + /// SortAndBind<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IList<TObject>, IComparer<TObject>, SortAndBindOptions) public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, IList targetList, @@ -293,8 +324,15 @@ public static partial class ObservableCacheEx where TKey : notnull => new SortAndBind(source, comparerChanged, options, targetList).Run(); - /// - /// This overload uses for types implementing . + /// + /// Provides an overload of SortAndBind for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The readOnlyObservableCollection value. + /// The resulting observable sequence. + /// This overload uses Comparer<T>.Default for types implementing IComparable<T>. public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection) @@ -302,8 +340,16 @@ public static partial class ObservableCacheEx where TKey : notnull => source.SortAndBind(out readOnlyObservableCollection, Comparer.Default, DynamicDataOptions.SortAndBind); - /// - /// This overload uses for types implementing . + /// + /// Provides an overload of SortAndBind for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The readOnlyObservableCollection value. + /// The options value. + /// The resulting observable sequence. + /// This overload uses Comparer<T>.Default for types implementing IComparable<T>. public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, @@ -312,7 +358,15 @@ public static partial class ObservableCacheEx where TKey : notnull => source.SortAndBind(out readOnlyObservableCollection, Comparer.Default, options); - /// + /// + /// Provides an overload of SortAndBind for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The readOnlyObservableCollection value. + /// The comparer value. + /// The resulting observable sequence. public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, @@ -321,11 +375,16 @@ public static partial class ObservableCacheEx where TKey : notnull => source.SortAndBind(out readOnlyObservableCollection, comparer, DynamicDataOptions.SortAndBind); - /// - /// The source to sort and bind. - /// The output that will be populated with the sorted results. - /// The that determines sort order. + /// + /// Provides an overload of SortAndBind for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The output ReadOnlyObservableCollection<TObject> that will be populated with the sorted results. + /// The IComparer<TObject> that determines sort order. /// The controlling reset threshold and initial capacity. + /// The resulting observable sequence. public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, @@ -346,7 +405,15 @@ public static partial class ObservableCacheEx return new SortAndBind(source, comparer, options, observableCollection).Run(); } - /// + /// + /// Provides an overload of SortAndBind for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The readOnlyObservableCollection value. + /// The comparerChanged value. + /// The resulting observable sequence. public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, @@ -355,11 +422,16 @@ public static partial class ObservableCacheEx where TKey : notnull => source.SortAndBind(out readOnlyObservableCollection, comparerChanged, DynamicDataOptions.SortAndBind); - /// - /// The source to sort and bind. - /// The output that will be populated with the sorted results. - /// An that emits new comparers to re-sort with. + /// + /// Provides an overload of SortAndBind for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort and bind. + /// The output ReadOnlyObservableCollection<TObject> that will be populated with the sorted results. + /// An IObservable<IComparer<TObject>> that emits new comparers to re-sort with. /// The controlling reset threshold and initial capacity. + /// The resulting observable sequence. public static IObservable> SortAndBind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TObject, TKey>( this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs b/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs index 7b530101c..dd143ff26 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs @@ -25,13 +25,13 @@ public static partial class ObservableCacheEx { /// /// Sorts the changeset stream by the value returned from . Creates a comparer internally - /// and delegates to . + /// and delegates to Sort<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IComparer<TObject>, SortOptimisations, int). /// Since Sort is obsolete, prefer SortAndBind for new code. /// /// The type of the object. /// The type of the key. - /// The source to sort. - /// A that expression that selects a comparable value from each item. + /// The source IObservable<IChangeSet<TObject, TKey>> to sort. + /// A Func<T, TResult> that expression that selects a comparable value from each item. /// The sort direction. Defaults to ascending. /// A that sort optimization flags. /// The number of updates before the entire list is re-sorted (rather than inline sort). diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs index c504fa66a..e93578868 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs @@ -29,9 +29,9 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to prepend an empty changeset to. + /// The source IObservable<IChangeSet<TObject, TKey>> to prepend an empty changeset to. /// An observable that emits an empty changeset first, then all source changesets. - /// + /// ObservableListEx.StartWithEmpty<T>(IObservable<IChangeSet<T>>) public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull where TKey : notnull @@ -41,10 +41,14 @@ public static IObservable> StartWithEmpty.Empty); } - /// - /// The source to prepend an empty changeset to. + /// + /// Provides an overload of StartWithEmpty for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to prepend an empty changeset to. /// An observable that emits an empty sorted changeset first, then all source changesets. - /// Overload for . + /// Overload for ISortedChangeSet<TObject, TKey>. public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull where TKey : notnull @@ -54,10 +58,14 @@ public static IObservable> StartWithEmpty.Empty); } - /// - /// The source to prepend an empty changeset to. + /// + /// Provides an overload of StartWithEmpty for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IVirtualChangeSet<TObject, TKey>> to prepend an empty changeset to. /// An observable that emits an empty virtual changeset first, then all source changesets. - /// Overload for . + /// Overload for IVirtualChangeSet<TObject, TKey>. public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull where TKey : notnull @@ -67,10 +75,14 @@ public static IObservable> StartWithEmpty.Empty); } - /// - /// The source to prepend an empty changeset to. + /// + /// Provides an overload of StartWithEmpty for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IPagedChangeSet<TObject, TKey>> to prepend an empty changeset to. /// An observable that emits an empty paged changeset first, then all source changesets. - /// Overload for . + /// Overload for IPagedChangeSet<TObject, TKey>. public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull where TKey : notnull @@ -80,13 +92,15 @@ public static IObservable> StartWithEmpty.Empty); } - /// + /// + /// Provides an overload of StartWithEmpty for the supplied arguments. + /// /// The type of the object. /// The type of the key. /// The grouping key type. - /// The source to prepend an empty changeset to. + /// The source IObservable<IGroupChangeSet<TObject, TKey, TGroupKey>> to prepend an empty changeset to. /// An observable that emits an empty group changeset first, then all source changesets. - /// Overload for . + /// Overload for IGroupChangeSet<TObject, TKey, TGroupKey>. public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull where TKey : notnull @@ -97,13 +111,15 @@ public static IObservable> StartWithEm return source.StartWith(GroupChangeSet.Empty); } - /// + /// + /// Provides an overload of StartWithEmpty for the supplied arguments. + /// /// The type of the object. /// The type of the key. /// The grouping key type. - /// The source to prepend an empty changeset to. + /// The source IObservable<IImmutableGroupChangeSet<TObject, TKey, TGroupKey>> to prepend an empty changeset to. /// An observable that emits an empty immutable group changeset first, then all source changesets. - /// Overload for . + /// Overload for IImmutableGroupChangeSet<TObject, TKey, TGroupKey>. public static IObservable> StartWithEmpty(this IObservable> source) where TObject : notnull where TKey : notnull @@ -114,11 +130,13 @@ public static IObservable> St return source.StartWith(ImmutableGroupChangeSet.Empty); } - /// + /// + /// Provides an overload of StartWithEmpty for the supplied arguments. + /// /// The type of the item. - /// The source of to prepend an empty changeset to. + /// The source IObservable<T> of IReadOnlyCollection<T> to prepend an empty changeset to. /// An observable that emits an empty collection first, then all source collections. - /// Overload for . + /// Overload for IReadOnlyCollection<T>. public static IObservable> StartWithEmpty(this IObservable> source) { ArgumentExceptionHelper.ThrowIfNull(source); diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs index b175c8720..b38ee99e5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs @@ -16,10 +16,15 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// The source to prepend an initial item to. - /// The item to prepend. The key is extracted from . - /// Overload for items that implement . Delegates to the explicit key overload. + /// + /// Provides an overload of StartWithItem for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to prepend an initial item to. + /// The item to prepend. The key is extracted from IKey<TKey>.Key. + /// The resulting observable sequence. + /// Overload for items that implement IKey<TKey>. Delegates to the explicit key overload. public static IObservable> StartWithItem(this IObservable> source, TObject item) where TObject : IKey where TKey : notnull @@ -35,7 +40,7 @@ public static IObservable> StartWithItem /// The type of the object. /// The type of the key. - /// The source to prepend an initial item to. + /// The source IObservable<IChangeSet<TObject, TKey>> to prepend an initial item to. /// The item to prepend. /// The key for the item. /// An observable that emits a single-item Add changeset first, then all source changesets. diff --git a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs index 81cb401ff..ae6524d96 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs @@ -30,7 +30,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to create a subscription for each item in. + /// The source IObservable<IChangeSet<TObject, TKey>> to create a subscription for each item in. /// A factory that creates an for each item. Called on Add and Update (for the new value). /// A stream that forwards all changesets from unchanged. /// @@ -45,8 +45,8 @@ public static partial class ObservableCacheEx /// /// /// - /// Internally implemented using - /// and , so disposal semantics match . + /// Internally implemented using Transform<TDestination,TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>, Func<TObject,TKey,TDestination>, bool) + /// and DisposeMany<TObject,TKey>, so disposal semantics match DisposeMany<TObject,TKey>. /// /// /// Use this to tie per-item side effects (event subscriptions, polling timers, child observable subscriptions) @@ -54,9 +54,9 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// - /// - /// + /// DisposeMany<TObject,TKey> + /// OnItemRemoved<TObject,TKey>(IObservable<IChangeSet<TObject,TKey>>, Action<TObject,TKey>, bool) + /// ObservableListEx.SubscribeMany public static IObservable> SubscribeMany(this IObservable> source, Func subscriptionFactory) where TObject : notnull where TKey : notnull @@ -67,10 +67,15 @@ public static IObservable> SubscribeMany(source, subscriptionFactory).Run(); } - /// - /// The source to create a subscription for each item in. + /// + /// Provides an overload of SubscribeMany for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to create a subscription for each item in. /// A factory that creates an for each item. Receives the item and its key. - /// Overload whose factory receives both the item and the key. See for full details. + /// The resulting observable sequence. + /// Overload whose factory receives both the item and the key. See SubscribeMany<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IDisposable>) for full details. public static IObservable> SubscribeMany(this IObservable> source, Func subscriptionFactory) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs index e16ddda43..b34449f3b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs @@ -21,7 +21,7 @@ public static partial class ObservableCacheEx ///
/// The object of the change set. /// The key of the change set. - /// The source to strip refresh events. + /// The source IObservable<IChangeSet<TObject, TKey>> to strip refresh events. /// An observable which emits change sets. public static IObservable> SuppressRefresh(this IObservable> source) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs index dce03d7b6..9011e5927 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs @@ -23,8 +23,13 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// - /// An observable that emits instances. + /// + /// Provides an overload of Switch for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// An observable that emits IObservableCache<TObject, TKey> instances. + /// The resulting observable sequence. /// Overload that accepts observable caches. Internally calls Connect() on each cache and delegates to the changeset overload. public static IObservable> Switch(this IObservable> sources) where TObject : notnull @@ -41,7 +46,7 @@ public static IObservable> Switch(this ///
/// The type of the object. /// The type of the key. - /// An of changeset streams. The operator subscribes to the latest inner stream. + /// An IObservable<T> of IObservable<T> changeset streams. The operator subscribes to the latest inner stream. /// A changeset stream reflecting the items from the most recently emitted inner source. /// /// On switch: Remove is emitted for all items from the previous source, then Add for all items from the new source. diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs index cac72b378..f40c2b1b6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs @@ -21,9 +21,9 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to materialize into a collection on each change. + /// The source IObservable<IChangeSet<TObject, TKey>> to materialize into a collection on each change. /// An observable which emits the read only collection. - /// + /// ObservableListEx.ToCollection<TObject>(IObservable<IChangeSet<TObject>>) public static IObservable> ToCollection(this IObservable> source) where TObject : notnull where TKey : notnull => source.QueryWhenChanged(query => new ReadOnlyCollectionLight(query.Items)); diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs index ea2077ce1..545805b7d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs @@ -23,9 +23,9 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to convert into a keyed changeset stream. - /// A that selects the unique key for each item. - /// An optional that specifies per-item expiration time. Return for no expiration. + /// The source IObservable<TObject> to convert into a keyed changeset stream. + /// A Func<T, TResult> that selects the unique key for each item. + /// An optional Func<T, TResult> that specifies per-item expiration time. Return for no expiration. /// The maximum cache size. Oldest items are removed when exceeded. Use -1 for no limit. /// An optional for expiration timing. /// An observable changeset stream. @@ -57,9 +57,9 @@ public static IObservable> ToObservableChangeSet /// The type of the object. /// The type of the key. - /// The source to convert into a keyed changeset stream. - /// A that selects the unique key for each item. - /// An optional that specifies per-item expiration time. Return for no expiration. + /// The source IObservable<IEnumerable<TObject>> to convert into a keyed changeset stream. + /// A Func<T, TResult> that selects the unique key for each item. + /// An optional Func<T, TResult> that specifies per-item expiration time. Return for no expiration. /// The maximum cache size. Oldest items are removed when exceeded. Use -1 for no limit. /// An optional for expiration timing. /// An observable changeset stream. diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs index 14f86dc6c..4902eec6f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs @@ -25,31 +25,31 @@ public static partial class ObservableCacheEx { /// /// Watches a single key in the source changeset stream, emitting ReactiveUI.Primitives.Optional.Some(value) when the key - /// is present and when it is removed. Duplicate values are suppressed via . + /// is present and ReactiveUI.Primitives.Optional.None<T> when it is removed. Duplicate values are suppressed via . /// /// The type of the object. /// The type of the key. - /// The source to watch a single key in. + /// The source IObservable<IChangeSet<TObject, TKey>> to watch a single key in. /// The key to watch. - /// An that optional comparer to suppress duplicate emissions. Uses default equality if . - /// An observable of that reflects the presence or absence of the specified key. + /// An IEqualityComparer<TObject> that optional comparer to suppress duplicate emissions. Uses default equality if . + /// An observable of Optional<TObject> that reflects the presence or absence of the specified key. /// /// - /// Unlike , this emits None on removal + /// Unlike WatchValue<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TKey), this emits None on removal /// (rather than the removed value), making it possible to distinguish "key is absent" from "key has a value". /// /// /// EventBehavior /// AddEmits ReactiveUI.Primitives.Optional.Some(value) if the key was not previously tracked. /// UpdateEmits ReactiveUI.Primitives.Optional.Some(newValue) if the new value differs from the previous per . Otherwise suppressed. - /// RemoveEmits . + /// RemoveEmits ReactiveUI.Primitives.Optional.None<T>. /// RefreshEmits ReactiveUI.Primitives.Optional.Some(value) if the value differs from the last emission per . Otherwise suppressed. /// /// Worth noting: No emission occurs if the key is not present at subscription time. To get an initial None when the key is absent, use the overload with initialOptionalWhenMissing: true. /// /// is . - /// - /// + /// Watch<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TKey) + /// WatchValue<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TKey) public static IObservable> ToObservableOptional(this IObservable> source, TKey key, IEqualityComparer? equalityComparer = null) where TObject : notnull where TKey : notnull @@ -64,10 +64,10 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to watch a single key in. + /// The source IObservable<IChangeSet<TObject, TKey>> to watch a single key in. /// The key value. - /// When , emits an initial with no value if the key is not present in the cache. - /// An optional instance used to determine if an object value has changed. + /// When , emits an initial Optional<TObject> with no value if the key is not present in the cache. + /// An optional IEqualityComparer<TObject> instance used to determine if an object value has changed. /// An observable optional. /// source is null. /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs index 658ed4326..3bc8779d1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs @@ -29,11 +29,11 @@ public static partial class ObservableCacheEx /// The type of the object. /// The type of the key. /// The sort key. - /// The source to materialize into a sorted collection on each change. - /// The sort function. + /// The source IObservable<IChangeSet<TObject, TKey>> to materialize into a sorted collection on each change. + /// The Func<TObject, TSortKey> sort function. /// The sort order. Defaults to ascending. /// An observable which emits the read only collection. - /// + /// ObservableListEx.ToSortedCollection<TObject, TSortKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TSortKey>, SortDirection) public static IObservable> ToSortedCollection(this IObservable> source, Func sort, SortDirection sortOrder = SortDirection.Ascending) where TObject : notnull where TKey : notnull @@ -44,8 +44,8 @@ public static IObservable> ToSortedCollection /// The type of the object. /// The type of the key. - /// The source to materialize into a sorted collection on each change. - /// The sort comparer. + /// The source IObservable<IChangeSet<TObject, TKey>> to materialize into a sorted collection on each change. + /// The IComparer<TObject> sort comparer. /// An observable which emits the read only collection. public static IObservable> ToSortedCollection(this IObservable> source, IComparer comparer) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs index 54c9662da..87666bc4d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs @@ -23,9 +23,18 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// + /// + /// Provides an overload of Transform for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The transformOnRefresh value. + /// The resulting observable sequence. /// This overload accepts a bool transformOnRefresh flag. When , Refresh changes cause re-transformation (emitted as Update). The factory receives only the current item. - /// + /// ObservableListEx.Transform public static IObservable> Transform(this IObservable> source, Func transformFactory, bool transformOnRefresh) where TDestination : notnull where TSource : notnull @@ -37,7 +46,16 @@ public static IObservable> Transform transformFactory(current), transformOnRefresh); } - /// + /// + /// Provides an overload of Transform for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The transformOnRefresh value. + /// The resulting observable sequence. /// This overload accepts a bool transformOnRefresh flag. When , Refresh changes cause re-transformation (emitted as Update). The factory receives the current item and key. public static IObservable> Transform(this IObservable> source, Func transformFactory, bool transformOnRefresh) where TDestination : notnull @@ -50,7 +68,16 @@ public static IObservable> Transform transformFactory(current, key), transformOnRefresh); } - /// + /// + /// Provides an overload of Transform for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The transformOnRefresh value. + /// The resulting observable sequence. /// This overload accepts a bool transformOnRefresh flag. When , Refresh changes cause re-transformation (emitted as Update). public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, bool transformOnRefresh) where TDestination : notnull @@ -63,7 +90,16 @@ public static IObservable> Transform(source, transformFactory, transformOnRefresh: transformOnRefresh).Run(); } - /// + /// + /// Provides an overload of Transform for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The forceTransform value. + /// The resulting observable sequence. /// This overload accepts an optional forceTransform predicate filtering by source item only (without the key). The factory receives only the current item. public static IObservable> Transform(this IObservable> source, Func transformFactory, IObservable>? forceTransform = null) where TDestination : notnull @@ -76,7 +112,16 @@ public static IObservable> Transform transformFactory(current), forceTransform?.ForForced()); } - /// + /// + /// Provides an overload of Transform for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The forceTransform value. + /// The resulting observable sequence. /// This overload accepts an optional forceTransform predicate filtering by source item and key. The factory receives the current item and key. public static IObservable> Transform(this IObservable> source, Func transformFactory, IObservable>? forceTransform = null) where TDestination : notnull @@ -95,8 +140,8 @@ public static IObservable> TransformThe type of the transformed items. /// The type of the source items. /// The type of the key. - /// The source to transform. - /// The that produces a from the current source item, the previous source item (if any), and the key. + /// The source IObservable<IChangeSet<TSource, TKey>> to transform. + /// The Func<TSource, Optional<TSource>, TKey, TDestination> that produces a from the current source item, the previous source item (if any), and the key. /// An observable that, when it emits a predicate, re-transforms all items for which the predicate returns . Re-transformed items are emitted as changes. If , no forced re-transforms occur. /// An observable changeset of transformed items. /// @@ -118,14 +163,14 @@ public static IObservable> Transform /// - /// Factory exceptions propagate as , terminating the stream. - /// Use + /// Factory exceptions propagate as IObserver<T>.OnError, terminating the stream. + /// Use TransformSafe<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, TDestination>, Action<Error<TSource, TKey>>, IObservable<Func<TSource, TKey, bool>>?) /// to catch factory errors without killing the stream. /// /// - /// - /// - /// + /// TransformSafe<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, TDestination>, Action<Error<TSource, TKey>>, IObservable<Func<TSource, TKey, bool>>?) + /// TransformAsync<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, Task<TDestination>>, IObservable<Func<TSource, TKey, bool>>?) + /// TransformImmutable<TDestination, TSource, TKey> /// or is . public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable>? forceTransform = null) where TDestination : notnull @@ -142,15 +187,33 @@ public static IObservable> Transform(source, transformFactory).Run(); } - /// - /// This overload accepts of to force re-transformation of ALL items when the observable emits. The factory receives only the current item. + /// + /// Provides an overload of ForForced for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The forceTransform value. + /// The resulting observable sequence. + /// This overload accepts IObservable<T> of to force re-transformation of ALL items when the observable emits. The factory receives only the current item. public static IObservable> Transform(this IObservable> source, Func transformFactory, IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull => source.Transform((cur, _, _) => transformFactory(cur), forceTransform.ForForced()); - /// - /// This overload accepts of to force re-transformation of ALL items when the observable emits. The factory receives the current item and key. + /// + /// Provides an overload of Transform for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The forceTransform value. + /// The resulting observable sequence. + /// This overload accepts IObservable<T> of to force re-transformation of ALL items when the observable emits. The factory receives the current item and key. public static IObservable> Transform(this IObservable> source, Func transformFactory, IObservable forceTransform) where TDestination : notnull where TSource : notnull @@ -163,8 +226,17 @@ public static IObservable> Transform transformFactory(cur, key), forceTransform.ForForced()); } - /// - /// This overload accepts of to force re-transformation of ALL items when the observable emits. + /// + /// Provides an overload of Transform for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The forceTransform value. + /// The resulting observable sequence. + /// This overload accepts IObservable<T> of to force re-transformation of ALL items when the observable emits. public static IObservable> Transform(this IObservable> source, Func, TKey, TDestination> transformFactory, IObservable forceTransform) where TDestination : notnull where TSource : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs index 952e062e1..934362bc2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs @@ -23,9 +23,18 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// + /// + /// Provides an overload of TransformAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The forceTransform value. + /// The resulting observable sequence. /// This overload takes a simpler factory that receives only the current item. - /// + /// ObservableListEx.TransformAsync [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func> transformFactory, IObservable>? forceTransform = null) where TDestination : notnull @@ -38,7 +47,16 @@ public static IObservable> TransformAsync transformFactory(current), forceTransform); } - /// + /// + /// Provides an overload of TransformAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The forceTransform value. + /// The resulting observable sequence. /// This overload takes a factory that receives the current item and key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func> transformFactory, IObservable>? forceTransform = null) @@ -53,14 +71,14 @@ public static IObservable> TransformAsync - /// Async version of . - /// Projects each item using an async factory that returns . + /// Async version of Transform<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, TDestination>, IObservable<Func<TSource, TKey, bool>>?). + /// Projects each item using an async factory that returns Task<TResult>. ///
/// The type of the transformed items. /// The type of the source items. /// The type of the key. - /// The source to transform asynchronously. - /// The async function that produces a from the current source item, the previous source item (if any), and the key. + /// The source IObservable<IChangeSet<TSource, TKey>> to transform asynchronously. + /// The Func<TSource, Optional<TSource>, TKey, Task<TDestination>> async function that produces a from the current source item, the previous source item (if any), and the key. /// An observable that, when it emits a predicate, re-transforms all items for which the predicate returns . Re-transformed items are emitted as changes. If , no forced re-transforms occur. /// An observable changeset of transformed items. /// @@ -79,8 +97,8 @@ public static IObservable> TransformAsync /// Worth noting: Transforms are batched per changeset (all tasks must complete before the next changeset is processed). Completion waits for in-flight transforms. Remove does NOT cancel in-flight transforms for the removed key. /// - /// Factory exceptions propagate as . Use - /// + /// Factory exceptions propagate as IObserver<T>.OnError. Use + /// TransformSafeAsync<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, Task<TDestination>>, Action<Error<TSource, TKey>>, IObservable<Func<TSource, TKey, bool>>?) /// to catch factory errors without terminating the stream. /// /// @@ -97,7 +115,16 @@ public static IObservable> TransformAsync(source, transformFactory, null, forceTransform).Run(); } - /// + /// + /// Provides an overload of TransformAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The options value. + /// The resulting observable sequence. /// This overload accepts to control concurrency and Refresh handling. The factory receives only the current item. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func> transformFactory, TransformAsyncOptions options) @@ -111,7 +138,16 @@ public static IObservable> TransformAsync transformFactory(current), options); } - /// + /// + /// Provides an overload of TransformAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The options value. + /// The resulting observable sequence. /// This overload accepts to control concurrency and Refresh handling. The factory receives the current item and key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func> transformFactory, TransformAsyncOptions options) @@ -125,7 +161,16 @@ public static IObservable> TransformAsync transformFactory(current, key), options); } - /// + /// + /// Provides an overload of TransformAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The options value. + /// The resulting observable sequence. /// This overload accepts to control concurrency and Refresh handling. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync(this IObservable> source, Func, TKey, Task> transformFactory, TransformAsyncOptions options) diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs index 698c05cdf..f5e42ce9a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs @@ -30,13 +30,13 @@ public static partial class ObservableCacheEx /// The type of the transformed items. /// The type of the source items. /// The type of the key. - /// The source to transform (items assumed immutable). - /// The pure function that maps a source item to a destination item. Must be deterministic: same input always produces equivalent output. + /// The source IObservable<IChangeSet<TSource, TKey>> to transform (items assumed immutable). + /// The Func<TSource, TDestination> pure function that maps a source item to a destination item. Must be deterministic: same input always produces equivalent output. /// An observable changeset of transformed items. /// /// /// Because the transform is assumed to be stateless and deterministic, this operator does not track - /// previously transformed items. This reduces memory overhead compared to . + /// previously transformed items. This reduces memory overhead compared to Transform<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, TDestination>, IObservable<Func<TSource, TKey, bool>>?). /// /// Change reason handling: /// @@ -46,7 +46,7 @@ public static partial class ObservableCacheEx /// RemoveEmits Remove. Factory is NOT called. /// RefreshDROPPED. Immutable items do not change, so Refresh is meaningless. /// - /// Use this when items are immutable, the factory is pure, and the factory is cheap. If any of these conditions are false, use instead. + /// Use this when items are immutable, the factory is pure, and the factory is cheap. If any of these conditions are false, use Transform<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, TDestination>, IObservable<Func<TSource, TKey, bool>>?) instead. /// /// or is . public static IObservable> TransformImmutable( diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs index 9cd4eb3af..073d594d7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs @@ -31,9 +31,9 @@ public static partial class ObservableCacheEx /// The type of the child item keys. /// The type of the source (parent) items. /// The type of the source (parent) keys. - /// The source to expand each item into multiple children. - /// A function that expands a parent item into its children. For or overloads, subsequent changes to the child collection are automatically tracked. - /// A that extracts a unique key from each child item. Keys must be unique across ALL parents, not just within one parent. + /// The source IObservable<IChangeSet<TSource, TSourceKey>> to expand each item into multiple children. + /// A function that expands a parent item into its children. For ObservableCollection<T> or IObservableCache<TObject, TKey> overloads, subsequent changes to the child collection are automatically tracked. + /// A Func<T, TResult> that extracts a unique key from each child item. Keys must be unique across ALL parents, not just within one parent. /// An observable changeset of flattened child items. /// /// Change reason handling: @@ -45,35 +45,65 @@ public static partial class ObservableCacheEx /// RefreshPropagated as Refresh to all children (no re-expansion). /// /// Worth noting: If two source items produce children with the same key, last-in-wins. Refresh does NOT re-expand children (only Update does). - /// If two parents produce children with the same key, last-in-wins. Use the async variant with a to control conflict resolution. + /// If two parents produce children with the same key, last-in-wins. Use the async variant with a IComparer<T> to control conflict resolution. /// /// , , or is . - /// - /// + /// TransformManyAsync<TDestination, TDestinationKey, TSource, TSourceKey>(IObservable<IChangeSet<TSource, TSourceKey>>, Func<TSource, TSourceKey, Task<IEnumerable<TDestination>>>, Func<TDestination, TDestinationKey>, IEqualityComparer<TDestination>?, IComparer<TDestination>?) + /// ObservableListEx.TransformMany public static IObservable> TransformMany(this IObservable> source, Func> manySelector, Func keySelector) where TDestination : notnull where TDestinationKey : notnull where TSource : notnull where TSourceKey : notnull => new TransformMany(source, manySelector, keySelector).Run(); - /// - /// This overload accepts an selector. Changes to the child collection (adds, removes, replacements) are automatically observed and reflected downstream. + /// + /// Provides an overload of Run for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The source value. + /// The manySelector value. + /// The keySelector value. + /// The resulting observable sequence. + /// This overload accepts an ObservableCollection<T> selector. Changes to the child collection (adds, removes, replacements) are automatically observed and reflected downstream. public static IObservable> TransformMany(this IObservable> source, Func> manySelector, Func keySelector) where TDestination : notnull where TDestinationKey : notnull where TSource : notnull where TSourceKey : notnull => new TransformMany(source, manySelector, keySelector).Run(); - /// - /// This overload accepts a selector. Changes to the child collection are automatically observed and reflected downstream. + /// + /// Provides an overload of Run for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The source value. + /// The manySelector value. + /// The keySelector value. + /// The resulting observable sequence. + /// This overload accepts a ReadOnlyObservableCollection<T> selector. Changes to the child collection are automatically observed and reflected downstream. public static IObservable> TransformMany(this IObservable> source, Func> manySelector, Func keySelector) where TDestination : notnull where TDestinationKey : notnull where TSource : notnull where TSourceKey : notnull => new TransformMany(source, manySelector, keySelector).Run(); - /// - /// This overload accepts an selector. The child cache is live: subsequent changes to it are automatically propagated downstream. + /// + /// Provides an overload of Run for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The source value. + /// The manySelector value. + /// The keySelector value. + /// The resulting observable sequence. + /// This overload accepts an IObservableCache<TObject, TKey> selector. The child cache is live: subsequent changes to it are automatically propagated downstream. public static IObservable> TransformMany(this IObservable> source, Func> manySelector, Func keySelector) where TDestination : notnull where TDestinationKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs index 26203650a..32fd5489e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs @@ -24,18 +24,18 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Async version of . + /// Async version of TransformMany<TDestination, TDestinationKey, TSource, TSourceKey>(IObservable<IChangeSet<TSource, TSourceKey>>, Func<TSource, IEnumerable<TDestination>>, Func<TDestination, TDestinationKey>). /// Flattens each source item into zero or more destination items using an async factory. /// /// The type of the child items. /// The type of the child item keys. /// The type of the source (parent) items. /// The type of the source (parent) keys. - /// The source to expand each item into multiple children asynchronously. - /// An async function that expands a parent item (and its key) into an of children. - /// A that extracts a unique key from each child item. - /// An that optional comparer to determine if two child items with the same key are equal. Used to suppress no-op updates. - /// An that optional comparer to resolve key collisions when the same destination key is produced by multiple parents. The winning item is determined by this comparer. + /// The source IObservable<IChangeSet<TSource, TSourceKey>> to expand each item into multiple children asynchronously. + /// An async function that expands a parent item (and its key) into an IEnumerable<T> of children. + /// A Func<T, TResult> that extracts a unique key from each child item. + /// An IEqualityComparer<TDestination> that optional comparer to determine if two child items with the same key are equal. Used to suppress no-op updates. + /// An IComparer<TDestination> that optional comparer to resolve key collisions when the same destination key is produced by multiple parents. The winning item is determined by this comparer. /// An observable changeset of flattened child items. /// /// @@ -43,8 +43,8 @@ public static partial class ObservableCacheEx /// (unlike the synchronous TransformMany which batches all children into one changeset). /// /// - /// Factory exceptions propagate as . Use - /// + /// Factory exceptions propagate as IObserver<T>.OnError. Use + /// TransformManySafeAsync<TDestination, TDestinationKey, TSource, TSourceKey>(IObservable<IChangeSet<TSource, TSourceKey>>, Func<TSource, TSourceKey, Task<IEnumerable<TDestination>>>, Func<TDestination, TDestinationKey>, Action<Error<TSource, TSourceKey>>, IEqualityComparer<TDestination>?, IComparer<TDestination>?) /// to catch errors without killing the stream. /// /// @@ -62,7 +62,19 @@ public static IObservable> TransformMa return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer).Run(); } - /// + /// + /// Provides an overload of manySelector for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The source value. + /// The manySelector value. + /// The keySelector value. + /// The equalityComparer value. + /// The comparer value. + /// The resulting observable sequence. /// This overload takes a factory that receives only the source item (without the key). [MethodImpl(MethodImplOptions.AggressiveInlining)] [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] @@ -72,8 +84,21 @@ public static IObservable> TransformMa where TSource : notnull where TSourceKey : notnull => source.TransformManyAsync((val, _) => manySelector(val), keySelector, equalityComparer, comparer); - /// - /// This overload returns an observable collection (of type implementing both and ) whose changes are tracked live. The factory receives the source item and its key. + /// + /// Provides an overload of TransformManyAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The type of the TCollection value. + /// The source value. + /// The manySelector value. + /// The keySelector value. + /// The equalityComparer value. + /// The comparer value. + /// The resulting observable sequence. + /// This overload returns an observable collection (of type implementing both and IEnumerable<T>) whose changes are tracked live. The factory receives the source item and its key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformManyAsync(this IObservable> source, Func> manySelector, Func keySelector, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) where TDestination : notnull @@ -88,8 +113,21 @@ public static IObservable> TransformMa return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer).Run(); } - /// - /// This overload returns an observable collection (of type implementing both and ) whose changes are tracked live. The factory receives only the source item. + /// + /// Provides an overload of manySelector for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The type of the TCollection value. + /// The source value. + /// The manySelector value. + /// The keySelector value. + /// The equalityComparer value. + /// The comparer value. + /// The resulting observable sequence. + /// This overload returns an observable collection (of type implementing both and IEnumerable<T>) whose changes are tracked live. The factory receives only the source item. [MethodImpl(MethodImplOptions.AggressiveInlining)] [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformManyAsync(this IObservable> source, Func> manySelector, Func keySelector, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) @@ -99,8 +137,19 @@ public static IObservable> TransformMa where TSourceKey : notnull where TCollection : INotifyCollectionChanged, IEnumerable => source.TransformManyAsync((val, _) => manySelector(val), keySelector, equalityComparer, comparer); - /// - /// This overload returns an per parent. The child cache is live: its changes propagate downstream. No keySelector is needed since the cache already has keys. The factory receives the source item and its key. + /// + /// Provides an overload of TransformManyAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The source value. + /// The manySelector value. + /// The equalityComparer value. + /// The comparer value. + /// The resulting observable sequence. + /// This overload returns an IObservableCache<TObject, TKey> per parent. The child cache is live: its changes propagate downstream. No keySelector is needed since the cache already has keys. The factory receives the source item and its key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformManyAsync(this IObservable> source, Func>> manySelector, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) where TDestination : notnull @@ -114,8 +163,19 @@ public static IObservable> TransformMa return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector), equalityComparer, comparer).Run(); } - /// - /// This overload returns an per parent. The child cache is live. The factory receives only the source item. + /// + /// Provides an overload of manySelector for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The source value. + /// The manySelector value. + /// The equalityComparer value. + /// The comparer value. + /// The resulting observable sequence. + /// This overload returns an IObservableCache<TObject, TKey> per parent. The child cache is live. The factory receives only the source item. [MethodImpl(MethodImplOptions.AggressiveInlining)] [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformManyAsync(this IObservable> source, Func>> manySelector, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs index b1532f42a..bb8f65084 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs @@ -24,7 +24,7 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Async version of + /// Async version of TransformMany<TDestination, TDestinationKey, TSource, TSourceKey>(IObservable<IChangeSet<TSource, TSourceKey>>, Func<TSource, IEnumerable<TDestination>>, Func<TDestination, TDestinationKey>) /// with error handling. Factory exceptions are caught and routed to instead of /// terminating the stream. /// @@ -32,12 +32,12 @@ public static partial class ObservableCacheEx /// The type of the child item keys. /// The type of the source (parent) items. /// The type of the source (parent) keys. - /// The source to expand each item into multiple children asynchronously with error handling. - /// An async function that expands a parent item (and its key) into an of children. - /// A that extracts a unique key from each child item. - /// A that called when throws. The faulting item is skipped and the stream continues. - /// An that optional comparer to determine if two child items with the same key are equal. - /// An that optional comparer to resolve key collisions when the same destination key is produced by multiple parents. + /// The source IObservable<IChangeSet<TSource, TSourceKey>> to expand each item into multiple children asynchronously with error handling. + /// An async function that expands a parent item (and its key) into an IEnumerable<T> of children. + /// A Func<T, TResult> that extracts a unique key from each child item. + /// A Action<T> that called when throws. The faulting item is skipped and the stream continues. + /// An IEqualityComparer<TDestination> that optional comparer to determine if two child items with the same key are equal. + /// An IComparer<TDestination> that optional comparer to resolve key collisions when the same destination key is produced by multiple parents. /// An observable changeset of flattened child items. /// Because the transformations are asynchronous, each sub-collection may be emitted via a separate changeset. /// , , or is . @@ -55,7 +55,20 @@ public static IObservable> TransformMa return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer, errorHandler).Run(); } - /// + /// + /// Provides an overload of manySelector for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The source value. + /// The manySelector value. + /// The keySelector value. + /// The errorHandler value. + /// The equalityComparer value. + /// The comparer value. + /// The resulting observable sequence. /// This overload takes a factory that receives only the source item (without the key). [MethodImpl(MethodImplOptions.AggressiveInlining)] [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] @@ -65,8 +78,22 @@ public static IObservable> TransformMa where TSource : notnull where TSourceKey : notnull => source.TransformManySafeAsync((val, _) => manySelector(val), keySelector, errorHandler, equalityComparer, comparer); - /// - /// This overload returns an observable collection (of type implementing both and ) whose changes are tracked live. The factory receives the source item and its key. + /// + /// Provides an overload of TransformManySafeAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The type of the TCollection value. + /// The source value. + /// The manySelector value. + /// The keySelector value. + /// The errorHandler value. + /// The equalityComparer value. + /// The comparer value. + /// The resulting observable sequence. + /// This overload returns an observable collection (of type implementing both and IEnumerable<T>) whose changes are tracked live. The factory receives the source item and its key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformManySafeAsync(this IObservable> source, Func> manySelector, Func keySelector, Action> errorHandler, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) where TDestination : notnull @@ -82,8 +109,22 @@ public static IObservable> TransformMa return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer, errorHandler).Run(); } - /// - /// This overload returns an observable collection (of type implementing both and ) whose changes are tracked live. The factory receives only the source item. + /// + /// Provides an overload of manySelector for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The type of the TCollection value. + /// The source value. + /// The manySelector value. + /// The keySelector value. + /// The errorHandler value. + /// The equalityComparer value. + /// The comparer value. + /// The resulting observable sequence. + /// This overload returns an observable collection (of type implementing both and IEnumerable<T>) whose changes are tracked live. The factory receives only the source item. [MethodImpl(MethodImplOptions.AggressiveInlining)] [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformManySafeAsync(this IObservable> source, Func> manySelector, Func keySelector, Action> errorHandler, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) @@ -93,8 +134,20 @@ public static IObservable> TransformMa where TSourceKey : notnull where TCollection : INotifyCollectionChanged, IEnumerable => source.TransformManySafeAsync((val, _) => manySelector(val), keySelector, errorHandler, equalityComparer, comparer); - /// - /// This overload returns an per parent. The child cache is live. The factory receives the source item and its key. + /// + /// Provides an overload of TransformManySafeAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The source value. + /// The manySelector value. + /// The errorHandler value. + /// The equalityComparer value. + /// The comparer value. + /// The resulting observable sequence. + /// This overload returns an IObservableCache<TObject, TKey> per parent. The child cache is live. The factory receives the source item and its key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformManySafeAsync(this IObservable> source, Func>> manySelector, Action> errorHandler, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) where TDestination : notnull @@ -109,8 +162,20 @@ public static IObservable> TransformMa return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector), equalityComparer, comparer, errorHandler).Run(); } - /// - /// This overload returns an per parent. The child cache is live. The factory receives only the source item. + /// + /// Provides an overload of manySelector for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TDestinationKey value. + /// The type of the TSource value. + /// The type of the TSourceKey value. + /// The source value. + /// The manySelector value. + /// The errorHandler value. + /// The equalityComparer value. + /// The comparer value. + /// The resulting observable sequence. + /// This overload returns an IObservableCache<TObject, TKey> per parent. The child cache is live. The factory receives only the source item. [MethodImpl(MethodImplOptions.AggressiveInlining)] [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformManySafeAsync(this IObservable> source, Func>> manySelector, Action> errorHandler, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs index aee73db8f..47ccba2c9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs @@ -30,8 +30,8 @@ public static partial class ObservableCacheEx /// The type of the source items. /// The type of the key. /// The type of the transformed items. - /// The source to transform using per-item observables. - /// A function that, given a source item and its key, returns an whose emissions become the transformed values. + /// The source IObservable<IChangeSet<TSource, TKey>> to transform using per-item observables. + /// A function that, given a source item and its key, returns an IObservable<TDestination> whose emissions become the transformed values. /// An observable changeset where each key's value is the latest emission from its per-item observable. /// /// @@ -63,9 +63,9 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// - /// - /// + /// Transform<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, TKey, TDestination>, bool) + /// FilterOnObservable<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IObservable<bool>>, TimeSpan?, IScheduler?) + /// GroupOnObservable<TObject, TKey, TGroupKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TKey, IObservable<TGroupKey>>) public static IObservable> TransformOnObservable(this IObservable> source, Func> transformFactory) where TSource : notnull where TKey : notnull @@ -77,7 +77,15 @@ public static IObservable> TransformOnObservable< return new TransformOnObservable(source, transformFactory).Run(); } - /// + /// + /// Provides an overload of TransformOnObservable for the supplied arguments. + /// + /// The type of the TSource value. + /// The type of the TKey value. + /// The type of the TDestination value. + /// The source value. + /// The transformFactory value. + /// The resulting observable sequence. /// This overload takes a factory that receives only the source item (without the key). public static IObservable> TransformOnObservable(this IObservable> source, Func> transformFactory) where TSource : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs index e94ad8b6a..1b438f647 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs @@ -23,7 +23,17 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// + /// + /// Provides an overload of TransformSafe for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The errorHandler value. + /// The forceTransform value. + /// The resulting observable sequence. /// This overload accepts a simpler factory that receives only the current item, and a forceTransform predicate filtering by source item only. public static IObservable> TransformSafe(this IObservable> source, Func transformFactory, Action> errorHandler, IObservable>? forceTransform = null) where TDestination : notnull @@ -37,7 +47,17 @@ public static IObservable> TransformSafe transformFactory(current), errorHandler, forceTransform.ForForced()); } - /// + /// + /// Provides an overload of TransformSafe for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The errorHandler value. + /// The forceTransform value. + /// The resulting observable sequence. /// This overload accepts a factory that receives the current item and key. public static IObservable> TransformSafe(this IObservable> source, Func transformFactory, Action> errorHandler, IObservable>? forceTransform = null) where TDestination : notnull @@ -58,15 +78,15 @@ public static IObservable> TransformSafeThe type of the transformed items. /// The type of the source items. /// The type of the key. - /// The source to transform with error handling. - /// The that produces a from the current source item, the previous source item (if any), and the key. - /// A callback invoked when throws. Receives an containing the exception and the faulting item. The item is skipped and the stream continues. - /// An optional that, when it emits a predicate, re-transforms all items for which the predicate returns . If , no forced re-transforms occur. + /// The source IObservable<IChangeSet<TSource, TKey>> to transform with error handling. + /// The Func<TSource, Optional<TSource>, TKey, TDestination> that produces a from the current source item, the previous source item (if any), and the key. + /// A callback invoked when throws. Receives an Error<TSource, TKey> containing the exception and the faulting item. The item is skipped and the stream continues. + /// An optional IObservable<T> that, when it emits a predicate, re-transforms all items for which the predicate returns . If , no forced re-transforms occur. /// An observable changeset of transformed items. /// /// - /// Behaves identically to - /// except that factory exceptions are routed to instead of propagating as . + /// Behaves identically to Transform<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, TDestination>, IObservable<Func<TSource, TKey, bool>>?) + /// except that factory exceptions are routed to instead of propagating as IObserver<T>.OnError. /// Source-level errors (i.e. the source observable itself erroring) still propagate normally. /// /// Worth noting: Factory exceptions are caught per-item; the faulting item is skipped and reported to the error handler while the stream continues. Source-level errors still terminate the stream. @@ -88,15 +108,35 @@ public static IObservable> TransformSafe(source, transformFactory, errorHandler).Run(); } - /// - /// This overload accepts of to force re-transformation of ALL items. The factory receives only the current item. + /// + /// Provides an overload of ForForced for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The errorHandler value. + /// The forceTransform value. + /// The resulting observable sequence. + /// This overload accepts IObservable<T> of to force re-transformation of ALL items. The factory receives only the current item. public static IObservable> TransformSafe(this IObservable> source, Func transformFactory, Action> errorHandler, IObservable forceTransform) where TDestination : notnull where TSource : notnull where TKey : notnull => source.TransformSafe((cur, _, _) => transformFactory(cur), errorHandler, forceTransform.ForForced()); - /// - /// This overload accepts of to force re-transformation of ALL items. The factory receives the current item and key. + /// + /// Provides an overload of TransformSafe for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The errorHandler value. + /// The forceTransform value. + /// The resulting observable sequence. + /// This overload accepts IObservable<T> of to force re-transformation of ALL items. The factory receives the current item and key. public static IObservable> TransformSafe(this IObservable> source, Func transformFactory, Action> errorHandler, IObservable forceTransform) where TDestination : notnull where TSource : notnull @@ -109,8 +149,18 @@ public static IObservable> TransformSafe transformFactory(cur, key), errorHandler, forceTransform.ForForced()); } - /// - /// This overload accepts of to force re-transformation of ALL items. + /// + /// Provides an overload of TransformSafe for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The errorHandler value. + /// The forceTransform value. + /// The resulting observable sequence. + /// This overload accepts IObservable<T> of to force re-transformation of ALL items. public static IObservable> TransformSafe(this IObservable> source, Func, TKey, TDestination> transformFactory, Action> errorHandler, IObservable forceTransform) where TDestination : notnull where TSource : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs index 0b05ee355..5aa43ffa1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs @@ -23,7 +23,17 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// + /// + /// Provides an overload of TransformSafeAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The errorHandler value. + /// The forceTransform value. + /// The resulting observable sequence. /// This overload takes a factory that receives only the current item. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformSafeAsync(this IObservable> source, Func> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) @@ -38,7 +48,17 @@ public static IObservable> TransformSafeAsync transformFactory(current), errorHandler, forceTransform); } - /// + /// + /// Provides an overload of TransformSafeAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The errorHandler value. + /// The forceTransform value. + /// The resulting observable sequence. /// This overload takes a factory that receives the current item and key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformSafeAsync(this IObservable> source, Func> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) @@ -54,18 +74,18 @@ public static IObservable> TransformSafeAsync - /// Async version of . + /// Async version of TransformSafe<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, TDestination>, Action<Error<TSource, TKey>>, IObservable<Func<TSource, TKey, bool>>?). /// Projects each item using an async factory, catching factory exceptions via a mandatory error handler. ///
/// The type of the transformed items. /// The type of the source items. /// The type of the key. - /// The source to transform asynchronously with error handling. - /// The async function that produces a . - /// A that called when throws or faults. The item is skipped and the stream continues. - /// An optional that forces re-transformation of matching items. + /// The source IObservable<IChangeSet<TSource, TKey>> to transform asynchronously with error handling. + /// The Func<TSource, Optional<TSource>, TKey, Task<TDestination>> async function that produces a . + /// A Action<T> that called when throws or faults. The item is skipped and the stream continues. + /// An optional IObservable<T> that forces re-transformation of matching items. /// An observable changeset of transformed items. - /// Combines the async execution model of with the error-safe behavior of . + /// Combines the async execution model of TransformAsync<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, Task<TDestination>>, IObservable<Func<TSource, TKey, bool>>?) with the error-safe behavior of TransformSafe<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Optional<TSource>, TKey, TDestination>, Action<Error<TSource, TKey>>, IObservable<Func<TSource, TKey, bool>>?). /// , , or is . [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, IObservable>? forceTransform = null) @@ -80,7 +100,17 @@ public static IObservable> TransformSafeAsync(source, transformFactory, errorHandler, forceTransform).Run(); } - /// + /// + /// Provides an overload of TransformSafeAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The errorHandler value. + /// The options value. + /// The resulting observable sequence. /// This overload accepts to control concurrency and Refresh handling. The factory receives only the current item. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformSafeAsync(this IObservable> source, Func> transformFactory, Action> errorHandler, TransformAsyncOptions options) @@ -95,7 +125,17 @@ public static IObservable> TransformSafeAsync transformFactory(current), errorHandler, options); } - /// + /// + /// Provides an overload of TransformSafeAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The errorHandler value. + /// The options value. + /// The resulting observable sequence. /// This overload accepts to control concurrency and Refresh handling. The factory receives the current item and key. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformSafeAsync(this IObservable> source, Func> transformFactory, Action> errorHandler, TransformAsyncOptions options) @@ -110,7 +150,17 @@ public static IObservable> TransformSafeAsync transformFactory(current, key), errorHandler, options); } - /// + /// + /// Provides an overload of TransformSafeAsync for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The errorHandler value. + /// The options value. + /// The resulting observable sequence. /// This overload accepts to control concurrency and Refresh handling. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformSafeAsync(this IObservable> source, Func, TKey, Task> transformFactory, Action> errorHandler, TransformAsyncOptions options) diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs index 7b09fcdf0..3322b971f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs @@ -25,14 +25,14 @@ public static partial class ObservableCacheEx { /// /// Builds a hierarchical tree from a flat changeset using a parent key selector. - /// Each item becomes a with Parent, Children, Depth, and IsRoot properties. + /// Each item becomes a Node<TObject, TKey> with Parent, Children, Depth, and IsRoot properties. /// /// The type of the source items. Must be a reference type. /// The type of the key. - /// The source to transform into a hierarchical tree. - /// The that returns the key of an item's parent. Return the item's own key (or a non-existent key) for root items. - /// An optional that emits a filter predicate for nodes. When the predicate changes, nodes are re-evaluated and filtered. - /// An observable changeset of items representing the tree. + /// The source IObservable<IChangeSet<TObject, TKey>> to transform into a hierarchical tree. + /// The Func<TObject, TKey> that returns the key of an item's parent. Return the item's own key (or a non-existent key) for root items. + /// An optional IObservable<T> that emits a filter predicate for nodes. When the predicate changes, nodes are re-evaluated and filtered. + /// An observable changeset of Node<TObject, TKey> items representing the tree. /// /// Change reason handling: /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs index 7ad8ee7e1..7ef67e50b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs @@ -23,7 +23,16 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// + /// + /// Provides an overload of TransformWithInlineUpdate for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The updateAction value. + /// The resulting observable sequence. /// This overload defaults to transformOnRefresh: false and does not provide an error handler (factory exceptions propagate as OnError). public static IObservable> TransformWithInlineUpdate(this IObservable> source, Func transformFactory, Action updateAction) where TDestination : class @@ -37,7 +46,17 @@ public static IObservable> TransformWithInlineUpd return source.TransformWithInlineUpdate(transformFactory, updateAction, false); } - /// + /// + /// Provides an overload of TransformWithInlineUpdate for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The updateAction value. + /// The transformOnRefresh value. + /// The resulting observable sequence. /// This overload does not provide an error handler (factory exceptions propagate as OnError). The transformOnRefresh parameter controls Refresh behavior. public static IObservable> TransformWithInlineUpdate(this IObservable> source, Func transformFactory, Action updateAction, bool transformOnRefresh) where TDestination : class @@ -51,7 +70,17 @@ public static IObservable> TransformWithInlineUpd return new TransformWithInlineUpdate(source, transformFactory, updateAction, transformOnRefresh: transformOnRefresh).Run(); } - /// + /// + /// Provides an overload of TransformWithInlineUpdate for the supplied arguments. + /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The type of the TKey value. + /// The source value. + /// The transformFactory value. + /// The updateAction value. + /// The errorHandler value. + /// The resulting observable sequence. /// This overload defaults to transformOnRefresh: false but includes an error handler for factory/update action exceptions. public static IObservable> TransformWithInlineUpdate(this IObservable> source, Func transformFactory, Action updateAction, Action> errorHandler) where TDestination : class @@ -73,10 +102,10 @@ public static IObservable> TransformWithInlineUpd /// The type of the transformed items. Must be a reference type since items are mutated in place. /// The type of the source items. /// The type of the key. - /// The source to transform with in-place mutation on updates. - /// A that called on Add (and optionally Refresh) to create a new . - /// A that called on Update. Receives (existingTransformed, newSource). Mutate the existing transformed item to reflect the new source value. Example: (vm, model) => vm.Value = model.Value. - /// A that called when or throws. The faulting item is skipped. + /// The source IObservable<IChangeSet<TSource, TKey>> to transform with in-place mutation on updates. + /// A Func<T, TResult> that called on Add (and optionally Refresh) to create a new . + /// A Action<T> that called on Update. Receives (existingTransformed, newSource). Mutate the existing transformed item to reflect the new source value. Example: (vm, model) => vm.Value = model.Value. + /// A Action<T> that called when or throws. The faulting item is skipped. /// When , Refresh changes call on the existing item. /// An observable changeset of transformed items. /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs index fc85c39c1..e7f1721e9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs @@ -21,7 +21,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to convert move events into remove/add pairs. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to convert move events into remove/add pairs. /// the same SortedChangeSets, except all moves are replaced with remove + add. public static IObservable> TreatMovesAsRemoveAdd(this IObservable> source) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs index 14ae4bff4..bbc99fd6c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs @@ -23,6 +23,16 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { + /// + /// Executes the TrueFor operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The type of the TValue value. + /// The source value. + /// The observableSelector value. + /// The collectionMatcher value. + /// The result of the operation. private static IObservable TrueFor(this IObservable> source, Func> observableSelector, Func>, bool> collectionMatcher) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs index 8ffb49468..74a740205 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs @@ -23,9 +23,9 @@ public static partial class ObservableCacheEx /// The type of the object. /// The type of the key. /// The type of the value emitted by each per-item observable. - /// The source to evaluate a condition across all items in. - /// A factory that produces a condition observable for each item. - /// A that predicate applied to each per-item observable's latest value. + /// The source IObservable<IChangeSet<TObject, TKey>> to evaluate a condition across all items in. + /// A Func<T, TResult> factory that produces a condition observable for each item. + /// A Func<T, TResult> that predicate applied to each per-item observable's latest value. /// An observable of bool that emits whenever the all-items condition changes. /// , , or is . /// @@ -38,7 +38,7 @@ public static partial class ObservableCacheEx /// /// Worth noting: Items whose per-item observable has not yet emitted are treated as not satisfying the condition. An empty cache is vacuously . The result uses DistinctUntilChanged, so duplicate bool values are suppressed. /// - /// + /// TrueForAny<TObject, TKey, TValue>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<TValue>>, Func<TValue, bool>) public static IObservable TrueForAll(this IObservable> source, Func> observableSelector, Func equalityCondition) where TObject : notnull where TKey : notnull @@ -57,9 +57,9 @@ public static IObservable TrueForAll(this IObservab /// The type of the object. /// The type of the key. /// The type of the value. - /// The source to evaluate a condition across all items in. - /// A that selector which returns the target observable. - /// The equality condition. + /// The source IObservable<IChangeSet<TObject, TKey>> to evaluate a condition across all items in. + /// A Func<T, TResult> that selector which returns the target observable. + /// The Func<TObject, TValue, bool> equality condition. /// An observable which boolean values indicating if true. /// source. public static IObservable TrueForAll(this IObservable> source, Func> observableSelector, Func equalityCondition) diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs index 657a9bf2b..fa548b69e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs @@ -23,9 +23,9 @@ public static partial class ObservableCacheEx /// The type of the object. /// The type of the key. /// The type of the value emitted by each per-item observable. - /// The source to evaluate a condition across any item in. - /// A factory that produces a condition observable for each item. - /// A that predicate applied to each item and its per-item observable's latest value. + /// The source IObservable<IChangeSet<TObject, TKey>> to evaluate a condition across any item in. + /// A Func<T, TResult> factory that produces a condition observable for each item. + /// A Func<T, TResult> that predicate applied to each item and its per-item observable's latest value. /// An observable of bool that emits whenever the any-item condition changes. /// , , or is . /// @@ -38,16 +38,22 @@ public static partial class ObservableCacheEx /// /// Worth noting: Items whose per-item observable has not yet emitted are treated as not satisfying the condition. An empty cache yields . The result uses DistinctUntilChanged, so duplicate bool values are suppressed. /// - /// + /// TrueForAll<TObject, TKey, TValue>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<TValue>>, Func<TValue, bool>) public static IObservable TrueForAny(this IObservable> source, Func> observableSelector, Func equalityCondition) where TObject : notnull where TKey : notnull where TValue : notnull => source.TrueFor(observableSelector, items => items.Any(o => o.LatestValue.HasValue && equalityCondition(o.Item, o.LatestValue.Value))); - /// - /// The source to evaluate a condition across any item in. - /// A factory that produces a condition observable for each item. - /// A that predicate applied to each per-item observable's latest value (without the item). + /// + /// Provides an overload of TrueForAny for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The type of the TValue value. + /// The source IObservable<IChangeSet<TObject, TKey>> to evaluate a condition across any item in. + /// A Func<T, TResult> factory that produces a condition observable for each item. + /// A Func<T, TResult> that predicate applied to each per-item observable's latest value (without the item). + /// The resulting observable sequence. /// This overload accepts a predicate that takes only the value, not the item. Useful when the condition depends only on the observed value. public static IObservable TrueForAny(this IObservable> source, Func> observableSelector, Func equalityCondition) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs index 843f7524b..48c71c51a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs @@ -25,11 +25,11 @@ public static partial class ObservableCacheEx { /// /// Sets the Index property on each item (which must implement ) - /// to reflect its position in the sorted output. Operates on . + /// to reflect its position in the sorted output. Operates on ISortedChangeSet<TObject, TKey>. /// /// The type of the object. /// The type of the key. - /// The source to update index positions in. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to update index positions in. /// An observable that emits the sorted changesets after updating item indices. public static IObservable> UpdateIndex(this IObservable> source) where TObject : IIndexAware diff --git a/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs index a063e398e..238e53fcd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs @@ -21,7 +21,15 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { - /// + /// + /// Provides an overload of SortAndVirtualize for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The comparer value. + /// The virtualRequests value. + /// The resulting observable sequence. /// This overload uses default . public static IObservable>> SortAndVirtualize(this IObservable> source, IComparer comparer, @@ -30,7 +38,15 @@ public static IObservable>> So where TKey : notnull => source.SortAndVirtualize(comparer, virtualRequests, new SortAndVirtualizeOptions()); - /// + /// + /// Provides an overload of SortAndVirtualize for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The comparerChanged value. + /// The virtualRequests value. + /// The resulting observable sequence. /// This overload uses default . public static IObservable>> SortAndVirtualize( this IObservable> source, @@ -51,9 +67,9 @@ public static IObservable>> So ///
/// The type of the object. /// The type of the key. - /// The source to paginate. - /// The that determines sort order. - /// The that controls which window of sorted items to include. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to paginate. + /// The IComparer<TObject> that determines sort order. + /// The IObservable<IVirtualRequest> that controls which window of sorted items to include. /// The for controlling virtualization behavior. /// An observable which will emit virtual change sets. /// source. @@ -73,8 +89,8 @@ public static IObservable>> So /// /// Worth noting: No data is emitted until produces its first value. Changing the window can cause a full recalculation of visible items. /// - /// - /// + /// SortAndVirtualize<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IComparer<TObject>>, IObservable<IVirtualRequest>, SortAndVirtualizeOptions) + /// Top<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IComparer<TObject>, int) public static IObservable>> SortAndVirtualize( this IObservable> source, IComparer comparer, @@ -95,9 +111,9 @@ public static IObservable>> So ///
/// The type of the object. /// The type of the key. - /// The source to paginate. - /// An that emits new comparers to re-sort with. - /// The that controls which window of sorted items to include. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to paginate. + /// An IObservable<IComparer<TObject>> that emits new comparers to re-sort with. + /// The IObservable<IVirtualRequest> that controls which window of sorted items to include. /// The for controlling virtualization behavior. /// An observable which will emit virtual change sets. /// source. @@ -117,8 +133,8 @@ public static IObservable>> So /// /// Worth noting: No data is emitted until both the comparer observable and virtualRequests have produced their first values. Changing the window or comparer can cause a full recalculation of visible items. /// - /// - /// + /// SortAndPage<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IComparer<TObject>>, IObservable<IPageRequest>, SortAndPageOptions) + /// Top<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IComparer<TObject>, int) public static IObservable>> SortAndVirtualize( this IObservable> source, IObservable> comparerChanged, @@ -138,8 +154,8 @@ public static IObservable>> So ///
/// The type of the object. /// The type of the key. - /// The source to paginate. - /// The that controls which window of sorted items to include. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to paginate. + /// The IObservable<IVirtualRequest> that controls which window of sorted items to include. /// An observable which will emit virtual change sets. /// source. [Obsolete(Constants.VirtualizeIsObsolete)] @@ -159,20 +175,20 @@ public static IObservable> Virtualise /// The type of the object. /// The type of the key. - /// The source to limit. - /// The that determines sort order. + /// The source IObservable<IChangeSet<TObject, TKey>> to limit. + /// The IComparer<TObject> that determines sort order. /// The maximum number of items to return. /// An observable which will emit virtual change sets. /// source. /// size;Size should be greater than zero. /// /// - /// Internally delegates to + /// Internally delegates to SortAndVirtualize<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IComparer<TObject>, IObservable<IVirtualRequest>, SortAndVirtualizeOptions) /// with a fixed of (0, size). /// /// Worth noting: When the Nth item is displaced by a new item with higher sort priority, the displaced item is emitted as a Remove and the new item as an Add. /// - /// + /// SortAndVirtualize<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IComparer<TObject>, IObservable<IVirtualRequest>, SortAndVirtualizeOptions) public static IObservable>> Top(this IObservable> source, IComparer comparer, int size) where TObject : notnull where TKey : notnull @@ -193,7 +209,7 @@ public static IObservable>> To ///
/// The type of the object. /// The type of the key. - /// The source to paginate. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to paginate. /// The maximum number of items to include. /// An observable which will emit virtual change sets. /// source. @@ -213,7 +229,15 @@ public static IObservable> Top(t return new Virtualise(source, Observable.Return(new VirtualRequest(0, size))).Run(); } - /// + /// + /// Provides an overload of SortAndPage for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The comparer value. + /// The pageRequests value. + /// The resulting observable sequence. /// This overload uses default . public static IObservable>> SortAndPage(this IObservable> source, IComparer comparer, @@ -222,7 +246,15 @@ public static IObservable>> SortA where TKey : notnull => source.SortAndPage(comparer, pageRequests, new SortAndPageOptions()); - /// + /// + /// Provides an overload of SortAndPage for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The comparerChanged value. + /// The pageRequests value. + /// The resulting observable sequence. /// This overload uses default . public static IObservable>> SortAndPage( this IObservable> source, @@ -243,9 +275,9 @@ public static IObservable>> SortA ///
/// The type of the object. /// The type of the key. - /// The source to paginate. - /// The that determines sort order. - /// The that controls which page of sorted items to include. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to paginate. + /// The IComparer<TObject> that determines sort order. + /// The IObservable<IPageRequest> that controls which page of sorted items to include. /// The for controlling paging behavior. /// An observable which will emit paged change sets. /// source. @@ -265,7 +297,7 @@ public static IObservable>> SortA /// /// Worth noting: No data is emitted until produces its first value. Page numbers are 1-based. Requesting a page beyond the data range results in an empty page. /// - /// + /// SortAndPage<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IComparer<TObject>>, IObservable<IPageRequest>, SortAndPageOptions) public static IObservable>> SortAndPage( this IObservable> source, IComparer comparer, @@ -286,9 +318,9 @@ public static IObservable>> SortA ///
/// The type of the object. /// The type of the key. - /// The source to paginate. - /// An that emits new comparers to re-sort with. - /// The that controls which page of sorted items to include. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to paginate. + /// An IObservable<IComparer<TObject>> that emits new comparers to re-sort with. + /// The IObservable<IPageRequest> that controls which page of sorted items to include. /// The for controlling paging behavior. /// An observable which will emit paged change sets. /// source. @@ -308,7 +340,7 @@ public static IObservable>> SortA /// /// Worth noting: No data is emitted until both the comparer observable and pageRequests have produced their first values. Page numbers are 1-based. Requesting a page beyond the data range results in an empty page. /// - /// + /// SortAndVirtualize<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IComparer<TObject>>, IObservable<IVirtualRequest>, SortAndVirtualizeOptions) public static IObservable>> SortAndPage( this IObservable> source, IObservable> comparerChanged, @@ -328,8 +360,8 @@ public static IObservable>> SortA ///
/// The type of the object. /// The type of the key. - /// The source to paginate. - /// The that controls which page of sorted items to include. + /// The source IObservable<ISortedChangeSet<TObject, TKey>> to paginate. + /// The IObservable<IPageRequest> that controls which page of sorted items to include. /// An observable which emits change sets. [Obsolete(Constants.PageIsObsolete)] public static IObservable> Page(this IObservable> source, IObservable pageRequests) diff --git a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs index cfe117af9..37fc60d27 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs @@ -17,24 +17,24 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Filters the source changeset stream to a single key, emitting each for that key. + /// Filters the source changeset stream to a single key, emitting each Change<TObject, TKey> for that key. /// Changes for all other keys are ignored. /// /// The type of the object. /// The type of the key. - /// The source to watch a single key in. + /// The source IObservable<IChangeSet<TObject, TKey>> to watch a single key in. /// The key to observe. - /// An observable of for the specified key only. + /// An observable of Change<TObject, TKey> for the specified key only. /// /// /// Emits Add, Update, Remove, and Refresh changes as they occur for the target key. /// No initial emission occurs if the key is not yet present in the cache. This operator does not /// produce changesets; it produces individual change notifications. For Optional-based watching, - /// use . + /// use ToObservableOptional<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TKey, IEqualityComparer<TObject>?). /// /// - /// - /// + /// WatchValue<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TKey) + /// ToObservableOptional<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TKey, IEqualityComparer<TObject>?) public static IObservable> Watch(this IObservable> source, TKey key) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs index 6df2c281f..70d2dac08 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs @@ -22,26 +22,26 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to watch a single key in. + /// The source IObservableCache<TObject, TKey> to watch a single key in. /// The key to observe. /// An observable of the item's value whenever it changes for the specified key. /// /// - /// Unlike , - /// this does not emit on removal. It emits the removed item's value instead. + /// Unlike ToObservableOptional<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TKey, IEqualityComparer<TObject>?), + /// this does not emit ReactiveUI.Primitives.Optional.None<T> on removal. It emits the removed item's value instead. /// If you need to distinguish presence from absence, use ToObservableOptional. /// /// /// EventBehavior /// AddEmits the added item's value. /// UpdateEmits the new value. - /// RemoveEmits the removed item's value (not None; use if you need removal detection). + /// RemoveEmits the removed item's value (not None; use ToObservableOptional<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TKey, IEqualityComparer<TObject>?) if you need removal detection). /// RefreshEmits the current value. /// /// Worth noting: No emission occurs if the key is not present at subscription time. Changes to other keys are ignored entirely. /// - /// - /// + /// Watch<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TKey) + /// ToObservableOptional<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TKey, IEqualityComparer<TObject>?) public static IObservable WatchValue(this IObservableCache source, TKey key) where TObject : notnull where TKey : notnull @@ -51,10 +51,15 @@ public static IObservable WatchValue(this IObservableCac return source.Watch(key).Select(u => u.Current); } - /// - /// The source to watch a single key in. + /// + /// Provides an overload of WatchValue for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<IChangeSet<TObject, TKey>> to watch a single key in. /// The key to observe. - /// This overload extends IObservable<> instead of . + /// The resulting observable sequence. + /// This overload extends IObservable<IChangeSet<TObject, TKey>> instead of IObservableCache<TObject, TKey>. public static IObservable WatchValue(this IObservable> source, TKey key) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs index 6cbfcc84d..5a57c6d56 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs @@ -29,7 +29,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object (must implement ). /// The type of the key. - /// The source to observe property changes on items in. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe property changes on items in. /// The specific property names to monitor. If empty, all property changes trigger emissions. /// An observable that emits the item itself each time a monitored property changes. /// @@ -48,10 +48,10 @@ public static partial class ObservableCacheEx /// OnErrorErrors from individual property subscriptions are silently ignored. Source errors terminate the stream. /// /// - /// - /// - /// - /// + /// WhenPropertyChanged<TObject, TKey, TValue> + /// WhenValueChanged<TObject, TKey, TValue> + /// AutoRefresh<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TimeSpan?, TimeSpan?, IScheduler?) + /// ObservableListEx.WhenAnyPropertyChanged public static IObservable WhenAnyPropertyChanged(this IObservable> source, params string[] propertiesToMonitor) where TObject : INotifyPropertyChanged where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs index 18845bdc8..8608dd73e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs @@ -24,21 +24,21 @@ namespace DynamicData; public static partial class ObservableCacheEx { /// - /// Emits a (item + property value) whenever the specified property + /// Emits a PropertyValue<TObject, TValue> (item + property value) whenever the specified property /// changes on any item in the cache. Subscribes via using MergeMany. /// /// The type of the object (must implement ). /// The type of the key. /// The type of the monitored property. - /// The source to observe a specific property on items in. - /// A that expression selecting the property to monitor. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe a specific property on items in. + /// A Expression<TDelegate> that expression selecting the property to monitor. /// When (the default), the current property value is emitted immediately for each item upon subscription. - /// An observable of containing both the item and its property value. + /// An observable of PropertyValue<TObject, TValue> containing both the item and its property value. /// /// /// Per-item subscriptions are created on Add, replaced on Update, disposed on Remove. Errors from individual /// property subscriptions are silently ignored. The output is not a changeset stream. If you only need - /// the value (not the owning item), use instead. + /// the value (not the owning item), use WhenValueChanged<TObject, TKey, TValue> instead. /// /// /// EventBehavior @@ -49,7 +49,7 @@ public static partial class ObservableCacheEx /// OnErrorPer-item property subscription errors are silently ignored. Source errors terminate the stream. /// /// - /// + /// ObservableListEx.WhenPropertyChanged public static IObservable> WhenPropertyChanged(this IObservable> source, Expression> propertyAccessor, bool notifyOnInitialValue = true) where TObject : INotifyPropertyChanged where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs index 1dfd3b75a..6f1a5ff49 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs @@ -25,20 +25,20 @@ public static partial class ObservableCacheEx { /// /// Emits the property value whenever the specified property changes on any item in the cache. - /// Like but emits only the value, discarding the owning item. + /// Like WhenPropertyChanged<TObject, TKey, TValue> but emits only the value, discarding the owning item. /// /// The type of the object (must implement ). /// The type of the key. /// The type of the monitored property. - /// The source to observe a specific property value on items in. - /// A that expression selecting the property to monitor. + /// The source IObservable<IChangeSet<TObject, TKey>> to observe a specific property value on items in. + /// A Expression<TDelegate> that expression selecting the property to monitor. /// When (the default), the current property value is emitted immediately for each item upon subscription. - /// An observable of property values. The owning item is not included; use if you need it. + /// An observable of property values. The owning item is not included; use WhenPropertyChanged<TObject, TKey, TValue> if you need it. /// /// /// Per-item subscriptions are created on Add, replaced on Update, disposed on Remove. Errors from individual /// property subscriptions are silently ignored. If you need to correlate a value back to its source item, - /// use which returns a pair. + /// use WhenPropertyChanged<TObject, TKey, TValue> which returns a PropertyValue<TObject, TValue> pair. /// /// /// EventBehavior @@ -49,10 +49,10 @@ public static partial class ObservableCacheEx /// OnErrorPer-item errors silently ignored. Source errors terminate the stream. /// /// - /// - /// - /// - /// + /// WhenPropertyChanged<TObject, TKey, TValue> + /// WhenAnyPropertyChanged<TObject, TKey> + /// AutoRefresh<TObject, TKey, TProperty>(IObservable<IChangeSet<TObject, TKey>>, Expression<Func<TObject, TProperty>>, TimeSpan?, TimeSpan?, IScheduler?) + /// ObservableListEx.WhenValueChanged public static IObservable WhenValueChanged(this IObservable> source, Expression> propertyAccessor, bool notifyOnInitialValue = true) where TObject : INotifyPropertyChanged where TKey : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs index 751edcbee..82d8f4a36 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs @@ -21,7 +21,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to filter by change reason. + /// The source IObservable<IChangeSet<TObject, TKey>> to filter by change reason. /// The values to filter by. /// An observable which emits a change set with items matching the reasons. /// reasons. diff --git a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs index faf63f801..82b50b226 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs @@ -21,7 +21,7 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to filter by excluding change reasons. + /// The source IObservable<IChangeSet<TObject, TKey>> to filter by excluding change reasons. /// The values to filter by. /// An observable which emits a change set with items not matching the reasons. /// reasons. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Xor.cs b/src/DynamicData/Cache/ObservableCacheEx.Xor.cs index 2b384302e..dabc9f3e5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Xor.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Xor.cs @@ -29,8 +29,8 @@ public static partial class ObservableCacheEx ///
/// The type of the object. /// The type of the key. - /// The source to combine. - /// The additional streams to combine with. + /// The source IObservable<IChangeSet<TObject, TKey>> to combine. + /// The additional IObservable<IChangeSet<TObject, TKey>> streams to combine with. /// A changeset stream containing items present in exactly one source. /// /// @@ -47,10 +47,10 @@ public static partial class ObservableCacheEx /// /// /// or is . - /// - /// - /// - /// + /// And<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IChangeSet<TObject, TKey>>[]) + /// Or<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IChangeSet<TObject, TKey>>[]) + /// Except<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IChangeSet<TObject, TKey>>[]) + /// ObservableListEx.Xor public static IObservable> Xor(this IObservable> source, params IObservable>[] others) where TObject : notnull where TKey : notnull @@ -65,8 +65,13 @@ public static IObservable> Xor(this IOb return source.Combine(CombineOperator.Xor, others); } - /// - /// The of streams to combine. + /// + /// Provides an overload of Xor for the supplied arguments. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The ICollection<T> of streams to combine. + /// The resulting observable sequence. /// This overload accepts a pre-built collection of sources instead of a params array. public static IObservable> Xor(this ICollection>> sources) where TObject : notnull @@ -83,7 +88,7 @@ public static IObservable> Xor(this ICo ///
/// The type of the object. /// The type of the key. - /// The of streams to combine. + /// The IObservableList<T> of streams to combine. /// An observable which emits a change set. public static IObservable> Xor(this IObservableList>> sources) where TObject : notnull @@ -100,7 +105,7 @@ public static IObservable> Xor(this IOb ///
/// The type of the object. /// The type of the key. - /// The of changeset streams to combine. + /// The IObservableList<IObservableCache<TObject, TKey>> of changeset streams to combine. /// An observable which emits a change set. public static IObservable> Xor(this IObservableList> sources) where TObject : notnull @@ -117,7 +122,7 @@ public static IObservable> Xor(this IOb ///
/// The type of the object. /// The type of the key. - /// The of changeset streams to combine. + /// The IObservableList<ISourceCache<TObject, TKey>> of changeset streams to combine. /// An observable which emits a change set. public static IObservable> Xor(this IObservableList> sources) where TObject : notnull diff --git a/src/DynamicData/Cache/ObservableCacheEx.cs b/src/DynamicData/Cache/ObservableCacheEx.cs index 118532aa9..548a3af9e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.cs @@ -16,5 +16,8 @@ namespace DynamicData; ///
public static partial class ObservableCacheEx { + /// + /// The DefaultSortResetThreshold field. + /// private const int DefaultSortResetThreshold = 100; } diff --git a/src/DynamicData/Cache/PageContext.cs b/src/DynamicData/Cache/PageContext.cs index cc4559ee2..d260e5d4f 100644 --- a/src/DynamicData/Cache/PageContext.cs +++ b/src/DynamicData/Cache/PageContext.cs @@ -28,6 +28,9 @@ public record PageContext( IComparer Comparer, SortAndPageOptions Options) { + /// + /// The Empty field. + /// internal static readonly PageContext Empty = new ( new PageResponse(0, 0, 0, 0), diff --git a/src/DynamicData/Cache/PageRequest.cs b/src/DynamicData/Cache/PageRequest.cs index 55f2c94f3..8bba7cb4e 100644 --- a/src/DynamicData/Cache/PageRequest.cs +++ b/src/DynamicData/Cache/PageRequest.cs @@ -71,12 +71,17 @@ public PageRequest() public int Size { get; } = 25; /// + /// The other value. + /// The result of the operation. public bool Equals(IPageRequest? other) => DefaultComparer.Equals(this, other); /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is IPageRequest value && Equals(value); /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -86,10 +91,20 @@ public override int GetHashCode() } /// + /// The result of the operation. public override string ToString() => $"Page: {Page}, Size: {Size}"; - private sealed class PageSizeEqualityComparer : IEqualityComparer +/// +/// Provides members for the PageSizeEqualityComparer class. +/// +private sealed class PageSizeEqualityComparer : IEqualityComparer { + /// + /// Executes the Equals operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public bool Equals(IPageRequest? x, IPageRequest? y) { if (ReferenceEquals(x, y)) @@ -115,6 +130,11 @@ public bool Equals(IPageRequest? x, IPageRequest? y) return x.Page == y.Page && x.Size == y.Size; } + /// + /// Executes the GetHashCode operation. + /// + /// The obj value. + /// The result of the operation. public int GetHashCode(IPageRequest? obj) { if (obj is null) diff --git a/src/DynamicData/Cache/PageResponse.cs b/src/DynamicData/Cache/PageResponse.cs index 7d730ac1f..4e445e73c 100644 --- a/src/DynamicData/Cache/PageResponse.cs +++ b/src/DynamicData/Cache/PageResponse.cs @@ -16,16 +16,38 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the PageResponse class. +/// +/// The pageSize value. +/// The totalSize value. +/// The page value. +/// The pages value. internal sealed class PageResponse(int pageSize, int totalSize, int page, int pages) : IEquatable, IPageResponse { + /// + /// Gets the DefaultComparer value. + /// public static IEqualityComparer DefaultComparer { get; } = new PageResponseEqualityComparer(); + /// + /// Gets the Page value. + /// public int Page { get; } = page; + /// + /// Gets the Pages value. + /// public int Pages { get; } = pages; + /// + /// Gets the PageSize value. + /// public int PageSize { get; } = pageSize; + /// + /// Gets the TotalSize value. + /// public int TotalSize { get; } = totalSize; /// @@ -85,8 +107,17 @@ public override int GetHashCode() /// public override string ToString() => $"Page: {Page}, PageSize: {PageSize}, Pages: {Pages}, TotalSize: {TotalSize}"; - private sealed class PageResponseEqualityComparer : IEqualityComparer +/// +/// Provides members for the PageResponseEqualityComparer class. +/// +private sealed class PageResponseEqualityComparer : IEqualityComparer { + /// + /// Executes the Equals operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public bool Equals(IPageResponse? x, IPageResponse? y) { if (ReferenceEquals(x, y)) @@ -112,6 +143,11 @@ public bool Equals(IPageResponse? x, IPageResponse? y) return x.PageSize == y.PageSize && x.TotalSize == y.TotalSize && x.Page == y.Page && x.Pages == y.Pages; } + /// + /// Executes the GetHashCode operation. + /// + /// The obj value. + /// The result of the operation. public int GetHashCode(IPageResponse? obj) { if (obj is null) diff --git a/src/DynamicData/Cache/PagedChangeSet.cs b/src/DynamicData/Cache/PagedChangeSet.cs index bfdb67c8c..2c0541c30 100644 --- a/src/DynamicData/Cache/PagedChangeSet.cs +++ b/src/DynamicData/Cache/PagedChangeSet.cs @@ -21,12 +21,26 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the PagedChangeSet class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class PagedChangeSet : ChangeSet, IPagedChangeSet where TObject : notnull where TKey : notnull { + /// + /// The Empty field. + /// public static new readonly IPagedChangeSet Empty = new PagedChangeSet(); + /// + /// Initializes a new instance of the class. + /// + /// The sortedItems value. + /// The updates value. + /// The response value. public PagedChangeSet(IKeyValueCollection sortedItems, IEnumerable> updates, IPageResponse response) : base(updates) { @@ -34,14 +48,23 @@ public PagedChangeSet(IKeyValueCollection sortedItems, IEnumerabl SortedItems = sortedItems; } + /// + /// Initializes a new instance of the class. + /// private PagedChangeSet() { SortedItems = new KeyValueCollection(); Response = new PageResponse(0, 0, 0, 0); } + /// + /// Gets the Response value. + /// public IPageResponse Response { get; } + /// + /// Gets the SortedItems value. + /// public IKeyValueCollection SortedItems { get; } /// @@ -51,8 +74,17 @@ private PagedChangeSet() /// If the page change set equals the other. public bool Equals(PagedChangeSet other) => SortedItems.SequenceEqual(other.SortedItems); + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is PagedChangeSet value && Equals(value); + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => SortedItems.GetHashCode(); /// diff --git a/src/DynamicData/Cache/SortedChangeSet.cs b/src/DynamicData/Cache/SortedChangeSet.cs index 7e18c1b4b..364c8121f 100644 --- a/src/DynamicData/Cache/SortedChangeSet.cs +++ b/src/DynamicData/Cache/SortedChangeSet.cs @@ -16,24 +16,61 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the SortedChangeSet class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class SortedChangeSet : ChangeSet, ISortedChangeSet where TObject : notnull where TKey : notnull { + /// + /// The Empty field. + /// public static new readonly ISortedChangeSet Empty = new SortedChangeSet(); + /// + /// Initializes a new instance of the class. + /// + /// The sortedItems value. + /// The updates value. public SortedChangeSet(IKeyValueCollection sortedItems, IEnumerable> updates) : base(updates) => SortedItems = sortedItems; + /// + /// Initializes a new instance of the class. + /// private SortedChangeSet() => SortedItems = new KeyValueCollection(); + /// + /// Gets the SortedItems value. + /// public IKeyValueCollection SortedItems { get; } + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(SortedChangeSet other) => SortedItems.SequenceEqual(other.SortedItems); + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is SortedChangeSet value && Equals(value); + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => SortedItems.GetHashCode(); + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"SortedChangeSet. Count= {SortedItems.Count}. Updates = {Count}"; } diff --git a/src/DynamicData/Cache/SourceCache.cs b/src/DynamicData/Cache/SourceCache.cs index 23d74d618..4aba29d00 100644 --- a/src/DynamicData/Cache/SourceCache.cs +++ b/src/DynamicData/Cache/SourceCache.cs @@ -32,6 +32,9 @@ public sealed class SourceCache(Func keySelector) where TObject : notnull where TKey : notnull { + /// + /// The _innerCache field. + /// private readonly ObservableCache _innerCache = new(keySelector); /// @@ -53,26 +56,38 @@ public sealed class SourceCache(Func keySelector) public IReadOnlyDictionary KeyValues => _innerCache.KeyValues; /// + /// The predicate value. + /// The suppressEmptyChangeSets value. + /// The result of the operation. public IObservable> Connect(Func? predicate = null, bool suppressEmptyChangeSets = true) => _innerCache.Connect(predicate, suppressEmptyChangeSets); /// public void Dispose() => _innerCache.Dispose(); /// + /// The updateAction value. public void Edit(Action> updateAction) => _innerCache.UpdateFromSource(updateAction); /// + /// The key value. + /// The result of the operation. public ReactiveUI.Primitives.Optional Lookup(TKey key) => _innerCache.Lookup(key); /// + /// The predicate value. + /// The result of the operation. public IObservable> Preview(Func? predicate = null) => _innerCache.Preview(predicate); /// + /// The key value. + /// The result of the operation. public IObservable> Watch(TKey key) => _innerCache.Watch(key); /// + /// The result of the operation. public IDisposable SuspendCount() => _innerCache.SuspendCount(); /// + /// The result of the operation. public IDisposable SuspendNotifications() => _innerCache.SuspendNotifications(); } diff --git a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs index 9fe1a9605..0b2e8a87c 100644 --- a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs @@ -26,6 +26,9 @@ public sealed class ChangeSetAggregator : IDisposable where TObject : notnull where TKey : notnull { + /// + /// The _disposer field. + /// private readonly IDisposable _disposer; /// @@ -109,6 +112,9 @@ public sealed class ChangeSetAggregator : IDisposable where TObject : notnull where TKey : notnull { + /// + /// The _disposer field. + /// private readonly IDisposable _disposer; /// diff --git a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs index 5ea59fad0..854d8f9f0 100644 --- a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs @@ -23,8 +23,14 @@ namespace DynamicData.Tests; public class DistinctChangeSetAggregator : IDisposable where TValue : notnull { + /// + /// The _disposer field. + /// private readonly IDisposable _disposer; + /// + /// The _isDisposed field. + /// private bool _isDisposed; /// diff --git a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs index ef6e8ff9e..3f69fed5e 100644 --- a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs @@ -27,8 +27,19 @@ public class GroupChangeSetAggregator : IDisposable where TKey : notnull where TGroupKey : notnull { + /// + /// The _compositeDisposable field. + /// private readonly CompositeDisposable _compositeDisposable; + + /// + /// The _messages field. + /// private readonly List> _messages = []; + + /// + /// The _disposedValue field. + /// private bool _disposedValue; /// diff --git a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs index 7b4a5ca4e..14bce5c9b 100644 --- a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs @@ -25,8 +25,14 @@ public class PagedChangeSetAggregator : IDisposable where TObject : notnull where TKey : notnull { + /// + /// The _disposer field. + /// private readonly IDisposable _disposer; + /// + /// The _isDisposed field. + /// private bool _isDisposed; /// diff --git a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs index 408d16590..6984cc330 100644 --- a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs @@ -25,8 +25,14 @@ public class SortedChangeSetAggregator : IDisposable where TObject : notnull where TKey : notnull { + /// + /// The _disposer field. + /// private readonly IDisposable _disposer; + /// + /// The _isDisposed field. + /// private bool _isDisposed; /// diff --git a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs index f77b7cd8d..de0f14635 100644 --- a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs @@ -25,8 +25,14 @@ public class VirtualChangeSetAggregator : IDisposable where TObject : notnull where TKey : notnull { + /// + /// The _disposer field. + /// private readonly IDisposable _disposer; + /// + /// The _isDisposed field. + /// private bool _isDisposed; /// diff --git a/src/DynamicData/Cache/VirtualChangeSet.cs b/src/DynamicData/Cache/VirtualChangeSet.cs index 625ec3909..6341236f9 100644 --- a/src/DynamicData/Cache/VirtualChangeSet.cs +++ b/src/DynamicData/Cache/VirtualChangeSet.cs @@ -16,12 +16,26 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the VirtualChangeSet class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class VirtualChangeSet : ChangeSet, IVirtualChangeSet, IEquatable> where TObject : notnull where TKey : notnull { + /// + /// The Empty field. + /// public static new readonly IVirtualChangeSet Empty = new VirtualChangeSet(); + /// + /// Initializes a new instance of the class. + /// + /// The items value. + /// The sortedItems value. + /// The response value. public VirtualChangeSet(IEnumerable> items, IKeyValueCollection sortedItems, IVirtualResponse response) : base(items) { @@ -29,20 +43,46 @@ public VirtualChangeSet(IEnumerable> items, IKeyValueColle Response = response; } + /// + /// Initializes a new instance of the class. + /// private VirtualChangeSet() { SortedItems = new KeyValueCollection(); Response = new VirtualResponse(0, 0, 0); } + /// + /// Gets the Response value. + /// public IVirtualResponse Response { get; } + /// + /// Gets the SortedItems value. + /// public IKeyValueCollection SortedItems { get; } + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(VirtualChangeSet left, VirtualChangeSet right) => Equals(left, right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(VirtualChangeSet left, VirtualChangeSet right) => !Equals(left, right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(VirtualChangeSet? other) { if (other is null) @@ -58,8 +98,17 @@ public bool Equals(VirtualChangeSet? other) return Response.Equals(other.Response) && Equals(SortedItems, other.SortedItems); } + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is VirtualChangeSet item && Equals(item); + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() { unchecked diff --git a/src/DynamicData/Cache/VirtualContext.cs b/src/DynamicData/Cache/VirtualContext.cs index 0de322ffc..3ebf5a2c7 100644 --- a/src/DynamicData/Cache/VirtualContext.cs +++ b/src/DynamicData/Cache/VirtualContext.cs @@ -21,6 +21,9 @@ public record VirtualContext( IComparer Comparer, SortAndVirtualizeOptions Options) { + /// + /// The Empty field. + /// internal static readonly VirtualContext Empty = new ( new VirtualResponse(0, 0, 0), diff --git a/src/DynamicData/Cache/VirtualRequest.cs b/src/DynamicData/Cache/VirtualRequest.cs index d6a3ddcd3..9ee304d82 100644 --- a/src/DynamicData/Cache/VirtualRequest.cs +++ b/src/DynamicData/Cache/VirtualRequest.cs @@ -56,12 +56,17 @@ public VirtualRequest() public int StartIndex { get; } /// + /// The other value. + /// The result of the operation. public bool Equals(IVirtualRequest? other) => StartIndexSizeComparer.Equals(this, other); /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is IVirtualRequest item && Equals(item); /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -71,10 +76,20 @@ public override int GetHashCode() } /// + /// The result of the operation. public override string ToString() => $"StartIndex: {StartIndex}, Size: {Size}"; - private sealed class StartIndexSizeEqualityComparer : IEqualityComparer +/// +/// Provides members for the StartIndexSizeEqualityComparer class. +/// +private sealed class StartIndexSizeEqualityComparer : IEqualityComparer { + /// + /// Executes the Equals operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public bool Equals(IVirtualRequest? x, IVirtualRequest? y) { if (ReferenceEquals(x, y)) @@ -100,6 +115,11 @@ public bool Equals(IVirtualRequest? x, IVirtualRequest? y) return x.StartIndex == y.StartIndex && x.Size == y.Size; } + /// + /// Executes the GetHashCode operation. + /// + /// The obj value. + /// The result of the operation. public int GetHashCode(IVirtualRequest? obj) { if (obj is null) diff --git a/src/DynamicData/Cache/VirtualResponse.cs b/src/DynamicData/Cache/VirtualResponse.cs index 60e4cc45e..af347f103 100644 --- a/src/DynamicData/Cache/VirtualResponse.cs +++ b/src/DynamicData/Cache/VirtualResponse.cs @@ -12,8 +12,14 @@ namespace DynamicData; /// /// Defines values used to virtualise the result set. /// +/// The size value. +/// The startIndex value. +/// The totalSize value. internal sealed class VirtualResponse(int size, int startIndex, int totalSize) : IEquatable, IVirtualResponse { + /// + /// Gets the DefaultComparer value. + /// public static IEqualityComparer DefaultComparer { get; } = new TotalSizeStartIndexSizeEqualityComparer(); /// @@ -74,8 +80,17 @@ public override int GetHashCode() /// public override string ToString() => $"Size: {Size}, StartIndex: {StartIndex}, TotalSize: {TotalSize}"; - private sealed class TotalSizeStartIndexSizeEqualityComparer : IEqualityComparer +/// +/// Provides members for the TotalSizeStartIndexSizeEqualityComparer class. +/// +private sealed class TotalSizeStartIndexSizeEqualityComparer : IEqualityComparer { + /// + /// Executes the Equals operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public bool Equals(IVirtualResponse? x, IVirtualResponse? y) { if (ReferenceEquals(x, y)) @@ -101,6 +116,11 @@ public bool Equals(IVirtualResponse? x, IVirtualResponse? y) return x.TotalSize == y.TotalSize && x.StartIndex == y.StartIndex && x.Size == y.Size; } + /// + /// Executes the GetHashCode operation. + /// + /// The obj value. + /// The result of the operation. public int GetHashCode(IVirtualResponse? obj) { if (obj is null) diff --git a/src/DynamicData/Constants.cs b/src/DynamicData/Constants.cs index 72f25a7f2..f03c46cd1 100644 --- a/src/DynamicData/Constants.cs +++ b/src/DynamicData/Constants.cs @@ -9,10 +9,28 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the Constants class. +/// internal static class Constants { + /// + /// The VirtualizeIsObsolete field. + /// public const string VirtualizeIsObsolete = "Use SortAndVirtualize as it's more efficient"; + + /// + /// The PageIsObsolete field. + /// public const string PageIsObsolete = "Use SortAndPage as it's more efficient"; + + /// + /// The TopIsObsolete field. + /// public const string TopIsObsolete = "Use Overload with comparer as it's more efficient"; + + /// + /// The SortIsObsolete field. + /// public const string SortIsObsolete = "Use SortAndBind as it's more efficient"; } diff --git a/src/DynamicData/Diagnostics/ChangeStatistics.cs b/src/DynamicData/Diagnostics/ChangeStatistics.cs index e4778ac1e..09623de49 100644 --- a/src/DynamicData/Diagnostics/ChangeStatistics.cs +++ b/src/DynamicData/Diagnostics/ChangeStatistics.cs @@ -36,6 +36,7 @@ public ChangeStatistics() public DateTime LastUpdated { get; } = DateTime.Now; /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -53,5 +54,6 @@ public override int GetHashCode() } /// + /// The result of the operation. public override string ToString() => $"CurrentIndex: {Index}, Adds: {Adds}, Updates: {Updates}, Removes: {Removes}, Refreshes: {Refreshes}, Count: {Count}, Timestamp: {LastUpdated}"; } diff --git a/src/DynamicData/Diagnostics/ChangeSummary.cs b/src/DynamicData/Diagnostics/ChangeSummary.cs index 7f7b59873..efe4b767b 100644 --- a/src/DynamicData/Diagnostics/ChangeSummary.cs +++ b/src/DynamicData/Diagnostics/ChangeSummary.cs @@ -19,6 +19,9 @@ public class ChangeSummary /// public static readonly ChangeSummary Empty = new(); + /// + /// The _index field. + /// private readonly int _index; /// @@ -61,6 +64,8 @@ private ChangeSummary() public ChangeStatistics Overall { get; } /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -77,6 +82,7 @@ public override bool Equals(object? obj) } /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -89,7 +95,13 @@ public override int GetHashCode() } /// + /// The result of the operation. public override string ToString() => $"CurrentIndex: {_index}, Latest Count: {Latest.Count}, Overall Count: {Overall.Count}"; + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. private bool Equals(ChangeSummary other) => _index == other._index && Equals(Latest, other.Latest) && Equals(Overall, other.Overall); } diff --git a/src/DynamicData/Experimental/SubjectWithRefCount.cs b/src/DynamicData/Experimental/SubjectWithRefCount.cs index bc3edd1fb..f067ce700 100644 --- a/src/DynamicData/Experimental/SubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/SubjectWithRefCount.cs @@ -19,10 +19,19 @@ namespace DynamicData.Experimental; /// The subject to perform reference counting on. internal sealed class SubjectWithRefCount(ISignal? subject = null) : ISubjectWithRefCount { + /// + /// The _subject field. + /// private readonly ISignal _subject = subject ?? new Signal(); + /// + /// The _isDisposed field. + /// private bool _isDisposed; + /// + /// The _refCount field. + /// private int _refCount; /// Gets number of subscribers. diff --git a/src/DynamicData/Experimental/Watcher.cs b/src/DynamicData/Experimental/Watcher.cs index f6c425e77..392aac1da 100644 --- a/src/DynamicData/Experimental/Watcher.cs +++ b/src/DynamicData/Experimental/Watcher.cs @@ -9,20 +9,42 @@ namespace DynamicData.Reactive.Experimental; namespace DynamicData.Experimental; #endif +/// +/// Provides members for the Watcher class. +/// +/// The type of the TObject value. +/// The type of the TKey value. internal sealed class Watcher : IWatcher where TObject : notnull where TKey : notnull { + /// + /// The _disposer field. + /// private readonly IDisposable _disposer; + /// + /// The _locker field. + /// private readonly Lock _locker = new(); + /// + /// The _source field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly IObservableCache _source; + /// + /// The _subscribers field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed with _cleanUp")] private readonly IntermediateCache>, TKey> _subscribers = new(); + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The scheduler value. public Watcher(IObservable> source, IScheduler scheduler) { _source = source.AsObservableCache(); @@ -57,8 +79,16 @@ public Watcher(IObservable> source, IScheduler schedul }); } + /// + /// Executes the Dispose operation. + /// public void Dispose() => _disposer.Dispose(); + /// + /// Executes the Watch operation. + /// + /// The key value. + /// The result of the operation. public IObservable> Watch(TKey key) => Observable.Create>( observer => { diff --git a/src/DynamicData/GlobalConfig.cs b/src/DynamicData/GlobalConfig.cs index 7e4018594..26d52c8a3 100644 --- a/src/DynamicData/GlobalConfig.cs +++ b/src/DynamicData/GlobalConfig.cs @@ -9,7 +9,13 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the GlobalConfig class. +/// internal static class GlobalConfig { + /// + /// Gets the DefaultScheduler value. + /// public static IScheduler DefaultScheduler => TaskPoolScheduler.Default; } diff --git a/src/DynamicData/Internal/Bitset.cs b/src/DynamicData/Internal/Bitset.cs index 641fa6680..0f1695a3e 100644 --- a/src/DynamicData/Internal/Bitset.cs +++ b/src/DynamicData/Internal/Bitset.cs @@ -28,10 +28,24 @@ namespace DynamicData.Internal; /// internal struct Bitset { + /// + /// The BitsPerWord field. + /// private const int BitsPerWord = 64; + + /// + /// The WordShift field. + /// private const int WordShift = 6; + + /// + /// The BitMask field. + /// private const int BitMask = BitsPerWord - 1; + /// + /// The _words field. + /// private long[] _words; /// Initializes a new instance of the struct with capacity for 64 slots. @@ -76,6 +90,7 @@ public void Clear(int index) /// Returns if the bit at is set. /// The zero-based slot index. + /// The result of the operation. [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly bool IsSet(int index) { @@ -99,6 +114,7 @@ public readonly bool IsSet(int index) /// in a single CPU instruction. /// /// + /// The result of the operation. [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly int FindHighest() { @@ -142,6 +158,7 @@ public readonly int FindHighest() /// in a single CPU instruction. /// /// + /// The result of the operation. [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly int FindLowest() { @@ -164,6 +181,7 @@ public readonly int FindLowest() } /// Returns if any bit is set. + /// The result of the operation. [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly bool HasAny() => Count > 0; @@ -219,7 +237,12 @@ public void Compact() } #if !NETCOREAPP3_0_OR_GREATER - private static int HighestSetBit(long value) + /// + /// Executes the HighestSetBit operation. + /// + /// The value value. + /// The result of the operation. +private static int HighestSetBit(long value) { var bit = 0; for (var v = (ulong)value; v > 1; v >>= 1) @@ -230,7 +253,12 @@ private static int HighestSetBit(long value) return bit; } - private static int LowestSetBit(long value) + /// + /// Executes the LowestSetBit operation. + /// + /// The value value. + /// The result of the operation. +private static int LowestSetBit(long value) { var bit = 0; var v = (ulong)value; diff --git a/src/DynamicData/Internal/CacheParentSubscription.cs b/src/DynamicData/Internal/CacheParentSubscription.cs index 41f57a4be..e3d8aac80 100644 --- a/src/DynamicData/Internal/CacheParentSubscription.cs +++ b/src/DynamicData/Internal/CacheParentSubscription.cs @@ -27,13 +27,44 @@ internal abstract class CacheParentSubscription + /// The _childSubscriptions field. + /// private readonly KeyedDisposable _childSubscriptions = new(); + + /// + /// The _parentSubscription field. + /// private readonly SingleAssignmentDisposable _parentSubscription = new(); + + /// + /// The _queue field. + /// private readonly SharedDeliveryQueue _queue; + + /// + /// The _observer field. + /// private readonly IObserver _observer; + + /// + /// The _subscriptionCounter field. + /// private int _subscriptionCounter = 1; // Starts at 1 for the parent subscription + + /// + /// The _isCompleted field. + /// private bool _isCompleted; + + /// + /// The _hasTerminated field. + /// private bool _hasTerminated; + + /// + /// The _disposedValue field. + /// private bool _disposedValue; /// @@ -53,12 +84,30 @@ public void Dispose() GC.SuppressFinalize(this); } + /// + /// Executes the ParentOnNext operation. + /// + /// The changes value. protected abstract void ParentOnNext(IChangeSet changes); + /// + /// Executes the ChildOnNext operation. + /// + /// The child value. + /// The parentKey value. protected abstract void ChildOnNext(TChild child, TKey parentKey); + /// + /// Executes the EmitChanges operation. + /// + /// The observer value. protected abstract void EmitChanges(IObserver observer); + /// + /// Executes the AddChildSubscription operation. + /// + /// The observable value. + /// The parentKey value. protected void AddChildSubscription(IObservable observable, TKey parentKey) { // Add a new subscription. Do first so cleanup of existing subs doesn't trigger OnCompleted. @@ -84,8 +133,16 @@ protected void AddChildSubscription(IObservable observable, TKey parentK onCompleted: () => RemoveChildSubscription(parentKey)); } + /// + /// Executes the RemoveChildSubscription operation. + /// + /// The parentKey value. protected void RemoveChildSubscription(TKey parentKey) => _childSubscriptions.Remove(parentKey); + /// + /// Executes the CreateParentSubscription operation. + /// + /// The source value. protected void CreateParentSubscription(IObservable> source) => _parentSubscription.Disposable = source @@ -95,6 +152,10 @@ protected void CreateParentSubscription(IObservable> s onError: TerminalError, onCompleted: CheckCompleted); + /// + /// Executes the Dispose operation. + /// + /// The disposing value. protected virtual void Dispose(bool disposing) { if (!_disposedValue) @@ -116,9 +177,15 @@ protected virtual void Dispose(bool disposing) /// Same-thread reentrant delivery ensures child items are delivered inline during /// parent processing, preserving the original Synchronize(lock) ordering semantics. /// + /// The type of the T value. + /// The observable value. + /// The result of the operation. protected IObservable MakeChildObservable(IObservable observable) => observable.SynchronizeSafe(_queue); + /// + /// Executes the OnDrainComplete operation. + /// private void OnDrainComplete() { EmitChanges(_observer); @@ -130,12 +197,19 @@ private void OnDrainComplete() } } + /// + /// Executes the TerminalError operation. + /// + /// The error value. private void TerminalError(Exception error) { _hasTerminated = true; _observer.OnError(error); } + /// + /// Executes the CheckCompleted operation. + /// private void CheckCompleted() { if (Interlocked.Decrement(ref _subscriptionCounter) == 0) diff --git a/src/DynamicData/Internal/DeliveryQueue.cs b/src/DynamicData/Internal/DeliveryQueue.cs index 9a6436608..2dcedcf1e 100644 --- a/src/DynamicData/Internal/DeliveryQueue.cs +++ b/src/DynamicData/Internal/DeliveryQueue.cs @@ -11,19 +11,36 @@ namespace DynamicData.Internal; /// /// A queue that serializes item delivery outside a caller-owned lock. -/// Internally stores values. Delivery -/// is dispatched to an outside the lock. +/// Internally stores Notification<T> values. Delivery +/// is dispatched to an IObserver<T> outside the lock. /// /// The value type delivered via OnNext. internal sealed class DeliveryQueue : IObserver, IDisposable where T : notnull { + /// + /// The _queue field. + /// private readonly Queue> _queue = new(1); + /// + /// The _gate field. + /// private readonly Lock _gate; + /// + /// The _observer field. + /// private readonly IObserver _observer; + + /// + /// The _drainThreadId field. + /// private int _drainThreadId = -1; + + /// + /// The _isTerminated field. + /// private volatile bool _isTerminated; /// @@ -92,14 +109,17 @@ private void EnsureDeliveryComplete() /// Acquires the gate and returns a scoped access for enqueueing notifications. /// Disposing releases the gate and triggers delivery if needed. /// + /// The result of the operation. public ScopedAccess AcquireLock() => new(this); /// /// Acquires the gate for read-only inspection. Does not trigger delivery on dispose. /// + /// The result of the operation. public ReadOnlyScopedAccess AcquireReadLock() => new(this); /// Enqueues an OnNext notification via the lock, then drains. + /// The value value. public void OnNext(T value) { using var scope = AcquireLock(); @@ -107,6 +127,7 @@ public void OnNext(T value) } /// Enqueues an OnError notification via the lock, then drains. + /// The error value. public void OnError(Exception error) { using var scope = AcquireLock(); @@ -119,17 +140,34 @@ public void OnCompleted() using var scope = AcquireLock(); scope.EnqueueCompleted(); } - #if NET9_0_OR_GREATER + + /// + /// Executes the EnterLock operation. + /// private void EnterLock() => _gate.Enter(); + /// + /// Executes the ExitLock operation. + /// private void ExitLock() => _gate.Exit(); #else + + /// + /// Executes the EnterLock operation. + /// private void EnterLock() => Monitor.Enter(_gate); + /// + /// Executes the ExitLock operation. + /// private void ExitLock() => Monitor.Exit(_gate); #endif + /// + /// Executes the EnqueueNotification operation. + /// + /// The item value. private void EnqueueNotification(Notification item) { if (_isTerminated) @@ -140,6 +178,9 @@ private void EnqueueNotification(Notification item) _queue.Enqueue(item); } + /// + /// Executes the ExitLockAndDeliver operation. + /// private void ExitLockAndDeliver() { var shouldDeliver = TryStartDelivery(); @@ -214,13 +255,20 @@ void DeliverAll() } } - /// - /// Scoped access for enqueueing notifications under the gate lock. - /// - public ref struct ScopedAccess +/// +/// Scoped access for enqueueing notifications under the gate lock. +/// +public ref struct ScopedAccess { + /// + /// The _owner field. + /// private DeliveryQueue? _owner; + /// + /// Initializes a new instance of the struct. + /// + /// The owner value. internal ScopedAccess(DeliveryQueue owner) { _owner = owner; @@ -228,9 +276,11 @@ internal ScopedAccess(DeliveryQueue owner) } /// Enqueues an OnNext notification. + /// The value value. public readonly void EnqueueNext(T value) => _owner?.EnqueueNotification(Notification.CreateNext(value)); /// Enqueues an OnError notification (terminal). + /// The error value. public readonly void EnqueueError(Exception error) => _owner?.EnqueueNotification(Notification.CreateError(error)); /// Enqueues an OnCompleted notification (terminal). @@ -250,13 +300,20 @@ public void Dispose() } } - /// - /// Read-only scoped access. Disposing releases the gate without triggering delivery. - /// - public ref struct ReadOnlyScopedAccess +/// +/// Read-only scoped access. Disposing releases the gate without triggering delivery. +/// +public ref struct ReadOnlyScopedAccess { + /// + /// The _owner field. + /// private DeliveryQueue? _owner; + /// + /// Initializes a new instance of the struct. + /// + /// The owner value. internal ReadOnlyScopedAccess(DeliveryQueue owner) { _owner = owner; diff --git a/src/DynamicData/Internal/KeyedDisposable.cs b/src/DynamicData/Internal/KeyedDisposable.cs index 81aa11fd8..92c013df9 100644 --- a/src/DynamicData/Internal/KeyedDisposable.cs +++ b/src/DynamicData/Internal/KeyedDisposable.cs @@ -19,12 +19,24 @@ namespace DynamicData.Internal; internal sealed class KeyedDisposable : IDisposable where TKey : notnull { + /// + /// The _disposables field. + /// private readonly Dictionary _disposables = []; + /// + /// The _gate field. + /// private readonly Lock _gate = new(); + /// + /// The _disposedValue field. + /// private bool _disposedValue; + /// + /// Gets the Count value. + /// public int Count { get @@ -34,6 +46,9 @@ public int Count } } + /// + /// Gets the Keys value. + /// public IEnumerable Keys { get @@ -43,12 +58,20 @@ public IEnumerable Keys } } + /// + /// Executes the ContainsKey operation. + /// + /// The key value. + /// The result of the operation. public bool ContainsKey(TKey key) { lock (_gate) return _disposables.ContainsKey(key); } + /// + /// Gets the IsDisposed value. + /// public bool IsDisposed { get @@ -64,6 +87,10 @@ public bool IsDisposed /// If the item is NOT disposable, any existing entry for the key is removed /// and disposed. /// + /// The type of the TItem value. + /// The key value. + /// The item value. + /// The result of the operation. public TItem Add(TKey key, TItem item) where TItem : notnull { @@ -106,6 +133,10 @@ public TItem Add(TKey key, TItem item) return item; } + /// + /// Executes the Remove operation. + /// + /// The key value. public void Remove(TKey key) { IDisposable? toDispose; @@ -124,6 +155,9 @@ public void Remove(TKey key) toDispose.Dispose(); } + /// + /// Executes the Dispose operation. + /// public void Dispose() { Dictionary? snapshot; diff --git a/src/DynamicData/Internal/Notification.cs b/src/DynamicData/Internal/Notification.cs index 382b20120..6e9d39861 100644 --- a/src/DynamicData/Internal/Notification.cs +++ b/src/DynamicData/Internal/Notification.cs @@ -11,16 +11,29 @@ namespace DynamicData.Internal; /// /// A lightweight notification struct for delivery queues. Discriminates -/// OnNext, OnError, and OnCompleted using +/// OnNext, OnError, and OnCompleted using Optional<T>.HasValue /// and the error field, avoiding null discrimination on T? which /// is broken for value types in generic struct fields on .NET 9. /// +/// The type of the T value. internal readonly struct Notification where T : notnull { + /// + /// The _value field. + /// private readonly ReactiveUI.Primitives.Optional _value; + + /// + /// The _error field. + /// private readonly Exception? _error; + /// + /// Initializes a new instance of the struct. + /// + /// The value value. + /// The error value. private Notification(ReactiveUI.Primitives.Optional value, Exception? error) { _value = value; @@ -28,9 +41,13 @@ private Notification(ReactiveUI.Primitives.Optional value, Exception? error) } /// Creates an OnNext notification. + /// The value value. + /// The result of the operation. public static Notification CreateNext(T value) => new(value, null); /// Creates an OnError notification (terminal). + /// The error value. + /// The result of the operation. public static Notification CreateError(Exception error) { ArgumentExceptionHelper.ThrowIfNull(error); @@ -38,6 +55,7 @@ public static Notification CreateError(Exception error) } /// Creates an OnCompleted notification (terminal). + /// The result of the operation. public static Notification CreateCompleted() => new(ReactiveUI.Primitives.Optional.None, null); /// Gets whether this is an OnError notification. @@ -47,6 +65,7 @@ public static Notification CreateError(Exception error) public bool IsTerminal => !_value.HasValue; /// Delivers this notification to the specified observer. + /// The observer value. public void Accept(IObserver observer) { if (_value.HasValue) diff --git a/src/DynamicData/Internal/SharedDeliveryQueue.cs b/src/DynamicData/Internal/SharedDeliveryQueue.cs index 55650cdf3..36f5c4524 100644 --- a/src/DynamicData/Internal/SharedDeliveryQueue.cs +++ b/src/DynamicData/Internal/SharedDeliveryQueue.cs @@ -11,21 +11,46 @@ namespace DynamicData.Internal; /// /// A type-erased delivery queue that serializes delivery across multiple sources -/// with different item types. Each source gets a typed -/// via . A single drain loop delivers items from all +/// with different item types. Each source gets a typed DeliverySubQueue<T> +/// via CreateQueue<T>. A single drain loop delivers items from all /// sub-queues outside the lock, one item per iteration. An /// tracks which sub-queues have pending items, replacing O(N) scans with O(1) lookups. /// internal sealed class SharedDeliveryQueue : IDisposable { + /// + /// The _sources field. + /// private readonly List _sources = []; + + /// + /// The _onDrainComplete field. + /// private readonly Action? _onDrainComplete; + /// + /// The _gate field. + /// private readonly Lock _gate; + /// + /// The _activeBits field. + /// private Bitset _activeBits = new(); + + /// + /// The _deadCount field. + /// private int _deadCount; + + /// + /// The _drainThreadId field. + /// private int _drainThreadId = -1; + + /// + /// The _isTerminated field. + /// private volatile bool _isTerminated; /// Initializes a new instance of the class with its own internal lock. @@ -38,6 +63,7 @@ public SharedDeliveryQueue() /// Initializes a new instance of the class with its own internal lock /// and a callback that fires outside the lock after each drain cycle completes. /// + /// The onDrainComplete value. public SharedDeliveryQueue(Action? onDrainComplete) { #if NET9_0_OR_GREATER @@ -47,12 +73,15 @@ public SharedDeliveryQueue(Action? onDrainComplete) #endif _onDrainComplete = onDrainComplete; } - #if NET9_0_OR_GREATER + /// Initializes a new instance of the class with a caller-provided lock. + /// The gate value. public SharedDeliveryQueue(Lock gate) => _gate = gate; #else + /// Initializes a new instance of the class with a caller-provided lock. + /// The gate value. public SharedDeliveryQueue(object gate) => _gate = gate; #endif @@ -98,6 +127,9 @@ private void EnsureDeliveryComplete() public void Dispose() => EnsureDeliveryComplete(); /// Creates a typed sub-queue bound to the specified observer. + /// The type of the T value. + /// The observer value. + /// The result of the operation. public DeliverySubQueue CreateQueue(IObserver observer) where T : notnull { @@ -117,10 +149,12 @@ public DeliverySubQueue CreateQueue(IObserver observer) } /// Acquires the gate for read-only inspection. Does not trigger delivery on dispose. + /// The result of the operation. [MethodImpl(MethodImplOptions.AggressiveInlining)] public ReadOnlyScopedAccess AcquireReadLock() => new(this); /// Called by a sub-queue when it is disposed. Clears its active bit and tracks dead slots. + /// The index value. [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void NotifyQueueRemoved(int index) { @@ -129,23 +163,38 @@ internal void NotifyQueueRemoved(int index) } /// Sets the active bit for a sub-queue when an item is enqueued. + /// The index value. [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void SetActive(int index) => _activeBits.Set(index); - #if NET9_0_OR_GREATER + + /// + /// Executes the EnterLock operation. + /// [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void EnterLock() => _gate.Enter(); + /// + /// Executes the ExitLock operation. + /// [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void ExitLock() => _gate.Exit(); #else - [MethodImpl(MethodImplOptions.AggressiveInlining)] + + /// + /// Executes the EnterLock operation. + /// internal void EnterLock() => Monitor.Enter(_gate); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + /// + /// Executes the ExitLock operation. + /// internal void ExitLock() => Monitor.Exit(_gate); #endif + /// + /// Executes the ExitLockAndDrain operation. + /// internal void ExitLockAndDrain() { var currentThreadId = Environment.CurrentManagedThreadId; @@ -176,6 +225,9 @@ internal void ExitLockAndDrain() } } + /// + /// Executes the DrainAll operation. + /// private void DrainAll() { try @@ -337,11 +389,18 @@ private void CompactIfNeeded() _activeBits.Compact(); } - /// Read-only scoped access. Disposing releases the gate without triggering delivery. - public ref struct ReadOnlyScopedAccess +/// Read-only scoped access. Disposing releases the gate without triggering delivery. +public ref struct ReadOnlyScopedAccess { + /// + /// The _owner field. + /// private SharedDeliveryQueue? _owner; + /// + /// Initializes a new instance of the struct. + /// + /// The owner value. [MethodImpl(MethodImplOptions.AggressiveInlining)] internal ReadOnlyScopedAccess(SharedDeliveryQueue owner) { @@ -407,16 +466,46 @@ internal abstract class DrainableBase /// A typed sub-queue. All enqueue access goes through /// which acquires the parent's lock. /// +/// The type of the T value. internal sealed class DeliverySubQueue : DrainableBase, IObserver, IDisposable where T : notnull { + /// + /// The _items field. + /// private readonly Queue> _items = new(1); + + /// + /// The _parent field. + /// private readonly SharedDeliveryQueue _parent; + + /// + /// The _observer field. + /// private readonly IObserver _observer; + + /// + /// The _staged field. + /// private Notification _staged; + + /// + /// The _index field. + /// private int _index; + + /// + /// The _isRemoved field. + /// private bool _isRemoved; + /// + /// Initializes a new instance of the class. + /// + /// The parent value. + /// The observer value. + /// The index value. internal DeliverySubQueue(SharedDeliveryQueue parent, IObserver observer, int index) { _parent = parent; @@ -449,10 +538,12 @@ internal override int Index } /// Acquires the parent gate. Disposing releases the lock and triggers drain. + /// The result of the operation. [MethodImpl(MethodImplOptions.AggressiveInlining)] public ScopedAccess AcquireLock() => new(this); /// Enqueues an OnNext notification via the lock, then drains. + /// The value value. public void OnNext(T value) { using var scope = AcquireLock(); @@ -460,6 +551,7 @@ public void OnNext(T value) } /// Enqueues an OnError notification via the lock, then drains. + /// The error value. public void OnError(Exception error) { using var scope = AcquireLock(); @@ -498,6 +590,7 @@ public void Dispose() } /// + /// The result of the operation. internal override bool StageNext() { _staged = _items.Dequeue(); @@ -514,6 +607,10 @@ internal override void DeliverStaged() /// internal override void Clear() => _items.Clear(); + /// + /// Executes the EnqueueItem operation. + /// + /// The item value. [MethodImpl(MethodImplOptions.AggressiveInlining)] private void EnqueueItem(Notification item) { @@ -526,11 +623,18 @@ private void EnqueueItem(Notification item) _parent.SetActive(_index); } - /// Scoped access for enqueueing items. Acquires the parent's gate lock. - public ref struct ScopedAccess +/// Scoped access for enqueueing items. Acquires the parent's gate lock. +public ref struct ScopedAccess { + /// + /// The _owner field. + /// private DeliverySubQueue? _owner; + /// + /// Initializes a new instance of the struct. + /// + /// The owner value. [MethodImpl(MethodImplOptions.AggressiveInlining)] internal ScopedAccess(DeliverySubQueue owner) { @@ -539,10 +643,12 @@ internal ScopedAccess(DeliverySubQueue owner) } /// Enqueues an OnNext item. + /// The item value. [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly void EnqueueNext(T item) => _owner?.EnqueueItem(Notification.CreateNext(item)); /// Enqueues a terminal error. + /// The error value. [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly void EnqueueError(Exception error) => _owner?.EnqueueItem(Notification.CreateError(error)); diff --git a/src/DynamicData/Internal/SwappableLock.cs b/src/DynamicData/Internal/SwappableLock.cs index d6153ce88..5466de6a9 100644 --- a/src/DynamicData/Internal/SwappableLock.cs +++ b/src/DynamicData/Internal/SwappableLock.cs @@ -8,27 +8,40 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif - #if NET9_0_OR_GREATER +/// +/// Represents the SwappableLock value. +/// internal ref struct SwappableLock { + /// + /// Executes the CreateAndEnter operation. + /// + /// The gate value. + /// The result of the operation. public static SwappableLock CreateAndEnter(Lock gate) { gate.Enter(); return new SwappableLock { _gate = gate }; } + /// + /// Executes the SwapTo operation. + /// + /// The gate value. public void SwapTo(Lock gate) { if (_gate is null) throw new InvalidOperationException("Lock is not initialized"); - gate.Enter(); _gate.Exit(); _gate = gate; } + /// + /// Executes the Dispose operation. + /// public void Dispose() { if (_gate is not null) @@ -38,13 +51,23 @@ public void Dispose() } } + /// + /// The _gate field. + /// private Lock? _gate; } - #else +/// +/// Represents the SwappableLock value. +/// internal ref struct SwappableLock { + /// + /// Executes the CreateAndEnter operation. + /// + /// The gate value. + /// The result of the operation. public static SwappableLock CreateAndEnter(object gate) { var result = new SwappableLock() @@ -57,6 +80,10 @@ public static SwappableLock CreateAndEnter(object gate) return result; } + /// + /// Executes the SwapTo operation. + /// + /// The gate value. public void SwapTo(object gate) { if (_gate is null) @@ -74,6 +101,9 @@ public void SwapTo(object gate) _gate = gate; } + /// + /// Executes the Dispose operation. + /// public void Dispose() { if (_hasLock && (_gate is not null)) @@ -84,7 +114,14 @@ public void Dispose() } } + /// + /// The _hasLock field. + /// private bool _hasLock; + + /// + /// The _gate field. + /// private object? _gate; } diff --git a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs index d01fb8447..d3cb6e1b2 100644 --- a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs +++ b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs @@ -27,7 +27,7 @@ namespace DynamicData.Internal; /// /// Queue-first (parameterless overload) /// Used by operators with teardown side effects (DisposeMany, OnBeingRemoved). -/// The queue is terminated first via , which ensures +/// The queue is terminated first via DeliveryQueue<T>.Dispose, which ensures /// all in-flight deliveries complete before the subscription is disposed and teardown logic /// (e.g., disposing removed items) runs. Terminal notifications are not needed because /// the subscriber is explicitly tearing down. @@ -40,6 +40,10 @@ internal static class SynchronizeSafeExtensions /// Synchronizes the source observable through a . /// Use when multiple sources of different types share a gate. /// + /// The type of the T value. + /// The source value. + /// The queue value. + /// The result of the operation. public static IObservable SynchronizeSafe(this IObservable source, SharedDeliveryQueue queue) where T : notnull => @@ -52,9 +56,13 @@ public static IObservable SynchronizeSafe(this IObservable source, Shar }); /// - /// Synchronizes the source observable through an implicitly created . + /// Synchronizes the source observable through an implicitly created DeliveryQueue<T>. /// Drop-in replacement for Synchronize(locker). /// + /// The type of the T value. + /// The source value. + /// The gate value. + /// The result of the operation. public static IObservable SynchronizeSafe(this IObservable source, Lock gate) where T : notnull => Observable.Create(observer => @@ -66,11 +74,14 @@ public static IObservable SynchronizeSafe(this IObservable source, Lock }); /// - /// Synchronizes the source observable through an implicitly created + /// Synchronizes the source observable through an implicitly created DeliveryQueue<T> /// with automatic delivery completion on dispose. The queue is terminated and drained /// before the source subscription is disposed, ensuring all in-flight notifications /// are delivered before teardown. /// + /// The type of the T value. + /// The source value. + /// The result of the operation. public static IObservable SynchronizeSafe(this IObservable source) where T : notnull => Observable.Create(observer => diff --git a/src/DynamicData/Kernel/EnumerableEx.cs b/src/DynamicData/Kernel/EnumerableEx.cs index dd14de279..08ad055e8 100644 --- a/src/DynamicData/Kernel/EnumerableEx.cs +++ b/src/DynamicData/Kernel/EnumerableEx.cs @@ -86,13 +86,31 @@ public static IEnumerable IndexOfMany(this IEnumerabl return itemsToFind.Join(indexed, left => left, right => right.Element, (_, right) => right).Select(x => resultSelector(x.Element, x.Index)); } + /// + /// Executes the EmptyIfNull operation. + /// + /// The type of the T value. + /// The source value. + /// The result of the operation. internal static IEnumerable EmptyIfNull(this IEnumerable? source) => source ?? Enumerable.Empty(); + /// + /// Executes the EnumerateOne operation. + /// + /// The type of the T value. + /// The source value. + /// The result of the operation. internal static IEnumerable EnumerateOne(this T source) { yield return source; } + /// + /// Executes the ForEach operation. + /// + /// The type of the T value. + /// The source value. + /// The action value. internal static void ForEach(this IEnumerable source, Action action) { foreach (var item in source) @@ -101,6 +119,12 @@ internal static void ForEach(this IEnumerable source, Action action) } } + /// + /// Executes the ForEach operation. + /// + /// The type of the TObject value. + /// The source value. + /// The action value. internal static void ForEach(this IEnumerable source, Action action) { var i = 0; @@ -111,6 +135,12 @@ internal static void ForEach(this IEnumerable source, Action + /// Executes the ToHashSet operation. + /// + /// The type of the T value. + /// The source value. + /// The result of the operation. internal static HashSet ToHashSet(this IEnumerable source) => new(source); /// diff --git a/src/DynamicData/Kernel/EnumerableIList.cs b/src/DynamicData/Kernel/EnumerableIList.cs index 068fcc9d6..53bfcb3e6 100644 --- a/src/DynamicData/Kernel/EnumerableIList.cs +++ b/src/DynamicData/Kernel/EnumerableIList.cs @@ -9,9 +9,17 @@ namespace DynamicData.Reactive.Kernel; namespace DynamicData.Kernel; #endif +/// +/// Represents the EnumerableIList value. +/// +/// The type of the T value. +/// The list value. [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Same class name, different generics.")] internal readonly struct EnumerableIList(IList list) : IEnumerableIList, IList { + /// + /// Gets the Empty value. + /// public static EnumerableIList Empty { get; } /// @@ -21,51 +29,102 @@ internal readonly struct EnumerableIList(IList list) : IEnumerableIList public bool IsReadOnly => list.IsReadOnly; /// + /// The index value. public T this[int index] { get => list[index]; set => list[index] = value; } + /// + /// Executes the conversion operator operation. + /// + /// The list value. + /// The result of the operation. public static implicit operator EnumerableIList(List list) => new(list); + /// + /// Executes the conversion operator operation. + /// + /// The array value. + /// The result of the operation. public static implicit operator EnumerableIList(T[] array) => new(array); + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. public EnumeratorIList GetEnumerator() => new(list); /// + /// The item value. public void Add(T item) => list.Add(item); /// public void Clear() => list.Clear(); /// + /// The item value. + /// The result of the operation. public bool Contains(T item) => list.Contains(item); /// + /// The array value. + /// The arrayIndex value. public void CopyTo(T[] array, int arrayIndex) => list.CopyTo(array, arrayIndex); /// + /// The item value. + /// The result of the operation. public int IndexOf(T item) => list.IndexOf(item); /// + /// The index value. + /// The item value. public void Insert(int index, T item) => list.Insert(index, item); /// + /// The item value. + /// The result of the operation. public bool Remove(T item) => list.Remove(item); /// + /// The index value. public void RemoveAt(int index) => list.RemoveAt(index); + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } +/// +/// Provides members for the EnumerableIList class. +/// internal static class EnumerableIList { + /// + /// Executes the Create operation. + /// + /// The type of the T value. + /// The list value. + /// The result of the operation. public static EnumerableIList Create(IList list) => new(list); + /// + /// Executes the Create operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The changeSet value. + /// The result of the operation. public static EnumerableIList> Create(IChangeSet changeSet) where TObject : notnull where TKey : notnull => diff --git a/src/DynamicData/Kernel/EnumeratorIList.cs b/src/DynamicData/Kernel/EnumeratorIList.cs index ca549a5c1..b913693b4 100644 --- a/src/DynamicData/Kernel/EnumeratorIList.cs +++ b/src/DynamicData/Kernel/EnumeratorIList.cs @@ -9,14 +9,32 @@ namespace DynamicData.Reactive.Kernel; namespace DynamicData.Kernel; #endif +/// +/// Represents the EnumeratorIList value. +/// +/// The type of the T value. +/// The list value. internal struct EnumeratorIList(IList list) : IEnumerator { + /// + /// The _index field. + /// private int _index = -1; + /// + /// Gets the Current value. + /// public readonly T Current => list[_index]; + /// + /// Gets the Current value. + /// readonly object? IEnumerator.Current => Current; + /// + /// Executes the MoveNext operation. + /// + /// The result of the operation. public bool MoveNext() { _index++; @@ -24,9 +42,15 @@ public bool MoveNext() return _index < list.Count; } + /// + /// Executes the Dispose operation. + /// public void Dispose() { } + /// + /// Executes the Reset operation. + /// public void Reset() => _index = -1; } diff --git a/src/DynamicData/Kernel/Error.cs b/src/DynamicData/Kernel/Error.cs index 3f5ca7764..0b78080b4 100644 --- a/src/DynamicData/Kernel/Error.cs +++ b/src/DynamicData/Kernel/Error.cs @@ -39,11 +39,25 @@ public sealed class Error(Exception? exception, TObject value, TK /// public TObject Value { get; } = value; + /// + /// Determines whether two instances are equal. + /// + /// The left error to compare. + /// The right error to compare. + /// when the values are equal; otherwise, . public static bool operator ==(Error left, Error right) => Equals(left, right); + /// + /// Determines whether two instances are not equal. + /// + /// The left error to compare. + /// The right error to compare. + /// when the values are not equal; otherwise, . public static bool operator !=(Error left, Error right) => !Equals(left, right); /// + /// The other value. + /// The result of the operation. public bool Equals(Error? other) { if (other is null) @@ -60,6 +74,8 @@ public bool Equals(Error? other) } /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -76,6 +92,7 @@ public override bool Equals(object? obj) } /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -88,5 +105,6 @@ public override int GetHashCode() } /// + /// The result of the operation. public override string ToString() => $"Key: {Key}, Value: {Value}, Exception: {Exception}"; } diff --git a/src/DynamicData/Kernel/InternalEx.cs b/src/DynamicData/Kernel/InternalEx.cs index 98776f280..276264a58 100644 --- a/src/DynamicData/Kernel/InternalEx.cs +++ b/src/DynamicData/Kernel/InternalEx.cs @@ -14,6 +14,10 @@ namespace DynamicData.Kernel; /// public static class InternalEx { + /// + /// Executes the NewLock operation. + /// + /// The result of the operation. internal static Lock NewLock() => new(); /// @@ -114,15 +118,34 @@ void ScheduleNext() => return disposable; } + /// + /// Executes the OnNext operation. + /// + /// The source value. internal static void OnNext(this ISignal source) => source.OnNext(Unit.Default); + /// + /// Executes the Swap operation. + /// + /// The type of the TSwap value. + /// The t1 value. + /// The t2 value. internal static void Swap(ref TSwap t1, ref TSwap t2) => (t2, t1) = (t1, t2); + /// + /// Executes the ToUnit operation. + /// + /// The type of the T value. + /// The source value. + /// The result of the operation. internal static IObservable ToUnit(this IObservable source) => source.Select(_ => Unit.Default); /// /// Observable.Return without the memory leak. /// + /// The type of the T value. + /// The source value. + /// The result of the operation. internal static IObservable Return(Func source) => Observable.Create(o => { diff --git a/src/DynamicData/Kernel/ItemWithIndex.cs b/src/DynamicData/Kernel/ItemWithIndex.cs index 6e611d972..46f94f049 100644 --- a/src/DynamicData/Kernel/ItemWithIndex.cs +++ b/src/DynamicData/Kernel/ItemWithIndex.cs @@ -26,5 +26,6 @@ public readonly record struct ItemWithIndex(T Item, int Index) public override int GetHashCode() => Item is null ? 0 : EqualityComparer.Default.GetHashCode(Item); /// + /// The result of the operation. public override string ToString() => $"{Item} ({Index})"; } diff --git a/src/DynamicData/Kernel/ItemWithValue.cs b/src/DynamicData/Kernel/ItemWithValue.cs index 4ffc78d9a..957547bf4 100644 --- a/src/DynamicData/Kernel/ItemWithValue.cs +++ b/src/DynamicData/Kernel/ItemWithValue.cs @@ -23,6 +23,7 @@ namespace DynamicData.Kernel; public readonly record struct ItemWithValue(TObject Item, TValue Value) { /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -32,5 +33,6 @@ public override int GetHashCode() } /// + /// The result of the operation. public override string ToString() => $"{Item} ({Value})"; } diff --git a/src/DynamicData/Kernel/OptionElse.cs b/src/DynamicData/Kernel/OptionElse.cs index d53060624..57af263d4 100644 --- a/src/DynamicData/Kernel/OptionElse.cs +++ b/src/DynamicData/Kernel/OptionElse.cs @@ -14,10 +14,20 @@ namespace DynamicData.Kernel; /// public sealed class OptionElse { + /// + /// The NoAction field. + /// internal static readonly OptionElse NoAction = new(false); + /// + /// The _shouldRunAction field. + /// private readonly bool _shouldRunAction; + /// + /// Initializes a new instance of the class. + /// + /// The shouldRunAction value. internal OptionElse(bool shouldRunAction = true) => _shouldRunAction = shouldRunAction; /// diff --git a/src/DynamicData/Kernel/OptionObservableExtensions.cs b/src/DynamicData/Kernel/OptionObservableExtensions.cs index 5b76b271f..42c98faf7 100644 --- a/src/DynamicData/Kernel/OptionObservableExtensions.cs +++ b/src/DynamicData/Kernel/OptionObservableExtensions.cs @@ -24,7 +24,7 @@ public static class OptionObservableExtensions /// The converter. /// Observable Optional of . /// Source or Converter was null. - /// Observable version of . + /// Observable version of OptionExtensions.Convert<TSource, TDestination>(in Optional<TSource>, Func<TSource, TDestination>). public static IObservable> Convert(this IObservable> source, Func converter) where TSource : notnull where TDestination : notnull @@ -36,7 +36,7 @@ public static class OptionObservableExtensions } /// - /// Overload of that allows the conversion + /// Overload of Convert<TSource, TDestination>(IObservable<Optional<TSource>>, Func<TSource, TDestination>) that allows the conversion /// operation to also return an ReactiveUI.Primitives.Optional. /// /// The type of the source. @@ -45,7 +45,7 @@ public static class OptionObservableExtensions /// The converter that returns an optional value. /// Observable Optional of . /// Source or Converter was null. - /// Observable version of . + /// Observable version of OptionExtensions.Convert<TSource, TDestination>(in Optional<TSource>, Func<TSource, Optional<TDestination>>). public static IObservable> Convert(this IObservable> source, Func> converter) where TSource : notnull where TDestination : notnull @@ -95,7 +95,7 @@ public static class OptionObservableExtensions /// or /// fallbackOperation. /// - /// Observable version of . + /// Observable version of OptionExtensions.OrElse<T>(in Optional<T>, Func<Optional<T>>). public static IObservable> OrElse(this IObservable> source, Func> fallbackOperation) where T : notnull { @@ -113,7 +113,7 @@ public static class OptionObservableExtensions /// The action. /// Optional alternative action for the Else case. /// The same Observable ReactiveUI.Primitives.Optional. - /// Observable version of . + /// Observable version of OptionExtensions.IfHasValue<T>(in Optional<T>, Action<T>). public static IObservable> OnHasValue(this IObservable> source, Action action, Action? elseAction = null) where T : notnull { @@ -141,13 +141,13 @@ public static class OptionObservableExtensions } /// - /// Converts an Observable of into an IObservable of by extracting + /// Converts an Observable of Optional<T> into an IObservable of by extracting /// the values from Optionals that have one. /// /// The type of item. /// The source. /// An Observable with the Values. - /// Observable version of . + /// Observable version of OptionExtensions.SelectValues<T>(IEnumerable<Optional<T>>). public static IObservable SelectValues(this IObservable> source) where T : notnull { @@ -157,7 +157,7 @@ public static IObservable SelectValues(this IObservable - /// Converts an Observable of into an IObservable of by extracting the + /// Converts an Observable of Optional<T> into an IObservable of by extracting the /// values from the ones that contain a value and then using to generate a value for the others. /// /// The type of the item. @@ -165,7 +165,7 @@ public static IObservable SelectValues(this IObservableThe value selector. /// If the value or a provided default. /// valueSelector. - /// Observable version of . + /// Observable version of OptionExtensions.ValueOr<T>(in Optional<T>, Func<T>). public static IObservable ValueOr(this IObservable> source, Func valueSelector) where T : notnull { @@ -181,7 +181,7 @@ public static IObservable ValueOr(this IObservableThe type of the item. /// The source. /// The value or default. - /// Observable version of . + /// Observable version of OptionExtensions.ValueOrDefault<T>(in Optional<T>). public static IObservable ValueOrDefault(this IObservable> source) where T : notnull { @@ -191,7 +191,7 @@ public static IObservable ValueOr(this IObservable - /// Converts an Observable of into an IObservable of by extracting the values. + /// Converts an Observable of Optional<T> into an IObservable of by extracting the values. /// If it has no value, is used to generate an exception that is injected into the stream as error. /// /// The type of the item. @@ -199,7 +199,7 @@ public static IObservable ValueOr(this IObservableThe exception generator. /// The value. /// exceptionGenerator. - /// Observable version of . + /// Observable version of OptionExtensions.ValueOrThrow<T>(in Optional<T>, Func<Exception>). public static IObservable ValueOrThrow(this IObservable> source, Func exceptionGenerator) where T : notnull { diff --git a/src/DynamicData/Kernel/ParallelEx.cs b/src/DynamicData/Kernel/ParallelEx.cs index 1b5ce675f..0c7163e24 100644 --- a/src/DynamicData/Kernel/ParallelEx.cs +++ b/src/DynamicData/Kernel/ParallelEx.cs @@ -9,8 +9,20 @@ namespace DynamicData.Reactive.Kernel; namespace DynamicData.Kernel; #endif +/// +/// Provides members for the ParallelEx class. +/// internal static class ParallelEx { + /// + /// Executes the SelectParallel operation. + /// + /// The type of the TSource value. + /// The type of the TDestination value. + /// The source value. + /// The selector value. + /// The maximumThreads value. + /// The result of the operation. public static async Task> SelectParallel(this IEnumerable source, Func> selector, int maximumThreads = 5) { ArgumentExceptionHelper.ThrowIfNull(source); diff --git a/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs b/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs index 2c5bd2a59..886a3b039 100644 --- a/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs +++ b/src/DynamicData/Kernel/ReadOnlyCollectionLight.cs @@ -9,23 +9,51 @@ namespace DynamicData.Reactive.Kernel; namespace DynamicData.Kernel; #endif +/// +/// Provides members for the ReadOnlyCollectionLight class. +/// +/// The type of the T value. internal sealed class ReadOnlyCollectionLight : IReadOnlyCollection { + /// + /// The _items field. + /// private readonly IList _items; + /// + /// Initializes a new instance of the class. + /// + /// The items value. public ReadOnlyCollectionLight(IEnumerable items) { _items = items.ToList(); Count = _items.Count; } + /// + /// Initializes a new instance of the class. + /// private ReadOnlyCollectionLight() => _items = new List(); + /// + /// Gets the Empty value. + /// public static IReadOnlyCollection Empty { get; } = new ReadOnlyCollectionLight(); + /// + /// Gets the Count value. + /// public int Count { get; } + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. public IEnumerator GetEnumerator() => _items.GetEnumerator(); + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/Kernel/ReferenceEqualityComparer.cs b/src/DynamicData/Kernel/ReferenceEqualityComparer.cs index 94fa5aff2..f02477e44 100644 --- a/src/DynamicData/Kernel/ReferenceEqualityComparer.cs +++ b/src/DynamicData/Kernel/ReferenceEqualityComparer.cs @@ -9,11 +9,29 @@ namespace DynamicData.Reactive.Kernel; namespace DynamicData.Kernel; #endif +/// +/// Provides members for the ReferenceEqualityComparer class. +/// +/// The type of the T value. internal sealed class ReferenceEqualityComparer : IEqualityComparer { + /// + /// The Instance field. + /// public static readonly IEqualityComparer Instance = new ReferenceEqualityComparer(); + /// + /// Executes the Equals operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public bool Equals(T? x, T? y) => ReferenceEquals(x, y); + /// + /// Executes the GetHashCode operation. + /// + /// The obj value. + /// The result of the operation. public int GetHashCode(T? obj) => obj is null ? 0 : obj.GetHashCode(); } diff --git a/src/DynamicData/List/Change.cs b/src/DynamicData/List/Change.cs index 05888ed9f..43851fe06 100644 --- a/src/DynamicData/List/Change.cs +++ b/src/DynamicData/List/Change.cs @@ -80,7 +80,7 @@ public Change(T current, int currentIndex, int previousIndex) /// /// Initializes a new instance of the class. - /// Initializes a new instance of the struct. + /// Initializes a new instance of the struct. /// /// The reason. /// The current. @@ -139,11 +139,25 @@ public Change(ListChangeReason reason, T current, in ReactiveUI.Primitives.Optio /// public ChangeType Type => Reason.GetChangeType(); + /// + /// Determines whether two instances are equal. + /// + /// The left change to compare. + /// The right change to compare. + /// when the values are equal; otherwise, . public static bool operator ==(Change left, Change right) => Equals(left, right); + /// + /// Determines whether two instances are not equal. + /// + /// The left change to compare. + /// The right change to compare. + /// when the values are not equal; otherwise, . public static bool operator !=(Change left, Change right) => !Equals(left, right); /// + /// The other value. + /// The result of the operation. public bool Equals(Change? other) { if (other is null) @@ -160,6 +174,8 @@ public bool Equals(Change? other) } /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -181,6 +197,7 @@ public override bool Equals(object? obj) } /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -193,5 +210,6 @@ public override int GetHashCode() } /// + /// The result of the operation. public override string ToString() => $"{Reason}. {Range.Count} changes"; } diff --git a/src/DynamicData/List/ChangeAwareList.cs b/src/DynamicData/List/ChangeAwareList.cs index c029261c5..1a4e3bd05 100644 --- a/src/DynamicData/List/ChangeAwareList.cs +++ b/src/DynamicData/List/ChangeAwareList.cs @@ -14,11 +14,18 @@ namespace DynamicData; /// Used for creating custom operators. ///
/// The item type. -/// +/// IExtendedList<T> public class ChangeAwareList : IExtendedList where T : notnull { + /// + /// The _innerList field. + /// private readonly List _innerList; + + /// + /// The _changes field. + /// private ChangeSet _changes = []; /// @@ -180,6 +187,7 @@ public virtual void Clear() public void CopyTo(T[] array, int arrayIndex) => _innerList.CopyTo(array, arrayIndex); /// + /// The result of the operation. public IEnumerator GetEnumerator() => _innerList.ToList().GetEnumerator(); /// @@ -218,12 +226,12 @@ public void Insert(int index, T item) } /// - /// Inserts the elements of a collection into the at the specified index. + /// Inserts the elements of a collection into the List<T> at the specified index. /// /// Inserts the specified items. /// The zero-based index at which the new elements should be inserted. /// is null. - /// is less than 0.-or- is greater than . + /// is less than 0.-or- is greater than List<T>.Count. public void InsertRange(IEnumerable collection, int index) { var args = new Change(ListChangeReason.AddRange, collection, index); @@ -392,9 +400,9 @@ public void RemoveAt(int index) } /// - /// Removes a range of elements from the . + /// Removes a range of elements from the List<T>. /// - /// The zero-based starting index of the range of elements to remove.The number of elements to remove. is less than 0.-or- is less than 0. and do not denote a valid range of elements in the . + /// The zero-based starting index of the range of elements to remove.The number of elements to remove. is less than 0.-or- is less than 0. and do not denote a valid range of elements in the List<T>. public void RemoveRange(int index, int count) { if (index >= _innerList.Count || index + count > _innerList.Count) @@ -417,6 +425,7 @@ public void RemoveRange(int index, int count) } /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); /// diff --git a/src/DynamicData/List/ChangeAwareListWithRefCounts.cs b/src/DynamicData/List/ChangeAwareListWithRefCounts.cs index 82900f13e..6b27b2448 100644 --- a/src/DynamicData/List/ChangeAwareListWithRefCounts.cs +++ b/src/DynamicData/List/ChangeAwareListWithRefCounts.cs @@ -16,29 +16,65 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the ChangeAwareListWithRefCounts class. +/// +/// The type of the T value. internal sealed class ChangeAwareListWithRefCounts : ChangeAwareList where T : notnull { + /// + /// The _tracker field. + /// private readonly ReferenceCountTracker _tracker = new(); + /// + /// Executes the Clear operation. + /// public override void Clear() { _tracker.Clear(); base.Clear(); } + /// + /// Executes the Contains operation. + /// + /// The item value. + /// The result of the operation. public override bool Contains(T item) => _tracker.Contains(item); + /// + /// Executes the InsertItem operation. + /// + /// The index value. + /// The item value. protected override void InsertItem(int index, T item) { _tracker.Add(item); base.InsertItem(index, item); } + /// + /// Executes the OnInsertItems operation. + /// + /// The startIndex value. + /// The items value. protected override void OnInsertItems(int startIndex, IEnumerable items) => items.ForEach(t => _tracker.Add(t)); + /// + /// Executes the OnRemoveItems operation. + /// + /// The startIndex value. + /// The items value. protected override void OnRemoveItems(int startIndex, IEnumerable items) => items.ForEach(t => _tracker.Remove(t)); + /// + /// Executes the OnSetItem operation. + /// + /// The index value. + /// The newItem value. + /// The oldItem value. protected override void OnSetItem(int index, T newItem, T oldItem) { _tracker.Remove(oldItem); @@ -46,6 +82,11 @@ protected override void OnSetItem(int index, T newItem, T oldItem) base.OnSetItem(index, newItem, oldItem); } + /// + /// Executes the RemoveItem operation. + /// + /// The index value. + /// The item value. protected override void RemoveItem(int index, T item) { _tracker.Remove(item); diff --git a/src/DynamicData/List/ChangeSet.cs b/src/DynamicData/List/ChangeSet.cs index 211b0f76d..e50a25f24 100644 --- a/src/DynamicData/List/ChangeSet.cs +++ b/src/DynamicData/List/ChangeSet.cs @@ -29,7 +29,7 @@ public ChangeSet() } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The items. /// items. diff --git a/src/DynamicData/List/IExtendedList.cs b/src/DynamicData/List/IExtendedList.cs index 95ccd7a22..c1e2b8733 100644 --- a/src/DynamicData/List/IExtendedList.cs +++ b/src/DynamicData/List/IExtendedList.cs @@ -23,12 +23,12 @@ public interface IExtendedList : IList void AddRange(IEnumerable collection); /// - /// Inserts the elements of a collection into the at the specified index. + /// Inserts the elements of a collection into the List<T> at the specified index. /// /// The items to insert. /// The zero-based index at which the new elements should be inserted. /// is null. - /// is less than 0.-or- is greater than . + /// is less than 0.-or- is greater than List<T>.Count. void InsertRange(IEnumerable collection, int index); /// @@ -39,8 +39,8 @@ public interface IExtendedList : IList void Move(int original, int destination); /// - /// Removes a range of elements from the . + /// Removes a range of elements from the List<T>. /// - /// The zero-based starting index of the range of elements to remove.The number of elements to remove. is less than 0.-or- is less than 0. and do not denote a valid range of elements in the . + /// The zero-based starting index of the range of elements to remove.The number of elements to remove. is less than 0.-or- is less than 0. and do not denote a valid range of elements in the List<T>. void RemoveRange(int index, int count); } diff --git a/src/DynamicData/List/Internal/AnonymousObservableList.cs b/src/DynamicData/List/Internal/AnonymousObservableList.cs index f9036af47..a28471ebb 100644 --- a/src/DynamicData/List/Internal/AnonymousObservableList.cs +++ b/src/DynamicData/List/Internal/AnonymousObservableList.cs @@ -11,14 +11,29 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the AnonymousObservableList class. +/// +/// The type of the T value. [DebuggerDisplay("AnonymousObservableList<{typeof(T).Name}> ({Count} Items)")] internal sealed class AnonymousObservableList : IObservableList where T : notnull { + /// + /// The _sourceList field. + /// [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposed through _cleanUp")] private readonly ISourceList _sourceList; + + /// + /// The _cleanUp field. + /// private readonly IDisposable _cleanUp; + /// + /// Initializes a new instance of the class. + /// + /// The source value. public AnonymousObservableList(IObservable> source) { ArgumentExceptionHelper.ThrowIfNull(source); @@ -27,6 +42,10 @@ public AnonymousObservableList(IObservable> source) _cleanUp = _sourceList; } + /// + /// Initializes a new instance of the class. + /// + /// The sourceList value. public AnonymousObservableList(ISourceList sourceList) { ArgumentExceptionHelper.ThrowIfNull(sourceList); @@ -34,15 +53,37 @@ public AnonymousObservableList(ISourceList sourceList) _cleanUp = Disposable.Empty; } + /// + /// Gets the Count value. + /// public int Count => _sourceList.Count; + /// + /// Gets the CountChanged value. + /// public IObservable CountChanged => _sourceList.CountChanged; + /// + /// Gets the Items value. + /// public IReadOnlyList Items => _sourceList.Items; + /// + /// Executes the Connect operation. + /// + /// The predicate value. + /// The result of the operation. public IObservable> Connect(Func? predicate = null) => _sourceList.Connect(predicate); + /// + /// Executes the Preview operation. + /// + /// The predicate value. + /// The result of the operation. public IObservable> Preview(Func? predicate = null) => _sourceList.Preview(predicate); + /// + /// Executes the Dispose operation. + /// public void Dispose() => _cleanUp.Dispose(); } diff --git a/src/DynamicData/List/Internal/AutoRefresh.cs b/src/DynamicData/List/Internal/AutoRefresh.cs index 61a572690..9f3a20e3f 100644 --- a/src/DynamicData/List/Internal/AutoRefresh.cs +++ b/src/DynamicData/List/Internal/AutoRefresh.cs @@ -9,12 +9,32 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the AutoRefresh class. +/// +/// The type of the TObject value. +/// The type of the TAny value. +/// The source value. +/// The reEvaluator value. +/// The buffer value. +/// The scheduler value. internal sealed class AutoRefresh(IObservable> source, Func> reEvaluator, TimeSpan? buffer = null, IScheduler? scheduler = null) where TObject : notnull { + /// + /// The _reEvaluator field. + /// private readonly Func> _reEvaluator = reEvaluator ?? throw new ArgumentNullException(nameof(reEvaluator)); + + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/List/Internal/BufferIf.cs b/src/DynamicData/List/Internal/BufferIf.cs index 9109caaaa..65f708195 100644 --- a/src/DynamicData/List/Internal/BufferIf.cs +++ b/src/DynamicData/List/Internal/BufferIf.cs @@ -9,17 +9,42 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the BufferIf class. +/// +/// The type of the T value. +/// The source value. +/// The pauseIfTrueSelector value. +/// The initialPauseState value. +/// The timeOut value. +/// The scheduler value. internal sealed class BufferIf(IObservable> source, IObservable pauseIfTrueSelector, bool initialPauseState = false, TimeSpan? timeOut = null, IScheduler? scheduler = null) where T : notnull { + /// + /// The _pauseIfTrueSelector field. + /// private readonly IObservable _pauseIfTrueSelector = pauseIfTrueSelector ?? throw new ArgumentNullException(nameof(pauseIfTrueSelector)); + /// + /// The _scheduler field. + /// private readonly IScheduler _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// The _timeOut field. + /// private readonly TimeSpan _timeOut = timeOut ?? TimeSpan.Zero; + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/List/Internal/ChangeSetMergeTracker.cs b/src/DynamicData/List/Internal/ChangeSetMergeTracker.cs index 336c90a36..30f026b75 100644 --- a/src/DynamicData/List/Internal/ChangeSetMergeTracker.cs +++ b/src/DynamicData/List/Internal/ChangeSetMergeTracker.cs @@ -9,11 +9,23 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the ChangeSetMergeTracker class. +/// +/// The type of the TObject value. internal sealed class ChangeSetMergeTracker where TObject : notnull { + /// + /// The _resultList field. + /// private readonly ChangeAwareList _resultList = new(); + /// + /// Executes the ProcessChangeSet operation. + /// + /// The changes value. + /// The observer value. public void ProcessChangeSet(IChangeSet changes, IObserver>? observer = null) { foreach (var change in changes) @@ -60,6 +72,11 @@ public void ProcessChangeSet(IChangeSet changes, IObserver + /// Executes the RemoveItems operation. + /// + /// The removeItems value. + /// The observer value. public void RemoveItems(IEnumerable removeItems, IObserver>? observer = null) { _resultList.Remove(removeItems); @@ -70,6 +87,10 @@ public void RemoveItems(IEnumerable removeItems, IObserver + /// Executes the EmitChanges operation. + /// + /// The observer value. public void EmitChanges(IObserver> observer) { var changeSet = _resultList.CaptureChanges(); @@ -79,17 +100,45 @@ public void EmitChanges(IObserver> observer) } } + /// + /// Executes the OnClear operation. + /// + /// The change value. private void OnClear(Change change) => _resultList.ClearOrRemoveMany(change); + /// + /// Executes the OnItemAdded operation. + /// + /// The item value. private void OnItemAdded(ItemChange item) => _resultList.Add(item.Current); + /// + /// Executes the OnItemRefreshed operation. + /// + /// The item value. private void OnItemRefreshed(ItemChange item) => _resultList.Refresh(item.Current); + /// + /// Executes the OnItemRemoved operation. + /// + /// The item value. private void OnItemRemoved(ItemChange item) => _resultList.Remove(item.Current); + /// + /// Executes the OnItemReplaced operation. + /// + /// The item value. private void OnItemReplaced(ItemChange item) => _resultList.ReplaceOrAdd(item.Previous.Value, item.Current); + /// + /// Executes the OnRangeAdded operation. + /// + /// The range value. private void OnRangeAdded(RangeChange range) => _resultList.AddRange(range); + /// + /// Executes the OnRangeRemoved operation. + /// + /// The range value. private void OnRangeRemoved(RangeChange range) => _resultList.Remove(range); } diff --git a/src/DynamicData/List/Internal/ClonedListChangeSet.cs b/src/DynamicData/List/Internal/ClonedListChangeSet.cs index 7c62e4c6b..e90c4564c 100644 --- a/src/DynamicData/List/Internal/ClonedListChangeSet.cs +++ b/src/DynamicData/List/Internal/ClonedListChangeSet.cs @@ -9,13 +9,28 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the ClonedListChangeSet class. +/// +/// The type of the TObject value. internal sealed class ClonedListChangeSet where TObject : notnull { + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The equalityComparer value. public ClonedListChangeSet(IObservable> source, IEqualityComparer? equalityComparer) => Source = source.Do(changeSet => List.Clone(changeSet, equalityComparer)); + /// + /// Gets the List value. + /// public List List { get; } = []; + /// + /// Gets the Source value. + /// public IObservable> Source { get; } } diff --git a/src/DynamicData/List/Internal/Combiner.cs b/src/DynamicData/List/Internal/Combiner.cs index 255f2301b..d16743626 100644 --- a/src/DynamicData/List/Internal/Combiner.cs +++ b/src/DynamicData/List/Internal/Combiner.cs @@ -16,13 +16,29 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Combiner class. +/// +/// The type of the T value. +/// The source value. +/// The type value. internal sealed class Combiner(ICollection>> source, CombineOperator type) where T : notnull { + /// + /// The _locker field. + /// private readonly Lock _locker = new(); + /// + /// The _source field. + /// private readonly ICollection>> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -54,6 +70,11 @@ public IObservable> Run() => Observable.Create>( return disposable; }); + /// + /// Executes the CloneSourceList operation. + /// + /// The tracker value. + /// The changes value. private static void CloneSourceList(ReferenceCountTracker tracker, IChangeSet changes) { foreach (var change in changes) @@ -93,6 +114,12 @@ private static void CloneSourceList(ReferenceCountTracker tracker, IChangeSet } } + /// + /// Executes the MatchesConstraint operation. + /// + /// The sourceLists value. + /// The item value. + /// The result of the operation. private bool MatchesConstraint(List> sourceLists, T item) { switch (type) @@ -124,6 +151,12 @@ private bool MatchesConstraint(List> sourceLists, T ite } } + /// + /// Executes the UpdateItemMembership operation. + /// + /// The item value. + /// The sourceLists value. + /// The resultList value. private void UpdateItemMembership(T item, List> sourceLists, ChangeAwareListWithRefCounts resultList) { var isInResult = resultList.Contains(item); @@ -138,6 +171,13 @@ private void UpdateItemMembership(T item, List> sourceL } } + /// + /// Executes the UpdateResultList operation. + /// + /// The changes value. + /// The sourceLists value. + /// The resultList value. + /// The result of the operation. [SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly", Justification = "By Design.")] private IChangeSet UpdateResultList(IChangeSet changes, List> sourceLists, ChangeAwareListWithRefCounts resultList) { diff --git a/src/DynamicData/List/Internal/DeferUntilLoaded.cs b/src/DynamicData/List/Internal/DeferUntilLoaded.cs index 3d426e23c..293e94413 100644 --- a/src/DynamicData/List/Internal/DeferUntilLoaded.cs +++ b/src/DynamicData/List/Internal/DeferUntilLoaded.cs @@ -9,10 +9,22 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the DeferUntilLoaded class. +/// +/// The type of the T value. +/// The source value. internal sealed class DeferUntilLoaded(IObservable> source) where T : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => _source.MonitorStatus().Where(status => status == ConnectionStatus.Loaded).Take(1).Select(_ => new ChangeSet()).Concat(_source).NotEmpty(); } diff --git a/src/DynamicData/List/Internal/DisposeMany.cs b/src/DynamicData/List/Internal/DisposeMany.cs index 48cf89985..a7d743ff9 100644 --- a/src/DynamicData/List/Internal/DisposeMany.cs +++ b/src/DynamicData/List/Internal/DisposeMany.cs @@ -9,9 +9,18 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the DisposeMany class. +/// +/// The type of the T value. +/// The source value. internal sealed class DisposeMany(IObservable> source) where T : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => { @@ -85,6 +94,10 @@ public IObservable> Run() }); }); + /// + /// Executes the ProcessFinalization operation. + /// + /// The cachedItems value. private static void ProcessFinalization(List cachedItems) { foreach (var item in cachedItems) diff --git a/src/DynamicData/List/Internal/Distinct.cs b/src/DynamicData/List/Internal/Distinct.cs index 2e4f11505..bd4f4f9a6 100644 --- a/src/DynamicData/List/Internal/Distinct.cs +++ b/src/DynamicData/List/Internal/Distinct.cs @@ -9,14 +9,31 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Distinct class. +/// +/// The type of the T value. +/// The type of the TValue value. +/// The source value. +/// The valueSelector value. internal sealed class Distinct(IObservable> source, Func valueSelector) where T : notnull where TValue : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// The _valueSelector field. + /// private readonly Func _valueSelector = valueSelector ?? throw new ArgumentNullException(nameof(valueSelector)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -33,6 +50,13 @@ public IObservable> Run() => Observable.Create Process(valueCounters, result, changes)).NotEmpty().SubscribeSafe(observer); }); + /// + /// Executes the Process operation. + /// + /// The values value. + /// The result value. + /// The changes value. + /// The result of the operation. private static IChangeSet Process(Dictionary values, ChangeAwareList result, IChangeSet changes) { void AddAction(TValue value) => @@ -138,26 +162,46 @@ void RemoveAction(TValue value) return result.CaptureChanges(); } - private sealed class ItemWithMatch(T item, TValue value, TValue? previousValue) : IEquatable +/// +/// Provides members for the ItemWithMatch class. +/// +/// The item value. +/// The value value. +/// The previousValue value. +private sealed class ItemWithMatch(T item, TValue value, TValue? previousValue) : IEquatable { + /// + /// Gets the Item value. + /// public T Item { get; } = item; + /// + /// Gets the Previous value. + /// public TValue? Previous { get; } = previousValue; + /// + /// Gets the Value value. + /// public TValue Value { get; } = value; - /// Returns a value that indicates whether the values of two objects are equal. + /// Returns a value that indicates whether the values of two Filter<T>.ItemWithMatch objects are equal. /// The first value to compare. /// The second value to compare. /// true if the and parameters have the same value; otherwise, false. public static bool operator ==(ItemWithMatch left, ItemWithMatch right) => Equals(left, right); - /// Returns a value that indicates whether two objects have different values. + /// Returns a value that indicates whether two Filter<T>.ItemWithMatch objects have different values. /// The first value to compare. /// The second value to compare. /// true if and are not equal; otherwise, false. public static bool operator !=(ItemWithMatch left, ItemWithMatch right) => !Equals(left, right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(ItemWithMatch? other) { if (other is null) @@ -173,6 +217,11 @@ public bool Equals(ItemWithMatch? other) return EqualityComparer.Default.Equals(Item, other.Item); } + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -193,8 +242,16 @@ public override bool Equals(object? obj) return Equals((ItemWithMatch)obj); } + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => Item is null ? 0 : EqualityComparer.Default.GetHashCode(Item); + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"{nameof(Item)}: {Item}, {nameof(Value)}: {Value}, {nameof(Previous)}: {Previous}"; } } diff --git a/src/DynamicData/List/Internal/DynamicCombiner.cs b/src/DynamicData/List/Internal/DynamicCombiner.cs index 2205b6bce..bfb482f6c 100644 --- a/src/DynamicData/List/Internal/DynamicCombiner.cs +++ b/src/DynamicData/List/Internal/DynamicCombiner.cs @@ -16,13 +16,29 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the DynamicCombiner class. +/// +/// The type of the T value. +/// The source value. +/// The type value. internal sealed class DynamicCombiner(IObservableList>> source, CombineOperator type) where T : notnull { + /// + /// The _locker field. + /// private readonly Lock _locker = new(); + /// + /// The _source field. + /// private readonly IObservableList>> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -92,6 +108,12 @@ public IObservable> Run() => Observable.Create>( return new CompositeDisposable(sourceLists, allChanges, removedItem, sourceChanged); }); + /// + /// Executes the MatchesConstraint operation. + /// + /// The sourceLists value. + /// The item value. + /// The result of the operation. private bool MatchesConstraint(MergeContainer[] sourceLists, T item) { if (sourceLists.Length == 0) @@ -128,6 +150,12 @@ private bool MatchesConstraint(MergeContainer[] sourceLists, T item) } } + /// + /// Executes the UpdateItemMembership operation. + /// + /// The item value. + /// The sourceLists value. + /// The resultList value. private void UpdateItemMembership(T item, MergeContainer[] sourceLists, ChangeAwareListWithRefCounts resultList) { var isInResult = resultList.Contains(item); @@ -142,12 +170,26 @@ private void UpdateItemMembership(T item, MergeContainer[] sourceLists, ChangeAw } } + /// + /// Executes the UpdateItemSetMemberships operation. + /// + /// The sourceLists value. + /// The resultingList value. + /// The items value. + /// The result of the operation. private IChangeSet UpdateItemSetMemberships(MergeContainer[] sourceLists, ChangeAwareListWithRefCounts resultingList, IEnumerable items) { items.ForEach(item => UpdateItemMembership(item, sourceLists, resultingList)); return resultingList.CaptureChanges(); } + /// + /// Executes the UpdateResultList operation. + /// + /// The sourceLists value. + /// The resultList value. + /// The changes value. + /// The result of the operation. [SuppressMessage("Usage", "CA2208:Instantiate argument exceptions correctly", Justification = "By Design.")] private IChangeSet UpdateResultList(MergeContainer[] sourceLists, ChangeAwareListWithRefCounts resultList, IChangeSet changes) { @@ -188,14 +230,31 @@ private IChangeSet UpdateResultList(MergeContainer[] sourceLists, ChangeAware return resultList.CaptureChanges(); } - private sealed class MergeContainer +/// +/// Provides members for the MergeContainer class. +/// +private sealed class MergeContainer { + /// + /// Initializes a new instance of the class. + /// + /// The source value. public MergeContainer(IObservable> source) => Source = source.Do(Clone); + /// + /// Gets the Source value. + /// public IObservable> Source { get; } + /// + /// Gets the Tracker value. + /// public ReferenceCountTracker Tracker { get; } = new(); + /// + /// Executes the Clone operation. + /// + /// The changes value. private void Clone(IChangeSet changes) { foreach (var change in changes) diff --git a/src/DynamicData/List/Internal/EditDiff.cs b/src/DynamicData/List/Internal/EditDiff.cs index 9ff14a8aa..df7a96532 100644 --- a/src/DynamicData/List/Internal/EditDiff.cs +++ b/src/DynamicData/List/Internal/EditDiff.cs @@ -9,13 +9,29 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the EditDiff class. +/// +/// The type of the T value. +/// The source value. +/// The equalityComparer value. internal sealed class EditDiff(ISourceList source, IEqualityComparer? equalityComparer) where T : notnull { + /// + /// The _equalityComparer field. + /// private readonly IEqualityComparer _equalityComparer = equalityComparer ?? EqualityComparer.Default; + /// + /// The _source field. + /// private readonly ISourceList _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Edit operation. + /// + /// The items value. public void Edit(IEnumerable items) => _source.Edit( innerList => { diff --git a/src/DynamicData/List/Internal/ExpirableItem.cs b/src/DynamicData/List/Internal/ExpirableItem.cs index 9f403dc6e..f03995ffb 100644 --- a/src/DynamicData/List/Internal/ExpirableItem.cs +++ b/src/DynamicData/List/Internal/ExpirableItem.cs @@ -9,18 +9,51 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the ExpirableItem class. +/// +/// The type of the TObject value. +/// The value value. +/// The dateTime value. +/// The index value. internal sealed class ExpirableItem(TObject value, DateTime dateTime, long index) : IEquatable> { + /// + /// Gets the ExpireAt value. + /// public DateTime ExpireAt { get; } = dateTime; + /// + /// Gets the Index value. + /// public long Index { get; } = index; + /// + /// Gets the Item value. + /// public TObject Item { get; } = value; + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(ExpirableItem left, ExpirableItem right) => Equals(left, right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(ExpirableItem left, ExpirableItem right) => !Equals(left, right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(ExpirableItem? other) { if (other is null) @@ -36,6 +69,11 @@ public bool Equals(ExpirableItem? other) return EqualityComparer.Default.Equals(Item, other.Item) && ExpireAt.Equals(other.ExpireAt) && Index == other.Index; } + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -51,6 +89,10 @@ public override bool Equals(object? obj) return obj is ExpirableItem item && Equals(item); } + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -62,5 +104,9 @@ public override int GetHashCode() } } + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"{Item} @ {ExpireAt}"; } diff --git a/src/DynamicData/List/Internal/ExpireAfter.cs b/src/DynamicData/List/Internal/ExpireAfter.cs index 0a63e5902..be491659b 100644 --- a/src/DynamicData/List/Internal/ExpireAfter.cs +++ b/src/DynamicData/List/Internal/ExpireAfter.cs @@ -9,9 +9,21 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the ExpireAfter class. +/// +/// The type of the T value. internal sealed class ExpireAfter where T : notnull { + /// + /// Executes the Create operation. + /// + /// The source value. + /// The timeSelector value. + /// The pollingInterval value. + /// The scheduler value. + /// The result of the operation. public static IObservable> Create( ISourceList source, Func timeSelector, @@ -35,21 +47,69 @@ public static IObservable> Create( timeSelector: timeSelector)); } - private abstract class SubscriptionBase +/// +/// Provides members for the SubscriptionBase class. +/// +private abstract class SubscriptionBase : IDisposable { + /// + /// The _expirationDueTimes field. + /// private readonly List _expirationDueTimes; + + /// + /// The _expiringIndexesBuffer field. + /// private readonly List _expiringIndexesBuffer; + + /// + /// The _observer field. + /// private readonly IObserver> _observer; + + /// + /// The _onEditingSource field. + /// private readonly Action> _onEditingSource; + + /// + /// The _scheduler field. + /// private readonly IScheduler _scheduler; + + /// + /// The _source field. + /// private readonly ISourceList _source; + + /// + /// The _sourceSubscription field. + /// private readonly IDisposable _sourceSubscription; + + /// + /// The _timeSelector field. + /// private readonly Func _timeSelector; + /// + /// The _hasSourceCompleted field. + /// private bool _hasSourceCompleted; + + /// + /// The _nextScheduledManagement field. + /// private ScheduledManagement? _nextScheduledManagement; + /// + /// Initializes a new instance of the class. + /// + /// The observer value. + /// The scheduler value. + /// The source value. + /// The timeSelector value. protected SubscriptionBase( IObserver> observer, IScheduler? scheduler, @@ -78,6 +138,9 @@ protected SubscriptionBase( onCompleted: OnSourceCompleted); } + /// + /// Executes the Dispose operation. + /// public void Dispose() { lock (SynchronizationGate) @@ -88,15 +151,29 @@ public void Dispose() } } + /// + /// Gets the Scheduler value. + /// protected IScheduler Scheduler => _scheduler; - // Instead of using a dedicated _synchronizationGate object, we can save an allocation by using any object that is never exposed to public consumers. + + /// + /// Gets the SynchronizationGate value. + /// protected object SynchronizationGate => _expirationDueTimes; + /// + /// Executes the GetNextManagementDueTime operation. + /// + /// The result of the operation. protected abstract DateTimeOffset? GetNextManagementDueTime(); + /// + /// Executes the GetNextProposedExpirationDueTime operation. + /// + /// The result of the operation. protected DateTimeOffset? GetNextProposedExpirationDueTime() { var result = null as DateTimeOffset?; @@ -110,8 +187,15 @@ protected object SynchronizationGate return result; } + /// + /// Executes the OnExpirationsManaged operation. + /// + /// The dueTime value. protected abstract void OnExpirationsManaged(DateTimeOffset dueTime); + /// + /// Executes the ManageExpirations operation. + /// private void ManageExpirations() { // This check is needed, to make sure we don't try and call .Edit() on a disposed _source, @@ -128,6 +212,10 @@ private void ManageExpirations() _source.Edit(_onEditingSource); } + /// + /// Executes the OnEditingSource operation. + /// + /// The updater value. private void OnEditingSource(IExtendedList updater) { lock (SynchronizationGate) @@ -183,6 +271,9 @@ private void OnEditingSource(IExtendedList updater) } } + /// + /// Executes the OnExpirationDueTimesChanged operation. + /// private void OnExpirationDueTimesChanged() { // Check if we need to re-schedule the next management operation @@ -218,6 +309,9 @@ private void OnExpirationDueTimesChanged() } } + /// + /// Executes the OnSourceCompleted operation. + /// private void OnSourceCompleted() { // If the source completes, we can no longer remove items from it, so any pending expirations are moot. @@ -226,6 +320,10 @@ private void OnSourceCompleted() _observer.OnCompleted(); } + /// + /// Executes the OnSourceError operation. + /// + /// The error value. private void OnSourceError(Exception error) { TryCancelNextScheduledManagement(); @@ -233,6 +331,10 @@ private void OnSourceError(Exception error) _observer.OnError(error); } + /// + /// Executes the OnSourceNext operation. + /// + /// The changes value. private void OnSourceNext(IChangeSet changes) { try @@ -356,23 +458,45 @@ private void OnSourceNext(IChangeSet changes) } } + /// + /// Executes the TryCancelNextScheduledManagement operation. + /// private void TryCancelNextScheduledManagement() { _nextScheduledManagement?.Cancellation.Dispose(); _nextScheduledManagement = null; } - private readonly record struct ScheduledManagement +/// +/// Represents the ScheduledManagement record. +/// +private readonly record struct ScheduledManagement { + /// + /// Gets or sets the Cancellation value. + /// public required IDisposable Cancellation { get; init; } + /// + /// Gets or sets the DueTime value. + /// public required DateTimeOffset DueTime { get; init; } } } - private sealed class OnDemandSubscription +/// +/// Provides members for the OnDemandSubscription class. +/// +private sealed class OnDemandSubscription : SubscriptionBase { + /// + /// Initializes a new instance of the class. + /// + /// The observer value. + /// The scheduler value. + /// The source value. + /// The timeSelector value. public OnDemandSubscription( IObserver> observer, IScheduler? scheduler, @@ -386,21 +510,46 @@ public OnDemandSubscription( { } + /// + /// Executes the GetNextManagementDueTime operation. + /// + /// The result of the operation. protected override DateTimeOffset? GetNextManagementDueTime() => GetNextProposedExpirationDueTime(); + /// + /// Executes the OnExpirationsManaged operation. + /// + /// The dueTime value. protected override void OnExpirationsManaged(DateTimeOffset dueTime) { } } - private sealed class PollingSubscription +/// +/// Provides members for the PollingSubscription class. +/// +private sealed class PollingSubscription : SubscriptionBase { + /// + /// The _pollingInterval field. + /// private readonly TimeSpan _pollingInterval; + /// + /// The _lastManagementDueTime field. + /// private DateTimeOffset _lastManagementDueTime; + /// + /// Initializes a new instance of the class. + /// + /// The observer value. + /// The pollingInterval value. + /// The scheduler value. + /// The source value. + /// The timeSelector value. public PollingSubscription( IObserver> observer, TimeSpan pollingInterval, @@ -418,6 +567,10 @@ public PollingSubscription( _lastManagementDueTime = Scheduler.Now; } + /// + /// Executes the GetNextManagementDueTime operation. + /// + /// The result of the operation. protected override DateTimeOffset? GetNextManagementDueTime() { var now = Scheduler.Now; @@ -429,6 +582,10 @@ public PollingSubscription( : now; } + /// + /// Executes the OnExpirationsManaged operation. + /// + /// The dueTime value. protected override void OnExpirationsManaged(DateTimeOffset dueTime) => _lastManagementDueTime = dueTime; } diff --git a/src/DynamicData/List/Internal/Filter.Dynamic.cs b/src/DynamicData/List/Internal/Filter.Dynamic.cs index 9bcdbce8e..97c0e21b5 100644 --- a/src/DynamicData/List/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/List/Internal/Filter.Dynamic.cs @@ -9,19 +9,44 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Filter class. +/// internal static partial class Filter { - internal sealed class Dynamic +/// +/// Provides members for the Dynamic class. +/// +/// The type of the T value. +internal sealed class Dynamic where T : notnull { + /// + /// The _policy field. + /// private readonly ListFilterPolicy _policy; + /// + /// The _predicate field. + /// private readonly Func? _predicate; + /// + /// The _predicates field. + /// private readonly IObservable>? _predicates; + /// + /// The _source field. + /// private readonly IObservable> _source; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The predicates value. + /// The policy value. public Dynamic(IObservable> source, IObservable> predicates, ListFilterPolicy policy = ListFilterPolicy.CalculateDiff) { _policy = policy; @@ -29,6 +54,12 @@ public Dynamic(IObservable> source, IObservable> pre _predicates = predicates ?? throw new ArgumentNullException(nameof(predicates)); } + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The predicate value. + /// The policy value. public Dynamic(IObservable> source, Func predicate, ListFilterPolicy policy = ListFilterPolicy.CalculateDiff) { _policy = policy; @@ -36,6 +67,10 @@ public Dynamic(IObservable> source, Func predicate, ListF _predicate = predicate ?? throw new ArgumentNullException(nameof(predicate)); } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -98,6 +133,12 @@ public IObservable> Run() => Observable.Create>( .SubscribeSafe(observer); }); + /// + /// Executes the Process operation. + /// + /// The filtered value. + /// The changes value. + /// The result of the operation. private static IChangeSet Process(ChangeAwareList filtered, IChangeSet changes) { // Maintain all items as well as filtered list. This enables us to a) re-query when the predicate changes b) check the previous state when Refresh is called @@ -201,6 +242,13 @@ private static IChangeSet Process(ChangeAwareList return filtered.CaptureChanges(); } + /// + /// Executes the Requery operation. + /// + /// The predicate value. + /// The all value. + /// The filtered value. + /// The result of the operation. private IChangeSet Requery(Func predicate, List all, ChangeAwareList filtered) { if (all.Count == 0) @@ -251,20 +299,52 @@ private IChangeSet Requery(Func predicate, List +/// +/// Provides members for the ItemWithMatch class. +/// +/// The item value. +/// The isMatch value. +/// The wasMatch value. +private sealed class ItemWithMatch(T item, bool isMatch, bool wasMatch = false) : IEquatable { + /// + /// Gets the Item value. + /// public T Item { get; } = item; + /// + /// Gets or sets the IsMatch value. + /// public bool IsMatch { get; set; } = isMatch; + /// + /// Gets or sets the WasMatch value. + /// public bool WasMatch { get; set; } = wasMatch; + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(ItemWithMatch? left, ItemWithMatch? right) => Equals(left, right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(ItemWithMatch? left, ItemWithMatch? right) => !Equals(left, right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(ItemWithMatch? other) { if (other is null) @@ -280,6 +360,11 @@ public bool Equals(ItemWithMatch? other) return EqualityComparer.Default.Equals(Item, other.Item); } + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -300,8 +385,16 @@ public override bool Equals(object? obj) return Equals((ItemWithMatch)obj); } + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => EqualityComparer.Default.GetHashCode(Item!); + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"{Item}, (was {IsMatch} is {WasMatch}"; } } diff --git a/src/DynamicData/List/Internal/Filter.Static.cs b/src/DynamicData/List/Internal/Filter.Static.cs index 368bb5186..b3a01b454 100644 --- a/src/DynamicData/List/Internal/Filter.Static.cs +++ b/src/DynamicData/List/Internal/Filter.Static.cs @@ -9,11 +9,25 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Filter class. +/// internal static partial class Filter { - public static class Static +/// +/// Provides members for the Static class. +/// +/// The type of the T value. +public static class Static where T : notnull { + /// + /// Executes the Create operation. + /// + /// The source value. + /// The predicate value. + /// The suppressEmptyChangesets value. + /// The result of the operation. public static IObservable> Create( IObservable> source, Func predicate, diff --git a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs index d5e55e86d..407699de9 100644 --- a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs +++ b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs @@ -9,11 +9,28 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Filter class. +/// internal static partial class Filter { - public static class WithPredicateState +/// +/// Provides members for the WithPredicateState class. +/// +/// The type of the T value. +/// The type of the TState value. +public static class WithPredicateState where T : notnull { + /// + /// Executes the Create operation. + /// + /// The source value. + /// The predicateState value. + /// The predicate value. + /// The filterPolicy value. + /// The suppressEmptyChangeSets value. + /// The result of the operation. public static IObservable> Create( IObservable> source, IObservable predicateState, @@ -48,24 +65,83 @@ public static IObservable> Create( }); } - private abstract class SubscriptionBase +/// +/// Provides members for the SubscriptionBase class. +/// +private abstract class SubscriptionBase : IDisposable { + /// + /// The _downstreamChangesBuffer field. + /// private readonly List> _downstreamChangesBuffer; + + /// + /// The _downstreamObserver field. + /// private readonly IObserver> _downstreamObserver; + + /// + /// The _itemsBuffer field. + /// private readonly List _itemsBuffer; + + /// + /// The _itemStates field. + /// private readonly List _itemStates; + + /// + /// The _itemStatesBuffer field. + /// private readonly List _itemStatesBuffer; + + /// + /// The _predicate field. + /// private readonly Func _predicate; + + /// + /// The _suppressEmptyChangeSets field. + /// private readonly bool _suppressEmptyChangeSets; + /// + /// The _hasPredicateStateCompleted field. + /// private bool _hasPredicateStateCompleted; + + /// + /// The _hasSourceCompleted field. + /// private bool _hasSourceCompleted; + + /// + /// The _isLatestPredicateStateValid field. + /// private bool _isLatestPredicateStateValid; + + /// + /// The _latestPredicateState field. + /// private TState _latestPredicateState; + + /// + /// The _predicateStateSubscription field. + /// private IDisposable? _predicateStateSubscription; + + /// + /// The _sourceSubscription field. + /// private IDisposable? _sourceSubscription; + /// + /// Initializes a new instance of the class. + /// + /// The downstreamObserver value. + /// The predicate value. + /// The suppressEmptyChangeSets value. protected SubscriptionBase( IObserver> downstreamObserver, Func predicate, @@ -81,8 +157,13 @@ protected SubscriptionBase( _itemStatesBuffer = new(); _latestPredicateState = default!; } - // Keeping subscriptions out of the constructor prevents subscriptions that emit immediately from triggering virtual method calls within the constructor. + + /// + /// Executes the Activate operation. + /// + /// The predicateState value. + /// The source value. public void Activate( IObservable predicateState, IObservable> source) @@ -107,57 +188,125 @@ public void Activate( onCompleted: OnSourceCompleted); } + /// + /// Executes the Dispose operation. + /// public void Dispose() { _predicateStateSubscription?.Dispose(); _sourceSubscription?.Dispose(); } + /// + /// Gets the DownstreamChangesBuffer value. + /// protected List> DownstreamChangesBuffer => _downstreamChangesBuffer; + /// + /// Gets the IsLatestPredicateStateValid value. + /// protected bool IsLatestPredicateStateValid => _isLatestPredicateStateValid; + /// + /// Gets the ItemsBuffer value. + /// protected List ItemsBuffer => _itemsBuffer; + /// + /// Gets the ItemStates value. + /// protected List ItemStates => _itemStates; + /// + /// Gets the ItemStatesBuffer value. + /// protected List ItemStatesBuffer => _itemStatesBuffer; + /// + /// Gets the LatestPredicateState value. + /// protected TState LatestPredicateState => _latestPredicateState; + /// + /// Gets the Predicate value. + /// protected Func Predicate => _predicate; + /// + /// Executes the PerformAdd operation. + /// + /// The change value. protected abstract void PerformAdd(ItemChange change); + /// + /// Executes the PerformAddRange operation. + /// + /// The change value. protected abstract void PerformAddRange(RangeChange change); + /// + /// Executes the PerformClear operation. + /// protected abstract void PerformClear(); + /// + /// Executes the PerformMove operation. + /// + /// The change value. protected abstract void PerformMove(ItemChange change); + /// + /// Executes the PerformReFilter operation. + /// protected abstract void PerformReFilter(); + /// + /// Executes the PerformRefresh operation. + /// + /// The change value. protected abstract void PerformRefresh(ItemChange change); + /// + /// Executes the PerformRemove operation. + /// + /// The change value. protected abstract void PerformRemove(ItemChange change); + /// + /// Executes the PerformRemoveRange operation. + /// + /// The change value. protected abstract void PerformRemoveRange(RangeChange change); + /// + /// Executes the PerformReplace operation. + /// + /// The change value. protected abstract void PerformReplace(ItemChange change); + /// + /// Gets the DownstreamSynchronizationGate value. + /// private object DownstreamSynchronizationGate => _downstreamChangesBuffer; + /// + /// Gets the UpstreamSynchronizationGate value. + /// private object UpstreamSynchronizationGate => _itemStates; + /// + /// Executes the AssembleDownstreamChanges operation. + /// + /// The result of the operation. private IChangeSet AssembleDownstreamChanges() { if (_downstreamChangesBuffer.Count is 0) @@ -169,6 +318,10 @@ private IChangeSet AssembleDownstreamChanges() return downstreamChanges; } + /// + /// Executes the OnError operation. + /// + /// The error value. private void OnError(Exception error) { var hasUpstreamLock = false; @@ -200,6 +353,9 @@ private void OnError(Exception error) } } + /// + /// Executes the OnPredicateStateCompleted operation. + /// private void OnPredicateStateCompleted() { var hasUpstreamLock = false; @@ -238,6 +394,10 @@ private void OnPredicateStateCompleted() } } + /// + /// Executes the OnPredicateStateNext operation. + /// + /// The predicateState value. private void OnPredicateStateNext(TState predicateState) { var hasUpstreamLock = false; @@ -276,6 +436,9 @@ private void OnPredicateStateNext(TState predicateState) } } + /// + /// Executes the OnSourceCompleted operation. + /// private void OnSourceCompleted() { var hasUpstreamLock = false; @@ -314,6 +477,10 @@ private void OnSourceCompleted() } } + /// + /// Executes the OnSourceNext operation. + /// + /// The upstreamChanges value. private void OnSourceNext(IChangeSet upstreamChanges) { var hasUpstreamLock = false; @@ -387,17 +554,35 @@ private void OnSourceNext(IChangeSet upstreamChanges) } } - protected readonly struct ItemState +/// +/// Represents the ItemState value. +/// +protected readonly struct ItemState { + /// + /// Gets or sets the FilteredIndex value. + /// public required int? FilteredIndex { get; init; } + /// + /// Gets or sets the Item value. + /// public required T Item { get; init; } } } - private sealed class CalculateDiffSubscription +/// +/// Provides members for the CalculateDiffSubscription class. +/// +private sealed class CalculateDiffSubscription : SubscriptionBase { + /// + /// Initializes a new instance of the class. + /// + /// The downstreamObserver value. + /// The predicate value. + /// The suppressEmptyChangeSets value. public CalculateDiffSubscription( IObserver> downstreamObserver, Func predicate, @@ -409,6 +594,10 @@ public CalculateDiffSubscription( { } + /// + /// Executes the PerformAdd operation. + /// + /// The change value. protected override void PerformAdd(ItemChange change) { var isIncluded = IsLatestPredicateStateValid && Predicate.Invoke(LatestPredicateState, change.Current); @@ -453,6 +642,10 @@ protected override void PerformAdd(ItemChange change) } } + /// + /// Executes the PerformAddRange operation. + /// + /// The change value. protected override void PerformAddRange(RangeChange change) { var nextFilteredIndex = 0; @@ -512,6 +705,9 @@ protected override void PerformAddRange(RangeChange change) } } + /// + /// Executes the PerformClear operation. + /// protected override void PerformClear() { ItemsBuffer.EnsureCapacity(ItemStates.Count); @@ -532,6 +728,10 @@ protected override void PerformClear() } } + /// + /// Executes the PerformMove operation. + /// + /// The change value. protected override void PerformMove(ItemChange change) { var itemState = ItemStates[change.PreviousIndex]; @@ -618,6 +818,9 @@ protected override void PerformMove(ItemChange change) } } + /// + /// Executes the PerformReFilter operation. + /// protected override void PerformReFilter() { var nextFilteredIndex = 0; @@ -672,6 +875,10 @@ protected override void PerformReFilter() } } + /// + /// Executes the PerformRefresh operation. + /// + /// The change value. protected override void PerformRefresh(ItemChange change) { var itemState = ItemStates[change.CurrentIndex]; @@ -749,6 +956,10 @@ protected override void PerformRefresh(ItemChange change) } } + /// + /// Executes the PerformRemove operation. + /// + /// The change value. protected override void PerformRemove(ItemChange change) { var itemState = ItemStates[change.CurrentIndex]; @@ -775,6 +986,10 @@ protected override void PerformRemove(ItemChange change) } } + /// + /// Executes the PerformRemoveRange operation. + /// + /// The change value. protected override void PerformRemoveRange(RangeChange change) { ItemsBuffer.EnsureCapacity(change.Count); @@ -817,6 +1032,10 @@ protected override void PerformRemoveRange(RangeChange change) } } + /// + /// Executes the PerformReplace operation. + /// + /// The change value. protected override void PerformReplace(ItemChange change) { var itemState = ItemStates[change.CurrentIndex]; @@ -912,11 +1131,23 @@ protected override void PerformReplace(ItemChange change) } } - private sealed class ClearAndReplaceSubscription +/// +/// Provides members for the ClearAndReplaceSubscription class. +/// +private sealed class ClearAndReplaceSubscription : SubscriptionBase { + /// + /// The _filteredCount field. + /// private int _filteredCount; + /// + /// Initializes a new instance of the class. + /// + /// The downstreamObserver value. + /// The predicate value. + /// The suppressEmptyChangeSets value. public ClearAndReplaceSubscription( IObserver> downstreamObserver, Func predicate, @@ -928,6 +1159,10 @@ public ClearAndReplaceSubscription( { } + /// + /// Executes the PerformAdd operation. + /// + /// The change value. protected override void PerformAdd(ItemChange change) { var isIncluded = IsLatestPredicateStateValid && Predicate.Invoke(LatestPredicateState, change.Current); @@ -951,6 +1186,10 @@ protected override void PerformAdd(ItemChange change) }); } + /// + /// Executes the PerformAddRange operation. + /// + /// The change value. protected override void PerformAddRange(RangeChange change) { var priorFilteredCount = _filteredCount; @@ -989,6 +1228,9 @@ protected override void PerformAddRange(RangeChange change) } } + /// + /// Executes the PerformClear operation. + /// protected override void PerformClear() { // Not using ItemsBuffer, because we already know the exact size we need, so we can allocate a fresh one and use it directly. @@ -1010,6 +1252,10 @@ protected override void PerformClear() } } + /// + /// Executes the PerformMove operation. + /// + /// The change value. protected override void PerformMove(ItemChange change) { // We're not supporting propagation of move changes, but we do still need to process them, to keep ItemStates correct. @@ -1018,6 +1264,9 @@ protected override void PerformMove(ItemChange change) ItemStates.Insert(change.CurrentIndex, itemState); } + /// + /// Executes the PerformReFilter operation. + /// protected override void PerformReFilter() { var nextFilteredIndex = 0; @@ -1089,6 +1338,10 @@ protected override void PerformReFilter() } } + /// + /// Executes the PerformRefresh operation. + /// + /// The change value. protected override void PerformRefresh(ItemChange change) { var itemState = ItemStates[change.CurrentIndex]; @@ -1146,6 +1399,10 @@ protected override void PerformRefresh(ItemChange change) } } + /// + /// Executes the PerformRemove operation. + /// + /// The change value. protected override void PerformRemove(ItemChange change) { var itemState = ItemStates[change.CurrentIndex]; @@ -1174,6 +1431,10 @@ protected override void PerformRemove(ItemChange change) } } + /// + /// Executes the PerformRemoveRange operation. + /// + /// The change value. protected override void PerformRemoveRange(RangeChange change) { for (var index = change.Index; index < change.Index + change.Count; ++index) @@ -1204,6 +1465,10 @@ protected override void PerformRemoveRange(RangeChange change) ItemStates.RemoveRange(change.Index, change.Count); } + /// + /// Executes the PerformReplace operation. + /// + /// The change value. protected override void PerformReplace(ItemChange change) { var itemState = ItemStates[change.CurrentIndex]; diff --git a/src/DynamicData/List/Internal/FilterOnObservable.cs b/src/DynamicData/List/Internal/FilterOnObservable.cs index 6b1a4105d..fe9168aac 100644 --- a/src/DynamicData/List/Internal/FilterOnObservable.cs +++ b/src/DynamicData/List/Internal/FilterOnObservable.cs @@ -9,12 +9,31 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the FilterOnObservable class. +/// +/// The type of the TObject value. +/// The source value. +/// The filter value. +/// The buffer value. +/// The scheduler value. internal sealed class FilterOnObservable(IObservable> source, Func> filter, TimeSpan? buffer = null, IScheduler? scheduler = null) where TObject : notnull { + /// + /// The _filter field. + /// private readonly Func> _filter = filter ?? throw new ArgumentNullException(nameof(filter)); + + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -48,6 +67,17 @@ public IObservable> Run() => Observable.Create + /// Executes the IndexOfMany operation. + /// + /// The type of the TObj value. + /// The type of the TObjectProp value. + /// The type of the TResult value. + /// The source value. + /// The itemsToFind value. + /// The objectPropertyFunc value. + /// The resultSelector value. + /// The result of the operation. private static IEnumerable IndexOfMany(IEnumerable source, IEnumerable itemsToFind, Func objectPropertyFunc, Func resultSelector) { ArgumentExceptionHelper.ThrowIfNull(source); @@ -58,25 +88,67 @@ private static IEnumerable IndexOfMany(IEnu return itemsToFind.Join(indexed, objectPropertyFunc, right => objectPropertyFunc(right.Element), (left, right) => resultSelector(left, right.Index)); } - private readonly struct ObjWithFilterValue(TObject obj, bool filter) : IEquatable +/// +/// Represents the ObjWithFilterValue value. +/// +/// The obj value. +/// The filter value. +private readonly struct ObjWithFilterValue(TObject obj, bool filter) : IEquatable { + /// + /// The Obj field. + /// public readonly TObject Obj = obj; + /// + /// The Filter field. + /// public readonly bool Filter = filter; + /// + /// Gets the ObjComparer value. + /// private static IEqualityComparer ObjComparer { get; } = new ObjEqualityComparer(); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(ObjWithFilterValue other) => ObjComparer.Equals(this, other); // default equality does _not_ include Filter value, as that would cause the Filter operator that is used later to fail + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is ObjWithFilterValue value && Equals(value); + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => ObjComparer.GetHashCode(this); - private sealed class ObjEqualityComparer : IEqualityComparer +/// +/// Provides members for the ObjEqualityComparer class. +/// +private sealed class ObjEqualityComparer : IEqualityComparer { + /// + /// Executes the Equals operation. + /// + /// The x value. + /// The y value. + /// The result of the operation. public bool Equals(ObjWithFilterValue x, ObjWithFilterValue y) => EqualityComparer.Default.Equals(x.Obj, y.Obj); + /// + /// Executes the GetHashCode operation. + /// + /// The obj value. + /// The result of the operation. public int GetHashCode(ObjWithFilterValue obj) { unchecked diff --git a/src/DynamicData/List/Internal/FilterOnProperty.cs b/src/DynamicData/List/Internal/FilterOnProperty.cs index a94269e5f..d172dab50 100644 --- a/src/DynamicData/List/Internal/FilterOnProperty.cs +++ b/src/DynamicData/List/Internal/FilterOnProperty.cs @@ -11,9 +11,23 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the FilterOnProperty class. +/// +/// The type of the TObject value. +/// The type of the TProperty value. +/// The source value. +/// The propertySelector value. +/// The predicate value. +/// The throttle value. +/// The scheduler value. [Obsolete("Use AutoRefresh(), followed by Filter() instead")] internal sealed class FilterOnProperty(IObservable> source, Expression> propertySelector, Func predicate, TimeSpan? throttle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => source.AutoRefresh(propertySelector, propertyChangeThrottle: throttle, scheduler: scheduler).Filter(predicate); } diff --git a/src/DynamicData/List/Internal/FilterStatic.cs b/src/DynamicData/List/Internal/FilterStatic.cs index e3e93fbbc..eca70a7ee 100644 --- a/src/DynamicData/List/Internal/FilterStatic.cs +++ b/src/DynamicData/List/Internal/FilterStatic.cs @@ -9,13 +9,29 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the FilterStatic class. +/// +/// The type of the T value. +/// The source value. +/// The predicate value. internal sealed class FilterStatic(IObservable> source, Func predicate) where T : notnull { + /// + /// The _predicate field. + /// private readonly Func _predicate = predicate ?? throw new ArgumentNullException(nameof(predicate)); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Defer(() => _source.Scan( new ChangeAwareList(), (state, changes) => @@ -24,6 +40,11 @@ public IObservable> Run() => Observable.Defer(() => _source.Scan( return state; }).Select(filtered => filtered.CaptureChanges()).NotEmpty()); + /// + /// Executes the Process operation. + /// + /// The filtered value. + /// The changes value. private void Process(ChangeAwareList filtered, IChangeSet changes) { foreach (var item in changes) diff --git a/src/DynamicData/List/Internal/Group.cs b/src/DynamicData/List/Internal/Group.cs index 0c9807659..98739bb2f 100644 --- a/src/DynamicData/List/Internal/Group.cs +++ b/src/DynamicData/List/Internal/Group.cs @@ -9,23 +9,62 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Group class. +/// +/// The type of the TObject value. +/// The type of the TGroup value. +/// The groupKey value. internal sealed class Group(TGroup groupKey) : IGroup, IDisposable, IEquatable> where TObject : notnull { + /// + /// Gets the GroupKey value. + /// public TGroup GroupKey { get; } = groupKey; + /// + /// Gets the List value. + /// public IObservableList List => Source; + /// + /// Gets the Source value. + /// private SourceList Source { get; } = new(); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(Group left, Group right) => Equals(left, right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(Group left, Group right) => !Equals(left, right); + /// + /// Executes the Dispose operation. + /// public void Dispose() => Source.Dispose(); + /// + /// Executes the Edit operation. + /// + /// The editAction value. public void Edit(Action> editAction) => Source.Edit(editAction); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(Group? other) { if (other is null) @@ -41,9 +80,22 @@ public bool Equals(Group? other) return EqualityComparer.Default.Equals(GroupKey, other.GroupKey); } + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is Group value && Equals(value); + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => GroupKey is null ? 0 : EqualityComparer.Default.GetHashCode(GroupKey); + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"Group of {GroupKey} ({List.Count} records)"; } diff --git a/src/DynamicData/List/Internal/GroupOn.cs b/src/DynamicData/List/Internal/GroupOn.cs index e3b0258a8..6ecd2883a 100644 --- a/src/DynamicData/List/Internal/GroupOn.cs +++ b/src/DynamicData/List/Internal/GroupOn.cs @@ -9,16 +9,37 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the GroupOn class. +/// +/// The type of the TObject value. +/// The type of the TGroupKey value. +/// The source value. +/// The groupSelector value. +/// The regrouper value. internal sealed class GroupOn(IObservable> source, Func groupSelector, IObservable? regrouper) where TObject : notnull where TGroupKey : notnull { + /// + /// The _groupSelector field. + /// private readonly Func _groupSelector = groupSelector ?? throw new ArgumentNullException(nameof(groupSelector)); + /// + /// The _regrouper field. + /// private readonly IObservable? _regrouper = regrouper; + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable>> Run() => Observable.Create>>( observer => { @@ -43,6 +64,12 @@ public IObservable>> Run() => Observable.C return new CompositeDisposable(publisher, shared.Connect()); }); + /// + /// Executes the GetCache operation. + /// + /// The groupCaches value. + /// The key value. + /// The result of the operation. private static GroupWithAddIndicator GetCache(IDictionary> groupCaches, TGroupKey key) { var cache = groupCaches.Lookup(key); @@ -56,6 +83,13 @@ private static GroupWithAddIndicator GetCache(IDictionary + /// Executes the Process operation. + /// + /// The result value. + /// The groupCollection value. + /// The changes value. + /// The result of the operation. private static IChangeSet> Process(ChangeAwareList> result, IDictionary> groupCollection, IChangeSet changes) { foreach (var grouping in changes.Unified().GroupBy(change => change.Current.Group)) @@ -181,6 +215,13 @@ private static IChangeSet> Process(ChangeAwareList + /// Executes the Regroup operation. + ///
+ /// The result value. + /// The groupCollection value. + /// The currentItems value. + /// The result of the operation. private IChangeSet> Regroup(ChangeAwareList> result, IDictionary> groupCollection, IReadOnlyCollection currentItems) { // TODO: We need to update ItemWithValue> @@ -221,8 +262,16 @@ private IChangeSet> Regroup(ChangeAwareList +/// Represents the GroupWithAddIndicator value. +///
+private readonly struct GroupWithAddIndicator { + /// + /// Initializes a new instance of the struct. + /// + /// The group value. + /// The wasCreated value. public GroupWithAddIndicator(Group group, bool wasCreated) : this() { @@ -230,31 +279,57 @@ public GroupWithAddIndicator(Group group, bool wasCreated) WasCreated = wasCreated; } + /// + /// Gets the Group value. + /// public Group Group { get; } + /// + /// Gets the WasCreated value. + /// public bool WasCreated { get; } } - private sealed class ItemWithGroupKey(TObject item, TGroupKey group, ReactiveUI.Primitives.Optional previousGroup) : IEquatable +/// +/// Provides members for the ItemWithGroupKey class. +/// +/// The item value. +/// The group value. +/// The previousGroup value. +private sealed class ItemWithGroupKey(TObject item, TGroupKey group, ReactiveUI.Primitives.Optional previousGroup) : IEquatable { + /// + /// Gets or sets the Group value. + /// public TGroupKey Group { get; set; } = group; + /// + /// Gets the Item value. + /// public TObject Item { get; } = item; + /// + /// Gets the PreviousGroup value. + /// public ReactiveUI.Primitives.Optional PreviousGroup { get; } = previousGroup; - /// Returns a value that indicates whether the values of two objects are equal. + /// Returns a value that indicates whether the values of two GroupOn<TObject, TGroupKey>.ItemWithGroupKey objects are equal. /// The first value to compare. /// The second value to compare. /// true if the and parameters have the same value; otherwise, false. public static bool operator ==(ItemWithGroupKey left, ItemWithGroupKey right) => Equals(left, right); - /// Returns a value that indicates whether two objects have different values. + /// Returns a value that indicates whether two GroupOn<TObject, TGroupKey>.ItemWithGroupKey objects have different values. /// The first value to compare. /// The second value to compare. /// true if and are not equal; otherwise, false. public static bool operator !=(ItemWithGroupKey left, ItemWithGroupKey right) => !Equals(left, right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(ItemWithGroupKey? other) { if (other is null) @@ -270,6 +345,11 @@ public bool Equals(ItemWithGroupKey? other) return EqualityComparer.Default.Equals(Item, other.Item); } + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -285,8 +365,16 @@ public override bool Equals(object? obj) return obj is ItemWithGroupKey value && Equals(value); } + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => Item is null ? 0 : EqualityComparer.Default.GetHashCode(Item); + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"{Item} ({Group})"; } } diff --git a/src/DynamicData/List/Internal/GroupOnImmutable.cs b/src/DynamicData/List/Internal/GroupOnImmutable.cs index e0e64d00b..377463b00 100644 --- a/src/DynamicData/List/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/List/Internal/GroupOnImmutable.cs @@ -9,16 +9,37 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the GroupOnImmutable class. +/// +/// The type of the TObject value. +/// The type of the TGroupKey value. +/// The source value. +/// The groupSelector value. +/// The reGrouper value. internal sealed class GroupOnImmutable(IObservable> source, Func groupSelector, IObservable? reGrouper) where TObject : notnull where TGroupKey : notnull { + /// + /// The _groupSelector field. + /// private readonly Func _groupSelector = groupSelector ?? throw new ArgumentNullException(nameof(groupSelector)); + /// + /// The _reGrouper field. + /// private readonly IObservable? _reGrouper = reGrouper; + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable>> Run() => Observable.Create>>( observer => { @@ -45,6 +66,13 @@ public IObservable>> Run() => Observabl return new CompositeDisposable(publisher, shared.Connect()); }); + /// + /// Executes the CreateChangeSet operation. + /// + /// The result value. + /// The allGroupings value. + /// The initialStateOfGroups value. + /// The result of the operation. private static IChangeSet> CreateChangeSet(ChangeAwareList> result, IDictionary allGroupings, IDictionary> initialStateOfGroups) { // Now maintain target list @@ -78,6 +106,12 @@ private static IChangeSet> CreateChangeSet(ChangeA return result.CaptureChanges(); } + /// + /// Executes the GetGroup operation. + /// + /// The groupCaches value. + /// The key value. + /// The result of the operation. private static GroupContainer GetGroup(IDictionary groupCaches, TGroupKey key) { var cached = groupCaches.Lookup(key); @@ -91,10 +125,28 @@ private static GroupContainer GetGroup(IDictionary gr return newcache; } + /// + /// Executes the GetGroupState operation. + /// + /// The grouping value. + /// The result of the operation. private static ImmutableGroup GetGroupState(GroupContainer grouping) => new(grouping.Key, grouping.List); + /// + /// Executes the GetGroupState operation. + /// + /// The key value. + /// The list value. + /// The result of the operation. private static ImmutableGroup GetGroupState(TGroupKey key, IList list) => new(key, list); + /// + /// Executes the Process operation. + /// + /// The result value. + /// The allGroupings value. + /// The changes value. + /// The result of the operation. private static IChangeSet> Process(ChangeAwareList> result, IDictionary allGroupings, IChangeSet changes) { // need to keep track of effected groups to calculate correct notifications @@ -212,6 +264,13 @@ void GetInitialState() return CreateChangeSet(result, allGroupings, initialStateOfGroups); } + /// + /// Executes the Regroup operation. + /// + /// The result value. + /// The allGroupings value. + /// The currentItems value. + /// The result of the operation. private IChangeSet> Regroup(ChangeAwareList> result, IDictionary allGroupings, IReadOnlyCollection currentItems) { var initialStateOfGroups = new Dictionary>(); @@ -251,25 +310,67 @@ private IChangeSet> Regroup(ChangeAwareList +/// Provides members for the GroupContainer class. +///
+/// The key value. +private sealed class GroupContainer(TGroupKey key) { + /// + /// Gets the Key value. + /// public TGroupKey Key { get; } = key; + /// + /// Gets the List value. + /// public IList List { get; } = new List(); } - private sealed class ItemWithGroupKey(TObject item, TGroupKey group, ReactiveUI.Primitives.Optional previousGroup) : IEquatable +/// +/// Provides members for the ItemWithGroupKey class. +/// +/// The item value. +/// The group value. +/// The previousGroup value. +private sealed class ItemWithGroupKey(TObject item, TGroupKey group, ReactiveUI.Primitives.Optional previousGroup) : IEquatable { + /// + /// Gets or sets the Group value. + /// public TGroupKey Group { get; set; } = group; + /// + /// Gets the Item value. + /// public TObject Item { get; } = item; + /// + /// Gets the PreviousGroup value. + /// public ReactiveUI.Primitives.Optional PreviousGroup { get; } = previousGroup; + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(ItemWithGroupKey left, ItemWithGroupKey right) => Equals(left, right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(ItemWithGroupKey left, ItemWithGroupKey right) => !Equals(left, right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(ItemWithGroupKey? other) { if (other is null) @@ -285,10 +386,23 @@ public bool Equals(ItemWithGroupKey? other) return EqualityComparer.Default.Equals(Item, other.Item); } + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) => obj is ItemWithGroupKey value && Equals(value); + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => Item is null ? 0 : EqualityComparer.Default.GetHashCode(Item); + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"{Item} ({Group})"; } } diff --git a/src/DynamicData/List/Internal/GroupOnProperty.cs b/src/DynamicData/List/Internal/GroupOnProperty.cs index ddf63758f..433247ce5 100644 --- a/src/DynamicData/List/Internal/GroupOnProperty.cs +++ b/src/DynamicData/List/Internal/GroupOnProperty.cs @@ -11,13 +11,33 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the GroupOnProperty class. +/// +/// The type of the TObject value. +/// The type of the TGroup value. +/// The source value. +/// The groupSelectorKey value. +/// The throttle value. +/// The scheduler value. internal sealed class GroupOnProperty(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged where TGroup : notnull { + /// + /// The _groupSelector field. + /// private readonly Func _groupSelector = groupSelectorKey.Compile(); + + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable>> Run() => _source.Publish( shared => { diff --git a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs index 909a61940..a1803817f 100644 --- a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs @@ -11,13 +11,33 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the GroupOnPropertyWithImmutableState class. +/// +/// The type of the TObject value. +/// The type of the TGroup value. +/// The source value. +/// The groupSelectorKey value. +/// The throttle value. +/// The scheduler value. internal sealed class GroupOnPropertyWithImmutableState(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged where TGroup : notnull { + /// + /// The _groupSelector field. + /// private readonly Func _groupSelector = groupSelectorKey.Compile(); + + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable>> Run() => _source.Publish( shared => { diff --git a/src/DynamicData/List/Internal/ImmutableGroup.cs b/src/DynamicData/List/Internal/ImmutableGroup.cs index 2d149541e..784695796 100644 --- a/src/DynamicData/List/Internal/ImmutableGroup.cs +++ b/src/DynamicData/List/Internal/ImmutableGroup.cs @@ -9,26 +9,65 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the ImmutableGroup class. +/// +/// The type of the TObject value. +/// The type of the TGroupKey value. internal sealed class ImmutableGroup : IGrouping, IEquatable> { + /// + /// The _items field. + /// private readonly IReadOnlyCollection _items; + /// + /// Initializes a new instance of the class. + /// + /// The key value. + /// The items value. internal ImmutableGroup(TGroupKey key, IList items) { Key = key; _items = new ReadOnlyCollectionLight(items); } + /// + /// Gets the Count value. + /// public int Count => _items.Count; + /// + /// Gets the Items value. + /// public IEnumerable Items => _items; + /// + /// Gets the Key value. + /// public TGroupKey Key { get; } + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(ImmutableGroup left, ImmutableGroup right) => Equals(left, right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(ImmutableGroup left, ImmutableGroup right) => !Equals(left, right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(ImmutableGroup? other) { if (other is null) @@ -44,6 +83,11 @@ public bool Equals(ImmutableGroup? other) return EqualityComparer.Default.Equals(Key, other.Key); } + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -59,7 +103,15 @@ public override bool Equals(object? obj) return obj is ImmutableGroup value && Equals(value); } + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => Key is null ? 0 : EqualityComparer.Default.GetHashCode(Key); + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"Grouping for: {Key} ({Count} items)"; } diff --git a/src/DynamicData/List/Internal/LimitSizeTo.cs b/src/DynamicData/List/Internal/LimitSizeTo.cs index 2f7e1bafa..ba04dfc75 100644 --- a/src/DynamicData/List/Internal/LimitSizeTo.cs +++ b/src/DynamicData/List/Internal/LimitSizeTo.cs @@ -8,18 +8,46 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif - #if NET9_0_OR_GREATER + +/// +/// Provides members for the LimitSizeTo class. +/// +/// The type of the T value. +/// The sourceList value. +/// The sizeLimit value. +/// The scheduler value. +/// The locker value. internal sealed class LimitSizeTo(ISourceList sourceList, int sizeLimit, IScheduler scheduler, Lock locker) #else + +/// +/// Provides members for the LimitSizeTo class. +/// +/// The type of the T value. +/// The sourceList value. +/// The sizeLimit value. +/// The scheduler value. +/// The locker value. internal sealed class LimitSizeTo(ISourceList sourceList, int sizeLimit, IScheduler scheduler, object locker) #endif where T : notnull { + /// + /// The _scheduler field. + /// private readonly IScheduler _scheduler = scheduler ?? throw new ArgumentNullException(nameof(scheduler)); + + /// + /// The _sourceList field. + /// private readonly ISourceList _sourceList = sourceList ?? throw new ArgumentNullException(nameof(sourceList)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() { var emptyResult = new List(); diff --git a/src/DynamicData/List/Internal/MergeChangeSets.cs b/src/DynamicData/List/Internal/MergeChangeSets.cs index e50a0375b..3c227a00f 100644 --- a/src/DynamicData/List/Internal/MergeChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeChangeSets.cs @@ -12,14 +12,28 @@ namespace DynamicData.List.Internal; /// /// Operator that is similiar to Merge but intelligently handles List ChangeSets. /// +/// The type of the TObject value. +/// The source value. +/// The equalityComparer value. internal sealed class MergeChangeSets(IObservable>> source, IEqualityComparer? equalityComparer) where TObject : notnull { + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The equalityComparer value. + /// The completable value. + /// The scheduler value. public MergeChangeSets(IEnumerable>> source, IEqualityComparer? equalityComparer, bool completable, IScheduler? scheduler = null) : this(CreateObservable(source, completable, scheduler), equalityComparer) { } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -38,6 +52,13 @@ public IObservable> Run() => Observable.Create + /// Executes the CreateObservable operation. + ///
+ /// The source value. + /// The completable value. + /// The scheduler value. + /// The result of the operation. private static IObservable>> CreateObservable(IEnumerable>> source, bool completable, IScheduler? scheduler) { var obs = (scheduler != null) ? source.ToObservable(scheduler) : source.ToObservable(); @@ -49,20 +70,45 @@ private static IObservable>> CreateObservable(IE return obs; } - // Can optimize for the Add case because that's the only one that applies #if NET9_0_OR_GREATER + + /// + /// Executes the CreateChange operation. + /// + /// The source value. + /// The locker value. + /// The result of the operation. private Change> CreateChange(IObservable> source, Lock locker) => new(ListChangeReason.Add, new ClonedListChangeSet(source.Synchronize(locker), equalityComparer)); - // Create a ChangeSet Observable that produces ChangeSets with a single Add event for each new sub-observable + + /// + /// Executes the CreateClonedListObservable operation. + /// + /// The source value. + /// The locker value. + /// The result of the operation. private IObservable>> CreateClonedListObservable(IObservable>> source, Lock locker) => source.Select(src => new ChangeSet>(new[] { CreateChange(src, locker) })); #else + + /// + /// Executes the CreateChange operation. + /// + /// The source value. + /// The locker value. + /// The result of the operation. private Change> CreateChange(IObservable> source, object locker) => new(ListChangeReason.Add, new ClonedListChangeSet(source.Synchronize(locker), equalityComparer)); - // Create a ChangeSet Observable that produces ChangeSets with a single Add event for each new sub-observable + + /// + /// Executes the CreateClonedListObservable operation. + /// + /// The source value. + /// The locker value. + /// The result of the operation. private IObservable>> CreateClonedListObservable(IObservable>> source, object locker) => source.Select(src => new ChangeSet>(new[] { CreateChange(src, locker) })); #endif diff --git a/src/DynamicData/List/Internal/MergeMany.cs b/src/DynamicData/List/Internal/MergeMany.cs index b5baf01cc..5d1fbb298 100644 --- a/src/DynamicData/List/Internal/MergeMany.cs +++ b/src/DynamicData/List/Internal/MergeMany.cs @@ -9,13 +9,30 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the MergeMany class. +/// +/// The type of the T value. +/// The type of the TDestination value. +/// The source value. +/// The observableSelector value. internal sealed class MergeMany(IObservable> source, Func> observableSelector) where T : notnull { + /// + /// The _observableSelector field. + /// private readonly Func> _observableSelector = observableSelector ?? throw new ArgumentNullException(nameof(observableSelector)); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable Run() => Observable.Create( observer => { @@ -27,10 +44,27 @@ public IObservable Run() => Observable.Create( return new CompositeDisposable(disposable, counter); }); - #if NET9_0_OR_GREATER + + /// + /// Executes the SubscribeChild operation. + /// + /// The item value. + /// The locker value. + /// The counter value. + /// The observer value. + /// The result of the operation. private IDisposable SubscribeChild(T item, Lock locker, SubscriptionCounter counter, IObserver observer) #else + + /// + /// Executes the SubscribeChild operation. + /// + /// The item value. + /// The locker value. + /// The counter value. + /// The observer value. + /// The result of the operation. private IDisposable SubscribeChild(T item, object locker, SubscriptionCounter counter, IObserver observer) #endif { @@ -46,23 +80,48 @@ private IDisposable SubscribeChild(T item, object locker, SubscriptionCounter co } } - private sealed class SubscriptionCounter : IDisposable +/// +/// Provides members for the SubscriptionCounter class. +/// +private sealed class SubscriptionCounter : IDisposable { + /// + /// The _subject field. + /// private readonly Signal> _subject = new(); + + /// + /// The _subscriptionCount field. + /// private int _subscriptionCount = 1; + /// + /// Gets the DeferCleanup value. + /// public IObservable> DeferCleanup => Observable.Defer(() => { CheckCompleted(); return _subject.AsObservable(); }); + /// + /// Executes the Added operation. + /// public void Added() => _ = Interlocked.Increment(ref _subscriptionCount); + /// + /// Executes the Finally operation. + /// public void Finally() => CheckCompleted(); + /// + /// Executes the Dispose operation. + /// public void Dispose() => _subject.Dispose(); + /// + /// Executes the CheckCompleted operation. + /// private void CheckCompleted() { if (Interlocked.Decrement(ref _subscriptionCount) == 0) diff --git a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs index 9bdac35f3..5e72bbed7 100644 --- a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs @@ -19,11 +19,22 @@ namespace DynamicData.List.Internal; /// /// Operator that is similiar to MergeMany but intelligently handles Cache ChangeSets. /// +/// The type of the TObject value. +/// The type of the TDestination value. +/// The type of the TDestinationKey value. +/// The source value. +/// The changeSetSelector value. +/// The equalityComparer value. +/// The comparer value. internal sealed class MergeManyCacheChangeSets(IObservable> source, Func>> changeSetSelector, IEqualityComparer? equalityComparer, IComparer? comparer) where TObject : notnull where TDestination : notnull where TDestinationKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs index 6da79d2a6..0708f41dc 100644 --- a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs @@ -12,10 +12,19 @@ namespace DynamicData.List.Internal; /// /// Operator that is similiar to MergeMany but intelligently handles List ChangeSets. /// +/// The type of the TObject value. +/// The type of the TDestination value. +/// The source value. +/// The selector value. +/// The equalityComparer value. internal sealed class MergeManyListChangeSets(IObservable> source, Func>> selector, IEqualityComparer? equalityComparer) where TObject : notnull where TDestination : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/List/Internal/OnItemAdded.cs b/src/DynamicData/List/Internal/OnItemAdded.cs index 4eb53967f..b61e05b9f 100644 --- a/src/DynamicData/List/Internal/OnItemAdded.cs +++ b/src/DynamicData/List/Internal/OnItemAdded.cs @@ -1,44 +1,54 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. -#if REACTIVE_SHIM - -namespace DynamicData.Reactive.List.Internal; -#else - -namespace DynamicData.List.Internal; +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else + +namespace DynamicData.List.Internal; #endif - -internal static class OnItemAdded - where T : notnull -{ - public static IObservable> Create( - IObservable> source, - Action addAction) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(addAction); - - return source.Do(changeSet => - { - foreach (var change in changeSet) - { - switch (change.Reason) - { - case ListChangeReason.Add: - addAction.Invoke(change.Item.Current); - break; - - case ListChangeReason.AddRange: - foreach (var item in change.Range) - addAction.Invoke(item); - break; - - case ListChangeReason.Replace: - addAction.Invoke(change.Item.Current); - break; - } - } - }); - } -} + +/// +/// Provides members for the OnItemAdded class. +/// +/// The type of the T value. +internal static class OnItemAdded + where T : notnull +{ + /// + /// Executes the Create operation. + /// + /// The source value. + /// The addAction value. + /// The result of the operation. + public static IObservable> Create( + IObservable> source, + Action addAction) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(addAction); + + return source.Do(changeSet => + { + foreach (var change in changeSet) + { + switch (change.Reason) + { + case ListChangeReason.Add: + addAction.Invoke(change.Item.Current); + break; + + case ListChangeReason.AddRange: + foreach (var item in change.Range) + addAction.Invoke(item); + break; + + case ListChangeReason.Replace: + addAction.Invoke(change.Item.Current); + break; + } + } + }); + } +} diff --git a/src/DynamicData/List/Internal/OnItemRefreshed.cs b/src/DynamicData/List/Internal/OnItemRefreshed.cs index a66ce78bb..89cf81bd2 100644 --- a/src/DynamicData/List/Internal/OnItemRefreshed.cs +++ b/src/DynamicData/List/Internal/OnItemRefreshed.cs @@ -1,31 +1,41 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. -#if REACTIVE_SHIM - -namespace DynamicData.Reactive.List.Internal; -#else - -namespace DynamicData.List.Internal; +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else + +namespace DynamicData.List.Internal; #endif - -internal static class OnItemRefreshed - where T : notnull -{ - public static IObservable> Create( - IObservable> source, - Action refreshAction) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(refreshAction); - - return source.Do(changeSet => - { - foreach (var change in changeSet) - { - if (change.Reason is ListChangeReason.Refresh) - refreshAction.Invoke(change.Item.Current); - } - }); - } -} + +/// +/// Provides members for the OnItemRefreshed class. +/// +/// The type of the T value. +internal static class OnItemRefreshed + where T : notnull +{ + /// + /// Executes the Create operation. + /// + /// The source value. + /// The refreshAction value. + /// The result of the operation. + public static IObservable> Create( + IObservable> source, + Action refreshAction) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(refreshAction); + + return source.Do(changeSet => + { + foreach (var change in changeSet) + { + if (change.Reason is ListChangeReason.Refresh) + refreshAction.Invoke(change.Item.Current); + } + }); + } +} diff --git a/src/DynamicData/List/Internal/OnItemRemoved.cs b/src/DynamicData/List/Internal/OnItemRemoved.cs index ccd3b8875..31582e3f4 100644 --- a/src/DynamicData/List/Internal/OnItemRemoved.cs +++ b/src/DynamicData/List/Internal/OnItemRemoved.cs @@ -1,62 +1,73 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. -#if REACTIVE_SHIM - -namespace DynamicData.Reactive.List.Internal; -#else - -namespace DynamicData.List.Internal; +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else + +namespace DynamicData.List.Internal; #endif - -internal static class OnItemRemoved - where T : notnull -{ - public static IObservable> Create( - IObservable> source, - Action removeAction, - bool invokeOnUnsubscribe) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(removeAction); - - var removalProcessor = source.Do(changeSet => - { - foreach (var change in changeSet) - { - switch (change.Reason) - { - case ListChangeReason.Clear: - case ListChangeReason.RemoveRange: - foreach (var item in change.Range) - removeAction.Invoke(item); - break; - - case ListChangeReason.Remove: - removeAction.Invoke(change.Item.Current); - break; - - case ListChangeReason.Replace: - removeAction.Invoke(change.Item.Previous.Value); - break; - } - } - }); - - return invokeOnUnsubscribe - ? Observable.Create>(observer => - { - var items = new List(); - - return removalProcessor - .Do(changeSet => items.Clone(changeSet)) - .Finally(() => - { - foreach (var item in items) - removeAction.Invoke(item); - }) - .SubscribeSafe(observer); - }) - : removalProcessor; - } -} + +/// +/// Provides members for the OnItemRemoved class. +/// +/// The type of the T value. +internal static class OnItemRemoved + where T : notnull +{ + /// + /// Executes the Create operation. + /// + /// The source value. + /// The removeAction value. + /// The invokeOnUnsubscribe value. + /// The result of the operation. + public static IObservable> Create( + IObservable> source, + Action removeAction, + bool invokeOnUnsubscribe) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(removeAction); + + var removalProcessor = source.Do(changeSet => + { + foreach (var change in changeSet) + { + switch (change.Reason) + { + case ListChangeReason.Clear: + case ListChangeReason.RemoveRange: + foreach (var item in change.Range) + removeAction.Invoke(item); + break; + + case ListChangeReason.Remove: + removeAction.Invoke(change.Item.Current); + break; + + case ListChangeReason.Replace: + removeAction.Invoke(change.Item.Previous.Value); + break; + } + } + }); + + return invokeOnUnsubscribe + ? Observable.Create>(observer => + { + var items = new List(); + + return removalProcessor + .Do(changeSet => items.Clone(changeSet)) + .Finally(() => + { + foreach (var item in items) + removeAction.Invoke(item); + }) + .SubscribeSafe(observer); + }) + : removalProcessor; + } +} diff --git a/src/DynamicData/List/Internal/Pager.cs b/src/DynamicData/List/Internal/Pager.cs index 099a2993f..ddfcb0502 100644 --- a/src/DynamicData/List/Internal/Pager.cs +++ b/src/DynamicData/List/Internal/Pager.cs @@ -9,13 +9,29 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Pager class. +/// +/// The type of the T value. +/// The source value. +/// The requests value. internal sealed class Pager(IObservable> source, IObservable requests) where T : notnull { + /// + /// The _requests field. + /// private readonly IObservable _requests = requests ?? throw new ArgumentNullException(nameof(requests)); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -43,6 +59,12 @@ public IObservable> Run() => Observable.Create + /// Executes the CalculatePages operation. + ///
+ /// The all value. + /// The request value. + /// The result of the operation. private static int CalculatePages(ICollection all, IPageRequest? request) { if (request is null || request.Size >= all.Count || request.Size == 0) @@ -61,6 +83,13 @@ private static int CalculatePages(ICollection all, IPageRequest? request) return pages + 1; } + /// + /// Executes the CheckParametersAndPage operation. + /// + /// The all value. + /// The paged value. + /// The request value. + /// The result of the operation. private static PageChangeSet? CheckParametersAndPage(List all, ChangeAwareList paged, IPageRequest? request) { if (request is null || request.Page < 0 || request.Size < 1) @@ -71,6 +100,14 @@ private static int CalculatePages(ICollection all, IPageRequest? request) return Page(all, paged, request); } + /// + /// Executes the Page operation. + /// + /// The all value. + /// The paged value. + /// The request value. + /// The changeSet value. + /// The result of the operation. private static PageChangeSet Page(List all, ChangeAwareList paged, IPageRequest request, IChangeSet? changeSet = null) { if (changeSet is not null) diff --git a/src/DynamicData/List/Internal/QueryWhenChanged.cs b/src/DynamicData/List/Internal/QueryWhenChanged.cs index afc2248fd..204e5c75f 100644 --- a/src/DynamicData/List/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/List/Internal/QueryWhenChanged.cs @@ -9,11 +9,23 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the QueryWhenChanged class. +/// +/// The type of the T value. +/// The source value. internal sealed class QueryWhenChanged(IObservable> source) where T : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => { var list = new List(); diff --git a/src/DynamicData/List/Internal/ReaderWriter.cs b/src/DynamicData/List/Internal/ReaderWriter.cs index 0a2651bab..a41d34677 100644 --- a/src/DynamicData/List/Internal/ReaderWriter.cs +++ b/src/DynamicData/List/Internal/ReaderWriter.cs @@ -9,15 +9,31 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the ReaderWriter class. +/// +/// The type of the T value. internal sealed class ReaderWriter where T : notnull { + /// + /// The _locker field. + /// private readonly Lock _locker = new(); + /// + /// The _data field. + /// private ChangeAwareList _data = new(); + /// + /// The _updateInProgress field. + /// private bool _updateInProgress; + /// + /// Gets the Count value. + /// public int Count { get @@ -29,6 +45,9 @@ public int Count } } + /// + /// Gets the Items value. + /// public T[] Items { get @@ -42,6 +61,11 @@ public T[] Items } } + /// + /// Executes the Write operation. + /// + /// The changes value. + /// The result of the operation. public IChangeSet Write(IChangeSet changes) { ArgumentExceptionHelper.ThrowIfNull(changes); @@ -57,6 +81,11 @@ public IChangeSet Write(IChangeSet changes) return result; } + /// + /// Executes the Write operation. + /// + /// The updateAction value. + /// The result of the operation. public IChangeSet Write(Action> updateAction) { ArgumentExceptionHelper.ThrowIfNull(updateAction); @@ -96,6 +125,12 @@ public void WriteNested(Action> updateAction) } } + /// + /// Executes the WriteWithPreview operation. + /// + /// The updateAction value. + /// The previewHandler value. + /// The result of the operation. public IChangeSet WriteWithPreview(Action> updateAction, Action> previewHandler) { ArgumentExceptionHelper.ThrowIfNull(updateAction); diff --git a/src/DynamicData/List/Internal/RefCount.cs b/src/DynamicData/List/Internal/RefCount.cs index 5518f6b5f..8333c9dc7 100644 --- a/src/DynamicData/List/Internal/RefCount.cs +++ b/src/DynamicData/List/Internal/RefCount.cs @@ -9,14 +9,33 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the RefCount class. +/// +/// The type of the T value. +/// The source value. internal sealed class RefCount(IObservable> source) where T : notnull { + /// + /// The _locker field. + /// private readonly Lock _locker = new(); + + /// + /// The _list field. + /// private IObservableList? _list; + /// + /// The _refCount field. + /// private int _refCount; + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/List/Internal/ReferenceCountTracker.cs b/src/DynamicData/List/Internal/ReferenceCountTracker.cs index e92b44b7f..4b416e95b 100644 --- a/src/DynamicData/List/Internal/ReferenceCountTracker.cs +++ b/src/DynamicData/List/Internal/ReferenceCountTracker.cs @@ -17,16 +17,27 @@ namespace DynamicData.List.Internal; internal sealed class ReferenceCountTracker where T : notnull { + /// + /// Gets the Items value. + /// public IEnumerable Items => ReferenceCounts.Keys; + /// + /// Gets the ReferenceCounts value. + /// private Dictionary ReferenceCounts { get; } = []; + /// + /// Gets or sets the indexed value. + /// + /// The item value. public int this[T item] => ReferenceCounts[item]; /// /// Increments the reference count for the item. Returns true when reference count goes from 0 to 1. /// /// The item to add. + /// The result of the operation. public bool Add(T item) { ArgumentExceptionHelper.ThrowIfNull(item); @@ -41,14 +52,23 @@ public bool Add(T item) return false; } + /// + /// Executes the Clear operation. + /// public void Clear() => ReferenceCounts.Clear(); + /// + /// Executes the Contains operation. + /// + /// The item value. + /// The result of the operation. public bool Contains(T item) => ReferenceCounts.ContainsKey(item); /// /// Decrements the reference count for the item. Returns true when reference count goes from 1 to 0. /// /// The item to remove. + /// The result of the operation. public bool Remove(T item) { ArgumentExceptionHelper.ThrowIfNull(item); diff --git a/src/DynamicData/List/Internal/Sort.cs b/src/DynamicData/List/Internal/Sort.cs index 3582697da..2884fcd2a 100644 --- a/src/DynamicData/List/Internal/Sort.cs +++ b/src/DynamicData/List/Internal/Sort.cs @@ -9,15 +9,43 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Sort class. +/// +/// The type of the T value. +/// The source value. +/// The comparer value. +/// The sortOptions value. +/// The resort value. +/// The comparerObservable value. +/// The resetThreshold value. internal sealed class Sort(IObservable> source, IComparer? comparer, SortOptions sortOptions, IObservable? resort, IObservable>? comparerObservable, int resetThreshold) where T : notnull { + /// + /// The _comparerObservable field. + /// private readonly IObservable> _comparerObservable = comparerObservable ?? Observable.Never>(); + + /// + /// The _resort field. + /// private readonly IObservable _resort = resort ?? Observable.Never(); + + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// The _comparer field. + /// private IComparer _comparer = comparer ?? Comparer.Default; + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -41,6 +69,12 @@ public IObservable> Run() => Observable.Create>( return changeComparer.Merge(resortSync).Merge(dataChanged).Where(changes => changes.Count != 0).SubscribeSafe(observer); }); + /// + /// Executes the ChangeComparer operation. + /// + /// The target value. + /// The comparer value. + /// The result of the operation. private IChangeSet ChangeComparer(ChangeAwareList target, IComparer comparer) { _comparer = comparer; @@ -55,6 +89,12 @@ private IChangeSet ChangeComparer(ChangeAwareList target, IComparer com return target.CaptureChanges(); } + /// + /// Executes the GetCurrentPosition operation. + /// + /// The target value. + /// The item value. + /// The result of the operation. private int GetCurrentPosition(ChangeAwareList target, T item) { var index = sortOptions == SortOptions.UseBinarySearch ? target.BinarySearch(item, _comparer) : target.IndexOf(item); @@ -67,8 +107,20 @@ private int GetCurrentPosition(ChangeAwareList target, T item) return index; } + /// + /// Executes the GetInsertPosition operation. + /// + /// The target value. + /// The item value. + /// The result of the operation. private int GetInsertPosition(ChangeAwareList target, T item) => sortOptions == SortOptions.UseBinarySearch ? GetInsertPositionBinary(target, item) : GetInsertPositionLinear(target, item); + /// + /// Executes the GetInsertPositionBinary operation. + /// + /// The target value. + /// The item value. + /// The result of the operation. private int GetInsertPositionBinary(ChangeAwareList target, T item) { var index = target.BinarySearch(item, _comparer); @@ -83,6 +135,12 @@ private int GetInsertPositionBinary(ChangeAwareList target, T item) return insertIndex; } + /// + /// Executes the GetInsertPositionLinear operation. + /// + /// The target value. + /// The item value. + /// The result of the operation. private int GetInsertPositionLinear(ChangeAwareList target, T item) { for (var i = 0; i < target.Count; i++) @@ -96,12 +154,23 @@ private int GetInsertPositionLinear(ChangeAwareList target, T item) return target.Count; } + /// + /// Executes the Insert operation. + /// + /// The target value. + /// The item value. private void Insert(ChangeAwareList target, T item) { var index = GetInsertPosition(target, item); target.Insert(index, item); } + /// + /// Executes the Process operation. + /// + /// The target value. + /// The changes value. + /// The result of the operation. private IChangeSet Process(ChangeAwareList target, IChangeSet changes) { // if all removes and not Clear, then more efficient to try clear range @@ -115,6 +184,12 @@ private IChangeSet Process(ChangeAwareList target, IChangeSet changes) return ProcessImpl(target, changes); } + /// + /// Executes the ProcessImpl operation. + /// + /// The target value. + /// The changes value. + /// The result of the operation. private IChangeSet ProcessImpl(ChangeAwareList target, IChangeSet changes) { var refreshes = new List(changes.Refreshes); @@ -216,12 +291,22 @@ private IChangeSet ProcessImpl(ChangeAwareList target, IChangeSet chang return target.CaptureChanges(); } + /// + /// Executes the Remove operation. + /// + /// The target value. + /// The item value. private void Remove(ChangeAwareList target, T item) { var index = GetCurrentPosition(target, item); target.RemoveAt(index); } + /// + /// Executes the Reorder operation. + /// + /// The target value. + /// The result of the operation. private IChangeSet Reorder(ChangeAwareList target) { var index = -1; @@ -245,6 +330,12 @@ private IChangeSet Reorder(ChangeAwareList target) return target.CaptureChanges(); } + /// + /// Executes the Reset operation. + /// + /// The original value. + /// The target value. + /// The result of the operation. private IChangeSet Reset(List original, ChangeAwareList target) { var sorted = original.OrderBy(t => t, _comparer).ToList(); diff --git a/src/DynamicData/List/Internal/SubscribeMany.cs b/src/DynamicData/List/Internal/SubscribeMany.cs index 533e51280..7ff5c1a71 100644 --- a/src/DynamicData/List/Internal/SubscribeMany.cs +++ b/src/DynamicData/List/Internal/SubscribeMany.cs @@ -9,13 +9,29 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the SubscribeMany class. +/// +/// The type of the T value. +/// The source value. +/// The subscriptionFactory value. internal sealed class SubscribeMany(IObservable> source, Func subscriptionFactory) where T : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// The _subscriptionFactory field. + /// private readonly Func _subscriptionFactory = subscriptionFactory ?? throw new ArgumentNullException(nameof(subscriptionFactory)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/List/Internal/Switch.cs b/src/DynamicData/List/Internal/Switch.cs index dc8523684..4ddc7604d 100644 --- a/src/DynamicData/List/Internal/Switch.cs +++ b/src/DynamicData/List/Internal/Switch.cs @@ -9,11 +9,23 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Switch class. +/// +/// The type of the T value. +/// The sources value. internal sealed class Switch(IObservable>> sources) where T : notnull { + /// + /// The _sources field. + /// private readonly IObservable>> _sources = sources ?? throw new ArgumentNullException(nameof(sources)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/List/Internal/ToObservableChangeSet.cs b/src/DynamicData/List/Internal/ToObservableChangeSet.cs index dee9509e3..03334362b 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -9,9 +9,21 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the ToObservableChangeSet class. +/// +/// The type of the TObject value. internal static class ToObservableChangeSet where TObject : notnull { + /// + /// Executes the Create operation. + /// + /// The source value. + /// The expireAfter value. + /// The limitSizeTo value. + /// The scheduler value. + /// The result of the operation. public static IObservable> Create( IObservable source, Func? expireAfter, @@ -38,6 +50,14 @@ public static IObservable> Create( }); } + /// + /// Executes the Create operation. + /// + /// The source value. + /// The expireAfter value. + /// The limitSizeTo value. + /// The scheduler value. + /// The result of the operation. public static IObservable> Create( IObservable> source, Func? expireAfter, @@ -54,22 +74,75 @@ public static IObservable> Create( source: source)); } - private sealed class Subscription +/// +/// Provides members for the Subscription class. +/// +private sealed class Subscription : IDisposable { + /// + /// The _downstreamItems field. + /// private readonly ChangeAwareList _downstreamItems; + + /// + /// The _downstreamObserver field. + /// private readonly IObserver> _downstreamObserver; + + /// + /// The _expireAfter field. + /// private readonly Func? _expireAfter; + + /// + /// The _expirationQueue field. + /// private readonly List _expirationQueue; + + /// + /// The _limitSizeTo field. + /// private readonly int _limitSizeTo; + + /// + /// The _scheduler field. + /// private readonly IScheduler _scheduler; + + /// + /// The _sourceSubscription field. + /// private readonly IDisposable _sourceSubscription; + + /// + /// The _synchronizationGate field. + /// private readonly Lock _synchronizationGate; + /// + /// The _hasInitialized field. + /// private bool _hasInitialized; + + /// + /// The _hasSourceCompleted field. + /// private bool _hasSourceCompleted; + + /// + /// The _scheduledExpiration field. + /// private ScheduledExpiration? _scheduledExpiration; + /// + /// Initializes a new instance of the class. + /// + /// The downstreamObserver value. + /// The expireAfter value. + /// The limitSizeTo value. + /// The scheduler value. + /// The source value. public Subscription( IObserver> downstreamObserver, Func? expireAfter, @@ -99,12 +172,20 @@ public Subscription( } } + /// + /// Executes the Dispose operation. + /// public void Dispose() { _sourceSubscription.Dispose(); _scheduledExpiration?.Cancellation.Dispose(); } + /// + /// Executes the OnScheduledExpirationInvoked operation. + /// + /// The intendedExpiration value. + /// The result of the operation. private IDisposable OnScheduledExpirationInvoked(Expiration intendedExpiration) { try @@ -166,6 +247,10 @@ private IDisposable OnScheduledExpirationInvoked(Expiration intendedExpiration) return Disposable.Empty; } + /// + /// Executes the OnSourceNext operation. + /// + /// The upstreamItems value. private void OnSourceNext(IEnumerable upstreamItems) { try @@ -263,6 +348,9 @@ private void OnSourceNext(IEnumerable upstreamItems) } } + /// + /// Executes the OnSourceCompleted operation. + /// private void OnSourceCompleted() { lock (_synchronizationGate) @@ -272,13 +360,18 @@ private void OnSourceCompleted() TryPublishCompletion(); } } - // This method must NOT be invoked under the umbrella of _synchronizationGate, // as some IScheduler implementations perform locking internally, which can result in deadlocking if we invoke the scheduler within our own lock. // // Additionally, some IScheduler implementations can invoke actions synchronously, // so it's important that scheduler invocation is only performed AFTER downstream changes have been processed. // Otherwise, downstream notifications can end up published out-of-order. + + /// + /// Executes the FinishSchedulingExpiration operation. + /// + /// The unfinishedExpiration value. + /// The scheduler value. private void FinishSchedulingExpiration( ScheduledExpiration unfinishedExpiration, IScheduler scheduler) @@ -298,6 +391,9 @@ private void FinishSchedulingExpiration( return Disposable.Empty; }); + /// + /// Executes the TryPublishCompletion operation. + /// private void TryPublishCompletion() { // There needs to be no possibility of a new changeset being emitted before we can call the stream complete. @@ -305,6 +401,9 @@ private void TryPublishCompletion() _downstreamObserver.OnCompleted(); } + /// + /// Executes the TryPublishDownstreamChanges operation. + /// private void TryPublishDownstreamChanges() { var downstreamChanges = _downstreamItems.CaptureChanges(); @@ -316,6 +415,10 @@ private void TryPublishDownstreamChanges() } } + /// + /// Executes the TryBeginSchedulingExpiration operation. + /// + /// The result of the operation. private ScheduledExpiration? TryBeginSchedulingExpiration() { // If there's no expirations currently queued up, we don't need to schedule anything. @@ -341,20 +444,43 @@ private void TryPublishDownstreamChanges() } } - private readonly struct ScheduledExpiration +/// +/// Represents the ScheduledExpiration value. +/// +private readonly struct ScheduledExpiration { + /// + /// Gets or sets the Cancellation value. + /// public required SingleAssignmentDisposable Cancellation { get; init; } + /// + /// Gets or sets the Expiration value. + /// public required Expiration Expiration { get; init; } } - private readonly record struct Expiration +/// +/// Represents the Expiration record. +/// +private readonly record struct Expiration : IComparable { + /// + /// Gets or sets the ExpireAt value. + /// public required DateTimeOffset ExpireAt { get; init; } + /// + /// Gets or sets the Index value. + /// public required int Index { get; init; } + /// + /// Executes the CompareTo operation. + /// + /// The other value. + /// The result of the operation. public int CompareTo(Expiration other) => ExpireAt.CompareTo(other.ExpireAt); } diff --git a/src/DynamicData/List/Internal/TransformAsync.cs b/src/DynamicData/List/Internal/TransformAsync.cs index 1bfd998c7..0ffa4a8dd 100644 --- a/src/DynamicData/List/Internal/TransformAsync.cs +++ b/src/DynamicData/List/Internal/TransformAsync.cs @@ -9,15 +9,36 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the TransformAsync class. +/// +/// The type of the TSource value. +/// The type of the TDestination value. internal sealed class TransformAsync where TSource : notnull where TDestination : notnull { + /// + /// The _containerFactory field. + /// private readonly Func, int, Task.TransformedItemContainer>> _containerFactory; + /// + /// The _source field. + /// private readonly IObservable> _source; + + /// + /// The _transformOnRefresh field. + /// private readonly bool _transformOnRefresh; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The factory value. + /// The transformOnRefresh value. public TransformAsync( IObservable> source, Func, int, Task> factory, @@ -34,8 +55,16 @@ public TransformAsync( }; } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Defer(RunImpl); + /// + /// Executes the RunImpl operation. + /// + /// The result of the operation. private IObservable> RunImpl() { var state = new ChangeAwareList.TransformedItemContainer>(); @@ -62,6 +91,12 @@ private IObservable> RunImpl() }); } + /// + /// Executes the Transform operation. + /// + /// The transformed value. + /// The changes value. + /// The result of the operation. private async Task Transform( ChangeAwareList.TransformedItemContainer> transformed, IChangeSet changes) diff --git a/src/DynamicData/List/Internal/TransformMany.cs b/src/DynamicData/List/Internal/TransformMany.cs index 13d5e260b..f5f136254 100644 --- a/src/DynamicData/List/Internal/TransformMany.cs +++ b/src/DynamicData/List/Internal/TransformMany.cs @@ -1,243 +1,325 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. -#if REACTIVE_SHIM - -using DynamicData.Reactive.Binding; -#else - -using DynamicData.Binding; +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. +#if REACTIVE_SHIM + +using DynamicData.Reactive.Binding; +#else + +using DynamicData.Binding; #endif -#if REACTIVE_SHIM - -namespace DynamicData.Reactive.List.Internal; -#else - -namespace DynamicData.List.Internal; +#if REACTIVE_SHIM + +namespace DynamicData.Reactive.List.Internal; +#else + +namespace DynamicData.List.Internal; #endif - -internal sealed class TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null, Func>>? childChanges = null) - where TSource : notnull - where TDestination : notnull -{ - private readonly IEqualityComparer _equalityComparer = equalityComparer ?? EqualityComparer.Default; - private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); - - public TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null) - : this( - source, - manySelector, - equalityComparer, - t => Observable.Defer( - () => - { - var subsequentChanges = manySelector(t).ToObservableChangeSet(); - - if (manySelector(t).Count > 0) - { - return subsequentChanges; - } - - return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); - })) - { - } - - public TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null) - : this( - source, - manySelector, - equalityComparer, - t => Observable.Defer( - () => - { - var subsequentChanges = manySelector(t).ToObservableChangeSet(); - - if (manySelector(t).Count > 0) - { - return subsequentChanges; - } - - return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); - })) - { - } - - public TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null) - : this( - source, - s => new ManySelectorFunc(s, x => manySelector(x).Items), - equalityComparer, - t => Observable.Defer( - () => - { - var subsequentChanges = manySelector(t).Connect(); - - if (manySelector(t).Count > 0) - { - return subsequentChanges; - } - - return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); - })) - { - } - - public IObservable> Run() - { - if (childChanges is not null) - { - return CreateWithChangeSet(); - } - - return Observable.Create>( - observer => - { - // NB: ChangeAwareList is used internally by dd to capture changes to a list and ensure they can be replayed by subsequent operators - var result = new ChangeAwareList(); - - return _source.Transform(item => new ManyContainer(manySelector(item).ToArray()), true).Select( - changes => - { - var destinationChanges = new DestinationEnumerator(changes, _equalityComparer); - result.Clone(destinationChanges, _equalityComparer); - return result.CaptureChanges(); - }).NotEmpty().SubscribeSafe(observer); - }); - } - - private IObservable> CreateWithChangeSet() - { - if (childChanges is null) - { - throw new InvalidOperationException("_childChanges must not be null."); - } - - return Observable.Create>( - observer => - { - var result = new ChangeAwareList(); - - var transformed = _source.Transform( - t => - { - var locker = InternalEx.NewLock(); - var collection = manySelector(t); - var changes = childChanges(t).Synchronize(locker).Skip(1); - return new ManyContainer(collection, changes); - }).Publish(); - - var outerLock = new Lock(); - var initial = transformed.Synchronize(outerLock).Select(changes => new ChangeSet(new DestinationEnumerator(changes, _equalityComparer))); - - var subsequent = transformed.MergeMany(x => x.Changes).Synchronize(outerLock); - - var init = initial.Select( - changes => - { - result.Clone(changes, _equalityComparer); - return result.CaptureChanges(); - }); - - var subsequentSelection = subsequent.RemoveIndex().Select( - changes => - { - result.Clone(changes, _equalityComparer); - return result.CaptureChanges(); - }); - - var allChanges = init.Merge(subsequentSelection); - - return new CompositeDisposable(allChanges.SubscribeSafe(observer), transformed.Connect()); - }); - } - - // make this an instance - private sealed class DestinationEnumerator(IChangeSet changes, IEqualityComparer equalityComparer) : IEnumerable> - { - public IEnumerator> GetEnumerator() - { - foreach (var change in changes) - { - switch (change.Reason) - { - case ListChangeReason.Add: - case ListChangeReason.Remove: - foreach (var destination in change.Item.Current.Destination) - { - yield return new Change(change.Reason, destination); - } - - break; - - case ListChangeReason.AddRange: - case ListChangeReason.Clear: - { - var items = change.Range.SelectMany(m => m.Destination); - yield return new Change(change.Reason, items); - } - - break; - - case ListChangeReason.Replace: - case ListChangeReason.Refresh: - { - // this is difficult as we need to discover adds and removes (and perhaps replaced) - var currentItems = change.Item.Current.Destination.AsArray(); - var previousItems = change.Item.Previous.Value.Destination.AsArray(); - - var adds = currentItems.Except(previousItems, equalityComparer); - - // I am not sure whether it is possible to translate the original change into a replace - foreach (var destination in previousItems.Except(currentItems, equalityComparer)) - { - yield return new Change(ListChangeReason.Remove, destination); - } - - foreach (var destination in adds) - { - yield return new Change(ListChangeReason.Add, destination); - } - } - - break; - - case ListChangeReason.RemoveRange: - { - foreach (var destination in change.Range.SelectMany(m => m.Destination)) - { - yield return new Change(ListChangeReason.Remove, destination); - } - } - - break; - - case ListChangeReason.Moved: - // do nothing as the original index has no bearing on the destination index - break; - - default: - throw new IndexOutOfRangeException("Unknown list reason " + change); - } - } - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - } - - private sealed class ManyContainer(IEnumerable destination, IObservable>? changes = null) - { - public IObservable> Changes { get; } = changes ?? Observable.Empty>(); - - public IEnumerable Destination { get; } = destination; - } - - private sealed class ManySelectorFunc(TSource source, Func> selector) : IEnumerable - { - private readonly Func> _selector = selector ?? throw new ArgumentNullException(nameof(selector)); - - public IEnumerator GetEnumerator() => _selector(source).GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => _selector(source).GetEnumerator(); - } -} + +/// +/// Provides members for the TransformMany class. +/// +/// The type of the TSource value. +/// The type of the TDestination value. +/// The source value. +/// The manySelector value. +/// The equalityComparer value. +/// The childChanges value. +internal sealed class TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null, Func>>? childChanges = null) + where TSource : notnull + where TDestination : notnull +{ + /// + /// The _equalityComparer field. + /// + private readonly IEqualityComparer _equalityComparer = equalityComparer ?? EqualityComparer.Default; + + /// + /// The _source field. + /// + private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The manySelector value. + /// The equalityComparer value. + public TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null) + : this( + source, + manySelector, + equalityComparer, + t => Observable.Defer( + () => + { + var subsequentChanges = manySelector(t).ToObservableChangeSet(); + + if (manySelector(t).Count > 0) + { + return subsequentChanges; + } + + return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); + })) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The manySelector value. + /// The equalityComparer value. + public TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null) + : this( + source, + manySelector, + equalityComparer, + t => Observable.Defer( + () => + { + var subsequentChanges = manySelector(t).ToObservableChangeSet(); + + if (manySelector(t).Count > 0) + { + return subsequentChanges; + } + + return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); + })) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The manySelector value. + /// The equalityComparer value. + public TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null) + : this( + source, + s => new ManySelectorFunc(s, x => manySelector(x).Items), + equalityComparer, + t => Observable.Defer( + () => + { + var subsequentChanges = manySelector(t).Connect(); + + if (manySelector(t).Count > 0) + { + return subsequentChanges; + } + + return Observable.Return(ChangeSet.Empty).Concat(subsequentChanges); + })) + { + } + + /// + /// Executes the Run operation. + /// + /// The result of the operation. + public IObservable> Run() + { + if (childChanges is not null) + { + return CreateWithChangeSet(); + } + + return Observable.Create>( + observer => + { + // NB: ChangeAwareList is used internally by dd to capture changes to a list and ensure they can be replayed by subsequent operators + var result = new ChangeAwareList(); + + return _source.Transform(item => new ManyContainer(manySelector(item).ToArray()), true).Select( + changes => + { + var destinationChanges = new DestinationEnumerator(changes, _equalityComparer); + result.Clone(destinationChanges, _equalityComparer); + return result.CaptureChanges(); + }).NotEmpty().SubscribeSafe(observer); + }); + } + + /// + /// Executes the CreateWithChangeSet operation. + /// + /// The result of the operation. + private IObservable> CreateWithChangeSet() + { + if (childChanges is null) + { + throw new InvalidOperationException("_childChanges must not be null."); + } + + return Observable.Create>( + observer => + { + var result = new ChangeAwareList(); + + var transformed = _source.Transform( + t => + { + var locker = InternalEx.NewLock(); + var collection = manySelector(t); + var changes = childChanges(t).Synchronize(locker).Skip(1); + return new ManyContainer(collection, changes); + }).Publish(); + + var outerLock = new Lock(); + var initial = transformed.Synchronize(outerLock).Select(changes => new ChangeSet(new DestinationEnumerator(changes, _equalityComparer))); + + var subsequent = transformed.MergeMany(x => x.Changes).Synchronize(outerLock); + + var init = initial.Select( + changes => + { + result.Clone(changes, _equalityComparer); + return result.CaptureChanges(); + }); + + var subsequentSelection = subsequent.RemoveIndex().Select( + changes => + { + result.Clone(changes, _equalityComparer); + return result.CaptureChanges(); + }); + + var allChanges = init.Merge(subsequentSelection); + + return new CompositeDisposable(allChanges.SubscribeSafe(observer), transformed.Connect()); + }); + } + // make this an instance + +/// +/// Provides members for the DestinationEnumerator class. +/// +/// The changes value. +/// The equalityComparer value. +private sealed class DestinationEnumerator(IChangeSet changes, IEqualityComparer equalityComparer) : IEnumerable> + { + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. + public IEnumerator> GetEnumerator() + { + foreach (var change in changes) + { + switch (change.Reason) + { + case ListChangeReason.Add: + case ListChangeReason.Remove: + foreach (var destination in change.Item.Current.Destination) + { + yield return new Change(change.Reason, destination); + } + + break; + + case ListChangeReason.AddRange: + case ListChangeReason.Clear: + { + var items = change.Range.SelectMany(m => m.Destination); + yield return new Change(change.Reason, items); + } + + break; + + case ListChangeReason.Replace: + case ListChangeReason.Refresh: + { + // this is difficult as we need to discover adds and removes (and perhaps replaced) + var currentItems = change.Item.Current.Destination.AsArray(); + var previousItems = change.Item.Previous.Value.Destination.AsArray(); + + var adds = currentItems.Except(previousItems, equalityComparer); + + // I am not sure whether it is possible to translate the original change into a replace + foreach (var destination in previousItems.Except(currentItems, equalityComparer)) + { + yield return new Change(ListChangeReason.Remove, destination); + } + + foreach (var destination in adds) + { + yield return new Change(ListChangeReason.Add, destination); + } + } + + break; + + case ListChangeReason.RemoveRange: + { + foreach (var destination in change.Range.SelectMany(m => m.Destination)) + { + yield return new Change(ListChangeReason.Remove, destination); + } + } + + break; + + case ListChangeReason.Moved: + // do nothing as the original index has no bearing on the destination index + break; + + default: + throw new IndexOutOfRangeException("Unknown list reason " + change); + } + } + } + + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + } + +/// +/// Provides members for the ManyContainer class. +/// +/// The destination value. +/// The changes value. +private sealed class ManyContainer(IEnumerable destination, IObservable>? changes = null) + { + /// + /// Gets the Changes value. + /// + public IObservable> Changes { get; } = changes ?? Observable.Empty>(); + + /// + /// Gets the Destination value. + /// + public IEnumerable Destination { get; } = destination; + } + +/// +/// Provides members for the ManySelectorFunc class. +/// +/// The source value. +/// The selector value. +private sealed class ManySelectorFunc(TSource source, Func> selector) : IEnumerable + { + /// + /// The _selector field. + /// + private readonly Func> _selector = selector ?? throw new ArgumentNullException(nameof(selector)); + + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. + public IEnumerator GetEnumerator() => _selector(source).GetEnumerator(); + + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. + IEnumerator IEnumerable.GetEnumerator() => _selector(source).GetEnumerator(); + } +} diff --git a/src/DynamicData/List/Internal/Transformer.cs b/src/DynamicData/List/Internal/Transformer.cs index 3d6c66478..10714662c 100644 --- a/src/DynamicData/List/Internal/Transformer.cs +++ b/src/DynamicData/List/Internal/Transformer.cs @@ -9,16 +9,36 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Transformer class. +/// +/// The type of the TSource value. +/// The type of the TDestination value. internal sealed class Transformer where TSource : notnull where TDestination : notnull { + /// + /// The _containerFactory field. + /// private readonly Func, int, TransformedItemContainer> _containerFactory; + /// + /// The _source field. + /// private readonly IObservable> _source; + /// + /// The _transformOnRefresh field. + /// private readonly bool _transformOnRefresh; + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The factory value. + /// The transformOnRefresh value. public Transformer(IObservable> source, Func, int, TDestination> factory, bool transformOnRefresh) { ArgumentExceptionHelper.ThrowIfNull(factory); @@ -29,8 +49,16 @@ public Transformer(IObservable> source, Func new TransformedItemContainer(item, factory(item, prev, index)); } + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Defer(RunImpl); + /// + /// Executes the RunImpl operation. + /// + /// The result of the operation. private IObservable> RunImpl() => _source.Scan(new ChangeAwareList(), (state, changes) => { Transform(state, changes); @@ -42,6 +70,11 @@ private IObservable> RunImpl() => _source.Scan(new Chan return changed.Transform(container => container.Destination); }); + /// + /// Executes the Transform operation. + /// + /// The transformed value. + /// The changes value. private void Transform(ChangeAwareList transformed, IChangeSet changes) { ArgumentExceptionHelper.ThrowIfNull(changes); @@ -198,16 +231,44 @@ private void Transform(ChangeAwareList transformed, IC } } - internal sealed class TransformedItemContainer(TSource source, TDestination destination) : IEquatable +/// +/// Provides members for the TransformedItemContainer class. +/// +/// The source value. +/// The destination value. +internal sealed class TransformedItemContainer(TSource source, TDestination destination) : IEquatable { + /// + /// Gets the Destination value. + /// public TDestination Destination { get; } = destination; + /// + /// Gets the Source value. + /// public TSource Source { get; } = source; + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(TransformedItemContainer left, TransformedItemContainer right) => Equals(left, right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(TransformedItemContainer left, TransformedItemContainer right) => !Equals(left, right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(TransformedItemContainer? other) { if (other is null) @@ -223,6 +284,11 @@ public bool Equals(TransformedItemContainer? other) return EqualityComparer.Default.Equals(Source, other.Source); } + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -243,6 +309,10 @@ public override bool Equals(object? obj) return Equals((TransformedItemContainer)obj); } + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() => Source is null ? 0 : EqualityComparer.Default.GetHashCode(Source); } } diff --git a/src/DynamicData/List/Internal/UnifiedChange.cs b/src/DynamicData/List/Internal/UnifiedChange.cs index 957601e7d..005631987 100644 --- a/src/DynamicData/List/Internal/UnifiedChange.cs +++ b/src/DynamicData/List/Internal/UnifiedChange.cs @@ -9,26 +9,69 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Represents the UnifiedChange value. +/// +/// The type of the T value. +/// The reason value. +/// The current value. +/// The previous value. internal readonly struct UnifiedChange(ListChangeReason reason, T current, ReactiveUI.Primitives.Optional previous) : IEquatable> where T : notnull { + /// + /// Initializes a new instance of the struct. + /// + /// The reason value. + /// The current value. public UnifiedChange(ListChangeReason reason, T current) : this(reason, current, ReactiveUI.Primitives.Optional.None) { } + /// + /// Gets the Reason value. + /// public ListChangeReason Reason { get; } = reason; + /// + /// Gets the Current value. + /// public T Current { get; } = current; + /// + /// Gets the Previous value. + /// public ReactiveUI.Primitives.Optional Previous { get; } = previous; + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator ==(in UnifiedChange left, in UnifiedChange right) => left.Equals(right); + /// + /// Executes the operator operation. + /// + /// The left value. + /// The right value. + /// The result of the operation. public static bool operator !=(in UnifiedChange left, in UnifiedChange right) => !left.Equals(right); + /// + /// Executes the Equals operation. + /// + /// The other value. + /// The result of the operation. public bool Equals(UnifiedChange other) => Reason == other.Reason && EqualityComparer.Default.Equals(Current, other.Current) && Previous.Equals(other.Previous); + /// + /// Executes the Equals operation. + /// + /// The obj value. + /// The result of the operation. public override bool Equals(object? obj) { if (obj is null) @@ -39,6 +82,10 @@ public override bool Equals(object? obj) return obj is UnifiedChange unifiedChange && Equals(unifiedChange); } + /// + /// Executes the GetHashCode operation. + /// + /// The result of the operation. public override int GetHashCode() { unchecked @@ -50,5 +97,9 @@ public override int GetHashCode() } } + /// + /// Executes the ToString operation. + /// + /// The result of the operation. public override string ToString() => $"Reason: {Reason}, Current: {Current}, Previous: {Previous}"; } diff --git a/src/DynamicData/List/Internal/Virtualiser.cs b/src/DynamicData/List/Internal/Virtualiser.cs index 1e282acd0..ca0789680 100644 --- a/src/DynamicData/List/Internal/Virtualiser.cs +++ b/src/DynamicData/List/Internal/Virtualiser.cs @@ -9,13 +9,29 @@ namespace DynamicData.Reactive.List.Internal; namespace DynamicData.List.Internal; #endif +/// +/// Provides members for the Virtualiser class. +/// +/// The type of the T value. +/// The source value. +/// The requests value. internal sealed class Virtualiser(IObservable> source, IObservable requests) where T : notnull { + /// + /// The _requests field. + /// private readonly IObservable _requests = requests ?? throw new ArgumentNullException(nameof(requests)); + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -40,6 +56,13 @@ public IObservable> Run() => Observable.Create new VirtualChangeSet(changes, new VirtualResponse(virtualised.Count, parameters.StartIndex, all.Count))).SubscribeSafe(observer); }); + /// + /// Executes the CheckParamsAndVirtualise operation. + /// + /// The all value. + /// The virtualised value. + /// The request value. + /// The result of the operation. private static IChangeSet? CheckParamsAndVirtualise(IList all, ChangeAwareList virtualised, IVirtualRequest? request) { if (request is null || request.StartIndex < 0 || request.Size < 1) @@ -50,6 +73,14 @@ public IObservable> Run() => Observable.Create + /// Executes the Virtualise operation. + ///
+ /// The all value. + /// The virtualised value. + /// The request value. + /// The changeSet value. + /// The result of the operation. private static IChangeSet Virtualise(IList all, ChangeAwareList virtualised, IVirtualRequest request, IChangeSet? changeSet = null) { if (changeSet is not null) diff --git a/src/DynamicData/List/ItemChange.cs b/src/DynamicData/List/ItemChange.cs index 50f59adfa..3ddf64a5a 100644 --- a/src/DynamicData/List/ItemChange.cs +++ b/src/DynamicData/List/ItemChange.cs @@ -22,7 +22,7 @@ namespace DynamicData; public static readonly ItemChange Empty; /// - /// Initializes a new instance of the struct. + /// Initializes a new instance of the struct. /// /// The reason. /// The current. diff --git a/src/DynamicData/List/Linq/AddKeyEnumerator.cs b/src/DynamicData/List/Linq/AddKeyEnumerator.cs index 5792e7604..bf8135839 100644 --- a/src/DynamicData/List/Linq/AddKeyEnumerator.cs +++ b/src/DynamicData/List/Linq/AddKeyEnumerator.cs @@ -9,19 +9,32 @@ namespace DynamicData.Reactive.List.Linq; namespace DynamicData.List.Linq; #endif +/// +/// Provides members for the AddKeyEnumerator class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The keySelector value. internal sealed class AddKeyEnumerator(IChangeSet source, Func keySelector) : IEnumerable> where TObject : notnull where TKey : notnull { + /// + /// The _keySelector field. + /// private readonly Func _keySelector = keySelector ?? throw new ArgumentNullException(nameof(keySelector)); + /// + /// The _source field. + /// private readonly IChangeSet _source = source ?? throw new ArgumentNullException(nameof(source)); /// /// Returns an enumerator that iterates through the collection. /// /// - /// A that can be used to iterate through the collection. + /// A IEnumerator<T> that can be used to iterate through the collection. /// public IEnumerator> GetEnumerator() { @@ -106,5 +119,9 @@ public IEnumerator> GetEnumerator() } } + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/List/Linq/ItemChangeEnumerator.cs b/src/DynamicData/List/Linq/ItemChangeEnumerator.cs index bf65469f4..e9be3c55e 100644 --- a/src/DynamicData/List/Linq/ItemChangeEnumerator.cs +++ b/src/DynamicData/List/Linq/ItemChangeEnumerator.cs @@ -9,9 +9,18 @@ namespace DynamicData.Reactive.List.Linq; namespace DynamicData.List.Linq; #endif +/// +/// Provides members for the ItemChangeEnumerator class. +/// +/// The type of the T value. +/// The changeSet value. internal sealed class ItemChangeEnumerator(IChangeSet changeSet) : IEnumerable> where T : notnull { + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. public IEnumerator> GetEnumerator() { var lastKnownIndex = 0; @@ -51,5 +60,9 @@ public IEnumerator> GetEnumerator() } } + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/List/Linq/Reverser.cs b/src/DynamicData/List/Linq/Reverser.cs index 17bdabf42..9c02426a1 100644 --- a/src/DynamicData/List/Linq/Reverser.cs +++ b/src/DynamicData/List/Linq/Reverser.cs @@ -9,11 +9,23 @@ namespace DynamicData.Reactive.List.Linq; namespace DynamicData.List.Linq; #endif +/// +/// Provides members for the Reverser class. +/// +/// The type of the T value. internal sealed class Reverser where T : notnull { + /// + /// The _length field. + /// private int _length; + /// + /// Executes the Reverse operation. + /// + /// The changes value. + /// The result of the operation. public IEnumerable> Reverse(IChangeSet changes) { foreach (var change in changes) diff --git a/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs b/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs index 4421c38c2..30aed895a 100644 --- a/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs +++ b/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs @@ -16,9 +16,18 @@ namespace DynamicData.Reactive.List.Linq; namespace DynamicData.List.Linq; #endif +/// +/// Provides members for the UnifiedChangeEnumerator class. +/// +/// The type of the T value. +/// The changeSet value. internal sealed class UnifiedChangeEnumerator(IChangeSet changeSet) : IEnumerable> where T : notnull { + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. public IEnumerator> GetEnumerator() { foreach (var change in changeSet) @@ -53,5 +62,9 @@ public IEnumerator> GetEnumerator() } } + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs b/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs index e4f10b276..625b8b76c 100644 --- a/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs +++ b/src/DynamicData/List/Linq/WithoutIndexEnumerator.cs @@ -14,9 +14,14 @@ namespace DynamicData.List.Linq; /// Otherwise these operators could break subsequent operators when the subsequent operator relies on the index. ///
/// The type of the item. +/// The changeSet value. internal sealed class WithoutIndexEnumerator(IEnumerable> changeSet) : IEnumerable> where T : notnull { + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. public IEnumerator> GetEnumerator() { foreach (var change in changeSet) @@ -38,5 +43,9 @@ public IEnumerator> GetEnumerator() } } + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/List/ListEx.cs b/src/DynamicData/List/ListEx.cs index aaac1eaa9..b0f59a197 100644 --- a/src/DynamicData/List/ListEx.cs +++ b/src/DynamicData/List/ListEx.cs @@ -1,646 +1,661 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -// ReSharper disable once CheckNamespace -#if REACTIVE_SHIM -namespace DynamicData.Reactive; -#else -namespace DynamicData; +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +// ReSharper disable once CheckNamespace +#if REACTIVE_SHIM +namespace DynamicData.Reactive; +#else +namespace DynamicData; #endif - -/// -/// Extensions to help with maintenance of a list. -/// -public static class ListEx -{ - /// - /// Adds the items to the specified list. - /// - /// The type of the item. - /// The source. - /// The items. - /// - /// source - /// or - /// items. - /// - public static void Add(this IList source, IEnumerable items) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(items); - - items.ForEach(source.Add); - } - - /// - /// Adds the range if a negative is specified, otherwise the range is added at the end of the list. - /// - /// The type of the item. - /// The source. - /// The items. - /// The index. - public static void AddOrInsertRange(this IList source, IEnumerable items, int index) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(items); - - switch (source) - { - case List list when index >= 0: - list.InsertRange(index, items); - break; - case List list: - list.AddRange(items); - break; - case IExtendedList extendedList when index >= 0: - extendedList.InsertRange(items, index); - break; - case IExtendedList extendedList: - extendedList.AddRange(items); - break; - default: - { - if (index >= 0) - { - // TODO: Why the hell reverse? Surely there must be as reason otherwise I would not have done it. - items.Reverse().ForEach(t => source.Insert(index, t)); - } - else - { - items.ForEach(source.Add); - } - - break; - } - } - } - - /// - /// Adds the range to the source list. - /// - /// The type of the item. - /// The source. - /// The items. - /// - /// source - /// or - /// items. - /// - public static void AddRange(this IList source, IEnumerable items) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(items); - - switch (source) - { - case List list: - list.AddRange(items); - break; - case IExtendedList extendedList: - extendedList.AddRange(items); - break; - default: - foreach (var t in items) - source.Add(t); - break; - } - } - - /// - /// Adds the range to the list. The starting range is at the specified index. - /// - /// The type of the item. - /// The source. - /// The items. - /// The index. - public static void AddRange(this IList source, IEnumerable items, int index) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(items); - - switch (source) - { - case List list: - list.InsertRange(index, items); - break; - case IExtendedList list: - list.InsertRange(items, index); - break; - default: - items.ForEach(source.Add); - break; - } - } - - /// - /// Performs a binary search on the specified collection. - /// - /// The type of the item. - /// The list to be searched. - /// The value to search for. - /// The index of the specified value in the specified array, if value is found; otherwise, a negative number. - public static int BinarySearch(this IList list, TItem value) => BinarySearch(list, value, Comparer.Default); - - /// - /// Performs a binary search on the specified collection. - /// - /// The type of the item. - /// The list to be searched. - /// The value to search for. - /// The comparer that is used to compare the value with the list items. - /// The index of the specified value in the specified array, if value is found; otherwise, a negative number. - public static int BinarySearch(this IList list, TItem value, IComparer comparer) - { - ArgumentExceptionHelper.ThrowIfNull(comparer); - - return list.BinarySearch(value, comparer.Compare); - } - - /// - /// Performs a binary search on the specified collection. - /// Thanks to https://stackoverflow.com/questions/967047/how-to-perform-a-binary-search-on-ilistt. - /// - /// The type of the item. - /// The type of the searched item. - /// The list to be searched. - /// The value to search for. - /// The comparer that is used to compare the value with the list items. - /// The index of the specified value in the specified array, if value is found; otherwise, a negative number. - public static int BinarySearch(this IList list, TSearch value, Func comparer) - { - ArgumentExceptionHelper.ThrowIfNull(list); - ArgumentExceptionHelper.ThrowIfNull(comparer); - - var lower = 0; - var upper = list.Count - 1; - - while (lower <= upper) - { - var middle = lower + ((upper - lower) / 2); - var comparisonResult = comparer(value, list[middle]); - if (comparisonResult < 0) - { - upper = middle - 1; - } - else if (comparisonResult > 0) - { - lower = middle + 1; - } - else - { - return middle; - } - } - - return ~lower; - } - - /// - /// Clones the list from the specified change set. - /// - /// The type of the item. - /// The source. - /// The changes. - /// - /// source - /// or - /// changes. - /// - public static void Clone(this IList source, IChangeSet changes) - where T : notnull => Clone(source, changes, null); - - /// - /// Clones the list from the specified change set. - /// - /// The type of the item. - /// The source. - /// The changes. - /// An equality comparer to match items in the changes. - /// - /// source - /// or - /// changes. - /// - public static void Clone(this IList source, IChangeSet changes, IEqualityComparer? equalityComparer) - where T : notnull => Clone(source, (IEnumerable>)changes, equalityComparer); - - /// - /// Clones the list from the specified enumerable of changes. - /// - /// The type of the item. - /// The source. - /// The changes. - /// An equality comparer to match items in the changes. - /// - /// source - /// or - /// changes. - /// - public static void Clone(this IList source, IEnumerable> changes, IEqualityComparer? equalityComparer) - where T : notnull - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(changes); - - foreach (var item in changes) - { - Clone(source, item, equalityComparer ?? EqualityComparer.Default); - } - } - - /// - /// Finds the index of the current item using the specified equality comparer. - /// - /// The type of the item. - /// The source enumerable. - /// The item to get the index of. - /// The index. - public static int IndexOf(this IEnumerable source, T item) => IndexOf(source, item, EqualityComparer.Default); - - /// - /// Finds the index of the current item using the specified equality comparer. - /// - /// The type of the item. - /// The source enumerable. - /// The item to get the index of. - /// Use to determine object equality. - /// The index. - public static int IndexOf(this IEnumerable source, T item, IEqualityComparer equalityComparer) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(equalityComparer); - - var i = 0; - foreach (var candidate in source) - { - if (equalityComparer.Equals(item, candidate)) - { - return i; - } - - i++; - } - - return -1; - } - - /// - /// Lookups the item using the specified comparer. If matched, the item's index is also returned. - /// - /// The type of the item. - /// The source. - /// The item. - /// The equality comparer. - /// The index of the item if available. - public static ReactiveUI.Primitives.Optional> IndexOfOptional(this IEnumerable source, T item, IEqualityComparer? equalityComparer = null) - { - var comparer = equalityComparer ?? EqualityComparer.Default; - var index = source.IndexOf(item, comparer); - return index < 0 ? ReactiveUI.Primitives.Optional>.None : new ItemWithIndex(item, index); - } - - /// - /// Removes the items from the specified list. - /// - /// The type of the item. - /// The source. - /// The items. - /// - /// source - /// or - /// items. - /// - public static void Remove(this IList source, IEnumerable items) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(items); - - items.ForEach(t => source.Remove(t)); - } - - /// - /// Removes many items from the collection in an optimal way. - /// - /// The type of the item. - /// The source. - /// The items to remove. - public static void RemoveMany(this IList source, IEnumerable itemsToRemove) - { - /* - This may seem OTT but for large sets of data where there are many removes scattered - across the source collection IndexOf lookups can result in very slow updates - (especially for subsequent operators) - */ - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(itemsToRemove); - - var toRemoveArray = itemsToRemove.AsArray(); - - // match all indexes and and remove in reverse as it is more efficient - var toRemove = source.IndexOfMany(toRemoveArray).OrderByDescending(x => x.Index).ToArray(); - - // if there are duplicates, it could be that an item exists in the - // source collection more than once - in that case the fast remove - // would remove each instance - var hasDuplicates = toRemove.Duplicates(t => t.Item).Any(); - - if (hasDuplicates) - { - // Slow remove but safe - toRemoveArray.ForEach(t => source.Remove(t)); - } - else - { - // Fast remove because we know the index of all and we remove in order - toRemove.ForEach(t => source.RemoveAt(t.Index)); - } - } - - /// - /// Replaces the specified item. - /// - /// The type of the item. - /// The source. - /// The original. - /// The value to replace with. - /// source - /// or - /// items. - public static void Replace(this IList source, T original, T replaceWith) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(original); - ArgumentExceptionHelper.ThrowIfNull(replaceWith); - - var index = source.IndexOf(original); - if (index == -1) - { - throw new ArgumentException("Cannot find index of original item. Either it does not exist in the list or the hashcode has mutated"); - } - - source[index] = replaceWith; - } - - /// - /// Replaces the specified item. - /// - /// The type of item. - /// The source. - /// The item which is to be replaced. If not in the list and argument exception will be thrown. - /// The new item. - /// The equality comparer to be used to find the original item in the list. - /// source - /// or - /// items. - public static void Replace(this IList source, T original, T replaceWith, IEqualityComparer comparer) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(original); - ArgumentExceptionHelper.ThrowIfNull(replaceWith); - ArgumentExceptionHelper.ThrowIfNull(comparer); - - var index = source.IndexOf(original); - if (index == -1) - { - throw new ArgumentException("Cannot find index of original item. Either it does not exist in the list or the hashcode has mutated"); - } - - if (comparer.Equals(source[index], replaceWith)) - { - source[index] = replaceWith; - } - } - - /// - /// Replaces the item if found, otherwise the item is added to the list. - /// - /// The type of the item. - /// The source. - /// The original. - /// The value to replace with. - public static void ReplaceOrAdd(this IList source, T original, T replaceWith) - { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(original); - ArgumentExceptionHelper.ThrowIfNull(replaceWith); - - var index = source.IndexOf(original); - if (index == -1) - { - source.Add(replaceWith); - } - else - { - source[index] = replaceWith; - } - } - - /// - /// Clears the collection if the number of items in the range is the same as the source collection. Otherwise a remove many operation is applied. - /// NB: This is because an observable change set may be a composite of multiple change sets in which case if one of them has clear operation applied it should not clear the entire result. - /// - /// The type of the item. - /// The source. - /// The change. - internal static void ClearOrRemoveMany(this IList source, Change change) - where T : notnull - { - // apply this to other operators - if (source.Count == change.Range.Count) - { - source.Clear(); - } - else - { - source.RemoveMany(change.Range); - } - } - - internal static bool MovedWithinRange(this Change source, int startIndex, int endIndex) - where T : notnull - { - if (source.Reason != ListChangeReason.Moved) - { - return false; - } - - var current = source.Item.CurrentIndex; - var previous = source.Item.PreviousIndex; - - return (current >= startIndex && current <= endIndex) || (previous >= startIndex && previous <= endIndex); - } - - private static void Clone(this IList source, Change item, IEqualityComparer equalityComparer) - where T : notnull - { - var changeAware = source as ChangeAwareList; - - switch (item.Reason) - { - case ListChangeReason.Add: - { - var change = item.Item; - var hasIndex = change.CurrentIndex >= 0; - if (hasIndex) - { - source.Insert(change.CurrentIndex, change.Current); - } - else - { - source.Add(change.Current); - } - - break; - } - - case ListChangeReason.AddRange: - { - source.AddOrInsertRange(item.Range, item.Range.Index); - break; - } - - case ListChangeReason.Clear: - { - source.ClearOrRemoveMany(item); - break; - } - - case ListChangeReason.Replace: - { - var change = item.Item; - if (change.CurrentIndex >= 0 && change.CurrentIndex == change.PreviousIndex) - { - source[change.CurrentIndex] = change.Current; - } - else - { - if (change.PreviousIndex == -1) - { - source.Remove(change.Previous.Value); - } - else - { - // is this best? or replace + move? - source.RemoveAt(change.PreviousIndex); - } - - if (change.CurrentIndex == -1) - { - source.Add(change.Current); - } - else - { - source.Insert(change.CurrentIndex, change.Current); - } - } - - break; - } - - case ListChangeReason.Refresh: - { - if (changeAware is not null) - { - changeAware.RefreshAt(item.Item.CurrentIndex); - } - else - { - source.RemoveAt(item.Item.CurrentIndex); - source.Insert(item.Item.CurrentIndex, item.Item.Current); - } - - break; - } - - case ListChangeReason.Remove: - { - var change = item.Item; - var hasIndex = change.CurrentIndex >= 0; - if (hasIndex) - { - source.RemoveAt(change.CurrentIndex); - } - else - { - var index = source.IndexOf(change.Current, equalityComparer); - if (index > -1) - { - source.RemoveAt(index); - } - } - - break; - } - - case ListChangeReason.RemoveRange: - { - // ignore this case because WhereReasonsAre removes the index [in which case call RemoveMany] - //// if (item.Range.Index < 0) - //// throw new UnspecifiedIndexException("ListChangeReason.RemoveRange should not have an index specified index"); - if (item.Range.Index >= 0 && (source is IExtendedList || source is List)) - { - source.RemoveRange(item.Range.Index, item.Range.Count); - } - else - { - source.RemoveMany(item.Range); - } - - break; - } - - case ListChangeReason.Moved: - { - var change = item.Item; - var hasIndex = change.CurrentIndex >= 0; - if (!hasIndex) - { - throw new UnspecifiedIndexException("Cannot move as an index was not specified"); - } - - if (source is IExtendedList extendedList) - { - extendedList.Move(change.PreviousIndex, change.CurrentIndex); - } - else if (source is ObservableCollection observableCollection) - { - observableCollection.Move(change.PreviousIndex, change.CurrentIndex); - } - else - { - // check this works whatever the index is - source.RemoveAt(change.PreviousIndex); - source.Insert(change.CurrentIndex, change.Current); - } - - break; - } - } - } - - /// - /// Removes the number of items, starting at the specified index. - /// - /// The type of the item. - /// The source. - /// The index. - /// The count. - /// Cannot remove range. - private static void RemoveRange(this IList source, int index, int count) - { - ArgumentExceptionHelper.ThrowIfNull(source); - - switch (source) - { - case List list: - list.RemoveRange(index, count); - break; - case IExtendedList list: - list.RemoveRange(index, count); - break; - default: - throw new NotSupportedException($"Cannot remove range from {source.GetType().FullName}"); - } - } -} + +/// +/// Extensions to help with maintenance of a list. +/// +public static class ListEx +{ + /// + /// Adds the items to the specified list. + /// + /// The type of the item. + /// The source. + /// The items. + /// + /// source + /// or + /// items. + /// + public static void Add(this IList source, IEnumerable items) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); + + items.ForEach(source.Add); + } + + /// + /// Adds the range if a negative is specified, otherwise the range is added at the end of the list. + /// + /// The type of the item. + /// The source. + /// The items. + /// The index. + public static void AddOrInsertRange(this IList source, IEnumerable items, int index) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); + + switch (source) + { + case List list when index >= 0: + list.InsertRange(index, items); + break; + case List list: + list.AddRange(items); + break; + case IExtendedList extendedList when index >= 0: + extendedList.InsertRange(items, index); + break; + case IExtendedList extendedList: + extendedList.AddRange(items); + break; + default: + { + if (index >= 0) + { + // TODO: Why the hell reverse? Surely there must be as reason otherwise I would not have done it. + items.Reverse().ForEach(t => source.Insert(index, t)); + } + else + { + items.ForEach(source.Add); + } + + break; + } + } + } + + /// + /// Adds the range to the source list. + /// + /// The type of the item. + /// The source. + /// The items. + /// + /// source + /// or + /// items. + /// + public static void AddRange(this IList source, IEnumerable items) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); + + switch (source) + { + case List list: + list.AddRange(items); + break; + case IExtendedList extendedList: + extendedList.AddRange(items); + break; + default: + foreach (var t in items) + source.Add(t); + break; + } + } + + /// + /// Adds the range to the list. The starting range is at the specified index. + /// + /// The type of the item. + /// The source. + /// The items. + /// The index. + public static void AddRange(this IList source, IEnumerable items, int index) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); + + switch (source) + { + case List list: + list.InsertRange(index, items); + break; + case IExtendedList list: + list.InsertRange(items, index); + break; + default: + items.ForEach(source.Add); + break; + } + } + + /// + /// Performs a binary search on the specified collection. + /// + /// The type of the item. + /// The list to be searched. + /// The value to search for. + /// The index of the specified value in the specified array, if value is found; otherwise, a negative number. + public static int BinarySearch(this IList list, TItem value) => BinarySearch(list, value, Comparer.Default); + + /// + /// Performs a binary search on the specified collection. + /// + /// The type of the item. + /// The list to be searched. + /// The value to search for. + /// The comparer that is used to compare the value with the list items. + /// The index of the specified value in the specified array, if value is found; otherwise, a negative number. + public static int BinarySearch(this IList list, TItem value, IComparer comparer) + { + ArgumentExceptionHelper.ThrowIfNull(comparer); + + return list.BinarySearch(value, comparer.Compare); + } + + /// + /// Performs a binary search on the specified collection. + /// Thanks to https://stackoverflow.com/questions/967047/how-to-perform-a-binary-search-on-ilistt. + /// + /// The type of the item. + /// The type of the searched item. + /// The list to be searched. + /// The value to search for. + /// The comparer that is used to compare the value with the list items. + /// The index of the specified value in the specified array, if value is found; otherwise, a negative number. + public static int BinarySearch(this IList list, TSearch value, Func comparer) + { + ArgumentExceptionHelper.ThrowIfNull(list); + ArgumentExceptionHelper.ThrowIfNull(comparer); + + var lower = 0; + var upper = list.Count - 1; + + while (lower <= upper) + { + var middle = lower + ((upper - lower) / 2); + var comparisonResult = comparer(value, list[middle]); + if (comparisonResult < 0) + { + upper = middle - 1; + } + else if (comparisonResult > 0) + { + lower = middle + 1; + } + else + { + return middle; + } + } + + return ~lower; + } + + /// + /// Clones the list from the specified change set. + /// + /// The type of the item. + /// The source. + /// The changes. + /// + /// source + /// or + /// changes. + /// + public static void Clone(this IList source, IChangeSet changes) + where T : notnull => Clone(source, changes, null); + + /// + /// Clones the list from the specified change set. + /// + /// The type of the item. + /// The source. + /// The changes. + /// An equality comparer to match items in the changes. + /// + /// source + /// or + /// changes. + /// + public static void Clone(this IList source, IChangeSet changes, IEqualityComparer? equalityComparer) + where T : notnull => Clone(source, (IEnumerable>)changes, equalityComparer); + + /// + /// Clones the list from the specified enumerable of changes. + /// + /// The type of the item. + /// The source. + /// The changes. + /// An equality comparer to match items in the changes. + /// + /// source + /// or + /// changes. + /// + public static void Clone(this IList source, IEnumerable> changes, IEqualityComparer? equalityComparer) + where T : notnull + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(changes); + + foreach (var item in changes) + { + Clone(source, item, equalityComparer ?? EqualityComparer.Default); + } + } + + /// + /// Finds the index of the current item using the specified equality comparer. + /// + /// The type of the item. + /// The source enumerable. + /// The item to get the index of. + /// The index. + public static int IndexOf(this IEnumerable source, T item) => IndexOf(source, item, EqualityComparer.Default); + + /// + /// Finds the index of the current item using the specified equality comparer. + /// + /// The type of the item. + /// The source enumerable. + /// The item to get the index of. + /// Use to determine object equality. + /// The index. + public static int IndexOf(this IEnumerable source, T item, IEqualityComparer equalityComparer) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(equalityComparer); + + var i = 0; + foreach (var candidate in source) + { + if (equalityComparer.Equals(item, candidate)) + { + return i; + } + + i++; + } + + return -1; + } + + /// + /// Lookups the item using the specified comparer. If matched, the item's index is also returned. + /// + /// The type of the item. + /// The source. + /// The item. + /// The equality comparer. + /// The index of the item if available. + public static ReactiveUI.Primitives.Optional> IndexOfOptional(this IEnumerable source, T item, IEqualityComparer? equalityComparer = null) + { + var comparer = equalityComparer ?? EqualityComparer.Default; + var index = source.IndexOf(item, comparer); + return index < 0 ? ReactiveUI.Primitives.Optional>.None : new ItemWithIndex(item, index); + } + + /// + /// Removes the items from the specified list. + /// + /// The type of the item. + /// The source. + /// The items. + /// + /// source + /// or + /// items. + /// + public static void Remove(this IList source, IEnumerable items) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(items); + + items.ForEach(t => source.Remove(t)); + } + + /// + /// Removes many items from the collection in an optimal way. + /// + /// The type of the item. + /// The source. + /// The items to remove. + public static void RemoveMany(this IList source, IEnumerable itemsToRemove) + { + /* + This may seem OTT but for large sets of data where there are many removes scattered + across the source collection IndexOf lookups can result in very slow updates + (especially for subsequent operators) + */ + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(itemsToRemove); + + var toRemoveArray = itemsToRemove.AsArray(); + + // match all indexes and and remove in reverse as it is more efficient + var toRemove = source.IndexOfMany(toRemoveArray).OrderByDescending(x => x.Index).ToArray(); + + // if there are duplicates, it could be that an item exists in the + // source collection more than once - in that case the fast remove + // would remove each instance + var hasDuplicates = toRemove.Duplicates(t => t.Item).Any(); + + if (hasDuplicates) + { + // Slow remove but safe + toRemoveArray.ForEach(t => source.Remove(t)); + } + else + { + // Fast remove because we know the index of all and we remove in order + toRemove.ForEach(t => source.RemoveAt(t.Index)); + } + } + + /// + /// Replaces the specified item. + /// + /// The type of the item. + /// The source. + /// The original. + /// The value to replace with. + /// source + /// or + /// items. + public static void Replace(this IList source, T original, T replaceWith) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(original); + ArgumentExceptionHelper.ThrowIfNull(replaceWith); + + var index = source.IndexOf(original); + if (index == -1) + { + throw new ArgumentException("Cannot find index of original item. Either it does not exist in the list or the hashcode has mutated"); + } + + source[index] = replaceWith; + } + + /// + /// Replaces the specified item. + /// + /// The type of item. + /// The source. + /// The item which is to be replaced. If not in the list and argument exception will be thrown. + /// The new item. + /// The equality comparer to be used to find the original item in the list. + /// source + /// or + /// items. + public static void Replace(this IList source, T original, T replaceWith, IEqualityComparer comparer) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(original); + ArgumentExceptionHelper.ThrowIfNull(replaceWith); + ArgumentExceptionHelper.ThrowIfNull(comparer); + + var index = source.IndexOf(original); + if (index == -1) + { + throw new ArgumentException("Cannot find index of original item. Either it does not exist in the list or the hashcode has mutated"); + } + + if (comparer.Equals(source[index], replaceWith)) + { + source[index] = replaceWith; + } + } + + /// + /// Replaces the item if found, otherwise the item is added to the list. + /// + /// The type of the item. + /// The source. + /// The original. + /// The value to replace with. + public static void ReplaceOrAdd(this IList source, T original, T replaceWith) + { + ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentExceptionHelper.ThrowIfNull(original); + ArgumentExceptionHelper.ThrowIfNull(replaceWith); + + var index = source.IndexOf(original); + if (index == -1) + { + source.Add(replaceWith); + } + else + { + source[index] = replaceWith; + } + } + + /// + /// Clears the collection if the number of items in the range is the same as the source collection. Otherwise a remove many operation is applied. + /// NB: This is because an observable change set may be a composite of multiple change sets in which case if one of them has clear operation applied it should not clear the entire result. + /// + /// The type of the item. + /// The source. + /// The change. + internal static void ClearOrRemoveMany(this IList source, Change change) + where T : notnull + { + // apply this to other operators + if (source.Count == change.Range.Count) + { + source.Clear(); + } + else + { + source.RemoveMany(change.Range); + } + } + + /// + /// Executes the MovedWithinRange operation. + /// + /// The type of the T value. + /// The source value. + /// The startIndex value. + /// The endIndex value. + /// The result of the operation. + internal static bool MovedWithinRange(this Change source, int startIndex, int endIndex) + where T : notnull + { + if (source.Reason != ListChangeReason.Moved) + { + return false; + } + + var current = source.Item.CurrentIndex; + var previous = source.Item.PreviousIndex; + + return (current >= startIndex && current <= endIndex) || (previous >= startIndex && previous <= endIndex); + } + + /// + /// Executes the Clone operation. + /// + /// The type of the T value. + /// The source value. + /// The item value. + /// The equalityComparer value. + private static void Clone(this IList source, Change item, IEqualityComparer equalityComparer) + where T : notnull + { + var changeAware = source as ChangeAwareList; + + switch (item.Reason) + { + case ListChangeReason.Add: + { + var change = item.Item; + var hasIndex = change.CurrentIndex >= 0; + if (hasIndex) + { + source.Insert(change.CurrentIndex, change.Current); + } + else + { + source.Add(change.Current); + } + + break; + } + + case ListChangeReason.AddRange: + { + source.AddOrInsertRange(item.Range, item.Range.Index); + break; + } + + case ListChangeReason.Clear: + { + source.ClearOrRemoveMany(item); + break; + } + + case ListChangeReason.Replace: + { + var change = item.Item; + if (change.CurrentIndex >= 0 && change.CurrentIndex == change.PreviousIndex) + { + source[change.CurrentIndex] = change.Current; + } + else + { + if (change.PreviousIndex == -1) + { + source.Remove(change.Previous.Value); + } + else + { + // is this best? or replace + move? + source.RemoveAt(change.PreviousIndex); + } + + if (change.CurrentIndex == -1) + { + source.Add(change.Current); + } + else + { + source.Insert(change.CurrentIndex, change.Current); + } + } + + break; + } + + case ListChangeReason.Refresh: + { + if (changeAware is not null) + { + changeAware.RefreshAt(item.Item.CurrentIndex); + } + else + { + source.RemoveAt(item.Item.CurrentIndex); + source.Insert(item.Item.CurrentIndex, item.Item.Current); + } + + break; + } + + case ListChangeReason.Remove: + { + var change = item.Item; + var hasIndex = change.CurrentIndex >= 0; + if (hasIndex) + { + source.RemoveAt(change.CurrentIndex); + } + else + { + var index = source.IndexOf(change.Current, equalityComparer); + if (index > -1) + { + source.RemoveAt(index); + } + } + + break; + } + + case ListChangeReason.RemoveRange: + { + // ignore this case because WhereReasonsAre removes the index [in which case call RemoveMany] + //// if (item.Range.Index < 0) + //// throw new UnspecifiedIndexException("ListChangeReason.RemoveRange should not have an index specified index"); + if (item.Range.Index >= 0 && (source is IExtendedList || source is List)) + { + source.RemoveRange(item.Range.Index, item.Range.Count); + } + else + { + source.RemoveMany(item.Range); + } + + break; + } + + case ListChangeReason.Moved: + { + var change = item.Item; + var hasIndex = change.CurrentIndex >= 0; + if (!hasIndex) + { + throw new UnspecifiedIndexException("Cannot move as an index was not specified"); + } + + if (source is IExtendedList extendedList) + { + extendedList.Move(change.PreviousIndex, change.CurrentIndex); + } + else if (source is ObservableCollection observableCollection) + { + observableCollection.Move(change.PreviousIndex, change.CurrentIndex); + } + else + { + // check this works whatever the index is + source.RemoveAt(change.PreviousIndex); + source.Insert(change.CurrentIndex, change.Current); + } + + break; + } + } + } + + /// + /// Removes the number of items, starting at the specified index. + /// + /// The type of the item. + /// The source. + /// The index. + /// The count. + /// Cannot remove range. + private static void RemoveRange(this IList source, int index, int count) + { + ArgumentExceptionHelper.ThrowIfNull(source); + + switch (source) + { + case List list: + list.RemoveRange(index, count); + break; + case IExtendedList list: + list.RemoveRange(index, count); + break; + default: + throw new NotSupportedException($"Cannot remove range from {source.GetType().FullName}"); + } + } +} diff --git a/src/DynamicData/List/ObservableListEx.Adapt.cs b/src/DynamicData/List/ObservableListEx.Adapt.cs index 40bdc5291..c33f3960e 100644 --- a/src/DynamicData/List/ObservableListEx.Adapt.cs +++ b/src/DynamicData/List/ObservableListEx.Adapt.cs @@ -22,21 +22,21 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Injects a side effect into a changeset stream via an . + /// Injects a side effect into a changeset stream via an IChangeSetAdaptor<T>. /// The adaptor's Adapt method is invoked for each changeset before it is forwarded downstream unchanged. /// /// The type of items in the list. - /// The source to observe and adapt. - /// The adaptor whose Adapt method is invoked for each changeset. + /// The source IObservable<IChangeSet<T>> to observe and adapt. + /// The IChangeSetAdaptor<T> adaptor whose Adapt method is invoked for each changeset. /// A list changeset stream identical to the source, with the adaptor side effect applied. /// or is . /// /// - /// This is the primary extension point for custom UI binding adaptors (e.g., + /// This is the primary extension point for custom UI binding adaptors (e.g., Bind<T>(IObservable<IChangeSet<T>>, IObservableCollection<T>, BindingOptions) /// delegates to this operator). If the adaptor throws, the exception propagates downstream as OnError. /// /// - /// + /// Bind<T>(IObservable<IChangeSet<T>>, IObservableCollection<T>, BindingOptions) public static IObservable> Adapt(this IObservable> source, IChangeSetAdaptor adaptor) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.AddKey.cs b/src/DynamicData/List/ObservableListEx.AddKey.cs index 4a1caa523..c2e894bd6 100644 --- a/src/DynamicData/List/ObservableListEx.AddKey.cs +++ b/src/DynamicData/List/ObservableListEx.AddKey.cs @@ -26,9 +26,9 @@ public static partial class ObservableListEx ///
/// The type of items in the list. /// The type of the key. - /// The source to add keys to, converting to a cache changeset. - /// A function to extract a unique key from each item. - /// A cache changeset stream with keyed items. + /// The source IObservable<IChangeSet<TObject>> to add keys to, converting to a cache changeset. + /// A Func<T, TResult> function to extract a unique key from each item. + /// A cache IObservable<IChangeSet<TObject, TKey>> changeset stream with keyed items. /// or is . /// /// @@ -36,7 +36,7 @@ public static partial class ObservableListEx /// Use this when you need to transition from list-based pipelines to cache-based operators (Filter by key, Join, Group, etc.). /// /// - /// + /// ObservableCacheEx.RemoveKey<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>) public static IObservable> AddKey(this IObservable> source, Func keySelector) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/List/ObservableListEx.And.cs b/src/DynamicData/List/ObservableListEx.And.cs index 140577f76..764233ad9 100644 --- a/src/DynamicData/List/ObservableListEx.And.cs +++ b/src/DynamicData/List/ObservableListEx.And.cs @@ -26,8 +26,8 @@ public static partial class ObservableListEx /// Only items present in ALL sources appear in the result. ///
/// The type of items in the lists. - /// The first source to intersect. - /// The additional changeset streams to intersect with. + /// The first source IObservable<IChangeSet<T>> to intersect. + /// The additional IObservable<IChangeSet<T>> changeset streams to intersect with. /// A list changeset stream containing items that exist in every source. /// is . /// @@ -45,10 +45,10 @@ public static partial class ObservableListEx /// /// Worth noting: Item identity uses object equality, not position. Duplicate items in a single source are reference-counted independently. /// - /// - /// - /// - /// + /// Or<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// Except<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// Xor<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// ObservableCacheEx.And<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IChangeSet<TObject, TKey>>[]) public static IObservable> And(this IObservable> source, params IObservable>[] others) where T : notnull { @@ -57,38 +57,54 @@ public static IObservable> And(this IObservable> return source.Combine(CombineOperator.And, others); } - /// - /// A of changeset streams to intersect. + /// + /// Provides an overload of Combine for the supplied arguments. + /// + /// The type of the T value. + /// A ICollection<T> of changeset streams to intersect. + /// The resulting observable sequence. /// - /// + /// This overload follows the same core behavior as the related overload. /// This overload accepts a pre-built collection of sources instead of a params array. /// public static IObservable> And(this ICollection>> sources) where T : notnull => sources.Combine(CombineOperator.And); - /// - /// An of changeset streams. Sources can be added or removed dynamically. + /// + /// Provides an overload of Combine for the supplied arguments. + /// + /// The type of the T value. + /// An IObservableList<T> of changeset streams. Sources can be added or removed dynamically. + /// The resulting observable sequence. /// - /// + /// This overload follows the same core behavior as the related overload. /// This overload supports dynamic source management: adding or removing changeset streams from the observable list triggers re-evaluation. /// public static IObservable> And(this IObservableList>> sources) where T : notnull => sources.Combine(CombineOperator.And); - /// - /// An of . Each inner list's changes are connected automatically. + /// + /// Provides an overload of Combine for the supplied arguments. + /// + /// The type of the T value. + /// An IObservableList<IObservableList<T>> of IObservableList<IObservableList<T>>. Each inner list's changes are connected automatically. + /// The resulting observable sequence. /// - /// - /// This overload accepts instances directly, calling Connect() internally. + /// This overload follows the same core behavior as the related overload. + /// This overload accepts IObservableList<T> instances directly, calling Connect() internally. /// public static IObservable> And(this IObservableList> sources) where T : notnull => sources.Combine(CombineOperator.And); - /// - /// An of . Each inner list's changes are connected automatically. + /// + /// Provides an overload of Combine for the supplied arguments. + /// + /// The type of the T value. + /// An IObservableList<ISourceList<T>> of ISourceList<T>. Each inner list's changes are connected automatically. + /// The resulting observable sequence. /// - /// - /// This overload accepts instances directly, calling Connect() internally. + /// This overload follows the same core behavior as the related overload. + /// This overload accepts ISourceList<T> instances directly, calling Connect() internally. /// public static IObservable> And(this IObservableList> sources) where T : notnull => sources.Combine(CombineOperator.And); diff --git a/src/DynamicData/List/ObservableListEx.AsObservableList.cs b/src/DynamicData/List/ObservableListEx.AsObservableList.cs index 51bd3b18a..471219da6 100644 --- a/src/DynamicData/List/ObservableListEx.AsObservableList.cs +++ b/src/DynamicData/List/ObservableListEx.AsObservableList.cs @@ -22,10 +22,10 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Wraps a as a read-only , hiding mutation methods. + /// Wraps a ISourceList<T> as a read-only IObservableList<T>, hiding mutation methods. /// /// The type of items in the list. - /// The mutable source list to wrap. + /// The ISourceList<T> mutable source list to wrap. /// A read-only observable list that mirrors the source. /// is . public static IObservableList AsObservableList(this ISourceList source) @@ -37,21 +37,21 @@ public static IObservableList AsObservableList(this ISourceList source) } /// - /// Materializes a changeset stream into a read-only . + /// Materializes a changeset stream into a read-only IObservableList<T>. /// The list is kept in sync with the source stream for the lifetime of the subscription. /// /// The type of items in the list. - /// The source to materialize into a read-only list. + /// The source IObservable<IChangeSet<T>> to materialize into a read-only list. /// A read-only observable list reflecting the current state of the stream. /// is . /// /// - /// This is the primary way to multicast a changeset pipeline. Materializing once into an , + /// This is the primary way to multicast a changeset pipeline. Materializing once into an IObservableList<T>, /// then calling Connect() on the result for each downstream consumer, ensures the upstream operators are evaluated only once /// regardless of how many subscribers consume the result. /// /// - /// + /// AsObservableList<T>(ISourceList<T>) public static IObservableList AsObservableList(this IObservable> source) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs index 724d735be..40f03e7b3 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs @@ -26,7 +26,7 @@ public static partial class ObservableListEx /// changes when any property changes, causing downstream operators to re-evaluate. ///
/// The type of items, which must implement . - /// The source to monitor for property-driven refresh signals. + /// The source IObservable<IChangeSet<TObject>> to monitor for property-driven refresh signals. /// An optional buffer duration to batch multiple refresh signals into a single changeset. /// An optional throttle applied to each item's property change notifications. /// The scheduler for throttle and buffer timing. Defaults to . @@ -34,8 +34,8 @@ public static partial class ObservableListEx /// is . /// /// - /// Wraps using WhenAnyPropertyChanged() as the re-evaluator. - /// Pair with or + /// Wraps AutoRefreshOnObservable<TObject, TAny> using WhenAnyPropertyChanged() as the re-evaluator. + /// Pair with Filter<T>(IObservable<IChangeSet<T>>, Func<T, bool>) or Sort<T>(IObservable<IChangeSet<T>>, IComparer<T>, SortOptions, IObservable<Unit>?, IObservable<IComparer<T>>?, int) /// to get reactive re-evaluation on property changes. /// /// @@ -48,10 +48,10 @@ public static partial class ObservableListEx /// /// Worth noting: Each item generates a subscription. For large lists with frequent property changes, use and to reduce churn. /// - /// - /// - /// - /// + /// AutoRefresh<TObject, TProperty>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TProperty>>, TimeSpan?, TimeSpan?, IScheduler?) + /// AutoRefreshOnObservable<TObject, TAny>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<TAny>>, TimeSpan?, IScheduler?) + /// SuppressRefresh<T>(IObservable<IChangeSet<T>>) + /// ObservableCacheEx.AutoRefresh<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, TimeSpan?, TimeSpan?, IScheduler?) public static IObservable> AutoRefresh(this IObservable> source, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged { @@ -76,7 +76,15 @@ public static IObservable> AutoRefresh(this IObserv /// and emits Refresh changes when that property changes, causing downstream operators to re-evaluate. More efficient than /// the all-properties overload when only one property (of type ) affects downstream behavior. ///
- /// + /// The type of the TObject value. + /// The type of the TProperty value. + /// This overload follows the same core behavior as the related overload. + /// The source value. + /// The propertyAccessor value. + /// The changeSetBuffer value. + /// The propertyChangeThrottle value. + /// The scheduler value. + /// The resulting observable sequence. public static IObservable> AutoRefresh(this IObservable> source, Expression> propertyAccessor, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged { diff --git a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs index 75b8fd516..58658fe13 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs @@ -27,15 +27,15 @@ public static partial class ObservableListEx ///
/// The type of items in the list. /// The type emitted by the re-evaluator observable (value is ignored). - /// The source to monitor for observable-driven refresh signals. - /// A factory that, given an item, returns an observable whose emissions trigger a Refresh for that item. + /// The source IObservable<IChangeSet<TObject>> to monitor for observable-driven refresh signals. + /// A Func<T, TResult> factory that, given an item, returns an observable whose emissions trigger a Refresh for that item. /// An optional buffer duration to batch refresh signals into a single changeset. /// The for buffering. /// A list changeset stream with additional Refresh changes injected when per-item observables fire. /// or is . /// /// - /// This is the general-purpose refresh mechanism. + /// This is the general-purpose refresh mechanism. AutoRefresh<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan?, TimeSpan?, IScheduler?) /// is a convenience wrapper that uses WhenAnyPropertyChanged() as the re-evaluator. /// /// @@ -47,9 +47,9 @@ public static partial class ObservableListEx /// Re-evaluator firesThe item's current index is looked up and a Refresh change is emitted. /// /// - /// - /// - /// + /// AutoRefresh<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan?, TimeSpan?, IScheduler?) + /// SuppressRefresh<T>(IObservable<IChangeSet<T>>) + /// ObservableCacheEx.AutoRefreshOnObservable<TObject, TKey, TAny>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<TAny>>, TimeSpan?, IScheduler?) public static IObservable> AutoRefreshOnObservable(this IObservable> source, Func> reevaluator, TimeSpan? changeSetBuffer = null, IScheduler? scheduler = null) where TObject : notnull { diff --git a/src/DynamicData/List/ObservableListEx.Bind.cs b/src/DynamicData/List/ObservableListEx.Bind.cs index f00e6b79f..15b26aa0b 100644 --- a/src/DynamicData/List/ObservableListEx.Bind.cs +++ b/src/DynamicData/List/ObservableListEx.Bind.cs @@ -22,17 +22,17 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Applies changeset mutations to a target for UI data binding. + /// Applies changeset mutations to a target IObservableCollection<T> for UI data binding. /// /// The type of items in the list. - /// The source to bind to a collection. - /// The target collection to keep in sync. + /// The source IObservable<IChangeSet<T>> to bind to a collection. + /// The IObservableCollection<T> target collection to keep in sync. /// When a changeset exceeds this many changes, the collection is reset instead of applying individual changes. /// A continuation of the source changeset stream (allows further chaining). /// or is . /// /// - /// Delegates to with an internal collection adaptor. + /// Delegates to Adapt<T>(IObservable<IChangeSet<T>>, IChangeSetAdaptor<T>) with an internal collection adaptor. /// Each changeset is applied to the target collection on the calling thread. For UI binding, ensure the source is /// observed on the UI thread (e.g., via ObserveOn). /// @@ -47,11 +47,11 @@ public static partial class ObservableListEx /// RefreshDepends on the adaptor implementation. /// /// - /// - /// - /// - /// - /// + /// Bind<T>(IObservable<IChangeSet<T>>, IObservableCollection<T>, BindingOptions) + /// Bind<T>(IObservable<IChangeSet<T>>, out ReadOnlyObservableCollection<T>, int) + /// Clone<T>(IObservable<IChangeSet<T>>, IList<T>) + /// Adapt<T>(IObservable<IChangeSet<T>>, IChangeSetAdaptor<T>) + /// ObservableCacheEx.Bind<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservableCollection<TObject>, int) public static IObservable> Bind(this IObservable> source, IObservableCollection targetCollection, int resetThreshold = BindingOptions.DefaultResetThreshold) where T : notnull { @@ -72,7 +72,12 @@ public static IObservable> Bind(this IObservable> /// /// Binds the source changeset stream to , with fine-grained control over reset threshold and other behaviors. /// - /// + /// The type of the T value. + /// This overload follows the same core behavior as the related overload. + /// The source value. + /// The targetCollection value. + /// The options value. + /// The resulting observable sequence. public static IObservable> Bind(this IObservable> source, IObservableCollection targetCollection, BindingOptions options) where T : notnull { @@ -84,13 +89,18 @@ public static IObservable> Bind(this IObservable> } /// - /// Constructs a and binds the changeset stream to it. + /// Constructs a ReadOnlyObservableCollection<T> and binds the changeset stream to it. /// Use this overload when you need a read-only view (typically for UI binding) without managing the backing collection yourself. /// The created collection is returned via the output parameter. /// - /// + /// The type of the T value. + /// This overload follows the same core behavior as the related overload. + /// The source value. + /// The readOnlyObservableCollection value. + /// The resetThreshold value. + /// The resulting observable sequence. /// - /// + /// This overload follows the same core behavior as the related overload. /// The created collection is backed by an internal ObservableCollectionExtended<T>. Callers receive only the read-only wrapper. /// public static IObservable> Bind(this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, int resetThreshold = BindingOptions.DefaultResetThreshold) @@ -109,13 +119,18 @@ public static IObservable> Bind(this IObservable> } /// - /// Constructs a and binds the changeset stream to it, + /// Constructs a ReadOnlyObservableCollection<T> and binds the changeset stream to it, /// with fine-grained control over reset threshold and other behaviors. /// The created collection is returned via the output parameter. /// - /// + /// The type of the T value. + /// This overload follows the same core behavior as the related overload. + /// The source value. + /// The readOnlyObservableCollection value. + /// The options value. + /// The resulting observable sequence. /// - /// + /// This overload follows the same core behavior as the related overload. /// The created collection is backed by an internal ObservableCollectionExtended<T>. Callers receive only the read-only wrapper. /// public static IObservable> Bind(this IObservable> source, out ReadOnlyObservableCollection readOnlyObservableCollection, BindingOptions options) @@ -129,12 +144,17 @@ public static IObservable> Bind(this IObservable> readOnlyObservableCollection = result; return source.Adapt(adaptor); } - #if SUPPORTS_BINDINGLIST + /// - /// Binds the source changeset stream to a WinForms , keeping in sync. + /// Binds the source changeset stream to a WinForms BindingList<T>, keeping in sync. /// - /// + /// The type of the T value. + /// This overload follows the same core behavior as the related overload. + /// The source value. + /// The bindingList value. + /// The resetThreshold value. + /// The resulting observable sequence. public static IObservable> Bind<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IObservable> source, BindingList bindingList, int resetThreshold = BindingOptions.DefaultResetThreshold) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.BufferIf.cs b/src/DynamicData/List/ObservableListEx.BufferIf.cs index 5ceb50319..d97e8032e 100644 --- a/src/DynamicData/List/ObservableListEx.BufferIf.cs +++ b/src/DynamicData/List/ObservableListEx.BufferIf.cs @@ -21,17 +21,32 @@ namespace DynamicData; ///
public static partial class ObservableListEx { - /// + /// + /// Provides an overload of BufferIf for the supplied arguments. + /// + /// The type of the T value. + /// The source value. + /// The pauseIfTrueSelector value. + /// The scheduler value. + /// The resulting observable sequence. /// - /// + /// This overload follows the same core behavior as the related overload. /// This overload starts unpaused and has no timeout. /// public static IObservable> BufferIf(this IObservable> source, IObservable pauseIfTrueSelector, IScheduler? scheduler = null) where T : notnull => BufferIf(source, pauseIfTrueSelector, false, scheduler); - /// + /// + /// Provides an overload of BufferIf for the supplied arguments. + /// + /// The type of the T value. + /// The source value. + /// The pauseIfTrueSelector value. + /// The initialPauseState value. + /// The scheduler value. + /// The resulting observable sequence. /// - /// + /// This overload follows the same core behavior as the related overload. /// This overload allows setting the initial pause state but has no timeout. /// public static IObservable> BufferIf(this IObservable> source, IObservable pauseIfTrueSelector, bool initialPauseState, IScheduler? scheduler = null) @@ -43,9 +58,17 @@ public static IObservable> BufferIf(this IObservable + /// + /// Provides an overload of BufferIf for the supplied arguments. + /// + /// The type of the T value. + /// The source value. + /// The pauseIfTrueSelector value. + /// The timeOut value. + /// The scheduler value. + /// The resulting observable sequence. /// - /// + /// This overload follows the same core behavior as the related overload. /// This overload starts unpaused and accepts a timeout but not an explicit initial pause state. /// public static IObservable> BufferIf(this IObservable> source, IObservable pauseIfTrueSelector, TimeSpan? timeOut, IScheduler? scheduler = null) @@ -55,8 +78,8 @@ public static IObservable> BufferIf(this IObservable /// The type of items in the list. - /// The source to conditionally buffer. - /// An of that controls buffering: pauses (buffers), resumes (flushes). + /// The source IObservable<IChangeSet<T>> to conditionally buffer. + /// An IObservable<bool> of that controls buffering: pauses (buffers), resumes (flushes). /// The initial pause state. When , buffering starts immediately. /// An optional maximum duration to keep the buffer open. After this time, the buffer is flushed regardless of pause state. /// The for timeout scheduling. diff --git a/src/DynamicData/List/ObservableListEx.BufferInitial.cs b/src/DynamicData/List/ObservableListEx.BufferInitial.cs index 6fa6204d4..2db1b3e34 100644 --- a/src/DynamicData/List/ObservableListEx.BufferInitial.cs +++ b/src/DynamicData/List/ObservableListEx.BufferInitial.cs @@ -18,7 +18,7 @@ public static partial class ObservableListEx /// Buffers changesets during an initial time window, then emits a single combined changeset and passes through subsequent changes. ///
/// The type of items in the list. - /// The source to buffer during the initial loading period. + /// The source IObservable<IChangeSet<TObject>> to buffer during the initial loading period. /// The time period (measured from first emission) during which changes are buffered. /// The for timing the buffer window. /// A list changeset stream where the initial burst is combined into one changeset. @@ -28,8 +28,8 @@ public static partial class ObservableListEx /// After this initial window, subsequent changesets pass through immediately. /// /// - /// - /// + /// DeferUntilLoaded<T>(IObservable<IChangeSet<T>>) + /// FlattenBufferResult<T>(IObservable<IList<IChangeSet<T>>>) public static IObservable> BufferInitial(this IObservable> source, TimeSpan initialBuffer, IScheduler? scheduler = null) where TObject : notnull => source.DeferUntilLoaded().Publish( shared => diff --git a/src/DynamicData/List/ObservableListEx.Cast.cs b/src/DynamicData/List/ObservableListEx.Cast.cs index 0728d5210..dadbc1117 100644 --- a/src/DynamicData/List/ObservableListEx.Cast.cs +++ b/src/DynamicData/List/ObservableListEx.Cast.cs @@ -18,11 +18,11 @@ public static partial class ObservableListEx /// Casts each item in the changeset from object to using a direct cast. ///
/// The target type to cast to. - /// The source of object items. + /// The source IObservable<IChangeSet<object>> of object items. /// A list changeset stream of cast items. /// is . - /// - /// + /// Cast<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, TDestination>) + /// CastToObject<T>(IObservable<IChangeSet<T>>) public static IObservable> Cast(this IObservable> source) where TDestination : notnull { @@ -36,13 +36,13 @@ public static IObservable> Cast(this IObs ///
/// The source item type. /// The destination item type. - /// The source to cast. - /// A function to convert each item from to . + /// The source IObservable<IChangeSet<TSource>> to cast. + /// A Func<T, TResult> function to convert each item from to . /// A list changeset stream of converted items. /// or is . - /// Use this overload when type inference requires explicit specification of both source and destination types. Alternatively, call first, then the single-type-parameter overload. - /// - /// + /// Use this overload when type inference requires explicit specification of both source and destination types. Alternatively, call CastToObject<T> first, then the single-type-parameter Cast<TDestination> overload. + /// Cast<TDestination>(IObservable<IChangeSet<object>>) + /// Transform<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, TDestination>, bool) public static IObservable> Cast(this IObservable> source, Func conversionFactory) where TSource : notnull where TDestination : notnull diff --git a/src/DynamicData/List/ObservableListEx.CastToObject.cs b/src/DynamicData/List/ObservableListEx.CastToObject.cs index 0853b0961..6e0601e46 100644 --- a/src/DynamicData/List/ObservableListEx.CastToObject.cs +++ b/src/DynamicData/List/ObservableListEx.CastToObject.cs @@ -15,12 +15,12 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Casts each item in the changeset to object. Typically used before to work around type inference limitations. + /// Casts each item in the changeset to object. Typically used before Cast<TDestination>(IObservable<IChangeSet<object>>) to work around type inference limitations. /// /// The source item type (must be a reference type). - /// The source to cast to object. + /// The source IObservable<IChangeSet<T>> to cast to object. /// A list changeset stream of object items. - /// + /// Cast<TDestination>(IObservable<IChangeSet<object>>) public static IObservable> CastToObject(this IObservable> source) where T : class { diff --git a/src/DynamicData/List/ObservableListEx.Clone.cs b/src/DynamicData/List/ObservableListEx.Clone.cs index e3968e5ce..fb2742b74 100644 --- a/src/DynamicData/List/ObservableListEx.Clone.cs +++ b/src/DynamicData/List/ObservableListEx.Clone.cs @@ -25,15 +25,15 @@ public static partial class ObservableListEx /// Applies each changeset to the target list as a side effect, keeping it synchronized with the source. ///
/// The type of items in the list. - /// The source to clone. - /// The target list to clone changes into. + /// The source IObservable<IChangeSet<T>> to clone. + /// The IList<T> target list to clone changes into. /// A continuation of the source changeset stream. /// is . /// - /// Lower-level than . Uses .Clone() to apply all changeset operations directly. + /// Lower-level than Bind<T>(IObservable<IChangeSet<T>>, IObservableCollection<T>, int). Uses IList<T>.Clone() to apply all changeset operations directly. /// - /// - /// + /// Bind<T>(IObservable<IChangeSet<T>>, IObservableCollection<T>, int) + /// PopulateInto<T>(IObservable<IChangeSet<T>>, ISourceList<T>) public static IObservable> Clone(this IObservable> source, IList target) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.Combine.cs b/src/DynamicData/List/ObservableListEx.Combine.cs index b6082943e..82dd3f381 100644 --- a/src/DynamicData/List/ObservableListEx.Combine.cs +++ b/src/DynamicData/List/ObservableListEx.Combine.cs @@ -26,6 +26,13 @@ namespace DynamicData; ///
public static partial class ObservableListEx { + /// + /// Executes the Combine operation. + /// + /// The type of the T value. + /// The sources value. + /// The type value. + /// The result of the operation. private static IObservable> Combine(this ICollection>> sources, CombineOperator type) where T : notnull { @@ -34,6 +41,14 @@ private static IObservable> Combine(this ICollection(sources, type).Run(); } + /// + /// Executes the Combine operation. + /// + /// The type of the T value. + /// The source value. + /// The type value. + /// The others value. + /// The result of the operation. private static IObservable> Combine(this IObservable> source, CombineOperator type, params IObservable>[] others) where T : notnull { @@ -49,6 +64,13 @@ private static IObservable> Combine(this IObservable(items, type).Run(); } + /// + /// Executes the Combine operation. + /// + /// The type of the T value. + /// The sources value. + /// The type value. + /// The result of the operation. private static IObservable> Combine(this IObservableList> sources, CombineOperator type) where T : notnull { @@ -63,6 +85,13 @@ private static IObservable> Combine(this IObservableList + /// Executes the Combine operation. + ///
+ /// The type of the T value. + /// The sources value. + /// The type value. + /// The result of the operation. private static IObservable> Combine(this IObservableList> sources, CombineOperator type) where T : notnull { @@ -77,6 +106,13 @@ private static IObservable> Combine(this IObservableList + /// Executes the Combine operation. + ///
+ /// The type of the T value. + /// The sources value. + /// The type value. + /// The result of the operation. private static IObservable> Combine(this IObservableList>> sources, CombineOperator type) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.Convert.cs b/src/DynamicData/List/ObservableListEx.Convert.cs index ac3762876..1d3af140b 100644 --- a/src/DynamicData/List/ObservableListEx.Convert.cs +++ b/src/DynamicData/List/ObservableListEx.Convert.cs @@ -20,8 +20,8 @@ public static partial class ObservableListEx ///
/// The type of items in the list. /// The type of the destination items. - /// The source to convert. - /// The conversion factory. + /// The source IObservable<IChangeSet<TObject>> to convert. + /// The Func<T, TResult> conversion factory. /// An observable which emits the change set. [Obsolete("Prefer Cast as it is does the same thing but is semantically correct")] public static IObservable> Convert(this IObservable> source, Func conversionFactory) diff --git a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs index ab2be276e..2d1b0ee88 100644 --- a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs +++ b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs @@ -25,7 +25,7 @@ public static partial class ObservableListEx /// Defers downstream delivery until the source emits its first changeset, then forwards all subsequent changesets. ///
/// The type of the object. - /// The source to defer until the first changeset arrives. + /// The source IObservable<IChangeSet<T>> to defer until the first changeset arrives. /// A list changeset stream that begins emitting only after the source has produced its first changeset. /// is . /// @@ -34,8 +34,8 @@ public static partial class ObservableListEx /// the initial data and all subsequent changesets. This is useful when downstream consumers should not receive an empty initial state. /// /// - /// - /// + /// SkipInitial<T>(IObservable<IChangeSet<T>>) + /// StartWithEmpty<T>(IObservable<IChangeSet<T>>) public static IObservable> DeferUntilLoaded(this IObservable> source) where T : notnull { @@ -44,9 +44,14 @@ public static IObservable> DeferUntilLoaded(this IObservable(source).Run(); } - /// + /// + /// Provides an overload of DeferUntilLoaded for the supplied arguments. + /// + /// The type of the T value. + /// The source value. + /// The resulting observable sequence. /// - /// + /// This overload follows the same core behavior as the related overload. /// Convenience overload that calls source.Connect().DeferUntilLoaded(). /// public static IObservable> DeferUntilLoaded(this IObservableList source) diff --git a/src/DynamicData/List/ObservableListEx.DisposeMany.cs b/src/DynamicData/List/ObservableListEx.DisposeMany.cs index f75ddc957..0f7187779 100644 --- a/src/DynamicData/List/ObservableListEx.DisposeMany.cs +++ b/src/DynamicData/List/ObservableListEx.DisposeMany.cs @@ -26,7 +26,7 @@ public static partial class ObservableListEx /// All remaining tracked items are disposed when the stream finalizes (OnCompleted, OnError, or subscription disposal). ///
/// The type of the object. - /// The source to track for disposal on removal. + /// The source IObservable<IChangeSet<T>> to track for disposal on removal. /// A continuation of the source changeset stream with disposal side effects applied. /// is . /// @@ -45,9 +45,9 @@ public static partial class ObservableListEx /// /// Worth noting: Disposal happens after the changeset is delivered downstream, so subscribers see the change before items are disposed. /// - /// - /// - /// + /// OnItemRemoved<T>(IObservable<IChangeSet<T>>, Action<T>, bool) + /// SubscribeMany<T>(IObservable<IChangeSet<T>>, Func<T, IDisposable>) + /// ObservableCacheEx.DisposeMany<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>) public static IObservable> DisposeMany(this IObservable> source) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.DistinctValues.cs b/src/DynamicData/List/ObservableListEx.DistinctValues.cs index 9a042f352..35fa24102 100644 --- a/src/DynamicData/List/ObservableListEx.DistinctValues.cs +++ b/src/DynamicData/List/ObservableListEx.DistinctValues.cs @@ -26,8 +26,8 @@ public static partial class ObservableListEx ///
/// The type of items in the source list. /// The type of distinct values produced. - /// The source to extract distinct values. - /// A function that extracts the value to track from each source item. + /// The source IObservable<IChangeSet<TObject>> to extract distinct values. + /// A Func<T, TResult> function that extracts the value to track from each source item. /// A list changeset stream of distinct values. /// or is . /// @@ -44,7 +44,7 @@ public static partial class ObservableListEx /// ClearAll reference counts cleared. Remove emitted for every tracked distinct value. /// /// - /// + /// ObservableCacheEx.DistinctValues<TObject, TKey, TValue>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, TValue>) public static IObservable> DistinctValues(this IObservable> source, Func valueSelector) where TObject : notnull where TValue : notnull diff --git a/src/DynamicData/List/ObservableListEx.Except.cs b/src/DynamicData/List/ObservableListEx.Except.cs index eec99d64f..b4f7d2fc0 100644 --- a/src/DynamicData/List/ObservableListEx.Except.cs +++ b/src/DynamicData/List/ObservableListEx.Except.cs @@ -26,8 +26,8 @@ public static partial class ObservableListEx /// Items present in the first source but not in any of the are included in the result. ///
/// The type of the item. - /// The primary from which other streams are subtracted. - /// The other changeset streams to exclude from the result. + /// The primary IObservable<IChangeSet<T>> from which other streams are subtracted. + /// The other IObservable<IChangeSet<T>> changeset streams to exclude from the result. /// A list changeset stream containing items from that are not in any of . /// is . /// @@ -46,12 +46,12 @@ public static partial class ObservableListEx /// MovedIgnored by the set logic (no positional semantics). /// RefreshForwarded if the item is currently in the result set. /// - /// Worth noting: Unlike , the first source is asymmetric: only its items can appear in the result. + /// Worth noting: Unlike Or<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]), the first source is asymmetric: only its items can appear in the result. /// - /// - /// - /// - /// + /// And<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// Or<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// Xor<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// ObservableCacheEx.Except<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IChangeSet<TObject, TKey>>[]) public static IObservable> Except(this IObservable> source, params IObservable>[] others) where T : notnull { @@ -60,34 +60,54 @@ public static IObservable> Except(this IObservable + /// + /// Provides an overload of Combine for the supplied arguments. + /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. /// - /// + /// This overload follows the same core behavior as the related overload. /// Static overload accepting a pre-built collection of sources. The first item in the collection is the primary source. /// public static IObservable> Except(this ICollection>> sources) where T : notnull => sources.Combine(CombineOperator.Except); - /// + /// + /// Provides an overload of Combine for the supplied arguments. + /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. /// - /// - /// Dynamic overload: sources can be added or removed from the at runtime. The first source in the list acts as the primary. + /// This overload follows the same core behavior as the related overload. + /// Dynamic overload: sources can be added or removed from the IObservableList<T> at runtime. The first source in the list acts as the primary. /// public static IObservable> Except(this IObservableList>> sources) where T : notnull => sources.Combine(CombineOperator.Except); - /// + /// + /// Provides an overload of Combine for the supplied arguments. + /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. /// - /// - /// Dynamic overload accepting of . Each inner list's Connect() is used as a source. + /// This overload follows the same core behavior as the related overload. + /// Dynamic overload accepting IObservableList<T> of IObservableList<T>. Each inner list's Connect() is used as a source. /// public static IObservable> Except(this IObservableList> sources) where T : notnull => sources.Combine(CombineOperator.Except); - /// + /// + /// Provides an overload of Combine for the supplied arguments. + /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. /// - /// - /// Dynamic overload accepting of . Each inner list's Connect() is used as a source. + /// This overload follows the same core behavior as the related overload. + /// Dynamic overload accepting IObservableList<T> of ISourceList<T>. Each inner list's Connect() is used as a source. /// public static IObservable> Except(this IObservableList> sources) where T : notnull => sources.Combine(CombineOperator.Except); diff --git a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs index b4108cee9..a92c0da88 100644 --- a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs +++ b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs @@ -19,14 +19,14 @@ public static partial class ObservableListEx /// Returns an observable of the items that were expired and removed. ///
/// The type of the item. - /// The source list to apply time-based expiration to. - /// A function returning the time-to-live for each item. Return for items that should never expire. + /// The ISourceList<T> source list to apply time-based expiration to. + /// A Func<T, TResult> function returning the time-to-live for each item. Return for items that should never expire. /// An optional polling interval to batch expiry checks. If omitted, a separate timer is created for each unique expiry time. /// The scheduler for scheduling expiry timers. Defaults to . /// An observable that emits collections of items each time expired items are removed from the source list. /// /// - /// This operator acts directly on an , not on a changeset stream. It monitors items as they are added, + /// This operator acts directly on an ISourceList<T>, not on a changeset stream. It monitors items as they are added, /// schedules their removal, and physically removes them from the source list when their time expires. /// /// @@ -35,8 +35,8 @@ public static partial class ObservableListEx /// /// Worth noting: The returned observable emits the expired items (not changesets). Subscribe to this observable to trigger the expiry mechanism; if not subscribed, no items will be removed. /// - /// - /// + /// LimitSizeTo<T>(ISourceList<T>, int, IScheduler?) + /// ToObservableChangeSet<T>(IObservable<T>, Func<T, TimeSpan?>, IScheduler?) public static IObservable> ExpireAfter( this ISourceList source, Func timeSelector, diff --git a/src/DynamicData/List/ObservableListEx.Filter.cs b/src/DynamicData/List/ObservableListEx.Filter.cs index 0275181be..764e05237 100644 --- a/src/DynamicData/List/ObservableListEx.Filter.cs +++ b/src/DynamicData/List/ObservableListEx.Filter.cs @@ -19,8 +19,8 @@ public static partial class ObservableListEx /// Only items satisfying are included downstream. ///
/// The type of items in the list. - /// The source to filter. - /// A predicate that determines which items are included. Items returning appear downstream; items returning are excluded. + /// The source IObservable<IChangeSet<T>> to filter. + /// A Func<T, TResult> predicate that determines which items are included. Items returning appear downstream; items returning are excluded. /// A list changeset stream containing only items that satisfy . /// Thrown when or is . /// @@ -41,12 +41,12 @@ public static partial class ObservableListEx /// RefreshThe predicate is re-evaluated. If the item now passes but previously did not, an Add is emitted. If it previously passed but no longer does, a Remove is emitted. If still passes, the Refresh is forwarded. If still fails, dropped. /// ClearAll downstream items are cleared. /// - /// Worth noting: Refresh events trigger re-evaluation, which can promote or demote items (turning a Refresh into an Add or Remove). Pair with for property-change-driven filtering. + /// Worth noting: Refresh events trigger re-evaluation, which can promote or demote items (turning a Refresh into an Add or Remove). Pair with AutoRefresh<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan?, TimeSpan?, IScheduler?) for property-change-driven filtering. /// - /// - /// - /// - /// + /// Filter<T>(IObservable<IChangeSet<T>>, IObservable<Func<T, bool>>, ListFilterPolicy) + /// FilterOnObservable<TObject>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<bool>>, TimeSpan?, IScheduler?) + /// AutoRefresh<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan?, TimeSpan?, IScheduler?) + /// ObservableCacheEx.Filter<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, bool>, bool) public static IObservable> Filter( this IObservable> source, Func predicate) @@ -61,8 +61,8 @@ public static IObservable> Filter( /// When emits a new function, all items are re-evaluated. ///
/// The type of the item. - /// The source to filter. - /// An that emits new predicate functions. Each emission triggers a full re-evaluation of all items. + /// The source IObservable<IChangeSet<T>> to filter. + /// An IObservable<Func<T, bool>> that emits new predicate functions. Each emission triggers a full re-evaluation of all items. /// The that controls re-filtering behavior when the predicate changes. /// A list changeset stream containing only items that satisfy the most recent predicate. /// @@ -83,8 +83,8 @@ public static IObservable> Filter( /// Worth noting: No items are included until emits its first function. /// /// or is . - /// - /// + /// Filter<T>(IObservable<IChangeSet<T>>, Func<T, bool>) + /// FilterOnObservable<TObject>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<bool>>, TimeSpan?, IScheduler?) public static IObservable> Filter(this IObservable> source, IObservable> predicate, ListFilterPolicy filterPolicy = ListFilterPolicy.CalculateDiff) where T : notnull { @@ -101,9 +101,9 @@ public static IObservable> Filter(this IObservable /// The type of the item. /// The type of state value required by . - /// The source to filter. - /// An stream of state values to be passed to . - /// A static predicate receiving the current state and an item, returning to include or to exclude. The function itself does not change; only the state value passed to it changes. + /// The source IObservable<IChangeSet<T>> to filter. + /// An IObservable<TState> stream of state values to be passed to . + /// A static Func<T, TResult> predicate receiving the current state and an item, returning to include or to exclude. The function itself does not change; only the state value passed to it changes. /// The that controls re-filtering behavior when the state changes. /// When (default), empty changesets are suppressed. Set to to publish empty changesets (useful for monitoring loading status). /// A list changeset stream containing only items satisfying with the current state. @@ -123,8 +123,8 @@ public static IObservable> Filter(this IObservableState changedAll items are re-evaluated with the new state value. The output is shaped by . /// /// - /// - /// + /// Filter<T>(IObservable<IChangeSet<T>>, Func<T, bool>) + /// Filter<T>(IObservable<IChangeSet<T>>, IObservable<Func<T, bool>>, ListFilterPolicy) public static IObservable> Filter( this IObservable> source, IObservable predicateState, diff --git a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs index cf7b6be0b..ca3146b56 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs @@ -22,11 +22,11 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Filters each item using a per-item of that dynamically controls inclusion. + /// Filters each item using a per-item IObservable<T> of that dynamically controls inclusion. /// When an item's observable emits the item enters the result; when it emits the item is removed. /// /// The type of items in the list. - /// The source to filter by property value. + /// The source IObservable<IChangeSet<TObject>> to filter by property value. /// A function that returns an observable of for each item, controlling its inclusion. /// An optional throttle duration applied to each per-item observable to reduce re-evaluation frequency. /// The used when throttling. Defaults to the system default scheduler. @@ -50,10 +50,10 @@ public static partial class ObservableListEx /// Emits If currently included, a Remove is emitted downstream. /// /// - /// - /// - /// - /// + /// Filter<T>(IObservable<IChangeSet<T>>, Func<T, bool>) + /// Filter<T>(IObservable<IChangeSet<T>>, IObservable<Func<T, bool>>, ListFilterPolicy) + /// AutoRefresh<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan?, TimeSpan?, IScheduler?) + /// ObservableCacheEx.FilterOnObservable<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<bool>>, TimeSpan?, IScheduler?) public static IObservable> FilterOnObservable(this IObservable> source, Func> objectFilterObservable, TimeSpan? propertyChangedThrottle = null, IScheduler? scheduler = null) where TObject : notnull { diff --git a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs index 93dda7044..a82032922 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs @@ -26,17 +26,17 @@ public static partial class ObservableListEx ///
/// The type of the object. Must implement . /// The type of the property. - /// The source to filter by property value. - /// selecting the property to monitor for changes. - /// A predicate evaluated against the item to determine inclusion. + /// The source IObservable<IChangeSet<TObject>> to filter by property value. + /// Expression<TDelegate> selecting the property to monitor for changes. + /// A Func<T, TResult> predicate evaluated against the item to determine inclusion. /// An optional throttle duration for property change notifications. /// The used when throttling. /// A list changeset stream of items satisfying the predicate, re-evaluated on property changes. /// - /// Deprecated. Use followed by instead. + /// Deprecated. Use AutoRefresh<TObject, TProperty>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TProperty>>, TimeSpan?, TimeSpan?, IScheduler?) followed by Filter<T>(IObservable<IChangeSet<T>>, Func<T, bool>) instead. /// - /// - /// + /// AutoRefresh<TObject, TProperty>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TProperty>>, TimeSpan?, TimeSpan?, IScheduler?) + /// Filter<T>(IObservable<IChangeSet<T>>, Func<T, bool>) [Obsolete("Use AutoRefresh(), followed by Filter() instead")] public static IObservable> FilterOnProperty(this IObservable> source, Expression> propertySelector, Func predicate, TimeSpan? propertyChangedThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged diff --git a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs index 15472262f..40f1fdf12 100644 --- a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs +++ b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs @@ -19,13 +19,13 @@ public static partial class ObservableListEx /// Empty buffers are dropped. ///
/// The type of the item. - /// The of buffered changeset lists. + /// The IObservable<T> of buffered changeset lists. /// A list changeset stream with all buffered changes concatenated into single changesets. /// /// Use this after applying Observable.Buffer() to a changeset stream to re-merge the batched changesets into a single stream. /// - /// - /// + /// BufferIf<T>(IObservable<IChangeSet<T>>, IObservable<bool>, IScheduler?) + /// BufferInitial<T>(IObservable<IChangeSet<T>>, TimeSpan, IScheduler?) public static IObservable> FlattenBufferResult(this IObservable>> source) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.ForEachChange.cs b/src/DynamicData/List/ObservableListEx.ForEachChange.cs index 84fd70884..e850acac9 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachChange.cs @@ -15,28 +15,28 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Invokes once for every in each changeset. Range changes - /// (AddRange, RemoveRange, Clear) are delivered as a single ; they are not flattened into per-item changes. + /// Invokes once for every Change<T> in each changeset. Range changes + /// (AddRange, RemoveRange, Clear) are delivered as a single Change<T>; they are not flattened into per-item changes. /// The changeset is forwarded downstream unchanged. /// /// The type of items in the list. - /// The source to observe each change in. - /// The action invoked for each . + /// The source IObservable<IChangeSet<TObject>> to observe each change in. + /// The action invoked for each Change<T>. /// A continuation of the source changeset stream. /// or is . /// - /// This is a side-effect operator. It does not modify the changeset. If you need each individual item from range operations flattened out, use instead. + /// This is a side-effect operator. It does not modify the changeset. If you need each individual item from range operations flattened out, use ForEachItemChange<TObject>(IObservable<IChangeSet<TObject>>, Action<ItemChange<TObject>>) instead. /// /// EventBehavior - /// Add/Replace/Remove/Moved/RefreshCallback invoked with the (single-item change). Changeset forwarded. - /// AddRange/RemoveRange/ClearCallback invoked once with the containing the range (accessible via Range property). Changeset forwarded. + /// Add/Replace/Remove/Moved/RefreshCallback invoked with the Change<T> (single-item change). Changeset forwarded. + /// AddRange/RemoveRange/ClearCallback invoked once with the Change<T> containing the range (accessible via Range property). Changeset forwarded. /// OnErrorIf the callback throws, the exception propagates as OnError. /// /// - /// - /// - /// - /// + /// ForEachItemChange<TObject>(IObservable<IChangeSet<TObject>>, Action<ItemChange<TObject>>) + /// OnItemAdded<T>(IObservable<IChangeSet<T>>, Action<T>) + /// OnItemRemoved<T>(IObservable<IChangeSet<T>>, Action<T>, bool) + /// ObservableCacheEx.ForEachChange<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Action<Change<TObject, TKey>>) public static IObservable> ForEachChange(this IObservable> source, Action> action) where TObject : notnull { diff --git a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs index 9add09218..52093167d 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs @@ -15,21 +15,21 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Invokes for every individual in each changeset. + /// Invokes for every individual ItemChange<TObject> in each changeset. /// Range changes are flattened into individual item changes first, so the callback only receives Add, Replace, Remove, and Refresh. /// /// The type of items in the list. - /// The source to observe each item-level change in. - /// The action invoked for each individual item change. + /// The source IObservable<IChangeSet<TObject>> to observe each item-level change in. + /// The Action<ItemChange<TObject>> action invoked for each individual item change. /// A continuation of the source changeset stream. /// or is . /// /// - /// Unlike , this operator flattens - /// AddRange, RemoveRange, and Clear into individual entries before invoking the callback. + /// Unlike ForEachChange<TObject>(IObservable<IChangeSet<TObject>>, Action<Change<TObject>>), this operator flattens + /// AddRange, RemoveRange, and Clear into individual ItemChange<TObject> entries before invoking the callback. /// /// - /// + /// ForEachChange<TObject>(IObservable<IChangeSet<TObject>>, Action<Change<TObject>>) public static IObservable> ForEachItemChange(this IObservable> source, Action> action) where TObject : notnull { diff --git a/src/DynamicData/List/ObservableListEx.GroupOn.cs b/src/DynamicData/List/ObservableListEx.GroupOn.cs index 902d38b6a..873b9b0b8 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOn.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOn.cs @@ -22,15 +22,15 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Groups source items by the value returned by . Each group is an + /// Groups source items by the value returned by . Each group is an IGroup<TObject, TGroup> /// containing an inner observable list of its members. /// /// The type of items in the list. /// The type of the group key. - /// The source to group. - /// A function that returns the group key for each item. - /// An optional of that forces all items to be re-evaluated against when it fires. Useful for time-based groupings (e.g., "Last Hour", "Today"). - /// A list changeset stream of objects, each containing the items belonging to that group. + /// The source IObservable<IChangeSet<TObject>> to group. + /// A Func<T, TResult> function that returns the group key for each item. + /// An optional IObservable<Unit> of that forces all items to be re-evaluated against when it fires. Useful for time-based groupings (e.g., "Last Hour", "Today"). + /// A list changeset stream of IGroup<TObject, TGroup> objects, each containing the items belonging to that group. /// or is . /// /// @@ -46,9 +46,9 @@ public static partial class ObservableListEx /// Regrouper firesAll items re-evaluated. Items that changed group key are moved between groups. Empty groups removed, new groups added. /// /// - /// - /// - /// + /// GroupOnProperty<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TGroup>>, TimeSpan?, IScheduler?) + /// GroupWithImmutableState<TObject, TGroupKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TGroupKey>, IObservable<Unit>?) + /// Transform<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, TDestination>, bool) public static IObservable>> GroupOn(this IObservable> source, Func groupSelector, IObservable? regrouper = null) where TObject : notnull where TGroup : notnull diff --git a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs index ab0634055..b17ccfc98 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs @@ -27,11 +27,11 @@ public static partial class ObservableListEx ///
/// The type of the object. Must implement . /// The type of the group key. - /// The source to group by property value. - /// selecting the property whose value determines the group key. + /// The source IObservable<IChangeSet<TObject>> to group by property value. + /// Expression<TDelegate> selecting the property whose value determines the group key. /// An optional throttle duration for property change notifications. /// The used when throttling. - /// A list changeset stream of objects. + /// A list changeset stream of IGroup<TObject, TGroup> objects. /// or is . /// /// @@ -39,9 +39,9 @@ public static partial class ObservableListEx /// Property changes trigger re-evaluation of the group key, potentially moving items between groups. /// /// - /// - /// - /// + /// GroupOn<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Func<TObject, TGroup>, IObservable<Unit>?) + /// GroupOnPropertyWithImmutableState<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TGroup>>, TimeSpan?, IScheduler?) + /// AutoRefresh<TObject, TProperty>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TProperty>>, TimeSpan?, TimeSpan?, IScheduler?) public static IObservable>> GroupOnProperty(this IObservable> source, Expression> propertySelector, TimeSpan? propertyChangedThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged where TGroup : notnull diff --git a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs index 765b99217..182834fda 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs @@ -27,22 +27,22 @@ public static partial class ObservableListEx ///
/// The type of the object. Must implement . /// The type of the group key. - /// The source to group by property value with immutable snapshots. - /// selecting the property whose value determines the group key. + /// The source IObservable<IChangeSet<TObject>> to group by property value with immutable snapshots. + /// Expression<TDelegate> selecting the property whose value determines the group key. /// An optional throttle duration for property change notifications. /// The used when throttling. - /// A list changeset stream of immutable group snapshots. + /// A list changeset stream of List.IGrouping<TObject, TGroup> immutable group snapshots. /// or is . /// /// - /// Combines - /// with . - /// Unlike , + /// Combines AutoRefresh<TObject, TProperty>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TProperty>>, TimeSpan?, TimeSpan?, IScheduler?) + /// with GroupWithImmutableState<TObject, TGroupKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TGroupKey>, IObservable<Unit>?). + /// Unlike GroupOnProperty<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TGroup>>, TimeSpan?, IScheduler?), /// this produces immutable snapshots per group rather than live inner observable lists. /// /// - /// - /// + /// GroupOnProperty<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TGroup>>, TimeSpan?, IScheduler?) + /// GroupWithImmutableState<TObject, TGroupKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TGroupKey>, IObservable<Unit>?) public static IObservable>> GroupOnPropertyWithImmutableState(this IObservable> source, Expression> propertySelector, TimeSpan? propertyChangedThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged where TGroup : notnull diff --git a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs index e9b45c977..5d3250878 100644 --- a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs @@ -27,20 +27,20 @@ public static partial class ObservableListEx ///
/// The type of items in the list. /// The type of the group key. - /// The source to group with immutable snapshots. - /// A function that returns the group key for each item. - /// An optional of that forces all items to be re-evaluated when it fires. - /// A list changeset stream of immutable snapshots. + /// The source IObservable<IChangeSet<TObject>> to group with immutable snapshots. + /// A Func<T, TResult> function that returns the group key for each item. + /// An optional IObservable<Unit> of that forces all items to be re-evaluated when it fires. + /// A list changeset stream of List.IGrouping<TObject, TGroupKey> immutable snapshots. /// or is . /// /// - /// Works like + /// Works like GroupOn<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Func<TObject, TGroup>, IObservable<Unit>?) /// but each affected group emits a new immutable snapshot on every change rather than updating a live inner list. /// This is useful when consumers need thread-safe, point-in-time snapshots of each group. /// /// - /// - /// + /// GroupOn<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Func<TObject, TGroup>, IObservable<Unit>?) + /// GroupOnPropertyWithImmutableState<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TGroup>>, TimeSpan?, IScheduler?) public static IObservable>> GroupWithImmutableState(this IObservable> source, Func groupSelectorKey, IObservable? regrouper = null) where TObject : notnull where TGroupKey : notnull diff --git a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs index 6d59b31c7..b6da5a8d0 100644 --- a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs +++ b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs @@ -27,7 +27,7 @@ public static partial class ObservableListEx /// Returns an observable of the items that were removed. ///
/// The type of the item. - /// The source list to apply size limits to. + /// The ISourceList<T> source list to apply size limits to. /// The maximum number of items allowed. Must be greater than zero. /// The scheduler for scheduling size checks. Defaults to . /// An observable that emits collections of items each time excess items are removed from the source list. @@ -35,13 +35,13 @@ public static partial class ObservableListEx /// is zero or negative. /// /// - /// This operator acts directly on an . It subscribes to the source's changes, + /// This operator acts directly on an ISourceList<T>. It subscribes to the source's changes, /// tracks insertion order using an internal Transform, and removes the oldest items when the size limit is exceeded. /// /// Worth noting: The returned observable emits the removed items (not changesets). Subscribe to this observable to activate the size-limiting mechanism. Removal is performed synchronously under a lock shared with the change tracking. /// - /// - /// + /// ExpireAfter<T>(ISourceList<T>, Func<T, TimeSpan?>, TimeSpan?, IScheduler?) + /// Top<T>(IObservable<IChangeSet<T>>, int) public static IObservable> LimitSizeTo(this ISourceList source, int sizeLimit, IScheduler? scheduler = null) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs index 1075aa075..905a5f92f 100644 --- a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs @@ -21,13 +21,15 @@ namespace DynamicData; ///
public static partial class ObservableListEx { - /// + /// This overload follows the same core behavior as the related overload. /// /// Merges multiple list changeset streams from an observable-of-observables into a single unified changeset stream. - /// Unlike , list merging performs no key-based deduplication. + /// Unlike ObservableCacheEx.MergeChangeSets<TObject, TKey>(IObservable<IObservable<IChangeSet<TObject, TKey>>>, IEqualityComparer<TObject>), list merging performs no key-based deduplication. /// - /// The source of nested changeset observables. - /// An optional used by the merge tracker to compare items. + /// The type of the TObject value. + /// The source IObservable<T> of nested changeset observables. + /// An optional IEqualityComparer<TObject> used by the merge tracker to compare items. + /// The resulting observable sequence. public static IObservable> MergeChangeSets(this IObservable>> source, IEqualityComparer? equalityComparer = null) where TObject : notnull { @@ -36,15 +38,17 @@ public static IObservable> MergeChangeSets(this IOb return new MergeChangeSets(source, equalityComparer).Run(); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Merges two list changeset streams into a single unified stream. /// - /// The first to merge. - /// The second to merge with. - /// An optional used to compare items. + /// The type of the TObject value. + /// The first IObservable<IChangeSet<TObject>> to merge. + /// The second IObservable<IChangeSet<TObject>> to merge with. + /// An optional IEqualityComparer<TObject> used to compare items. /// An optional for scheduling enumeration. /// When (default), the result completes when all sources complete. + /// The resulting observable sequence. public static IObservable> MergeChangeSets(this IObservable> source, IObservable> other, IEqualityComparer? equalityComparer = null, IScheduler? scheduler = null, bool completable = true) where TObject : notnull { @@ -54,15 +58,17 @@ public static IObservable> MergeChangeSets(this IOb return new[] { source, other }.MergeChangeSets(equalityComparer, scheduler, completable); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Merges the source list changeset stream with additional changeset streams into a single unified stream. /// - /// The primary source to merge. - /// The additional of list changeset streams to merge with. - /// An optional used to compare items. + /// The type of the TObject value. + /// The primary source IObservable<IChangeSet<TObject>> to merge. + /// The additional IEnumerable<T> of list changeset streams to merge with. + /// An optional IEqualityComparer<TObject> used to compare items. /// An optional for scheduling enumeration. /// When (default), the result completes when all sources complete. + /// The resulting observable sequence. public static IObservable> MergeChangeSets(this IObservable> source, IEnumerable>> others, IEqualityComparer? equalityComparer = null, IScheduler? scheduler = null, bool completable = true) where TObject : notnull { @@ -74,18 +80,18 @@ public static IObservable> MergeChangeSets(this IOb /// /// Merges a collection of list changeset streams into a single unified changeset stream. - /// This is the canonical list MergeChangeSets overload: other overloads accepting , , or pair/params variants ultimately produce equivalent behavior. + /// This is the canonical list MergeChangeSets overload: other overloads accepting IObservable<T>, IObservableList<T>, or pair/params variants ultimately produce equivalent behavior. /// /// The type of items in the list. - /// The collection of list changeset streams to merge. - /// An optional used by the merge tracker to compare items. Defaults to when . + /// The IEnumerable<T> collection of list changeset streams to merge. + /// An optional IEqualityComparer<TObject> used by the merge tracker to compare items. Defaults to EqualityComparer<T>.Default when . /// An optional for scheduling enumeration. /// When (default), the result completes when all sources complete. /// A single list changeset stream containing all changes from all sources. /// is . /// /// - /// All changes from inner streams are forwarded to the output. There is no key-based deduplication (unlike ): if the same item appears in multiple inner streams, it will appear multiple times in the merged output. + /// All changes from inner streams are forwarded to the output. There is no key-based deduplication (unlike ObservableCacheEx.MergeChangeSets<TObject, TKey>(IObservable<IObservable<IChangeSet<TObject, TKey>>>, IEqualityComparer<TObject>)): if the same item appears in multiple inner streams, it will appear multiple times in the merged output. /// /// /// EventBehavior @@ -96,10 +102,10 @@ public static IObservable> MergeChangeSets(this IOb /// MovedIgnored. /// /// - /// - /// - /// - /// + /// MergeChangeSets<TObject>(IObservable<IObservable<IChangeSet<TObject>>>, IEqualityComparer<TObject>?) + /// MergeManyChangeSets<TObject, TDestination>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination>>>, IEqualityComparer<TDestination>?) + /// Or<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// ObservableCacheEx.MergeChangeSets<TObject, TKey>(IObservable<IObservable<IChangeSet<TObject, TKey>>>, IEqualityComparer<TObject>) public static IObservable> MergeChangeSets(this IEnumerable>> source, IEqualityComparer? equalityComparer = null, IScheduler? scheduler = null, bool completable = true) where TObject : notnull { @@ -108,10 +114,14 @@ public static IObservable> MergeChangeSets(this IEn return new MergeChangeSets(source, equalityComparer, completable, scheduler).Run(); } - /// + /// This overload follows the same core behavior as the related overload. /// - /// Merges list changeset streams from an into a single stream. Sources can be added or removed dynamically. + /// Merges list changeset streams from an IObservableList<T> into a single stream. Sources can be added or removed dynamically. /// + /// The type of the TObject value. + /// The source value. + /// The equalityComparer value. + /// The resulting observable sequence. public static IObservable> MergeChangeSets(this IObservableList>> source, IEqualityComparer? equalityComparer = null) where TObject : notnull { @@ -120,11 +130,15 @@ public static IObservable> MergeChangeSets(this IOb return source.Connect().MergeChangeSets(equalityComparer); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Merges list changeset streams from a list-of-list-changeset-observables into a single stream. /// Each inner list changeset observable in the source list is merged, and parent item removal triggers child cleanup. /// + /// The type of the TObject value. + /// The source value. + /// The equalityComparer value. + /// The resulting observable sequence. public static IObservable> MergeChangeSets(this IObservable>>> source, IEqualityComparer? equalityComparer = null) where TObject : notnull { @@ -134,13 +148,13 @@ public static IObservable> MergeChangeSets(this IOb } /// - /// Merges cache changeset streams from an into a single cache changeset stream. + /// Merges cache changeset streams from an IObservableList<T> into a single cache changeset stream. /// Uses to resolve conflicts when the same key appears in multiple child streams. /// /// The type of items in the list. /// The type of the object key. - /// The of cache changeset observables. - /// to resolve which value wins when the same key appears in multiple sources. + /// The IObservableList<T> of cache changeset observables. + /// IComparer<TObject> to resolve which value wins when the same key appears in multiple sources. /// A single cache changeset stream with key-based deduplication. /// is . /// @@ -155,8 +169,8 @@ public static IObservable> MergeChangeSets(this IOb /// Source list RemoveDisposes that source's subscription. All keys it contributed are removed. For keys also contributed by other sources, the next-best value (per ) is promoted as an Update, not an Add. ///
/// - /// - /// + /// MergeChangeSets<TObject, TKey>(IObservableList<IObservable<IChangeSet<TObject, TKey>>>, IEqualityComparer<TObject>?, IComparer<TObject>?) + /// MergeManyChangeSets<TObject, TDestination, TDestinationKey>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>>, IEqualityComparer<TDestination>?, IComparer<TDestination>?) public static IObservable> MergeChangeSets(this IObservableList>> source, IComparer comparer) where TObject : notnull where TKey : notnull @@ -166,13 +180,16 @@ public static IObservable> MergeChangeSets + /// This overload follows the same core behavior as the related overload. /// - /// Merges cache changeset streams from an into a single cache changeset stream, with optional equality and ordering comparers. + /// Merges cache changeset streams from an IObservableList<T> into a single cache changeset stream, with optional equality and ordering comparers. /// - /// The of cache changeset observables. - /// An optional to determine if two elements are the same. - /// An optional to resolve conflicts when the same key appears in multiple sources. + /// The type of the TObject value. + /// The type of the TKey value. + /// The IObservableList<T> of cache changeset observables. + /// An optional IEqualityComparer<TObject> to determine if two elements are the same. + /// An optional IComparer<TObject> to resolve conflicts when the same key appears in multiple sources. + /// The resulting observable sequence. public static IObservable> MergeChangeSets(this IObservableList>> source, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) where TObject : notnull where TKey : notnull @@ -182,12 +199,15 @@ public static IObservable> MergeChangeSets + /// This overload follows the same core behavior as the related overload. /// /// Merges cache changeset streams from a list changeset of cache changeset observables, using a comparer for conflict resolution. /// - /// The source whose items are cache changeset observables. - /// to resolve which value wins when the same key appears in multiple sources. + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<T> whose items are cache changeset observables. + /// IComparer<TObject> to resolve which value wins when the same key appears in multiple sources. + /// The resulting observable sequence. public static IObservable> MergeChangeSets(this IObservable>>> source, IComparer comparer) where TObject : notnull where TKey : notnull @@ -197,13 +217,16 @@ public static IObservable> MergeChangeSets + /// This overload follows the same core behavior as the related overload. /// /// Merges cache changeset streams from a list changeset of cache changeset observables, with optional equality and ordering comparers. /// - /// The source whose items are cache changeset observables. - /// An optional to determine if two elements are the same. - /// An optional to resolve conflicts when the same key appears in multiple sources. + /// The type of the TObject value. + /// The type of the TKey value. + /// The source IObservable<T> whose items are cache changeset observables. + /// An optional IEqualityComparer<TObject> to determine if two elements are the same. + /// An optional IComparer<TObject> to resolve conflicts when the same key appears in multiple sources. + /// The resulting observable sequence. public static IObservable> MergeChangeSets(this IObservable>>> source, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) where TObject : notnull where TKey : notnull diff --git a/src/DynamicData/List/ObservableListEx.MergeMany.cs b/src/DynamicData/List/ObservableListEx.MergeMany.cs index cc4715b30..3b7125a12 100644 --- a/src/DynamicData/List/ObservableListEx.MergeMany.cs +++ b/src/DynamicData/List/ObservableListEx.MergeMany.cs @@ -22,13 +22,13 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Subscribes to a per-item observable for each item in the source and merges all emissions into a single stream. + /// Subscribes to a per-item observable for each item in the source and merges all emissions into a single IObservable<TDestination> stream. /// This is NOT a changeset operator: it returns a flat observable of values. /// /// The type of items in the source list. /// The type of values emitted by per-item observables. - /// The source whose items each produce an observable. - /// A function that returns an observable for each source item. + /// The source IObservable<IChangeSet<T>> whose items each produce an observable. + /// A Func<T, TResult> function that returns an observable for each source item. /// An observable that emits values from all per-item observables, merged together. /// or is . /// @@ -41,10 +41,10 @@ public static partial class ObservableListEx /// OnCompleted (source)Completes only after the source and all active inner observables have completed. /// /// - /// - /// - /// - /// + /// SubscribeMany<T>(IObservable<IChangeSet<T>>, Func<T, IDisposable>) + /// MergeManyChangeSets<TObject, TDestination>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination>>>, IEqualityComparer<TDestination>?) + /// WhenPropertyChanged<TObject, TValue>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TValue>>, bool) + /// ObservableCacheEx.MergeMany<TObject, TKey, TDestination>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<TDestination>>) public static IObservable MergeMany(this IObservable> source, Func> observableSelector) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs index d2022a992..e6fb3171c 100644 --- a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs @@ -27,9 +27,9 @@ public static partial class ObservableListEx ///
/// The type of items in the source list. /// The type of items in the child changeset streams. - /// The source whose items each produce a child changeset stream. - /// A function that returns a child list changeset stream for each source item. - /// An optional used to compare child items. + /// The source IObservable<IChangeSet<TObject>> whose items each produce a child changeset stream. + /// A Func<T, TResult> function that returns a child list changeset stream for each source item. + /// An optional IEqualityComparer<TDestination> used to compare child items. /// A single list changeset stream containing all items from all child streams. /// or is . /// @@ -44,10 +44,10 @@ public static partial class ObservableListEx /// Remove/RemoveRange/ClearChild subscription disposed. All child items from that parent are removed. /// /// - /// - /// - /// - /// + /// MergeChangeSets<TObject>(IEnumerable<IObservable<IChangeSet<TObject>>>, IEqualityComparer<TObject>?, IScheduler?, bool) + /// MergeManyChangeSets<TObject, TDestination, TDestinationKey>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>>, IEqualityComparer<TDestination>?, IComparer<TDestination>?) + /// TransformMany<TDestination, TSource>(IObservable<IChangeSet<TSource>>, Func<TSource, IEnumerable<TDestination>>, IEqualityComparer<TDestination>?) + /// ObservableCacheEx.MergeManyChangeSets<TObject, TKey, TDestination, TDestinationKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>>, IEqualityComparer<TDestination>, IComparer<TDestination>) public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IEqualityComparer? equalityComparer = null) where TObject : notnull where TDestination : notnull @@ -72,16 +72,16 @@ public static IObservable> MergeManyChangeSetsThe type of items in the source list. /// The type of items in the child cache changeset streams. /// The type of the key in the child cache changesets. - /// The source whose items each produce a child changeset stream. - /// A function that returns a child cache changeset stream for each source item. - /// to resolve which value wins when the same key appears from multiple children. + /// The source IObservable<IChangeSet<TObject>> whose items each produce a child changeset stream. + /// A Func<T, TResult> function that returns a child cache changeset stream for each source item. + /// IComparer<TDestination> to resolve which value wins when the same key appears from multiple children. /// A single cache changeset stream with key-based deduplication. /// , , or is . /// - /// - /// Delegates to with a equality comparer. + /// This overload follows the same core behavior as the related overload. + /// Delegates to MergeManyChangeSets<TObject, TDestination, TDestinationKey>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>>, IEqualityComparer<TDestination>?, IComparer<TDestination>?) with a equality comparer. /// - /// + /// MergeManyChangeSets<TObject, TDestination, TDestinationKey>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>>, IEqualityComparer<TDestination>?, IComparer<TDestination>?) public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IComparer comparer) where TObject : notnull where TDestination : notnull @@ -101,10 +101,10 @@ public static IObservable> MergeManyCh /// The type of items in the source list. /// The type of items in the child cache changeset streams. /// The type of the key in the child cache changesets. - /// The source whose items each produce a child changeset stream. - /// A function that returns a child cache changeset stream for each source item. - /// An optional to determine if two elements are the same. - /// An optional to resolve conflicts when the same key appears from multiple children. + /// The source IObservable<IChangeSet<TObject>> whose items each produce a child changeset stream. + /// A Func<T, TResult> function that returns a child cache changeset stream for each source item. + /// An optional IEqualityComparer<TDestination> to determine if two elements are the same. + /// An optional IComparer<TDestination> to resolve conflicts when the same key appears from multiple children. /// A single cache changeset stream with key-based deduplication. /// or is . /// @@ -125,12 +125,12 @@ public static IObservable> MergeManyCh /// /// /// EventBehavior - /// OnErrorAn error from the source (parent) stream or from any child changeset stream terminates the entire output. Unlike , child errors are NOT swallowed. + /// OnErrorAn error from the source (parent) stream or from any child changeset stream terminates the entire output. Unlike MergeMany<T, TDestination>(IObservable<IChangeSet<T>>, Func<T, IObservable<TDestination>>), child errors are NOT swallowed. /// OnCompletedThe output completes when the source (parent) stream completes and all active child changeset streams have also completed. /// /// - /// - /// + /// MergeManyChangeSets<TObject, TDestination>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination>>>, IEqualityComparer<TDestination>?) + /// MergeChangeSets<TObject, TKey>(IObservableList<IObservable<IChangeSet<TObject, TKey>>>, IComparer<TObject>) public static IObservable> MergeManyChangeSets(this IObservable> source, Func>> observableSelector, IEqualityComparer? equalityComparer = null, IComparer? comparer = null) where TObject : notnull where TDestination : notnull diff --git a/src/DynamicData/List/ObservableListEx.NotEmpty.cs b/src/DynamicData/List/ObservableListEx.NotEmpty.cs index 15e58b527..71f9a308e 100644 --- a/src/DynamicData/List/ObservableListEx.NotEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.NotEmpty.cs @@ -18,11 +18,11 @@ public static partial class ObservableListEx /// Suppresses empty changesets from the stream. Only changesets with at least one change are forwarded. ///
/// The type of the item. - /// The source to suppress empty changesets. + /// The source IObservable<IChangeSet<T>> to suppress empty changesets. /// A list changeset stream with empty changesets filtered out. /// is . - /// - /// + /// StartWithEmpty<T>(IObservable<IChangeSet<T>>) + /// WhereReasonsAre<T>(IObservable<IChangeSet<T>>, ListChangeReason[]) public static IObservable> NotEmpty(this IObservable> source) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs index bed6d8fab..e28b9bf00 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs @@ -19,8 +19,8 @@ public static partial class ObservableListEx /// Triggers on , , and the new item of . ///
/// The type of items in the list. - /// The source to observe item additions in. - /// The action to invoke for each added item. + /// The source IObservable<IChangeSet<T>> to observe item additions in. + /// The Action<T> action to invoke for each added item. /// A continuation of the source changeset stream, with the side effect applied before forwarding. /// or is . /// @@ -35,10 +35,10 @@ public static partial class ObservableListEx /// OnErrorIf the callback throws, the exception propagates as OnError. /// /// - /// - /// - /// - /// + /// OnItemRemoved<T>(IObservable<IChangeSet<T>>, Action<T>, bool) + /// OnItemRefreshed<T>(IObservable<IChangeSet<T>>, Action<T>) + /// ForEachItemChange<TObject>(IObservable<IChangeSet<TObject>>, Action<ItemChange<TObject>>) + /// ObservableCacheEx.OnItemAdded<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Action<TObject>) public static IObservable> OnItemAdded( this IObservable> source, Action addAction) diff --git a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs index 77b55570c..827ffab00 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs @@ -18,14 +18,14 @@ public static partial class ObservableListEx /// Invokes for every item with a change in the source stream. ///
/// The type of items in the list. - /// The source to observe item refresh events in. - /// The action to invoke for each refreshed item. + /// The source IObservable<IChangeSet<T>> to observe item refresh events in. + /// The Action<T> action to invoke for each refreshed item. /// A continuation of the source changeset stream, with the side effect applied before forwarding. /// or is . - /// - /// - /// - /// + /// OnItemAdded<T>(IObservable<IChangeSet<T>>, Action<T>) + /// OnItemRemoved<T>(IObservable<IChangeSet<T>>, Action<T>, bool) + /// AutoRefresh<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan?, TimeSpan?, IScheduler?) + /// ObservableCacheEx.OnItemRefreshed<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Action<TObject>) public static IObservable> OnItemRefreshed( this IObservable> source, Action refreshAction) diff --git a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs index c17885e64..0f7a85e67 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs @@ -19,8 +19,8 @@ public static partial class ObservableListEx /// Triggers on , , , and the old item of . ///
/// The type of items in the list. - /// The source to observe item removals in. - /// The action to invoke for each removed item. + /// The source IObservable<IChangeSet<T>> to observe item removals in. + /// The Action<T> action to invoke for each removed item. /// When (default), is also invoked for all remaining tracked items upon stream disposal, completion, or error. /// A continuation of the source changeset stream, with the side effect applied before forwarding. /// or is . @@ -41,10 +41,10 @@ public static partial class ObservableListEx /// /// Worth noting: When is (the default), disposing the subscription also invokes the callback for every item still in the list, not just items that were explicitly removed during the subscription. Exceptions in are not caught. /// - /// - /// - /// - /// + /// OnItemAdded<T>(IObservable<IChangeSet<T>>, Action<T>) + /// DisposeMany<T>(IObservable<IChangeSet<T>>) + /// SubscribeMany<T>(IObservable<IChangeSet<T>>, Func<T, IDisposable>) + /// ObservableCacheEx.OnItemRemoved<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Action<TObject>, bool) public static IObservable> OnItemRemoved( this IObservable> source, Action removeAction, diff --git a/src/DynamicData/List/ObservableListEx.Or.cs b/src/DynamicData/List/ObservableListEx.Or.cs index 074046002..6a1d4a783 100644 --- a/src/DynamicData/List/ObservableListEx.Or.cs +++ b/src/DynamicData/List/ObservableListEx.Or.cs @@ -21,11 +21,14 @@ namespace DynamicData; ///
public static partial class ObservableListEx { - /// + /// This overload follows the same core behavior as the related overload. /// /// Applies a logical OR (union) between a pre-built collection of list changeset sources. Items present in any source are included. /// - /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. + /// ObservableCacheEx.Or<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IChangeSet<TObject, TKey>>[]) public static IObservable> Or(this ICollection>> sources) where T : notnull => sources.Combine(CombineOperator.Or); @@ -34,8 +37,8 @@ public static IObservable> Or(this ICollection /// The type of the item. - /// The primary source to union. - /// The other changeset streams to combine with. + /// The primary source IObservable<IChangeSet<T>> to union. + /// The other IObservable<IChangeSet<T>> changeset streams to combine with. /// A list changeset stream containing items that exist in at least one source. /// is . /// @@ -52,10 +55,10 @@ public static IObservable> Or(this ICollectionMovedIgnored. /// /// - /// - /// - /// - /// + /// And<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// Except<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// Xor<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// MergeChangeSets<TObject>(IEnumerable<IObservable<IChangeSet<TObject>>>, IEqualityComparer<TObject>?, IScheduler?, bool) public static IObservable> Or(this IObservable> source, params IObservable>[] others) where T : notnull { @@ -64,24 +67,33 @@ public static IObservable> Or(this IObservable> s return source.Combine(CombineOperator.Or, others); } - /// + /// This overload follows the same core behavior as the related overload. /// - /// Dynamic OR: sources can be added or removed from the at runtime. + /// Dynamic OR: sources can be added or removed from the IObservableList<T> at runtime. /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. public static IObservable> Or(this IObservableList>> sources) where T : notnull => sources.Combine(CombineOperator.Or); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Dynamic OR accepting of . Each inner list's Connect() is used as a source. + /// Dynamic OR accepting IObservableList<T> of IObservableList<T>. Each inner list's Connect() is used as a source. /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. public static IObservable> Or(this IObservableList> sources) where T : notnull => sources.Combine(CombineOperator.Or); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Dynamic OR accepting of . Each inner list's Connect() is used as a source. + /// Dynamic OR accepting IObservableList<T> of ISourceList<T>. Each inner list's Connect() is used as a source. /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. public static IObservable> Or(this IObservableList> sources) where T : notnull => sources.Combine(CombineOperator.Or); } diff --git a/src/DynamicData/List/ObservableListEx.Page.cs b/src/DynamicData/List/ObservableListEx.Page.cs index 948663a36..436ec7b61 100644 --- a/src/DynamicData/List/ObservableListEx.Page.cs +++ b/src/DynamicData/List/ObservableListEx.Page.cs @@ -25,9 +25,9 @@ public static partial class ObservableListEx /// Applies page-based windowing to the source list. Only items within the current page (determined by page number and page size from ) are included downstream. ///
/// The type of the item. - /// The source to page. + /// The source IObservable<IChangeSet<T>> to page. /// An observable of controlling which page to display (page number and page size). - /// An stream containing only items within the current page window. + /// An IPageChangeSet<T> stream containing only items within the current page window. /// or is . /// /// @@ -37,9 +37,9 @@ public static partial class ObservableListEx /// /// Worth noting: Duplicate items are removed from the result via Distinct() using the default equality comparer for , regardless of source order. The source should ideally be sorted before paging, since list order determines which items fall within each page window. /// - /// - /// - /// + /// Virtualise<T>(IObservable<IChangeSet<T>>, IObservable<IVirtualRequest>) + /// Top<T>(IObservable<IChangeSet<T>>, int) + /// Sort<T>(IObservable<IChangeSet<T>>, IComparer<T>, SortOptions, IObservable<Unit>?, IObservable<IComparer<T>>?, int) public static IObservable> Page(this IObservable> source, IObservable requests) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.PopulateInto.cs b/src/DynamicData/List/ObservableListEx.PopulateInto.cs index 61a7da15f..969744086 100644 --- a/src/DynamicData/List/ObservableListEx.PopulateInto.cs +++ b/src/DynamicData/List/ObservableListEx.PopulateInto.cs @@ -22,19 +22,19 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Subscribes to the source changeset stream and pipes all changes into the . + /// Subscribes to the source changeset stream and pipes all changes into the ISourceList<T>. /// /// The type of the object. - /// The source to pipe into a target list. - /// The destination to receive all changes. + /// The source IObservable<IChangeSet<T>> to pipe into a target list. + /// The destination ISourceList<T> to receive all changes. /// An representing the subscription. Dispose to stop piping changes. /// or is . /// /// Each changeset is applied to the destination using Clone() inside an Edit() call, producing a single batch update per changeset. /// - /// - /// - /// + /// Clone<T>(IObservable<IChangeSet<T>>, IList<T>) + /// Bind<T>(IObservable<IChangeSet<T>>, IObservableCollection<T>, BindingOptions) + /// ObservableCacheEx.PopulateInto<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, ISourceCache<TObject, TKey>) public static IDisposable PopulateInto(this IObservable> source, ISourceList destination) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs index 68cd8070e..45831cdeb 100644 --- a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs +++ b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs @@ -28,20 +28,20 @@ public static partial class ObservableListEx { /// /// Emits a projected value from the current list snapshot after every changeset. - /// The receives an representing the current state. + /// The receives an IReadOnlyCollection<T> representing the current state. /// /// The type of items in the list. /// The type of the projected result. - /// The source to project on each change. - /// A function projecting the current list snapshot to a result value. + /// The source IObservable<IChangeSet<TObject>> to project on each change. + /// A Func<T, TResult> function projecting the current list snapshot to a result value. /// An observable emitting the projected value after each changeset. /// or is . /// - /// Delegates to and applies via Select. + /// Delegates to QueryWhenChanged<T>(IObservable<IChangeSet<T>>) and applies via Select. /// - /// - /// - /// + /// QueryWhenChanged<T>(IObservable<IChangeSet<T>>) + /// ToCollection<TObject>(IObservable<IChangeSet<TObject>>) + /// ObservableCacheEx.QueryWhenChanged<TObject, TKey, TDestination>(IObservable<IChangeSet<TObject, TKey>>, Func<IQuery<TObject, TKey>, TDestination>) public static IObservable QueryWhenChanged(this IObservable> source, Func, TDestination> resultSelector) where TObject : notnull { @@ -52,20 +52,20 @@ public static IObservable QueryWhenChanged( } /// - /// Emits an snapshot of the current list state after every changeset. + /// Emits an IReadOnlyCollection<T> snapshot of the current list state after every changeset. /// Maintains an internal list updated by cloning each changeset. /// /// The type of items in the list. - /// The source to project on each change. - /// An observable emitting the full list snapshot as after each change. + /// The source IObservable<IChangeSet<T>> to project on each change. + /// An observable emitting the full list snapshot as IReadOnlyCollection<T> after each change. /// is . /// /// This is a non-changeset operator. It emits the entire collection state on each change, not incremental diffs. - /// Worth noting: A new snapshot is emitted on every changeset, which can be chatty. The collection is rebuilt by cloning each changeset into an internal list. For sorted output, use . + /// Worth noting: A new snapshot is emitted on every changeset, which can be chatty. The collection is rebuilt by cloning each changeset into an internal list. For sorted output, use ToSortedCollection<TObject, TSortKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TSortKey>, SortDirection). /// - /// - /// - /// + /// QueryWhenChanged<TObject, TDestination>(IObservable<IChangeSet<TObject>>, Func<IReadOnlyCollection<TObject>, TDestination>) + /// ToCollection<TObject>(IObservable<IChangeSet<TObject>>) + /// ToSortedCollection<TObject, TSortKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TSortKey>, SortDirection) public static IObservable> QueryWhenChanged(this IObservable> source) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.RefCount.cs b/src/DynamicData/List/ObservableListEx.RefCount.cs index 93b443c15..656150e2f 100644 --- a/src/DynamicData/List/ObservableListEx.RefCount.cs +++ b/src/DynamicData/List/ObservableListEx.RefCount.cs @@ -22,17 +22,17 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Reference-counted materialization of the source changeset stream into an . + /// Reference-counted materialization of the source changeset stream into an IObservableList<T>. /// The shared list is created on the first subscriber and disposed when the last subscriber unsubscribes. /// /// The type of the item. - /// The source to share via reference counting. - /// A list changeset stream backed by a shared, reference-counted . + /// The source IObservable<IChangeSet<T>> to share via reference counting. + /// A list changeset stream backed by a shared, reference-counted IObservableList<T>. /// is . /// /// Equivalent to Publish().RefCount() for changeset streams. The underlying list is created lazily on first subscription. /// - /// + /// AsObservableList<T>(IObservable<IChangeSet<T>>) public static IObservable> RefCount(this IObservable> source) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs index 190fbd6e9..fa569ede2 100644 --- a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs +++ b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs @@ -18,13 +18,13 @@ public static partial class ObservableListEx /// Strips index information from all changes in the stream. ///
/// The type of the object. - /// The source to strip index information. + /// The source IObservable<IChangeSet<T>> to strip index information. /// A list changeset stream with all index values removed from changes. /// is . /// /// Removes index positions from every change in each changeset. This is useful when downstream operators do not require or support index-based operations. /// - /// + /// ChangeSetEx.YieldWithoutIndex<T>(IEnumerable<Change<T>>) public static IObservable> RemoveIndex(this IObservable> source) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.Reverse.cs b/src/DynamicData/List/ObservableListEx.Reverse.cs index 58a5891db..c56cca121 100644 --- a/src/DynamicData/List/ObservableListEx.Reverse.cs +++ b/src/DynamicData/List/ObservableListEx.Reverse.cs @@ -25,13 +25,13 @@ public static partial class ObservableListEx /// Reverses the order of items in the changeset stream by transforming all indices: new_index = length - old_index - 1. ///
/// The type of the item. - /// The source to reverse. + /// The source IObservable<IChangeSet<T>> to reverse. /// A list changeset stream with all index positions reversed. /// is . /// /// This is a pure index transformation. The items themselves are unchanged; only their positional indices are inverted. /// - /// + /// Sort<T>(IObservable<IChangeSet<T>>, IComparer<T>, SortOptions, IObservable<Unit>?, IObservable<IComparer<T>>?, int) public static IObservable> Reverse(this IObservable> source) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.SkipInitial.cs b/src/DynamicData/List/ObservableListEx.SkipInitial.cs index b1aaa99f4..107bdb1d8 100644 --- a/src/DynamicData/List/ObservableListEx.SkipInitial.cs +++ b/src/DynamicData/List/ObservableListEx.SkipInitial.cs @@ -19,7 +19,7 @@ public static partial class ObservableListEx /// Internally defers until loaded, then skips the first emission. ///
/// The type of the object. - /// The source to skip the initial changeset. + /// The source IObservable<IChangeSet<T>> to skip the initial changeset. /// A list changeset stream that omits the initial snapshot. /// is . /// @@ -28,11 +28,11 @@ public static partial class ObservableListEx /// initial snapshot, those items are silently dropped while downstream consumers remain unaware of them. /// Any later Refresh, Replace, Remove, or Moved change targeting one of those /// dropped items will throw because the downstream collection has no record of them. Only use this against - /// a source you know starts empty (for example, a that has not yet been populated). + /// a source you know starts empty (for example, a ISourceList<T> that has not yet been populated). /// /// - /// - /// + /// DeferUntilLoaded<T>(IObservable<IChangeSet<T>>) + /// StartWithEmpty<T>(IObservable<IChangeSet<T>>) public static IObservable> SkipInitial(this IObservable> source) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.Sort.cs b/src/DynamicData/List/ObservableListEx.Sort.cs index 4702db60a..710cb2d1d 100644 --- a/src/DynamicData/List/ObservableListEx.Sort.cs +++ b/src/DynamicData/List/ObservableListEx.Sort.cs @@ -30,11 +30,11 @@ public static partial class ObservableListEx /// Sorts the list using the specified comparer, maintaining a sorted output that incrementally updates as items change. ///
/// The type of the item. - /// The source to sort. - /// The used for sorting. + /// The source IObservable<IChangeSet<T>> to sort. + /// The IComparer<T> used for sorting. /// The for improved performance when sorted values are immutable. - /// An optional of that forces a full re-sort when it fires. Required when sorted property values are mutable. - /// An optional of that replaces the comparer, triggering a full re-sort. + /// An optional IObservable<Unit> of that forces a full re-sort when it fires. Required when sorted property values are mutable. + /// An optional IObservable<IComparer<T>> of IComparer<T> that replaces the comparer, triggering a full re-sort. /// When the number of changes exceeds this threshold, a full reset is performed instead of incremental updates. Default is 50. /// A list changeset stream with items in sorted order. /// or is . @@ -52,12 +52,12 @@ public static partial class ObservableListEx /// Comparer changedFull re-sort of all items. /// Re-sort signalFull re-sort using the current comparer. /// - /// Worth noting: is faster but requires that the values being sorted on never mutate. If they do, use the signal or . + /// Worth noting: is faster but requires that the values being sorted on never mutate. If they do, use the signal or AutoRefresh<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan?, TimeSpan?, IScheduler?). /// - /// - /// - /// - /// + /// Sort<T>(IObservable<IChangeSet<T>>, IObservable<IComparer<T>>, SortOptions, IObservable<Unit>?, int) + /// Page<T>(IObservable<IChangeSet<T>>, IObservable<IPageRequest>) + /// Bind<T>(IObservable<IChangeSet<T>>, IObservableCollection<T>, BindingOptions) + /// ObservableCacheEx.Sort<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IComparer<TObject>, SortOptimisations, int) public static IObservable> Sort(this IObservable> source, IComparer comparer, SortOptions options = SortOptions.None, IObservable? resort = null, IObservable>? comparerChanged = null, int resetThreshold = 50) where T : notnull { @@ -67,17 +67,19 @@ public static IObservable> Sort(this IObservable> return new Sort(source, comparer, options, resort, comparerChanged, resetThreshold).Run(); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Sorts the list using an observable comparer. The initial comparer is taken from the first emission; subsequent emissions trigger a full re-sort. /// + /// The type of the T value. + /// The resulting observable sequence. /// - /// Until emits its first comparer, items are sorted using . Downstream still receives changesets immediately; the initial ordering is whatever produces, then a full re-sort happens once the first comparer arrives. + /// Until emits its first comparer, items are sorted using Comparer<T>.Default. Downstream still receives changesets immediately; the initial ordering is whatever Comparer<T>.Default produces, then a full re-sort happens once the first comparer arrives. /// - /// The source to sort. - /// An of that emits comparers. The first emission provides the initial sort order; subsequent emissions trigger re-sorts. + /// The source IObservable<IChangeSet<T>> to sort. + /// An IObservable<IComparer<T>> of IComparer<T> that emits comparers. The first emission provides the initial sort order; subsequent emissions trigger re-sorts. /// for controlling sort behavior. - /// An optional of to force a re-sort with the current comparer. + /// An optional IObservable<Unit> of to force a re-sort with the current comparer. /// The threshold for triggering a full reset instead of incremental updates. public static IObservable> Sort(this IObservable> source, IObservable> comparerChanged, SortOptions options = SortOptions.None, IObservable? resort = null, int resetThreshold = 50) where T : notnull diff --git a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs index a48b51929..d92f1ce2f 100644 --- a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs @@ -18,11 +18,11 @@ public static partial class ObservableListEx /// Prepends an empty changeset to the source stream. Useful for initializing downstream consumers that expect an initial emission. ///
/// The type of item. - /// The source to prepend an empty changeset to. + /// The source IObservable<IChangeSet<T>> to prepend an empty changeset to. /// A list changeset stream that begins with an empty changeset. - /// - /// - /// + /// DeferUntilLoaded<T>(IObservable<IChangeSet<T>>) + /// SkipInitial<T>(IObservable<IChangeSet<T>>) + /// ObservableCacheEx.StartWithEmpty<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>) public static IObservable> StartWithEmpty(this IObservable> source) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs index adfe1b531..01d1f3d37 100644 --- a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs +++ b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs @@ -27,7 +27,7 @@ public static partial class ObservableListEx /// The changeset is forwarded downstream unmodified. ///
/// The type of the object. - /// The source to create a subscription for each item in. + /// The source IObservable<IChangeSet<T>> to create a subscription for each item in. /// A function that creates an for each item. /// A continuation of the source changeset stream with per-item subscriptions managed as a side effect. /// or is . @@ -41,10 +41,10 @@ public static partial class ObservableListEx /// OnError/OnCompleted/DisposalAll active subscriptions are disposed. /// /// - /// - /// - /// - /// + /// MergeMany<T, TDestination>(IObservable<IChangeSet<T>>, Func<T, IObservable<TDestination>>) + /// DisposeMany<T>(IObservable<IChangeSet<T>>) + /// OnItemRemoved<T>(IObservable<IChangeSet<T>>, Action<T>, bool) + /// ObservableCacheEx.SubscribeMany<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, Func<TObject, IDisposable>) public static IObservable> SubscribeMany(this IObservable> source, Func subscriptionFactory) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs index b1b8c7fd5..0e71455a3 100644 --- a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs @@ -18,10 +18,10 @@ public static partial class ObservableListEx /// Suppresses all changes from the stream. All other change reasons pass through. ///
/// The type of the object. - /// The source to strip refresh events. + /// The source IObservable<IChangeSet<T>> to strip refresh events. /// A list changeset stream with Refresh changes removed. - /// - /// + /// WhereReasonsAreNot<T>(IObservable<IChangeSet<T>>, ListChangeReason[]) + /// AutoRefresh<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan?, TimeSpan?, IScheduler?) public static IObservable> SuppressRefresh(this IObservable> source) where T : notnull => source.WhereReasonsAreNot(ListChangeReason.Refresh); } diff --git a/src/DynamicData/List/ObservableListEx.Switch.cs b/src/DynamicData/List/ObservableListEx.Switch.cs index d278e8d8b..d00f6b414 100644 --- a/src/DynamicData/List/ObservableListEx.Switch.cs +++ b/src/DynamicData/List/ObservableListEx.Switch.cs @@ -22,17 +22,17 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Subscribes to the latest inner , switching to each new source and clearing the result when switching. - /// This is the changeset-aware equivalent of Rx's , which cannot be applied directly to changeset streams. + /// Subscribes to the latest inner IObservableList<T>, switching to each new source and clearing the result when switching. + /// This is the changeset-aware equivalent of Rx's Observable.Switch<TSource>(IObservable<IObservable<TSource>>), which cannot be applied directly to changeset streams. /// /// The type of the object. - /// An observable that emits instances. Each emission triggers a switch to the new list. + /// An observable that emits IObservableList<T> instances. Each emission triggers a switch to the new list. /// A list changeset stream reflecting the most recently received inner list. /// is . /// - /// Convenience overload that calls Connect() on each inner list, then delegates to . + /// Convenience overload that calls Connect() on each inner list, then delegates to Switch<T>(IObservable<IObservable<IChangeSet<T>>>). /// - /// + /// Switch<T>(IObservable<IObservable<IChangeSet<T>>>) public static IObservable> Switch(this IObservable> sources) where T : notnull { @@ -46,7 +46,7 @@ public static IObservable> Switch(this IObservable /// The type of the object. - /// An of changeset streams. The operator subscribes to the latest inner stream. + /// An IObservable<T> of IObservable<T> changeset streams. The operator subscribes to the latest inner stream. /// A list changeset stream reflecting the most recently received inner changeset stream. /// is . /// @@ -55,7 +55,7 @@ public static IObservable> Switch(this IObservableSwitch(). /// /// - /// + /// Switch<T>(IObservable<IObservableList<T>>) public static IObservable> Switch(this IObservable>> sources) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.ToCollection.cs b/src/DynamicData/List/ObservableListEx.ToCollection.cs index 9d6da299e..2c43ab29f 100644 --- a/src/DynamicData/List/ObservableListEx.ToCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToCollection.cs @@ -22,14 +22,14 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Emits the full collection as an after every changeset. Equivalent to QueryWhenChanged(items => items). + /// Emits the full collection as an IReadOnlyCollection<T> after every changeset. Equivalent to QueryWhenChanged(items => items). /// /// The type of items in the list. - /// The source to materialize into a collection on each change. + /// The source IObservable<IChangeSet<TObject>> to materialize into a collection on each change. /// An observable emitting the full collection snapshot after each change. - /// - /// - /// + /// QueryWhenChanged<T>(IObservable<IChangeSet<T>>) + /// ToSortedCollection<TObject, TSortKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TSortKey>, SortDirection) + /// ObservableCacheEx.ToCollection<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>) public static IObservable> ToCollection(this IObservable> source) where TObject : notnull => source.QueryWhenChanged(items => items); } diff --git a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs index 6b4105aaa..a6a09890f 100644 --- a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs +++ b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs @@ -15,11 +15,11 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Bridges an into the DynamicData world by converting each emitted item into a list changeset. + /// Bridges an IObservable<T> into the DynamicData world by converting each emitted item into a list changeset. /// Each emission becomes an Add operation in the resulting changeset stream. /// /// The type of the object. - /// The source to convert into a changeset stream. + /// The source IObservable<T> to convert into a changeset stream. /// An optional for time-based operations (expiry, size limiting). /// A list changeset stream where each source emission is an Add. /// is . @@ -31,8 +31,8 @@ public static partial class ObservableListEx /// /// Worth noting: Source completion and errors are propagated. The internal list is disposed on unsubscribe. /// - /// - /// + /// ToObservableChangeSet<T>(IObservable<T>, Func<T, TimeSpan?>, int, IScheduler?) + /// ToObservableChangeSet<T>(IObservable<IEnumerable<T>>, IScheduler?) public static IObservable> ToObservableChangeSet( this IObservable source, IScheduler? scheduler = null) @@ -43,14 +43,16 @@ public static IObservable> ToObservableChangeSet( limitSizeTo: -1, scheduler: scheduler); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Bridges an into a list changeset stream with per-item time-based expiry. + /// Bridges an IObservable<T> into a list changeset stream with per-item time-based expiry. /// Expired items are automatically removed. /// - /// The source to convert into a changeset stream. - /// A function returning the time-to-live for each item. Return for non-expiring items. + /// The type of the T value. + /// The source IObservable<T> to convert into a changeset stream. + /// A Func<T, TResult> function returning the time-to-live for each item. Return for non-expiring items. /// An optional for expiry timers. + /// The resulting observable sequence. public static IObservable> ToObservableChangeSet( this IObservable source, Func expireAfter, @@ -62,14 +64,16 @@ public static IObservable> ToObservableChangeSet( limitSizeTo: -1, scheduler: scheduler); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Bridges an into a list changeset stream with FIFO size limiting. + /// Bridges an IObservable<T> into a list changeset stream with FIFO size limiting. /// When the list exceeds , the oldest items are removed. /// - /// The source to convert into a changeset stream. + /// The type of the T value. + /// The source IObservable<T> to convert into a changeset stream. /// The maximum list size. Supply -1 to disable size limiting. /// An optional for scheduling removals. + /// The resulting observable sequence. public static IObservable> ToObservableChangeSet( this IObservable source, int limitSizeTo, @@ -81,14 +85,16 @@ public static IObservable> ToObservableChangeSet( limitSizeTo: limitSizeTo, scheduler: scheduler); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Bridges an into a list changeset stream with both time-based expiry and FIFO size limiting. + /// Bridges an IObservable<T> into a list changeset stream with both time-based expiry and FIFO size limiting. /// - /// The source to convert into a changeset stream. - /// A function returning the time-to-live for each item. Return for non-expiring items. + /// The type of the T value. + /// The source IObservable<T> to convert into a changeset stream. + /// A Func<T, TResult> function returning the time-to-live for each item. Return for non-expiring items. /// The maximum list size. Supply -1 to disable size limiting. /// An optional for expiry timers and size-limit checks. + /// The resulting observable sequence. public static IObservable> ToObservableChangeSet( this IObservable source, Func? expireAfter, @@ -101,13 +107,15 @@ public static IObservable> ToObservableChangeSet( limitSizeTo: limitSizeTo, scheduler: scheduler); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Bridges an of batches into a list changeset stream. + /// Bridges an IObservable<T> of IEnumerable<T> batches into a list changeset stream. /// Each emitted batch becomes an AddRange. /// - /// The source of to convert into a changeset stream. + /// The type of the T value. + /// The source IObservable<IEnumerable<T>> of IEnumerable<T> to convert into a changeset stream. /// An optional for time-based operations. + /// The resulting observable sequence. public static IObservable> ToObservableChangeSet( this IObservable> source, IScheduler? scheduler = null) @@ -118,13 +126,15 @@ public static IObservable> ToObservableChangeSet( limitSizeTo: -1, scheduler: scheduler); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Bridges an of batches into a list changeset stream with FIFO size limiting. + /// Bridges an IObservable<T> of IEnumerable<T> batches into a list changeset stream with FIFO size limiting. /// - /// The source of to convert into a changeset stream. + /// The type of the T value. + /// The source IObservable<IEnumerable<T>> of IEnumerable<T> to convert into a changeset stream. /// The maximum list size. Oldest items are removed when the limit is exceeded. /// An optional for scheduling removals. + /// The resulting observable sequence. public static IObservable> ToObservableChangeSet( this IObservable> source, int limitSizeTo, @@ -136,13 +146,15 @@ public static IObservable> ToObservableChangeSet( limitSizeTo: limitSizeTo, scheduler: scheduler); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Bridges an of batches into a list changeset stream with time-based expiry. + /// Bridges an IObservable<T> of IEnumerable<T> batches into a list changeset stream with time-based expiry. /// - /// The source of to convert into a changeset stream. - /// A function returning the time-to-live for each item. Return for non-expiring items. + /// The type of the T value. + /// The source IObservable<IEnumerable<T>> of IEnumerable<T> to convert into a changeset stream. + /// A Func<T, TResult> function returning the time-to-live for each item. Return for non-expiring items. /// An optional for expiry timers. + /// The resulting observable sequence. public static IObservable> ToObservableChangeSet( this IObservable> source, Func expireAfter, @@ -154,14 +166,16 @@ public static IObservable> ToObservableChangeSet( limitSizeTo: -1, scheduler: scheduler); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Bridges an of batches into a list changeset stream with both time-based expiry and FIFO size limiting. + /// Bridges an IObservable<T> of IEnumerable<T> batches into a list changeset stream with both time-based expiry and FIFO size limiting. /// - /// The source of to convert into a changeset stream. - /// A function returning the time-to-live for each item. Return for non-expiring items. + /// The type of the T value. + /// The source IObservable<IEnumerable<T>> of IEnumerable<T> to convert into a changeset stream. + /// A Func<T, TResult> function returning the time-to-live for each item. Return for non-expiring items. /// The maximum list size. Oldest items removed when exceeded. /// An optional for expiry timers and size-limit checks. + /// The resulting observable sequence. public static IObservable> ToObservableChangeSet( this IObservable> source, Func? expireAfter, diff --git a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs index 2fca0b78f..7d6c53e4d 100644 --- a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs @@ -22,30 +22,30 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Emits a sorted after every changeset, sorted by the value returned by . + /// Emits a sorted IReadOnlyCollection<T> after every changeset, sorted by the value returned by . /// /// The type of items in the list. /// The type of the sort key. - /// The source to materialize into a sorted collection on each change. - /// A function extracting the sort key from each item. + /// The source IObservable<IChangeSet<TObject>> to materialize into a sorted collection on each change. + /// A Func<T, TResult> function extracting the sort key from each item. /// The sort direction. Defaults to ascending. /// An observable emitting a sorted collection snapshot after each change. - /// - /// - /// - /// + /// ToCollection<TObject>(IObservable<IChangeSet<TObject>>) + /// ToSortedCollection<TObject>(IObservable<IChangeSet<TObject>>, IComparer<TObject>) + /// QueryWhenChanged<T>(IObservable<IChangeSet<T>>) + /// ObservableCacheEx.ToSortedCollection<TObject, TKey> public static IObservable> ToSortedCollection(this IObservable> source, Func sort, SortDirection sortOrder = SortDirection.Ascending) where TObject : notnull => source.QueryWhenChanged(query => sortOrder == SortDirection.Ascending ? new ReadOnlyCollectionLight(query.OrderBy(sort)) : new ReadOnlyCollectionLight(query.OrderByDescending(sort))); /// - /// Emits a sorted after every changeset, sorted using the specified . + /// Emits a sorted IReadOnlyCollection<T> after every changeset, sorted using the specified . /// /// The type of items in the list. - /// The source to materialize into a sorted collection on each change. - /// The used for sorting. + /// The source IObservable<IChangeSet<TObject>> to materialize into a sorted collection on each change. + /// The IComparer<TObject> used for sorting. /// An observable emitting a sorted collection snapshot after each change. - /// - /// + /// ToSortedCollection<TObject, TSortKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TSortKey>, SortDirection) + /// ToCollection<TObject>(IObservable<IChangeSet<TObject>>) public static IObservable> ToSortedCollection(this IObservable> source, IComparer comparer) where TObject : notnull => source.QueryWhenChanged( query => diff --git a/src/DynamicData/List/ObservableListEx.Top.cs b/src/DynamicData/List/ObservableListEx.Top.cs index 2d4f7fc90..2e689e986 100644 --- a/src/DynamicData/List/ObservableListEx.Top.cs +++ b/src/DynamicData/List/ObservableListEx.Top.cs @@ -18,7 +18,7 @@ public static partial class ObservableListEx /// Takes the first items from the source list. Implemented as Virtualise with a fixed window starting at index 0. ///
/// The type of the item. - /// The source to take the top items. + /// The source IObservable<IChangeSet<T>> to take the top items. /// The maximum number of items to include. Must be greater than zero. /// A virtual changeset stream containing at most items from the beginning of the source. /// is . @@ -26,9 +26,9 @@ public static partial class ObservableListEx /// /// The source should ideally be sorted before applying Top, since list order determines which items appear. /// - /// - /// - /// + /// Virtualise<T>(IObservable<IChangeSet<T>>, IObservable<IVirtualRequest>) + /// Page<T>(IObservable<IChangeSet<T>>, IObservable<IPageRequest>) + /// Sort<T>(IObservable<IChangeSet<T>>, IComparer<T>, SortOptions, IObservable<Unit>?, IObservable<IComparer<T>>?, int) public static IObservable> Top(this IObservable> source, int numberOfItems) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.Transform.cs b/src/DynamicData/List/ObservableListEx.Transform.cs index 4e9a4f384..6f201a4d7 100644 --- a/src/DynamicData/List/ObservableListEx.Transform.cs +++ b/src/DynamicData/List/ObservableListEx.Transform.cs @@ -26,8 +26,8 @@ public static partial class ObservableListEx ///
/// The type of the source items. /// The type of the destination items. - /// The source to transform. - /// The transform function applied to each item. + /// The source IObservable<IChangeSet<TSource>> to transform. + /// The Func<T, TResult> transform function applied to each item. /// When , Refresh events re-invoke the factory and emit an update. When (the default), Refresh is forwarded without re-transforming. /// A list changeset stream of transformed items. /// @@ -39,7 +39,7 @@ public static partial class ObservableListEx /// EventBehavior /// AddThe factory is called and an Add is emitted at the same index. /// AddRangeThe factory is called for each item. An AddRange is emitted at the same start index. - /// ReplaceThe factory is called for the new item. A Replace is emitted at the same index. The previous transformed value is available to overloads that accept . + /// ReplaceThe factory is called for the new item. A Replace is emitted at the same index. The previous transformed value is available to overloads that accept Optional<TDestination>. /// RemoveA Remove is emitted (no factory call). /// RemoveRangeA RemoveRange is emitted. /// MovedA Moved is emitted with updated indices (no factory call). Throws if the source change has no index information. @@ -50,10 +50,10 @@ public static partial class ObservableListEx /// Worth noting: By default, Refresh does NOT re-transform the item (it just forwards the signal). Set to if you need the factory re-invoked on Refresh. Add operations with out-of-bounds indices silently append to the end. /// /// or is . - /// - /// - /// - /// + /// TransformAsync<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, Task<TDestination>>, bool) + /// TransformMany<TDestination, TSource>(IObservable<IChangeSet<TSource>>, Func<TSource, IEnumerable<TDestination>>, IEqualityComparer<TDestination>?) + /// Convert<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, TDestination>) + /// ObservableCacheEx.Transform<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, TDestination>, bool) public static IObservable> Transform(this IObservable> source, Func transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull @@ -65,10 +65,16 @@ public static IObservable> Transform((t, _, _) => transformFactory(t), transformOnRefresh); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Projects each item using a transform function that also receives the item's index. /// + /// The type of the TSource value. + /// The type of the TDestination value. + /// The source value. + /// The transformFactory value. + /// The transformOnRefresh value. + /// The resulting observable sequence. public static IObservable> Transform(this IObservable> source, Func transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull @@ -79,11 +85,17 @@ public static IObservable> Transform((t, _, idx) => transformFactory(t, idx), transformOnRefresh); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Projects each item using a transform function that also receives the previously transformed value (if any). /// Type arguments must be specified explicitly as type inference fails for this overload. /// + /// The type of the TSource value. + /// The type of the TDestination value. + /// The source value. + /// The transformFactory value. + /// The transformOnRefresh value. + /// The resulting observable sequence. public static IObservable> Transform(this IObservable> source, Func, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull @@ -94,11 +106,17 @@ public static IObservable> Transform((t, previous, _) => transformFactory(t, previous), transformOnRefresh); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Projects each item using a transform function that receives the source item, the previously transformed value, and the index. /// Type arguments must be specified explicitly as type inference fails for this overload. /// + /// The type of the TSource value. + /// The type of the TDestination value. + /// The source value. + /// The transformFactory value. + /// The transformOnRefresh value. + /// The resulting observable sequence. public static IObservable> Transform(this IObservable> source, Func, int, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull diff --git a/src/DynamicData/List/ObservableListEx.TransformAsync.cs b/src/DynamicData/List/ObservableListEx.TransformAsync.cs index e0a66113f..c589f3627 100644 --- a/src/DynamicData/List/ObservableListEx.TransformAsync.cs +++ b/src/DynamicData/List/ObservableListEx.TransformAsync.cs @@ -22,17 +22,17 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Projects each item to a new form using an async transform function. Behaves like but the factory returns a . + /// Projects each item to a new form using an async transform function. Behaves like Transform<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, TDestination>, bool) but the factory returns a Task<T>. /// /// The type of the source items. /// The type of the destination items. - /// The source to transform asynchronously. - /// An async function that transforms each source item. + /// The source IObservable<IChangeSet<TSource>> to transform asynchronously. + /// An Func<T, TResult> async function that transforms each source item. /// When , Refresh events re-invoke the factory. /// A list changeset stream of asynchronously transformed items. /// or is . /// - /// Change handling is identical to the synchronous except the factory is awaited. Operations are serialized per changeset via a semaphore. + /// Change handling is identical to the synchronous Transform<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, TDestination>, bool) except the factory is awaited. Operations are serialized per changeset via a semaphore. /// /// EventBehavior /// Add/AddRangeThe async factory is awaited for each item. An Add/AddRange is emitted with the transformed results. @@ -46,8 +46,8 @@ public static partial class ObservableListEx /// /// Worth noting: All async transforms within a single changeset are serialized (not parallel). Each changeset is fully processed before the next begins. By default, Refresh does NOT re-transform. /// - /// - /// + /// Transform<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, TDestination>, bool) + /// ObservableCacheEx.TransformAsync<TDestination, TSource, TKey>(IObservable<IChangeSet<TSource, TKey>>, Func<TSource, Task<TDestination>>, IObservable<Func<TSource, TKey, bool>>) [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync( this IObservable> source, @@ -62,10 +62,16 @@ public static IObservable> TransformAsync((t, _, _) => transformFactory(t), transformOnRefresh); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Async transform overload receiving the source item and its index. /// + /// The type of the TSource value. + /// The type of the TDestination value. + /// The source value. + /// The transformFactory value. + /// The transformOnRefresh value. + /// The resulting observable sequence. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync( this IObservable> source, @@ -80,10 +86,16 @@ public static IObservable> TransformAsync((t, _, i) => transformFactory(t, i), transformOnRefresh); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Async transform overload receiving the source item and the previously transformed value. /// + /// The type of the TSource value. + /// The type of the TDestination value. + /// The source value. + /// The transformFactory value. + /// The transformOnRefresh value. + /// The resulting observable sequence. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync( this IObservable> source, @@ -98,10 +110,16 @@ public static IObservable> TransformAsync((t, d, _) => transformFactory(t, d), transformOnRefresh); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Async transform overload receiving the source item, previously transformed value, and index. This is the terminal overload that all other TransformAsync overloads delegate to. /// + /// The type of the TSource value. + /// The type of the TDestination value. + /// The source value. + /// The transformFactory value. + /// The transformOnRefresh value. + /// The resulting observable sequence. [SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "By Design.")] public static IObservable> TransformAsync( this IObservable> source, diff --git a/src/DynamicData/List/ObservableListEx.TransformMany.cs b/src/DynamicData/List/ObservableListEx.TransformMany.cs index 3896ff377..416666d8c 100644 --- a/src/DynamicData/List/ObservableListEx.TransformMany.cs +++ b/src/DynamicData/List/ObservableListEx.TransformMany.cs @@ -27,9 +27,9 @@ public static partial class ObservableListEx ///
/// The type of the destination items. /// The type of the source items. - /// The source to expand each item into multiple children. - /// A function that returns the child items for each source item. - /// An optional used during Replace to determine which child items changed between old and new parent values. + /// The source IObservable<IChangeSet<TSource>> to expand each item into multiple children. + /// A Func<T, TResult> function that returns the child items for each source item. + /// An optional IEqualityComparer<TDestination> used during Replace to determine which child items changed between old and new parent values. /// A list changeset stream of all child items from all source items. /// or is . /// @@ -41,9 +41,9 @@ public static partial class ObservableListEx /// RefreshChildren re-expanded and diffed. /// /// - /// - /// - /// + /// Transform<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, TDestination>, bool) + /// MergeManyChangeSets<TObject, TDestination>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination>>>, IEqualityComparer<TDestination>?) + /// ObservableCacheEx.TransformMany<TDestination, TDestinationKey, TSource, TSourceKey>(IObservable<IChangeSet<TSource, TSourceKey>>, Func<TSource, IEnumerable<TDestination>>, Func<TDestination, TDestinationKey>) public static IObservable> TransformMany(this IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null) where TDestination : notnull where TSource : notnull @@ -54,26 +54,44 @@ public static IObservable> TransformMany(source, manySelector, equalityComparer).Run(); } - /// + /// This overload follows the same core behavior as the related overload. /// - /// Flattens each source item into children from an . The collection is observed for subsequent changes. + /// Flattens each source item into children from an ObservableCollection<T>. The collection is observed for subsequent changes. /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The source value. + /// The manySelector value. + /// The equalityComparer value. + /// The resulting observable sequence. public static IObservable> TransformMany(this IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null) where TDestination : notnull where TSource : notnull => new TransformMany(source, manySelector, equalityComparer).Run(); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Flattens each source item into children from a . The collection is observed for subsequent changes. + /// Flattens each source item into children from a ReadOnlyObservableCollection<T>. The collection is observed for subsequent changes. /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The source value. + /// The manySelector value. + /// The equalityComparer value. + /// The resulting observable sequence. public static IObservable> TransformMany(this IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null) where TDestination : notnull where TSource : notnull => new TransformMany(source, manySelector, equalityComparer).Run(); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Flattens each source item into children from an . The inner list is observed for subsequent changes. + /// Flattens each source item into children from an IObservableList<T>. The inner list is observed for subsequent changes. /// + /// The type of the TDestination value. + /// The type of the TSource value. + /// The source value. + /// The manySelector value. + /// The equalityComparer value. + /// The resulting observable sequence. public static IObservable> TransformMany(this IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null) where TDestination : notnull where TSource : notnull => new TransformMany(source, manySelector, equalityComparer).Run(); diff --git a/src/DynamicData/List/ObservableListEx.Virtualise.cs b/src/DynamicData/List/ObservableListEx.Virtualise.cs index 02db162fe..69f00ef28 100644 --- a/src/DynamicData/List/ObservableListEx.Virtualise.cs +++ b/src/DynamicData/List/ObservableListEx.Virtualise.cs @@ -26,18 +26,18 @@ public static partial class ObservableListEx /// Only items within the window are included downstream. ///
/// The type of the item. - /// The source to virtualize. + /// The source IObservable<IChangeSet<T>> to virtualize. /// An observable of specifying the start index and size of the window. - /// An stream containing only items within the current virtual window. + /// An IVirtualChangeSet<T> stream containing only items within the current virtual window. /// or is . /// /// - /// Like but uses absolute start index and size instead of page number and page size. + /// Like Page<T>(IObservable<IChangeSet<T>>, IObservable<IPageRequest>) but uses absolute start index and size instead of page number and page size. /// Internally maintains the full source list and recalculates the window on each change or request. /// /// - /// - /// + /// Page<T>(IObservable<IChangeSet<T>>, IObservable<IPageRequest>) + /// Top<T>(IObservable<IChangeSet<T>>, int) public static IObservable> Virtualise(this IObservable> source, IObservable requests) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs index a814953f9..95dd20ac8 100644 --- a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs @@ -24,20 +24,20 @@ public static partial class ObservableListEx /// /// Watches all items in the source list and emits the item when any of its properties change. /// Requires to implement . - /// This is NOT a changeset operator: it returns a flat . + /// This is NOT a changeset operator: it returns a flat IObservable<T>. /// /// The type of the object. Must implement . - /// The source to observe property changes on items in. + /// The source IObservable<IChangeSet<TObject>> to observe property changes on items in. /// An optional list of property names to monitor. If empty, all property changes are observed. /// An observable emitting the item whenever any monitored property changes. /// is . /// - /// Implemented via . Subscriptions are managed per item: created on add, disposed on remove. + /// Implemented via MergeMany<T, TDestination>(IObservable<IChangeSet<T>>, Func<T, IObservable<TDestination>>). Subscriptions are managed per item: created on add, disposed on remove. /// - /// - /// - /// - /// + /// WhenPropertyChanged<TObject, TValue>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TValue>>, bool) + /// WhenValueChanged<TObject, TValue>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TValue>>, bool) + /// AutoRefresh<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan?, TimeSpan?, IScheduler?) + /// ObservableCacheEx.WhenAnyPropertyChanged<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, string[]) public static IObservable WhenAnyPropertyChanged(this IObservable> source, params string[] propertiesToMonitor) where TObject : INotifyPropertyChanged { diff --git a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs index 3ee8b630b..e27d42ee4 100644 --- a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs @@ -22,23 +22,23 @@ namespace DynamicData; public static partial class ObservableListEx { /// - /// Watches a specific property on all items in the source list and emits a (item + value pair) when it changes. + /// Watches a specific property on all items in the source list and emits a PropertyValue<TObject, TValue> (item + value pair) when it changes. /// Requires to implement . - /// This is NOT a changeset operator: it returns a flat . + /// This is NOT a changeset operator: it returns a flat IObservable<T>. /// /// The type of item. Must implement . /// The type of the property value. - /// The source to observe a specific property on items in. - /// An expression selecting the property to observe. + /// The source IObservable<IChangeSet<TObject>> to observe a specific property on items in. + /// An Expression<TDelegate> expression selecting the property to observe. /// When (default), the current value is emitted immediately upon subscribing to each item. - /// An observable emitting whenever the property changes on any tracked item. + /// An observable emitting PropertyValue<TObject, TValue> whenever the property changes on any tracked item. /// or is . /// - /// Implemented via . + /// Implemented via MergeMany<T, TDestination>(IObservable<IChangeSet<T>>, Func<T, IObservable<TDestination>>). /// - /// - /// - /// + /// WhenValueChanged<TObject, TValue>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TValue>>, bool) + /// WhenAnyPropertyChanged<TObject>(IObservable<IChangeSet<TObject>>, string[]) + /// ObservableCacheEx.WhenPropertyChanged<TObject, TKey, TValue>(IObservable<IChangeSet<TObject, TKey>>, Expression<Func<TObject, TValue>>, bool) public static IObservable> WhenPropertyChanged(this IObservable> source, Expression> propertyAccessor, bool notifyOnInitialValue = true) where TObject : INotifyPropertyChanged { diff --git a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs index 3d021c1a2..f11aafdca 100644 --- a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs @@ -24,18 +24,18 @@ public static partial class ObservableListEx /// /// Watches a specific property on all items and emits just the property value (without the sender) when it changes. /// Requires to implement . - /// This is NOT a changeset operator: it returns a flat . + /// This is NOT a changeset operator: it returns a flat IObservable<T>. /// /// The type of item. Must implement . /// The type of the property value. - /// The source to observe a specific property value on items in. - /// An expression selecting the property to observe. + /// The source IObservable<IChangeSet<TObject>> to observe a specific property value on items in. + /// An Expression<TDelegate> expression selecting the property to observe. /// When (default), the current value is emitted immediately upon subscribing to each item. /// An observable emitting the property value whenever it changes on any tracked item. /// or is . - /// - /// - /// + /// WhenPropertyChanged<TObject, TValue>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TValue>>, bool) + /// WhenAnyPropertyChanged<TObject>(IObservable<IChangeSet<TObject>>, string[]) + /// ObservableCacheEx.WhenValueChanged<TObject, TKey, TValue>(IObservable<IChangeSet<TObject, TKey>>, Expression<Func<TObject, TValue>>, bool) public static IObservable WhenValueChanged(this IObservable> source, Expression> propertyAccessor, bool notifyOnInitialValue = true) where TObject : INotifyPropertyChanged { diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs index 352ca6814..8c0a873ce 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs @@ -19,18 +19,18 @@ public static partial class ObservableListEx /// Index information is stripped from the output because removing some changes invalidates the original index positions. ///
/// The type of the item. - /// The source to filter by change reason. + /// The source IObservable<IChangeSet<T>> to filter by change reason. /// The change reasons to include. Must specify at least one. /// A list changeset stream containing only changes with the specified reasons. /// is . /// is empty. /// - /// Filters individual changes within each changeset. If filtering removes all changes from a changeset, the empty changeset is suppressed via . + /// Filters individual changes within each changeset. If filtering removes all changes from a changeset, the empty changeset is suppressed via NotEmpty<T>(IObservable<IChangeSet<T>>). /// Worth noting: Filtering out Remove changes can cause downstream operators to accumulate items indefinitely (memory leak). Index information is stripped because removing some changes invalidates the original index positions. /// - /// - /// - /// + /// WhereReasonsAreNot<T>(IObservable<IChangeSet<T>>, ListChangeReason[]) + /// SuppressRefresh<T>(IObservable<IChangeSet<T>>) + /// ChangeSetEx.YieldWithoutIndex<T>(IEnumerable<Change<T>>) public static IObservable> WhereReasonsAre(this IObservable> source, params ListChangeReason[] reasons) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs index cdbef4d29..b490a271c 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs @@ -20,7 +20,7 @@ public static partial class ObservableListEx /// The exception is when only is excluded, since removing Refresh does not affect index calculations. ///
/// The type of the item. - /// The source to filter by excluding change reasons. + /// The source IObservable<IChangeSet<T>> to filter by excluding change reasons. /// The change reasons to exclude. Must specify at least one. /// A list changeset stream with the specified change reasons removed. /// is . @@ -31,9 +31,9 @@ public static partial class ObservableListEx /// indices are preserved, since removing Refresh does not affect index calculations. /// /// - /// - /// - /// + /// WhereReasonsAre<T>(IObservable<IChangeSet<T>>, ListChangeReason[]) + /// SuppressRefresh<T>(IObservable<IChangeSet<T>>) + /// ChangeSetEx.YieldWithoutIndex<T>(IEnumerable<Change<T>>) public static IObservable> WhereReasonsAreNot(this IObservable> source, params ListChangeReason[] reasons) where T : notnull { diff --git a/src/DynamicData/List/ObservableListEx.Xor.cs b/src/DynamicData/List/ObservableListEx.Xor.cs index 2dfdadb12..462206421 100644 --- a/src/DynamicData/List/ObservableListEx.Xor.cs +++ b/src/DynamicData/List/ObservableListEx.Xor.cs @@ -26,8 +26,8 @@ public static partial class ObservableListEx /// Items present in exactly one source are included in the result. ///
/// The type of the item. - /// The primary source to exclusively combine. - /// The other changeset streams to combine with. + /// The primary source IObservable<IChangeSet<T>> to exclusively combine. + /// The other IObservable<IChangeSet<T>> changeset streams to combine with. /// A list changeset stream containing items that exist in exactly one source. /// is . /// @@ -45,10 +45,10 @@ public static partial class ObservableListEx /// MovedIgnored. /// /// - /// - /// - /// - /// + /// And<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// Or<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// Except<T>(IObservable<IChangeSet<T>>, IObservable<IChangeSet<T>>[]) + /// ObservableCacheEx.Xor<TObject, TKey>(IObservable<IChangeSet<TObject, TKey>>, IObservable<IChangeSet<TObject, TKey>>[]) public static IObservable> Xor(this IObservable> source, params IObservable>[] others) where T : notnull { @@ -57,31 +57,43 @@ public static IObservable> Xor(this IObservable> return source.Combine(CombineOperator.Xor, others); } - /// + /// This overload follows the same core behavior as the related overload. /// /// Applies a logical XOR between a pre-built collection of list changeset sources. /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. public static IObservable> Xor(this ICollection>> sources) where T : notnull => sources.Combine(CombineOperator.Xor); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Dynamic XOR: sources can be added or removed from the at runtime. + /// Dynamic XOR: sources can be added or removed from the IObservableList<T> at runtime. /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. public static IObservable> Xor(this IObservableList>> sources) where T : notnull => sources.Combine(CombineOperator.Xor); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Dynamic XOR accepting of . Each inner list's Connect() is used as a source. + /// Dynamic XOR accepting IObservableList<T> of IObservableList<T>. Each inner list's Connect() is used as a source. /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. public static IObservable> Xor(this IObservableList> sources) where T : notnull => sources.Combine(CombineOperator.Xor); - /// + /// This overload follows the same core behavior as the related overload. /// - /// Dynamic XOR accepting of . Each inner list's Connect() is used as a source. + /// Dynamic XOR accepting IObservableList<T> of ISourceList<T>. Each inner list's Connect() is used as a source. /// + /// The type of the T value. + /// The sources value. + /// The resulting observable sequence. public static IObservable> Xor(this IObservableList> sources) where T : notnull => sources.Combine(CombineOperator.Xor); } diff --git a/src/DynamicData/List/PageChangeSet.cs b/src/DynamicData/List/PageChangeSet.cs index f38555a7f..5ee4e93a3 100644 --- a/src/DynamicData/List/PageChangeSet.cs +++ b/src/DynamicData/List/PageChangeSet.cs @@ -16,34 +16,78 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the PageChangeSet class. +/// +/// The type of the T value. +/// The virtualChangeSet value. +/// The response value. internal sealed class PageChangeSet(IChangeSet virtualChangeSet, IPageResponse response) : IPageChangeSet where T : notnull { + /// + /// The _virtualChangeSet field. + /// private readonly IChangeSet _virtualChangeSet = virtualChangeSet ?? throw new ArgumentNullException(nameof(virtualChangeSet)); + /// + /// Gets the Count value. + /// public int Count => _virtualChangeSet.Count; + /// + /// Gets the Refreshes value. + /// public int Refreshes => _virtualChangeSet.Refreshes; + /// + /// Gets the Response value. + /// public IPageResponse Response { get; } = response ?? throw new ArgumentNullException(nameof(response)); + /// + /// Gets the Adds value. + /// int IChangeSet.Adds => _virtualChangeSet.Adds; + /// + /// Gets or sets the Capacity value. + /// int IChangeSet.Capacity { get => _virtualChangeSet.Capacity; set => _virtualChangeSet.Capacity = value; } + /// + /// Gets the Moves value. + /// int IChangeSet.Moves => _virtualChangeSet.Moves; + /// + /// Gets the Removes value. + /// int IChangeSet.Removes => _virtualChangeSet.Removes; + /// + /// Gets the Replaced value. + /// int IChangeSet.Replaced => _virtualChangeSet.Replaced; + /// + /// Gets the TotalChanges value. + /// int IChangeSet.TotalChanges => _virtualChangeSet.TotalChanges; + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. public IEnumerator> GetEnumerator() => _virtualChangeSet.GetEnumerator(); + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/List/RangeChange.cs b/src/DynamicData/List/RangeChange.cs index f3da16011..a9c25491e 100644 --- a/src/DynamicData/List/RangeChange.cs +++ b/src/DynamicData/List/RangeChange.cs @@ -15,6 +15,9 @@ namespace DynamicData; /// The type of the item. public sealed class RangeChange : IEnumerable { + /// + /// The _items field. + /// private readonly List _items; /// @@ -62,6 +65,7 @@ private RangeChange() public void Add(T item) => _items.Add(item); /// + /// The result of the operation. public IEnumerator GetEnumerator() => _items.GetEnumerator(); /// @@ -86,5 +90,6 @@ private RangeChange() public override string ToString() => $"Range<{typeof(T).Name}>. Count={Count}"; /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/List/SourceList.cs b/src/DynamicData/List/SourceList.cs index c6542474d..55b66e46a 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.cs @@ -26,20 +26,44 @@ namespace DynamicData; public sealed class SourceList : ISourceList where T : notnull { + /// + /// The _changes field. + /// private readonly Signal> _changes = new(); + /// + /// The _changesPreview field. + /// private readonly Signal> _changesPreview = new(); + /// + /// The _cleanUp field. + /// private readonly IDisposable _cleanUp; + /// + /// The _countChanged field. + /// private readonly Lazy> _countChanged = new(() => new Signal()); + /// + /// The _locker field. + /// private readonly Lock _locker = new(); + /// + /// The _readerWriter field. + /// private readonly ReaderWriter _readerWriter = new(); + /// + /// The _editLevel field. + /// private int _editLevel; + /// + /// The _isDisposed field. + /// private bool _isDisposed; /// @@ -88,6 +112,8 @@ public SourceList(IObservable>? source = null) public IReadOnlyList Items => _readerWriter.Items; /// + /// The predicate value. + /// The result of the operation. public IObservable> Connect(Func? predicate = null) { var observable = Observable.Create>( @@ -147,6 +173,7 @@ public void Dispose() } /// + /// The updateAction value. public void Edit(Action> updateAction) { ArgumentExceptionHelper.ThrowIfNull(updateAction); @@ -181,6 +208,8 @@ public void Edit(Action> updateAction) } /// + /// The predicate value. + /// The result of the operation. public IObservable> Preview(Func? predicate = null) { var observable = Observable.Create>( @@ -206,6 +235,10 @@ public IObservable> Preview(Func? predicate = null) return observable; } + /// + /// Executes the InvokeNext operation. + /// + /// The changes value. private void InvokeNext(IChangeSet changes) { if (changes.Count == 0) @@ -224,6 +257,10 @@ private void InvokeNext(IChangeSet changes) } } + /// + /// Executes the InvokeNextPreview operation. + /// + /// The changes value. private void InvokeNextPreview(IChangeSet changes) { if (changes.Count == 0) @@ -237,8 +274,16 @@ private void InvokeNextPreview(IChangeSet changes) } } + /// + /// Executes the LoadFromSource operation. + /// + /// The source value. + /// The result of the operation. private IDisposable LoadFromSource(IObservable> source) => source.Synchronize(_locker).Finally(OnCompleted).Select(_readerWriter.Write).Subscribe(InvokeNext, OnError, OnCompleted); + /// + /// Executes the OnCompleted operation. + /// private void OnCompleted() { lock (_locker) @@ -248,6 +293,10 @@ private void OnCompleted() } } + /// + /// Executes the OnError operation. + /// + /// The exception value. private void OnError(Exception exception) { lock (_locker) diff --git a/src/DynamicData/List/SourceListEditConvenienceEx.cs b/src/DynamicData/List/SourceListEditConvenienceEx.cs index 7f3194d2c..a3ce89d45 100644 --- a/src/DynamicData/List/SourceListEditConvenienceEx.cs +++ b/src/DynamicData/List/SourceListEditConvenienceEx.cs @@ -97,7 +97,7 @@ public static void Insert(this ISourceList source, int index, T item) } /// - /// Inserts the elements of a collection into the at the specified index. + /// Inserts the elements of a collection into the IExtendedList<T> at the specified index. /// /// The item type. /// The source. @@ -172,14 +172,14 @@ public static void RemoveMany(this ISourceList source, IEnumerable item } /// - /// Removes a range of elements from the . + /// Removes a range of elements from the ISourceList<T>. /// /// The item type. /// The source. /// The zero-based starting index of the range of elements to remove. /// The number of elements to remove. /// is less than 0.-or- is less than 0. - /// and do not denote a valid range of elements in the . + /// and do not denote a valid range of elements in the List<T>. public static void RemoveRange(this ISourceList source, int index, int count) where T : notnull { diff --git a/src/DynamicData/List/Tests/ChangeSetAggregator.cs b/src/DynamicData/List/Tests/ChangeSetAggregator.cs index 39a2431ab..2180fdfd3 100644 --- a/src/DynamicData/List/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/List/Tests/ChangeSetAggregator.cs @@ -16,8 +16,14 @@ namespace DynamicData.Tests; public class ChangeSetAggregator : IDisposable where TObject : notnull { + /// + /// The _disposer field. + /// private readonly IDisposable _disposer; + /// + /// The _isDisposed field. + /// private bool _isDisposed; /// diff --git a/src/DynamicData/List/VirtualChangeSet.cs b/src/DynamicData/List/VirtualChangeSet.cs index bd4575db6..bedaab07f 100644 --- a/src/DynamicData/List/VirtualChangeSet.cs +++ b/src/DynamicData/List/VirtualChangeSet.cs @@ -9,34 +9,78 @@ namespace DynamicData.Reactive; namespace DynamicData; #endif +/// +/// Provides members for the VirtualChangeSet class. +/// +/// The type of the T value. +/// The virtualChangeSet value. +/// The response value. internal sealed class VirtualChangeSet(IChangeSet virtualChangeSet, IVirtualResponse response) : IVirtualChangeSet where T : notnull { + /// + /// The _virtualChangeSet field. + /// private readonly IChangeSet _virtualChangeSet = virtualChangeSet ?? throw new ArgumentNullException(nameof(virtualChangeSet)); + /// + /// Gets the Refreshes value. + /// public int Refreshes => _virtualChangeSet.Refreshes; + /// + /// Gets the Response value. + /// public IVirtualResponse Response { get; } = response ?? throw new ArgumentNullException(nameof(response)); + /// + /// Gets the Adds value. + /// int IChangeSet.Adds => _virtualChangeSet.Adds; + /// + /// Gets or sets the Capacity value. + /// int IChangeSet.Capacity { get => _virtualChangeSet.Capacity; set => _virtualChangeSet.Capacity = value; } + /// + /// Gets the Count value. + /// int IChangeSet.Count => _virtualChangeSet.Count; + /// + /// Gets the Moves value. + /// int IChangeSet.Moves => _virtualChangeSet.Moves; + /// + /// Gets the Removes value. + /// int IChangeSet.Removes => _virtualChangeSet.Removes; + /// + /// Gets the Replaced value. + /// int IChangeSet.Replaced => _virtualChangeSet.Replaced; + /// + /// Gets the TotalChanges value. + /// int IChangeSet.TotalChanges => _virtualChangeSet.TotalChanges; + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. public IEnumerator> GetEnumerator() => _virtualChangeSet.GetEnumerator(); + /// + /// Executes the GetEnumerator operation. + /// + /// The result of the operation. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } diff --git a/src/DynamicData/Platforms/net45/PFilter.cs b/src/DynamicData/Platforms/net45/PFilter.cs index 64dbf5049..33ffe099c 100644 --- a/src/DynamicData/Platforms/net45/PFilter.cs +++ b/src/DynamicData/Platforms/net45/PFilter.cs @@ -18,10 +18,22 @@ namespace DynamicData.Reactive.PLinq namespace DynamicData.PLinq #endif { - internal sealed class PFilter(IObservable> source, Func filter, ParallelisationOptions parallelisationOptions) +/// +/// Provides members for the PFilter class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The filter value. +/// The parallelisationOptions value. +internal sealed class PFilter(IObservable> source, Func filter, ParallelisationOptions parallelisationOptions) where TObject : notnull where TKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { @@ -29,10 +41,23 @@ public IObservable> Run() => Observable.Create filter, ParallelisationOptions parallelisationOptions) : AbstractFilter(new ChangeAwareCache(), filter) +/// +/// Provides members for the PLinqFilteredUpdater class. +/// +/// The filter value. +/// The parallelisationOptions value. +private sealed class PLinqFilteredUpdater(Func filter, ParallelisationOptions parallelisationOptions) : AbstractFilter(new ChangeAwareCache(), filter) { + /// + /// The _parallelisationOptions field. + /// private readonly ParallelisationOptions _parallelisationOptions = parallelisationOptions; + /// + /// Executes the GetChangesWithFilter operation. + /// + /// The updates value. + /// The result of the operation. protected override IEnumerable GetChangesWithFilter(ChangeSet updates) { if (updates.ShouldParallelise(_parallelisationOptions)) @@ -43,6 +68,12 @@ protected override IEnumerable GetChangesWithFilter(ChangeSet< return updates.Select(u => new UpdateWithFilter(Filter(u.Current), u)).ToArray(); } + /// + /// Executes the Refresh operation. + /// + /// The items value. + /// The factory value. + /// The result of the operation. protected override IEnumerable> Refresh(IEnumerable> items, Func, ReactiveUI.Primitives.Optional>> factory) { var keyValuePairs = items as KeyValuePair[] ?? items.ToArray(); diff --git a/src/DynamicData/Platforms/net45/PSubscribeMany.cs b/src/DynamicData/Platforms/net45/PSubscribeMany.cs index ebd2d7004..435c3330c 100644 --- a/src/DynamicData/Platforms/net45/PSubscribeMany.cs +++ b/src/DynamicData/Platforms/net45/PSubscribeMany.cs @@ -11,14 +11,32 @@ namespace DynamicData.Reactive.PLinq namespace DynamicData.PLinq #endif { - internal sealed class PSubscribeMany(IObservable> source, Func subscriptionFactory, ParallelisationOptions parallelisationOptions) +/// +/// Provides members for the PSubscribeMany class. +/// +/// The type of the TObject value. +/// The type of the TKey value. +/// The source value. +/// The subscriptionFactory value. +/// The parallelisationOptions value. +internal sealed class PSubscribeMany(IObservable> source, Func subscriptionFactory, ParallelisationOptions parallelisationOptions) where TObject : notnull where TKey : notnull { + /// + /// The _source field. + /// private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + /// + /// The _subscriptionFactory field. + /// private readonly Func _subscriptionFactory = subscriptionFactory ?? throw new ArgumentNullException(nameof(subscriptionFactory)); + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>( observer => { diff --git a/src/DynamicData/Platforms/net45/PTransform.cs b/src/DynamicData/Platforms/net45/PTransform.cs index 50471c994..3bcec44b6 100644 --- a/src/DynamicData/Platforms/net45/PTransform.cs +++ b/src/DynamicData/Platforms/net45/PTransform.cs @@ -11,7 +11,17 @@ namespace DynamicData.Reactive.PLinq namespace DynamicData.PLinq #endif { - internal sealed class PTransform( +/// +/// Provides members for the PTransform class. +/// +/// The type of the TDestination value. +/// The type of the TSource value. +/// The type of the TKey value. +/// The source value. +/// The transformFactory value. +/// The parallelisationOptions value. +/// The exceptionCallback value. +internal sealed class PTransform( IObservable> source, Func, TKey, TDestination> transformFactory, ParallelisationOptions parallelisationOptions, @@ -20,6 +30,10 @@ internal sealed class PTransform( where TSource : notnull where TKey : notnull { + /// + /// Executes the Run operation. + /// + /// The result of the operation. public IObservable> Run() => Observable.Create>(observer => { @@ -28,6 +42,12 @@ public IObservable> Run() => return transformer.NotEmpty().SubscribeSafe(observer); }); + /// + /// Executes the DoTransform operation. + /// + /// The cache value. + /// The changes value. + /// The result of the operation. [SuppressMessage("Style", "IDE0305:Simplify collection initialization", Justification = "A collection initializer is not equivalent to a .ToArray() call for a ParallelQuery. This change actually introduces a race-condition exception.")] private ChangeSet DoTransform(ChangeAwareCache cache, IChangeSet changes) { @@ -38,6 +58,11 @@ private ChangeSet DoTransform(ChangeAwareCache + /// Executes the ToDestination operation. + /// + /// The change value. + /// The result of the operation. private TransformResult ToDestination(Change change) { try @@ -62,6 +87,12 @@ private TransformResult ToDestination(Change change) } } + /// + /// Executes the ProcessUpdates operation. + /// + /// The cache value. + /// The transformedItems value. + /// The result of the operation. private ChangeSet ProcessUpdates(ChangeAwareCache cache, IEnumerable transformedItems) { foreach (var result in transformedItems) @@ -95,8 +126,16 @@ private ChangeSet ProcessUpdates(ChangeAwareCache +/// Represents the TransformResult value. +/// +private readonly struct TransformResult { + /// + /// Initializes a new instance of the struct. + /// + /// The change value. + /// The destination value. public TransformResult(in Change change, TDestination destination) : this() { @@ -106,6 +145,10 @@ public TransformResult(in Change change, TDestination destination Key = change.Key; } + /// + /// Initializes a new instance of the struct. + /// + /// The change value. public TransformResult(in Change change) : this() { @@ -115,6 +158,11 @@ public TransformResult(in Change change) Key = change.Key; } + /// + /// Initializes a new instance of the struct. + /// + /// The change value. + /// The error value. public TransformResult(in Change change, Exception error) : this() { @@ -124,14 +172,29 @@ public TransformResult(in Change change, Exception error) Key = change.Key; } + /// + /// Gets the Change value. + /// public Change Change { get; } + /// + /// Gets the Error value. + /// public Exception? Error { get; } + /// + /// Gets the Success value. + /// public bool Success { get; } + /// + /// Gets the Destination value. + /// public ReactiveUI.Primitives.Optional Destination { get; } + /// + /// Gets the Key value. + /// public TKey Key { get; } } } diff --git a/src/DynamicData/Platforms/net45/ParallelEx.cs b/src/DynamicData/Platforms/net45/ParallelEx.cs index 82aeba987..defde0461 100644 --- a/src/DynamicData/Platforms/net45/ParallelEx.cs +++ b/src/DynamicData/Platforms/net45/ParallelEx.cs @@ -10,11 +10,19 @@ namespace DynamicData.Reactive.PLinq namespace DynamicData.PLinq #endif { - /// - /// Parallelisation extensions for DynamicData. - /// - internal static class ParallelEx +/// +/// Parallelisation extensions for DynamicData. +/// +internal static class ParallelEx { + /// + /// Executes the Parallelise operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The option value. + /// The result of the operation. internal static ParallelQuery> Parallelise(this IChangeSet source, ParallelisationOptions option) where TObject : notnull where TKey : notnull => option.Type switch @@ -24,6 +32,14 @@ internal static ParallelQuery> Parallelise( _ => throw new ArgumentException("Should not parallelise! Call ShouldParallelise() first"), }; + /// + /// Executes the Parallelise operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The option value. + /// The result of the operation. internal static ParallelQuery> Parallelise(this IEnumerable> source, ParallelisationOptions option) where TKey : notnull => option.Type switch { @@ -32,6 +48,13 @@ internal static ParallelQuery> Parallelise throw new ArgumentException("Should not parallelise! Call ShouldParallelise() first"), }; + /// + /// Executes the Parallelise operation. + /// + /// The type of the T value. + /// The source value. + /// The option value. + /// The result of the operation. internal static IEnumerable Parallelise(this IEnumerable source, ParallelisationOptions option) { switch (option.Type) @@ -63,10 +86,26 @@ internal static IEnumerable Parallelise(this IEnumerable source, Parall } } + /// + /// Executes the ShouldParallelise operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The option value. + /// The result of the operation. internal static bool ShouldParallelise(this IChangeSet source, ParallelisationOptions option) where TObject : notnull where TKey : notnull => (option.Type == ParallelType.Parallelise || option.Type == ParallelType.Ordered) && (option.Threshold >= 0 && source.Count >= option.Threshold); + /// + /// Executes the ShouldParallelise operation. + /// + /// The type of the TObject value. + /// The type of the TKey value. + /// The source value. + /// The option value. + /// The result of the operation. internal static bool ShouldParallelise(this IEnumerable> source, ParallelisationOptions option) where TKey : notnull => (option.Type == ParallelType.Parallelise || option.Type == ParallelType.Ordered) && (option.Threshold >= 0 && source.Skip(option.Threshold).Any()); } diff --git a/src/DynamicData/Platforms/net45/ParallelOperators.cs b/src/DynamicData/Platforms/net45/ParallelOperators.cs index 98f1c3b1d..2003b4d7c 100644 --- a/src/DynamicData/Platforms/net45/ParallelOperators.cs +++ b/src/DynamicData/Platforms/net45/ParallelOperators.cs @@ -11,10 +11,10 @@ namespace DynamicData.Reactive.PLinq namespace DynamicData.PLinq #endif { - /// - /// PLinq operators or Net4 and Net45 only. - /// - public static class ParallelOperators +/// +/// PLinq operators or Net4 and Net45 only. +/// +public static class ParallelOperators { /// /// Filters the stream using the specified predicate. diff --git a/src/DynamicData/Platforms/net45/ParallelType.cs b/src/DynamicData/Platforms/net45/ParallelType.cs index 153da7158..2f0e0da09 100644 --- a/src/DynamicData/Platforms/net45/ParallelType.cs +++ b/src/DynamicData/Platforms/net45/ParallelType.cs @@ -10,10 +10,10 @@ namespace DynamicData.Reactive.PLinq namespace DynamicData.PLinq #endif { - /// - /// The type of parallelisation. - /// - public enum ParallelType +/// +/// The type of parallelisation. +/// +public enum ParallelType { /// /// No parallelisation will take place. diff --git a/src/DynamicData/Platforms/net45/ParallelisationOptions.cs b/src/DynamicData/Platforms/net45/ParallelisationOptions.cs index 5aeb79a30..6d6ed4f59 100644 --- a/src/DynamicData/Platforms/net45/ParallelisationOptions.cs +++ b/src/DynamicData/Platforms/net45/ParallelisationOptions.cs @@ -10,16 +10,16 @@ namespace DynamicData.Reactive.PLinq namespace DynamicData.PLinq #endif { - /// - /// Options to specify parallelisation of stream operations. Only applicable for .Net4 and .Net45 builds. - /// - /// - /// Initializes a new instance of the class. - /// - /// The type of parallel operation. - /// The threshold before making the operation parallel. - /// The maximum degrees of parallelism. - public class ParallelisationOptions(ParallelType type = ParallelType.None, int threshold = 0, int maxDegreeOfParallelisation = 0) +/// +/// Options to specify parallelisation of stream operations. Only applicable for .Net4 and .Net45 builds. +/// +/// +/// Initializes a new instance of the class. +/// +/// The type of parallel operation. +/// The threshold before making the operation parallel. +/// The maximum degrees of parallelism. +public class ParallelisationOptions(ParallelType type = ParallelType.None, int threshold = 0, int maxDegreeOfParallelisation = 0) { /// /// The default parallelisation options. diff --git a/src/DynamicData/Polyfills/CancellationTokenPolyfillExtensions.cs b/src/DynamicData/Polyfills/CancellationTokenPolyfillExtensions.cs index 022699fc3..a98322436 100644 --- a/src/DynamicData/Polyfills/CancellationTokenPolyfillExtensions.cs +++ b/src/DynamicData/Polyfills/CancellationTokenPolyfillExtensions.cs @@ -10,7 +10,6 @@ namespace System.Threading; internal static class CancellationTokenPolyfillExtensions { /// Polyfill registration operations for a cancellation token. - /// The cancellation token. extension(CancellationToken token) { /// Registers a delegate that is invoked when the token is cancelled, without capturing the execution context. diff --git a/src/DynamicData/Polyfills/CancellationTokenSourcePolyfillExtensions.cs b/src/DynamicData/Polyfills/CancellationTokenSourcePolyfillExtensions.cs index 519e74a12..20974a5c6 100644 --- a/src/DynamicData/Polyfills/CancellationTokenSourcePolyfillExtensions.cs +++ b/src/DynamicData/Polyfills/CancellationTokenSourcePolyfillExtensions.cs @@ -10,7 +10,6 @@ namespace System.Threading; internal static class CancellationTokenSourcePolyfillExtensions { /// Polyfill operations for a cancellation token source. - /// The cancellation token source. extension(CancellationTokenSource source) { /// Communicates a request for cancellation, completing synchronously (no asynchronous callback draining on this framework). diff --git a/src/DynamicData/Polyfills/DynamicallyAccessedMembersAttribute.cs b/src/DynamicData/Polyfills/DynamicallyAccessedMembersAttribute.cs index 7c591011b..75aa51ae0 100644 --- a/src/DynamicData/Polyfills/DynamicallyAccessedMembersAttribute.cs +++ b/src/DynamicData/Polyfills/DynamicallyAccessedMembersAttribute.cs @@ -1,39 +1,115 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. #if !NET5_0_OR_GREATER namespace System.Diagnostics.CodeAnalysis; +/// +/// Defines values for the DynamicallyAccessedMemberTypes enumeration. +/// [Flags] internal enum DynamicallyAccessedMemberTypes { + /// + /// The All value. + /// All = -1, + + /// + /// The None value. + /// None = 0, + + /// + /// The PublicParameterlessConstructor value. + /// PublicParameterlessConstructor = 1, + + /// + /// The PublicConstructors value. + /// PublicConstructors = 3, + + /// + /// The NonPublicConstructors value. + /// NonPublicConstructors = 4, + + /// + /// The PublicMethods value. + /// PublicMethods = 8, + + /// + /// The NonPublicMethods value. + /// NonPublicMethods = 16, + + /// + /// The PublicFields value. + /// PublicFields = 32, + + /// + /// The NonPublicFields value. + /// NonPublicFields = 64, + + /// + /// The PublicNestedTypes value. + /// PublicNestedTypes = 128, + + /// + /// The NonPublicNestedTypes value. + /// NonPublicNestedTypes = 256, + + /// + /// The PublicProperties value. + /// PublicProperties = 512, + + /// + /// The NonPublicProperties value. + /// NonPublicProperties = 1024, + + /// + /// The PublicEvents value. + /// PublicEvents = 2048, + + /// + /// The NonPublicEvents value. + /// NonPublicEvents = 4096, + + /// + /// The Interfaces value. + /// Interfaces = 8192 } +/// +/// Provides members for the DynamicallyAccessedMembersAttribute class. +/// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)] internal sealed class DynamicallyAccessedMembersAttribute : Attribute { + /// + /// Initializes a new instance of the class. + /// + /// The member types which are dynamically accessed. public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes) { MemberTypes = memberTypes; } + /// + /// Gets the MemberTypes value. + /// public DynamicallyAccessedMemberTypes MemberTypes { get; } } #endif diff --git a/src/DynamicData/Polyfills/EnumEx.cs b/src/DynamicData/Polyfills/EnumEx.cs index 1e590a8b3..0f70588b6 100644 --- a/src/DynamicData/Polyfills/EnumEx.cs +++ b/src/DynamicData/Polyfills/EnumEx.cs @@ -1,17 +1,33 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. namespace System; +/// +/// Provides members for the EnumEx class. +/// internal static class EnumEx { #if NET5_0_OR_GREATER + + /// + /// Executes the IsDefined operation. + /// + /// The type of the TEnum value. + /// The value value. + /// The result of the operation. public static bool IsDefined(TEnum value) where TEnum : struct, Enum => Enum.IsDefined(value); #else - public static bool IsDefined(TEnum value) + /// + /// Executes the IsDefined operation. + /// + /// The type of the TEnum value. + /// The value value. + /// The result of the operation. +public static bool IsDefined(TEnum value) where TEnum : struct, Enum => Enum.IsDefined(typeof(TEnum), value); #endif diff --git a/src/DynamicData/Polyfills/ListEnsureCapacity.cs b/src/DynamicData/Polyfills/ListEnsureCapacity.cs index 671b66760..b336215db 100644 --- a/src/DynamicData/Polyfills/ListEnsureCapacity.cs +++ b/src/DynamicData/Polyfills/ListEnsureCapacity.cs @@ -1,13 +1,22 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. // Roland Pheasant licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. #if !NETCOREAPP namespace System.Collections.Generic; +/// +/// Provides members for the ListEnsureCapacity class. +/// internal static class ListEnsureCapacity { - public static void EnsureCapacity(this List list, int capacity) + /// + /// Executes the EnsureCapacity operation. + /// + /// The type of the T value. + /// The list value. + /// The capacity value. +public static void EnsureCapacity(this List list, int capacity) { if (list.Capacity < capacity) list.Capacity = capacity; diff --git a/src/DynamicData/Polyfills/TaskCompletionSource.cs b/src/DynamicData/Polyfills/TaskCompletionSource.cs index 314294ac2..904202264 100644 --- a/src/DynamicData/Polyfills/TaskCompletionSource.cs +++ b/src/DynamicData/Polyfills/TaskCompletionSource.cs @@ -7,7 +7,7 @@ namespace System.Threading.Tasks; -/// Polyfill for the non-generic introduced in .NET 5, backed by a . +/// Polyfill for the non-generic introduced in .NET 5, backed by a TaskCompletionSource<TResult>. [SuppressMessage("Performance", "CA1812", Justification = "Broadcast polyfill; not instantiated in every consuming leaf.")] internal sealed class TaskCompletionSource { diff --git a/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs b/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs index 03b302224..c97f40bd6 100644 --- a/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs +++ b/src/DynamicData/Polyfills/TaskPolyfillExtensions.cs @@ -10,7 +10,6 @@ namespace System.Threading.Tasks; internal static class TaskPolyfillExtensions { /// Polyfill awaiting operations for a task. - /// The task to await. extension(Task task) { /// Gets a task that completes with , or faults when the timeout elapses or the token is cancelled. @@ -25,8 +24,6 @@ public async Task WaitAsync(TimeSpan timeout, CancellationToken cancellationToke } /// Polyfill awaiting operations for a task that produces a result. - /// The task to await. - /// The task result type. extension(Task task) { /// Gets a task that completes with the same result as , or faults when the timeout elapses or the token is cancelled. From ddabd8ee42d5398f85b4a657799d5f79886fb064 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 18:43:27 +0100 Subject: [PATCH 30/36] fix: stabilize merge many changeset tests Rewrite list-source MergeManyChangeSets internals to serialize parent and child processing through CacheParentSubscription using stable internal parent keys. Remove child items before child subscription disposal for cache-source merge operators so stale child notifications cannot leave published items behind. Place timing-sensitive concurrency fixtures in the existing non-parallel integration collection to avoid suite-load induced timeout failures while keeping the tests enabled. Verified with Release solution tests and pack. --- .../Cache/DeadlockTortureTest.cs | 1 + .../Cache/SuspendNotificationsFixture.cs | 1 + .../CacheParentSubscriptionFixture.cs | 1 + .../Internal/MergeManyCacheChangeSets.cs | 2 +- .../Cache/Internal/MergeManyListChangeSets.cs | 2 +- .../List/Internal/MergeManyCacheChangeSets.cs | 402 ++++++++++++++++-- .../List/Internal/MergeManyListChangeSets.cs | 401 +++++++++++++++-- 7 files changed, 742 insertions(+), 68 deletions(-) diff --git a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs index cdf7edc62..c53d55776 100644 --- a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs +++ b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs @@ -17,6 +17,7 @@ namespace DynamicData.Tests.Cache; /// On main (Synchronize(lock)): deadlocks reliably within seconds. /// On the PR branch (SynchronizeSafe queue-drain): no deadlock possible. /// +[Collection(IntegrationTestFixtureBase.CollectionName)] public sealed class DeadlockTortureTest { private const int ItemCount = 200; diff --git a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs index a81ef9340..84ae7be03 100644 --- a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs +++ b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.cs @@ -2,6 +2,7 @@ namespace DynamicData.Tests.Cache; +[Collection(IntegrationTestFixtureBase.CollectionName)] public sealed class SuspendNotificationsFixture : IDisposable { private readonly SourceCache _source = new(static x => x); diff --git a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs index dc09beb4b..0e8dccbaa 100644 --- a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs +++ b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs @@ -10,6 +10,7 @@ namespace DynamicData.Tests.Internal; /// Tests for /// behavioral contracts using a minimal concrete subclass. /// +[Collection(IntegrationTestFixtureBase.CollectionName)] public sealed class CacheParentSubscriptionFixture { private const int SeedMin = 1; diff --git a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs index 0d3a1e07d..c67107933 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs @@ -97,8 +97,8 @@ protected override void ParentOnNext(IChangeSet /// The result of the operation. public IObservable> Run() => Observable.Create>( - observer => + observer => new Subscription(source, changeSetSelector, observer, equalityComparer, comparer)); + + /// + /// Maintains state for a single subscription. + /// + private sealed class Subscription : CacheParentSubscription, int, IChangeSet, IChangeSet> + { + /// + /// The _cache field. + /// + private readonly Cache, int> _cache = new(); + + /// + /// The _changeSetMergeTracker field. + /// + private readonly ChangeSetMergeTracker _changeSetMergeTracker; + + /// + /// The _changeSetSelector field. + /// + private readonly Func>> _changeSetSelector; + + /// + /// The _parents field. + /// + private readonly List _parents = []; + + /// + /// The _nextParentKey field. + /// + private int _nextParentKey; + + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The changeSetSelector value. + /// The observer value. + /// The equalityComparer value. + /// The comparer value. + public Subscription( + IObservable> source, + Func>> changeSetSelector, + IObserver> observer, + IEqualityComparer? equalityComparer, + IComparer? comparer) + : base(observer) + { + _changeSetSelector = changeSetSelector; + _changeSetMergeTracker = new(() => _cache.Items, comparer, equalityComparer); + + CreateParentSubscription(source.Select(ConvertParentChanges).Where(static changes => changes.Count != 0)); + } + + /// + /// Executes the ParentOnNext operation. + /// + /// The changes value. + protected override void ParentOnNext(IChangeSet, int> changes) + { + foreach (var change in changes.ToConcreteType()) + { + switch (change.Reason) + { + case ChangeReason.Add or ChangeReason.Update: + _cache.AddOrUpdate(change.Current, change.Key); + AddChildSubscription(change.Current.Source, change.Key); + if (change.Previous.HasValue) + { + _changeSetMergeTracker.RemoveItems(change.Previous.Value.Cache.KeyValues); + } + + break; + + case ChangeReason.Remove: + _cache.Remove(change.Key); + _changeSetMergeTracker.RemoveItems(change.Current.Cache.KeyValues); + RemoveChildSubscription(change.Key); + break; + } + } + } + + /// + /// Executes the ChildOnNext operation. + /// + /// The changes value. + /// The parentKey value. + protected override void ChildOnNext(IChangeSet changes, int parentKey) => + _changeSetMergeTracker.ProcessChangeSet(changes, null); + + /// + /// Executes the EmitChanges operation. + /// + /// The observer value. + protected override void EmitChanges(IObserver> observer) => + _changeSetMergeTracker.EmitChanges(observer); + + /// + /// Executes the ConvertParentChanges operation. + /// + /// The changes value. + /// The result of the operation. + private IChangeSet, int> ConvertParentChanges(IChangeSet changes) + { + var results = new ChangeSet, int>(changes.Count); + + foreach (var change in changes) + { + switch (change.Reason) + { + case ListChangeReason.Add: + AddParent(change.Item.Current, change.Item.CurrentIndex, results); + break; + + case ListChangeReason.AddRange: + AddParents(change.Range, results); + break; + + case ListChangeReason.Remove: + RemoveParent(change.Item.Current, change.Item.CurrentIndex, results); + break; + + case ListChangeReason.RemoveRange: + RemoveParents(change.Range, results); + break; + + case ListChangeReason.Replace: + ReplaceParent(change.Item.Previous.Value, change.Item.Current, change.Item.PreviousIndex, change.Item.CurrentIndex, results); + break; + + case ListChangeReason.Clear: + RemoveAllParents(results); + break; + + case ListChangeReason.Moved: + MoveParent(change.Item.Current, change.Item.CurrentIndex, change.Item.PreviousIndex); + break; + } + } + + return results; + } + + /// + /// Executes the AddParents operation. + /// + /// The range value. + /// The changes value. + private void AddParents(RangeChange range, ChangeSet, int> changes) { - var locker = InternalEx.NewLock(); - var list = new List>(); - var parentUpdate = false; - - // This is manages all of the changes - var changeTracker = new ChangeSetMergeTracker(() => list, comparer, equalityComparer); - - // Transform to a list changeset of child caches, synchronize, update the local copy, and publish. - var shared = source - .Transform(obj => new ChangeSetCache(changeSetSelector(obj).Synchronize(locker))) - .Synchronize(locker) - .Do(list.Clone) - .Do(_ => parentUpdate = true) - .Publish(); - - // Merge the child changeset changes together and apply to the tracker - var subMergeMany = shared - .MergeMany(chanceSetCache => chanceSetCache.Source) - .SubscribeSafe( - changes => changeTracker.ProcessChangeSet(changes, !parentUpdate ? observer : null), - observer.OnError, - observer.OnCompleted); - - // When a source item is removed, all of its sub-items need to be removed - var subRemove = shared - .OnItemRemoved(changeSetCache => changeTracker.RemoveItems(changeSetCache.Cache.KeyValues), invokeOnUnsubscribe: false) - .Do(_ => + var index = range.Index; + foreach (var item in range) + { + AddParent(item, index, changes); + if (index >= 0) { - changeTracker.EmitChanges(observer); - parentUpdate = false; - }) - .Subscribe(static _ => { }, observer.OnError); + index++; + } + } + } + + /// + /// Executes the AddParent operation. + /// + /// The item value. + /// The index value. + /// The changes value. + private void AddParent(TObject item, int index, ChangeSet, int> changes) + { + var key = ++_nextParentKey; + var child = CreateChild(item); + var parent = new ParentItem(item, key, child); + var insertIndex = NormalizeAddIndex(index); + + _parents.Insert(insertIndex, parent); + changes.Add(new Change, int>(ChangeReason.Add, key, child, insertIndex)); + } + + /// + /// Executes the ReplaceParent operation. + /// + /// The previous value. + /// The current value. + /// The previousIndex value. + /// The currentIndex value. + /// The changes value. + private void ReplaceParent(TObject previous, TObject current, int previousIndex, int currentIndex, ChangeSet, int> changes) + { + var replaceIndex = NormalizeExistingIndex(previousIndex); + if (replaceIndex < 0 || !ReferenceEquals(_parents[replaceIndex].Source, previous)) + { + replaceIndex = FindParentIndex(previous); + } + + if (replaceIndex < 0) + { + AddParent(current, currentIndex, changes); + return; + } + + var existing = _parents[replaceIndex]; + var child = CreateChild(current); + var updated = new ParentItem(current, existing.Key, child); + _parents[replaceIndex] = updated; + + var destinationIndex = NormalizeReplacementIndex(currentIndex, replaceIndex); + if (destinationIndex != replaceIndex) + { + _parents.RemoveAt(replaceIndex); + _parents.Insert(destinationIndex, updated); + } + + changes.Add(new Change, int>(ChangeReason.Update, existing.Key, child, existing.Child, destinationIndex, replaceIndex)); + } + + /// + /// Executes the RemoveParents operation. + /// + /// The range value. + /// The changes value. + private void RemoveParents(RangeChange range, ChangeSet, int> changes) + { + if (range.Index >= 0) + { + for (var i = 0; i < range.Count; i++) + { + RemoveParentAt(range.Index, changes); + } + + return; + } + + foreach (var item in range) + { + RemoveParent(item, -1, changes); + } + } + + /// + /// Executes the RemoveParent operation. + /// + /// The item value. + /// The index value. + /// The changes value. + private void RemoveParent(TObject item, int index, ChangeSet, int> changes) + { + var removeIndex = NormalizeExistingIndex(index); + if (removeIndex < 0 || !ReferenceEquals(_parents[removeIndex].Source, item)) + { + removeIndex = FindParentIndex(item); + } + + if (removeIndex >= 0) + { + RemoveParentAt(removeIndex, changes); + } + } + + /// + /// Executes the RemoveParentAt operation. + /// + /// The index value. + /// The changes value. + private void RemoveParentAt(int index, ChangeSet, int> changes) + { + if (index < 0 || index >= _parents.Count) + { + return; + } + + var parent = _parents[index]; + _parents.RemoveAt(index); + changes.Add(new Change, int>(ChangeReason.Remove, parent.Key, parent.Child, index)); + } + + /// + /// Executes the RemoveAllParents operation. + /// + /// The changes value. + private void RemoveAllParents(ChangeSet, int> changes) + { + for (var i = _parents.Count - 1; i >= 0; i--) + { + RemoveParentAt(i, changes); + } + } + + /// + /// Executes the MoveParent operation. + /// + /// The item value. + /// The currentIndex value. + /// The previousIndex value. + private void MoveParent(TObject item, int currentIndex, int previousIndex) + { + var from = NormalizeExistingIndex(previousIndex); + if (from < 0 || !ReferenceEquals(_parents[from].Source, item)) + { + from = FindParentIndex(item); + } + + if (from < 0) + { + return; + } + + var parent = _parents[from]; + _parents.RemoveAt(from); + _parents.Insert(NormalizeAddIndex(currentIndex), parent); + } + + /// + /// Executes the FindParentIndex operation. + /// + /// The item value. + /// The result of the operation. + private int FindParentIndex(TObject item) + { + var comparer = EqualityComparer.Default; + for (var i = 0; i < _parents.Count; i++) + { + if (ReferenceEquals(_parents[i].Source, item) || comparer.Equals(_parents[i].Source, item)) + { + return i; + } + } + + return -1; + } + + /// + /// Executes the NormalizeAddIndex operation. + /// + /// The index value. + /// The result of the operation. + private int NormalizeAddIndex(int index) => index < 0 || index > _parents.Count ? _parents.Count : index; + + /// + /// Executes the NormalizeExistingIndex operation. + /// + /// The index value. + /// The result of the operation. + private int NormalizeExistingIndex(int index) => index >= 0 && index < _parents.Count ? index : -1; + + /// + /// Executes the NormalizeReplacementIndex operation. + /// + /// The index value. + /// The fallbackIndex value. + /// The result of the operation. + private int NormalizeReplacementIndex(int index, int fallbackIndex) => index >= 0 && index < _parents.Count ? index : fallbackIndex; + + /// + /// Executes the CreateChild operation. + /// + /// The item value. + /// The result of the operation. + private ChangeSetCache CreateChild(TObject item) => + new(MakeChildObservable(_changeSetSelector(item))); - return new CompositeDisposable(shared.Connect(), subMergeMany, subRemove); - }); + /// + /// Stores a source item and its child container. + /// + /// The Source value. + /// The Key value. + /// The Child value. + private sealed record ParentItem(TObject Source, int Key, ChangeSetCache Child); + } } diff --git a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs index 0708f41dc..37a2e788f 100644 --- a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs @@ -3,6 +3,13 @@ // See the LICENSE file in the project root for full license information. #if REACTIVE_SHIM +using DynamicData.Reactive.Internal; +#else + +using DynamicData.Internal; +#endif +#if REACTIVE_SHIM + namespace DynamicData.Reactive.List.Internal; #else @@ -26,39 +33,369 @@ internal sealed class MergeManyListChangeSets(IObservable /// /// The result of the operation. public IObservable> Run() => Observable.Create>( - observer => + observer => new Subscription(source, selector, observer, equalityComparer)); + + /// + /// Maintains state for a single subscription. + /// + private sealed class Subscription : CacheParentSubscription, int, IChangeSet, IChangeSet> + { + /// + /// The _changeSetMergeTracker field. + /// + private readonly ChangeSetMergeTracker _changeSetMergeTracker = new(); + + /// + /// The _parents field. + /// + private readonly List _parents = []; + + /// + /// The _selector field. + /// + private readonly Func>> _selector; + + /// + /// The _equalityComparer field. + /// + private readonly IEqualityComparer? _equalityComparer; + + /// + /// The _nextParentKey field. + /// + private int _nextParentKey; + + /// + /// Initializes a new instance of the class. + /// + /// The source value. + /// The selector value. + /// The observer value. + /// The equalityComparer value. + public Subscription( + IObservable> source, + Func>> selector, + IObserver> observer, + IEqualityComparer? equalityComparer) + : base(observer) + { + _selector = selector; + _equalityComparer = equalityComparer; + + CreateParentSubscription(source.Select(ConvertParentChanges).Where(static changes => changes.Count != 0)); + } + + /// + /// Executes the ParentOnNext operation. + /// + /// The changes value. + protected override void ParentOnNext(IChangeSet, int> changes) + { + foreach (var change in changes.ToConcreteType()) + { + switch (change.Reason) + { + case ChangeReason.Add or ChangeReason.Update: + AddChildSubscription(change.Current.Source, change.Key); + if (change.Previous.HasValue) + { + _changeSetMergeTracker.RemoveItems(change.Previous.Value.List); + } + + break; + + case ChangeReason.Remove: + _changeSetMergeTracker.RemoveItems(change.Current.List); + RemoveChildSubscription(change.Key); + break; + } + } + } + + /// + /// Executes the ChildOnNext operation. + /// + /// The child value. + /// The parentKey value. + protected override void ChildOnNext(IChangeSet child, int parentKey) => + _changeSetMergeTracker.ProcessChangeSet(child, null); + + /// + /// Executes the EmitChanges operation. + /// + /// The observer value. + protected override void EmitChanges(IObserver> observer) => + _changeSetMergeTracker.EmitChanges(observer); + + /// + /// Executes the ConvertParentChanges operation. + /// + /// The changes value. + /// The result of the operation. + private IChangeSet, int> ConvertParentChanges(IChangeSet changes) + { + var results = new ChangeSet, int>(changes.Count); + + foreach (var change in changes) + { + switch (change.Reason) + { + case ListChangeReason.Add: + AddParent(change.Item.Current, change.Item.CurrentIndex, results); + break; + + case ListChangeReason.AddRange: + AddParents(change.Range, results); + break; + + case ListChangeReason.Remove: + RemoveParent(change.Item.Current, change.Item.CurrentIndex, results); + break; + + case ListChangeReason.RemoveRange: + RemoveParents(change.Range, results); + break; + + case ListChangeReason.Replace: + ReplaceParent(change.Item.Previous.Value, change.Item.Current, change.Item.PreviousIndex, change.Item.CurrentIndex, results); + break; + + case ListChangeReason.Clear: + RemoveAllParents(results); + break; + + case ListChangeReason.Moved: + MoveParent(change.Item.Current, change.Item.CurrentIndex, change.Item.PreviousIndex); + break; + } + } + + return results; + } + + /// + /// Executes the AddParents operation. + /// + /// The range value. + /// The changes value. + private void AddParents(RangeChange range, ChangeSet, int> changes) { - var locker = InternalEx.NewLock(); - var parentUpdate = false; - - // This is manages all of the changes - var changeTracker = new ChangeSetMergeTracker(); - - // Transform to a list changeset of child lists, synchronize, and publish. - var shared = source - .Transform(obj => new ClonedListChangeSet(selector(obj).Synchronize(locker), equalityComparer)) - .Synchronize(locker) - .Do(_ => parentUpdate = true) - .Publish(); - - // Merge the child changeset changes together and apply to the tracker - var subMergeMany = shared - .MergeMany(clonedList => clonedList.Source.RemoveIndex()) - .SubscribeSafe( - changes => changeTracker.ProcessChangeSet(changes, !parentUpdate ? observer : null), - observer.OnError, - observer.OnCompleted); - - // When a source item is removed, all of its sub-items need to be removed - var subRemove = shared - .OnItemRemoved(clonedList => changeTracker.RemoveItems(clonedList.List), invokeOnUnsubscribe: false) - .Do(_ => + var index = range.Index; + foreach (var item in range) + { + AddParent(item, index, changes); + if (index >= 0) { - changeTracker.EmitChanges(observer); - parentUpdate = false; - }) - .Subscribe(static _ => { }, observer.OnError); + index++; + } + } + } + + /// + /// Executes the AddParent operation. + /// + /// The item value. + /// The index value. + /// The changes value. + private void AddParent(TObject item, int index, ChangeSet, int> changes) + { + var key = ++_nextParentKey; + var child = CreateChild(item); + var parent = new ParentItem(item, key, child); + var insertIndex = NormalizeAddIndex(index); + + _parents.Insert(insertIndex, parent); + changes.Add(new Change, int>(ChangeReason.Add, key, child, insertIndex)); + } + + /// + /// Executes the ReplaceParent operation. + /// + /// The previous value. + /// The current value. + /// The previousIndex value. + /// The currentIndex value. + /// The changes value. + private void ReplaceParent(TObject previous, TObject current, int previousIndex, int currentIndex, ChangeSet, int> changes) + { + var replaceIndex = NormalizeExistingIndex(previousIndex); + if (replaceIndex < 0 || !ReferenceEquals(_parents[replaceIndex].Source, previous)) + { + replaceIndex = FindParentIndex(previous); + } + + if (replaceIndex < 0) + { + AddParent(current, currentIndex, changes); + return; + } + + var existing = _parents[replaceIndex]; + var child = CreateChild(current); + var updated = new ParentItem(current, existing.Key, child); + _parents[replaceIndex] = updated; + + var destinationIndex = NormalizeReplacementIndex(currentIndex, replaceIndex); + if (destinationIndex != replaceIndex) + { + _parents.RemoveAt(replaceIndex); + _parents.Insert(destinationIndex, updated); + } + + changes.Add(new Change, int>(ChangeReason.Update, existing.Key, child, existing.Child, destinationIndex, replaceIndex)); + } + + /// + /// Executes the RemoveParents operation. + /// + /// The range value. + /// The changes value. + private void RemoveParents(RangeChange range, ChangeSet, int> changes) + { + if (range.Index >= 0) + { + for (var i = 0; i < range.Count; i++) + { + RemoveParentAt(range.Index, changes); + } + + return; + } + + foreach (var item in range) + { + RemoveParent(item, -1, changes); + } + } + + /// + /// Executes the RemoveParent operation. + /// + /// The item value. + /// The index value. + /// The changes value. + private void RemoveParent(TObject item, int index, ChangeSet, int> changes) + { + var removeIndex = NormalizeExistingIndex(index); + if (removeIndex < 0 || !ReferenceEquals(_parents[removeIndex].Source, item)) + { + removeIndex = FindParentIndex(item); + } + + if (removeIndex >= 0) + { + RemoveParentAt(removeIndex, changes); + } + } + + /// + /// Executes the RemoveParentAt operation. + /// + /// The index value. + /// The changes value. + private void RemoveParentAt(int index, ChangeSet, int> changes) + { + if (index < 0 || index >= _parents.Count) + { + return; + } + + var parent = _parents[index]; + _parents.RemoveAt(index); + changes.Add(new Change, int>(ChangeReason.Remove, parent.Key, parent.Child, index)); + } + + /// + /// Executes the RemoveAllParents operation. + /// + /// The changes value. + private void RemoveAllParents(ChangeSet, int> changes) + { + for (var i = _parents.Count - 1; i >= 0; i--) + { + RemoveParentAt(i, changes); + } + } + + /// + /// Executes the MoveParent operation. + /// + /// The item value. + /// The currentIndex value. + /// The previousIndex value. + private void MoveParent(TObject item, int currentIndex, int previousIndex) + { + var from = NormalizeExistingIndex(previousIndex); + if (from < 0 || !ReferenceEquals(_parents[from].Source, item)) + { + from = FindParentIndex(item); + } + + if (from < 0) + { + return; + } + + var parent = _parents[from]; + _parents.RemoveAt(from); + _parents.Insert(NormalizeAddIndex(currentIndex), parent); + } + + /// + /// Executes the FindParentIndex operation. + /// + /// The item value. + /// The result of the operation. + private int FindParentIndex(TObject item) + { + var comparer = EqualityComparer.Default; + for (var i = 0; i < _parents.Count; i++) + { + if (ReferenceEquals(_parents[i].Source, item) || comparer.Equals(_parents[i].Source, item)) + { + return i; + } + } + + return -1; + } + + /// + /// Executes the NormalizeAddIndex operation. + /// + /// The index value. + /// The result of the operation. + private int NormalizeAddIndex(int index) => index < 0 || index > _parents.Count ? _parents.Count : index; + + /// + /// Executes the NormalizeExistingIndex operation. + /// + /// The index value. + /// The result of the operation. + private int NormalizeExistingIndex(int index) => index >= 0 && index < _parents.Count ? index : -1; + + /// + /// Executes the NormalizeReplacementIndex operation. + /// + /// The index value. + /// The fallbackIndex value. + /// The result of the operation. + private int NormalizeReplacementIndex(int index, int fallbackIndex) => index >= 0 && index < _parents.Count ? index : fallbackIndex; + + /// + /// Executes the CreateChild operation. + /// + /// The item value. + /// The result of the operation. + private ClonedListChangeSet CreateChild(TObject item) => + new(MakeChildObservable(_selector(item).RemoveIndex()), _equalityComparer); - return new CompositeDisposable(shared.Connect(), subMergeMany, subRemove); - }); + /// + /// Stores a source item and its child container. + /// + /// The Source value. + /// The Key value. + /// The Child value. + private sealed record ParentItem(TObject Source, int Key, ClonedListChangeSet Child); + } } From ed2de8fe70a8c90a74cfc2d5f65d1f5c546f6c3f Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 21:13:36 +0100 Subject: [PATCH 31/36] fix: resolve primitives SubscribeSafe binding Use the ReactiveUI.Primitives 5.6.0 package SubscribeSafe overloads directly through project-level PrimitivesLinqExtensions aliases for DynamicData and DynamicData.Reactive. Remove the temporary ReactiveShimObservableExtensions implementation from DynamicData.Reactive and update callback-based SubscribeSafe call sites to static Primitives LinqExtensions calls so the Rx SubscribeSafe overload is not selected. Guard the DynamicData.Tests reactive output copy target when no target output directory exists, and run the property-changed race fixture in the integration collection to avoid suite-parallel timing failures. Verification: dotnet build src\\DynamicData.sln -c Release --no-restore /nr:false /m:1 /p:UseSharedCompilation=false; dotnet test src\\DynamicData.sln -c Release --no-build --logger console;verbosity=minimal /nr:false /m:1 /p:UseSharedCompilation=false --- .../DynamicData.Reactive.csproj | 5 +- .../ReactiveShimObservableExtensions.cs | 45 ----------- .../Binding/WhenPropertyChangedRaceFixture.cs | 1 + .../DynamicData.Tests.csproj | 2 +- .../Cache/Internal/AsyncDisposeMany.cs | 59 +++++++------- .../Cache/Internal/ExpireAfter.ForSource.cs | 18 ++--- .../Cache/Internal/ExpireAfter.ForStream.cs | 11 ++- .../Cache/Internal/Filter.Dynamic.cs | 33 ++++---- .../Cache/Internal/GroupOnDynamic.cs | 79 ++++++++++--------- .../Cache/Internal/MergeChangeSets.cs | 14 ++-- src/DynamicData/Cache/Internal/OfType.cs | 78 +++++++++--------- .../Cache/Internal/ToObservableChangeSet.cs | 3 +- src/DynamicData/DynamicData.csproj | 5 +- .../Internal/CacheParentSubscription.cs | 22 +++--- src/DynamicData/List/Internal/ExpireAfter.cs | 18 ++--- .../Internal/Filter.WithPredicateState.cs | 21 +++-- .../List/Internal/ToObservableChangeSet.cs | 3 +- 17 files changed, 187 insertions(+), 230 deletions(-) delete mode 100644 src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index fb761f272..731f53c23 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -13,8 +13,8 @@ - - + + @@ -32,6 +32,7 @@ + diff --git a/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs b/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs deleted file mode 100644 index 6fc32a2a5..000000000 --- a/src/DynamicData.Reactive/Internal/ReactiveShimObservableExtensions.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. -// Roland Pheasant licenses this file to you under the MIT license. -// See the LICENSE file in the project root for full license information. - -namespace DynamicData.Reactive.Internal; - -/// -/// Temporary shim to provide SubscribeSafe extension methods for IObservable{T} when using the REACTIVE_SHIM compilation symbol. This is a workaround for the absence of SubscribeSafe in the Reactive Extensions (Primitives) library as of V5.5.0. -/// -internal static class ReactiveShimObservableExtensions -{ - /// - /// Subscribes to the source with safe observer callbacks. - /// - /// The observable value type. - /// The observable source. - /// The callback invoked for each value. - /// The callback invoked when the source fails. - /// The subscription disposable. - public static IDisposable SubscribeSafe(this IObservable source, Action onNext, Action onError) => - source.Subscribe(onNext, onError); - - /// - /// Subscribes to the source with safe observer callbacks and a completion callback. - /// - /// The observable value type. - /// The observable source. - /// The callback invoked for each value. - /// The callback invoked when the source fails. - /// The callback invoked when the source completes. - /// The subscription disposable. - public static IDisposable SubscribeSafe(this IObservable source, Action onNext, Action onError, Action onCompleted) => - source.Subscribe(onNext, onError, onCompleted); - - /// - /// Subscribes to the source with safe error and completion callbacks. - /// - /// The observable value type. - /// The observable source. - /// The callback invoked when the source fails. - /// The callback invoked when the source completes. - /// The subscription disposable. - public static IDisposable SubscribeSafe(this IObservable source, Action onError, Action onCompleted) => - source.Subscribe(static _ => { }, onError, onCompleted); -} diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs index e45103280..3d5225e92 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedRaceFixture.cs @@ -11,6 +11,7 @@ namespace DynamicData.Tests.Binding; /// Each test forces concurrency between the operator's subscribe call (or chain re-walk) and one or more /// notifiers firing on other threads. /// +[Collection(IntegrationTestFixtureBase.CollectionName)] public sealed class WhenPropertyChangedRaceFixture { private static readonly TimeSpan ConditionTimeout = TimeSpan.FromSeconds(30); diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index 4c043da54..51808d43e 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -53,6 +53,6 @@ - + diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index bfc39888b..3281ce4a6 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs @@ -45,40 +45,39 @@ public static IObservable> Create( disposalsCompletedAccessor.Invoke(disposalsCompleted); - var sourceSubscription = source - .SynchronizeSafe() - .SubscribeSafe( - onNext: upstreamChanges => - { - downstreamObserver.OnNext(upstreamChanges); + var sourceSubscription = PrimitivesLinqExtensions.SubscribeSafe( + source.SynchronizeSafe(), + onNext: upstreamChanges => + { + downstreamObserver.OnNext(upstreamChanges); - foreach (var change in upstreamChanges.ToConcreteType()) + foreach (var change in upstreamChanges.ToConcreteType()) + { + switch (change.Reason) { - switch (change.Reason) - { - case ChangeReason.Update: - if (change.Previous.HasValue && !EqualityComparer.Default.Equals(change.Current, change.Previous.Value)) - TryDisposeItem(change.Previous.Value); - break; - - case ChangeReason.Remove: - TryDisposeItem(change.Current); - break; - } + case ChangeReason.Update: + if (change.Previous.HasValue && !EqualityComparer.Default.Equals(change.Current, change.Previous.Value)) + TryDisposeItem(change.Previous.Value); + break; + + case ChangeReason.Remove: + TryDisposeItem(change.Current); + break; } + } - itemsByKey.Clone(upstreamChanges); - }, - onError: error => - { - downstreamObserver.OnError(error); - TearDown(); - }, - onCompleted: () => - { - downstreamObserver.OnCompleted(); - TearDown(); - }); + itemsByKey.Clone(upstreamChanges); + }, + onError: error => + { + downstreamObserver.OnError(error); + TearDown(); + }, + onCompleted: () => + { + downstreamObserver.OnCompleted(); + TearDown(); + }); return Disposable.Create(() => { diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs index 10b93a6a4..4ac684ec3 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs @@ -140,15 +140,15 @@ protected SubscriptionBase( _proposedExpirationsQueue = []; _removedItemsBuffer = []; - _sourceSubscription = source - .Connect() - // It's important to set this flag outside the context of a lock, because it'll be read outside of lock as well. - .Finally(() => _hasSourceCompleted = true) - .Synchronize(SynchronizationGate) - .SubscribeSafe( - onNext: OnSourceNext, - onError: OnSourceError, - onCompleted: OnSourceCompleted); + _sourceSubscription = PrimitivesLinqExtensions.SubscribeSafe( + source + .Connect() + // It's important to set this flag outside the context of a lock, because it'll be read outside of lock as well. + .Finally(() => _hasSourceCompleted = true) + .Synchronize(SynchronizationGate), + OnSourceNext, + OnSourceError, + OnSourceCompleted); } /// diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs index f825e2f70..bfa548c8c 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -127,12 +127,11 @@ protected SubscriptionBase( _itemsCache = new(); _proposedExpirationsQueue = []; - _sourceSubscription = source - .Synchronize(SynchronizationGate) - .SubscribeSafe( - onNext: OnSourceNext, - onError: OnSourceError, - onCompleted: OnSourceCompleted); + _sourceSubscription = PrimitivesLinqExtensions.SubscribeSafe( + source.Synchronize(SynchronizationGate), + OnSourceNext, + OnSourceError, + OnSourceCompleted); } /// diff --git a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs index fffc04030..87b98aef8 100644 --- a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs @@ -170,23 +170,22 @@ public Subscription( using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); - _predicateStateSubscription = predicateState - .SubscribeSafe( - onNext: OnPredicateStateNext, - onError: onError, - onCompleted: OnPredicateStateCompleted); - - _reapplyFilterSubscription = reapplyFilter - .SubscribeSafe( - onNext: OnReapplyFilterNext, - onError: onError, - onCompleted: OnReapplyFilterCompleted); - - _sourceSubscription = source - .SubscribeSafe( - onNext: OnSourceNext, - onError: onError, - onCompleted: OnSourceCompleted); + _predicateStateSubscription = predicateState.SubscribeSafe(Observer.Create( + onNext: OnPredicateStateNext, + onError: onError, + onCompleted: OnPredicateStateCompleted)); + + _reapplyFilterSubscription = PrimitivesLinqExtensions.SubscribeSafe( + reapplyFilter, + OnReapplyFilterNext, + onError, + OnReapplyFilterCompleted); + + _sourceSubscription = PrimitivesLinqExtensions.SubscribeSafe( + source, + OnSourceNext, + onError, + OnSourceCompleted); _hasInitialized = true; diff --git a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs index dcca310a0..cb35dcc6f 100644 --- a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs +++ b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs @@ -41,54 +41,55 @@ public IObservable> Run() => Observabl // The first value from the Group Selector should update the Grouper with all the values seen so far // Then indicate a selector has been found. Subsequent values should just update the group selector. - var subGroupSelector = sharedGroupSelector - .SubscribeSafe( - onNext: groupSelector => + var subGroupSelector = PrimitivesLinqExtensions.SubscribeSafe( + sharedGroupSelector, + onNext: groupSelector => + { + if (hasSelector) { - if (hasSelector) - { - dynamicGrouper.SetGroupSelector(groupSelector, observer); - } - else - { - dynamicGrouper.Initialize(notGrouped.KeyValues, groupSelector, observer); - hasSelector = true; - } - }, - onError: observer.OnError); + dynamicGrouper.SetGroupSelector(groupSelector, observer); + } + else + { + dynamicGrouper.Initialize(notGrouped.KeyValues, groupSelector, observer); + hasSelector = true; + } + }, + onError: observer.OnError); // Ignore values until a selector has been provided // Then re-evaluate all the groupings each time it fires - var subRegrouper = sharedRegrouper - .SubscribeSafe( - onNext: _ => + var subRegrouper = PrimitivesLinqExtensions.SubscribeSafe( + sharedRegrouper, + onNext: _ => + { + if (hasSelector) { - if (hasSelector) - { - dynamicGrouper.RegroupAll(observer); - } - }, - onError: observer.OnError); + dynamicGrouper.RegroupAll(observer); + } + }, + onError: observer.OnError); - var subChanges = sharedSource - .SubscribeSafe( - onNext: changeSet => + var subChanges = PrimitivesLinqExtensions.SubscribeSafe( + sharedSource, + onNext: changeSet => + { + if (hasSelector) + { + dynamicGrouper.ProcessChangeSet(changeSet, observer); + } + else { - if (hasSelector) - { - dynamicGrouper.ProcessChangeSet(changeSet, observer); - } - else - { - notGrouped.Clone(changeSet); - } - }, - onError: observer.OnError); + notGrouped.Clone(changeSet); + } + }, + onError: observer.OnError); // Create an observable that completes when all 3 inputs complete so the downstream can be completed as well - var subOnComplete = Observable.Merge(sharedSource.ToUnit(), sharedGroupSelector.ToUnit(), sharedRegrouper) - .IgnoreElements() - .SubscribeSafe(observer.OnError, observer.OnCompleted); + var subOnComplete = PrimitivesLinqExtensions.SubscribeSafe( + Observable.Merge(sharedSource.ToUnit(), sharedGroupSelector.ToUnit(), sharedRegrouper).IgnoreElements(), + observer.OnError, + observer.OnCompleted); return new CompositeDisposable( sharedGroupSelector.Connect(), diff --git a/src/DynamicData/Cache/Internal/MergeChangeSets.cs b/src/DynamicData/Cache/Internal/MergeChangeSets.cs index d13c9cb54..674847daa 100644 --- a/src/DynamicData/Cache/Internal/MergeChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeChangeSets.cs @@ -48,14 +48,16 @@ public IObservable> Run() => Observable.Create(() => cache.Items, comparer, equalityComparer); // Create a ChangeSet of Caches, synchronize, update the local copy, and merge the sub-observables together. - return new CompositeDisposable(CreateContainerObservable(source, queue) - .SynchronizeSafe(queue) - .Do(cache.Clone) - .MergeMany(mc => mc.Source.Do(static _ => { }, observer.OnError)) - .SubscribeSafe( + return new CompositeDisposable( + PrimitivesLinqExtensions.SubscribeSafe( + CreateContainerObservable(source, queue) + .SynchronizeSafe(queue) + .Do(cache.Clone) + .MergeMany(mc => mc.Source.Do(static _ => { }, observer.OnError)), changes => changeTracker.ProcessChangeSet(changes, observer), observer.OnError, - observer.OnCompleted), queue); + observer.OnCompleted), + queue); }); // Can optimize for the Add case because that's the only one that applies diff --git a/src/DynamicData/Cache/Internal/OfType.cs b/src/DynamicData/Cache/Internal/OfType.cs index 02a183662..6cf00d286 100644 --- a/src/DynamicData/Cache/Internal/OfType.cs +++ b/src/DynamicData/Cache/Internal/OfType.cs @@ -27,55 +27,55 @@ internal sealed class OfType(IObservable /// The result of the operation. public IObservable> Run() => - Observable.Create>(observer => source - .SubscribeSafe( - onNext: upstreamChanges => - { - var downstreamChanges = new ChangeSet(capacity: upstreamChanges.Count); + Observable.Create>(observer => PrimitivesLinqExtensions.SubscribeSafe( + source, + onNext: upstreamChanges => + { + var downstreamChanges = new ChangeSet(capacity: upstreamChanges.Count); - try + try + { + foreach (var change in upstreamChanges.ToConcreteType()) { - foreach (var change in upstreamChanges.ToConcreteType()) - { - // Don't propagate moves at all, since we don't preserve indexes. - if (change.Reason is ChangeReason.Moved) - continue; - - Change? transformedChange = (change.Reason, change.Current) switch - { - // Update when Current is the right type, but the Previous was not (Add) - (ChangeReason.Update, TDestination addDestination) when change.Previous.Value is not TDestination => - new(ChangeReason.Add, change.Key, addDestination), + // Don't propagate moves at all, since we don't preserve indexes. + if (change.Reason is ChangeReason.Moved) + continue; - // Update when Current is not the right type, but the Previous was (Remove) - (ChangeReason.Update, not TDestination) when change.Previous.Value is TDestination removeDestination => - new(ChangeReason.Remove, change.Key, removeDestination), + Change? transformedChange = (change.Reason, change.Current) switch + { + // Update when Current is the right type, but the Previous was not (Add) + (ChangeReason.Update, TDestination addDestination) when change.Previous.Value is not TDestination => + new(ChangeReason.Add, change.Key, addDestination), - // For any other change reason, if the Current is the right type, forward with converted types - (_, TDestination otherDestination) => - new(change.Reason, change.Key, otherDestination, change.Previous.HasValue && change.Previous.Value is TDestination pd ? ReactiveUI.Primitives.Optional.Some(pd) : default), + // Update when Current is not the right type, but the Previous was (Remove) + (ChangeReason.Update, not TDestination) when change.Previous.Value is TDestination removeDestination => + new(ChangeReason.Remove, change.Key, removeDestination), - // Otherwise, don't do anything at all - _ => default, - }; + // For any other change reason, if the Current is the right type, forward with converted types + (_, TDestination otherDestination) => + new(change.Reason, change.Key, otherDestination, change.Previous.HasValue && change.Previous.Value is TDestination pd ? ReactiveUI.Primitives.Optional.Some(pd) : default), - if (transformedChange is { } c) - { - // Do not propagate indexes, we can't guarantee them to be correct, because we aren't caching items. - downstreamChanges.Add(c); - } - } + // Otherwise, don't do anything at all + _ => default, + }; - if (!suppressEmptyChangeSets || downstreamChanges.Count != 0) + if (transformedChange is { } c) { - observer.OnNext(downstreamChanges); + // Do not propagate indexes, we can't guarantee them to be correct, because we aren't caching items. + downstreamChanges.Add(c); } } - catch (Exception error) + + if (!suppressEmptyChangeSets || downstreamChanges.Count != 0) { - observer.OnError(error); + observer.OnNext(downstreamChanges); } - }, - onError: observer.OnError, - onCompleted: observer.OnCompleted)); + } + catch (Exception error) + { + observer.OnError(error); + } + }, + onError: observer.OnError, + onCompleted: observer.OnCompleted)); } diff --git a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs index 5f336eeae..7b7b9a02d 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -178,7 +178,8 @@ public Subscription( _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; _synchronizationGate = new(); - _sourceSubscription = source.SubscribeSafe( + _sourceSubscription = PrimitivesLinqExtensions.SubscribeSafe( + source, onNext: OnSourceNext, onError: downstreamObserver.OnError, onCompleted: OnSourceCompleted); diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index b06452235..f035a5fcf 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -11,8 +11,8 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int - - + + @@ -26,6 +26,7 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int + diff --git a/src/DynamicData/Internal/CacheParentSubscription.cs b/src/DynamicData/Internal/CacheParentSubscription.cs index e3d8aac80..cbd8c6c4d 100644 --- a/src/DynamicData/Internal/CacheParentSubscription.cs +++ b/src/DynamicData/Internal/CacheParentSubscription.cs @@ -125,12 +125,11 @@ protected void AddChildSubscription(IObservable observable, TKey parentK // on normal completion (not disposal), so RemoveChildSubscription is NOT called when the // parent disposes child subscriptions during Dispose(). This asymmetry is intentional: // disposal cleanup is handled by KeyedDisposable, not by individual completion callbacks. - disposableContainer.Disposable = observable - .Finally(CheckCompleted) - .SubscribeSafe( - onNext: val => ChildOnNext(val, parentKey), - onError: TerminalError, - onCompleted: () => RemoveChildSubscription(parentKey)); + disposableContainer.Disposable = PrimitivesLinqExtensions.SubscribeSafe( + observable.Finally(CheckCompleted), + onNext: val => ChildOnNext(val, parentKey), + onError: TerminalError, + onCompleted: () => RemoveChildSubscription(parentKey)); } /// @@ -145,12 +144,11 @@ protected void AddChildSubscription(IObservable observable, TKey parentK /// The source value. protected void CreateParentSubscription(IObservable> source) => _parentSubscription.Disposable = - source - .SynchronizeSafe(_queue) - .SubscribeSafe( - onNext: ParentOnNext, - onError: TerminalError, - onCompleted: CheckCompleted); + PrimitivesLinqExtensions.SubscribeSafe( + source.SynchronizeSafe(_queue), + onNext: ParentOnNext, + onError: TerminalError, + onCompleted: CheckCompleted); /// /// Executes the Dispose operation. diff --git a/src/DynamicData/List/Internal/ExpireAfter.cs b/src/DynamicData/List/Internal/ExpireAfter.cs index be491659b..04d50a594 100644 --- a/src/DynamicData/List/Internal/ExpireAfter.cs +++ b/src/DynamicData/List/Internal/ExpireAfter.cs @@ -127,15 +127,15 @@ protected SubscriptionBase( _expirationDueTimes = new(); _expiringIndexesBuffer = new(); - _sourceSubscription = source - .Connect() - // It's important to set this flag outside the context of a lock, because it'll be read outside of lock as well. - .Finally(() => _hasSourceCompleted = true) - .Synchronize(SynchronizationGate) - .SubscribeSafe( - onNext: OnSourceNext, - onError: OnSourceError, - onCompleted: OnSourceCompleted); + _sourceSubscription = PrimitivesLinqExtensions.SubscribeSafe( + source + .Connect() + // It's important to set this flag outside the context of a lock, because it'll be read outside of lock as well. + .Finally(() => _hasSourceCompleted = true) + .Synchronize(SynchronizationGate), + onNext: OnSourceNext, + onError: OnSourceError, + onCompleted: OnSourceCompleted); } /// diff --git a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs index 407699de9..b3b3b06da 100644 --- a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs +++ b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs @@ -175,17 +175,16 @@ public void Activate( _predicateStateSubscription = predicateStateSubscription; _sourceSubscription = sourceSubscription; - predicateStateSubscription.Disposable = predicateState - .SubscribeSafe( - onNext: OnPredicateStateNext, - onError: onError, - onCompleted: OnPredicateStateCompleted); - - sourceSubscription.Disposable = source - .SubscribeSafe( - onNext: OnSourceNext, - onError: onError, - onCompleted: OnSourceCompleted); + predicateStateSubscription.Disposable = predicateState.SubscribeSafe(Observer.Create( + onNext: OnPredicateStateNext, + onError: onError, + onCompleted: OnPredicateStateCompleted)); + + sourceSubscription.Disposable = PrimitivesLinqExtensions.SubscribeSafe( + source, + onNext: OnSourceNext, + onError: onError, + onCompleted: OnSourceCompleted); } /// diff --git a/src/DynamicData/List/Internal/ToObservableChangeSet.cs b/src/DynamicData/List/Internal/ToObservableChangeSet.cs index 03334362b..a65653468 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -158,7 +158,8 @@ public Subscription( _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; _synchronizationGate = new(); - _sourceSubscription = source.SubscribeSafe( + _sourceSubscription = PrimitivesLinqExtensions.SubscribeSafe( + source, onNext: OnSourceNext, onError: downstreamObserver.OnError, onCompleted: OnSourceCompleted); From eab488af3b7fd1e71e289c81524723d00a468ecf Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Sun, 21 Jun 2026 22:52:55 +0100 Subject: [PATCH 32/36] Remove ReactiveUI.Primitives.Extensions package refs Delete ReactiveUI.Primitives.Extensions package references from DynamicData and DynamicData.Reactive project files. The two entries (ReactiveUI.Primitives.Extensions and ReactiveUI.Primitives.Extensions.Reactive) were removed from their respective .csproj ItemGroup sections because the extensions are no longer referenced by these projects. --- src/DynamicData.Reactive/DynamicData.Reactive.csproj | 1 - src/DynamicData/DynamicData.csproj | 1 - 2 files changed, 2 deletions(-) diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index 731f53c23..c13d44062 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -14,7 +14,6 @@ - diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index f035a5fcf..19266ed59 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -12,7 +12,6 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int - From a7ec3131277e5de15fba142e5e71afdc55cd8aab Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Mon, 22 Jun 2026 00:19:58 +0100 Subject: [PATCH 33/36] Use Lock for _gate initialization Remove conditional compilation and always initialize the _gate field with Lock instead of an object fallback. This simplifies the constructors in DeliveryQueue and SharedDeliveryQueue and eliminates NET9_0_OR_GREATER #if branches. --- src/DynamicData/Internal/DeliveryQueue.cs | 4 ---- src/DynamicData/Internal/SharedDeliveryQueue.cs | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/DynamicData/Internal/DeliveryQueue.cs b/src/DynamicData/Internal/DeliveryQueue.cs index 2dcedcf1e..9f0206c26 100644 --- a/src/DynamicData/Internal/DeliveryQueue.cs +++ b/src/DynamicData/Internal/DeliveryQueue.cs @@ -49,11 +49,7 @@ internal sealed class DeliveryQueue : IObserver, IDisposable /// The observer that receives delivered items. public DeliveryQueue(IObserver observer) { -#if NET9_0_OR_GREATER _gate = new Lock(); -#else - _gate = new object(); -#endif _observer = observer; } diff --git a/src/DynamicData/Internal/SharedDeliveryQueue.cs b/src/DynamicData/Internal/SharedDeliveryQueue.cs index 36f5c4524..9a4a9cf3f 100644 --- a/src/DynamicData/Internal/SharedDeliveryQueue.cs +++ b/src/DynamicData/Internal/SharedDeliveryQueue.cs @@ -66,11 +66,7 @@ public SharedDeliveryQueue() /// The onDrainComplete value. public SharedDeliveryQueue(Action? onDrainComplete) { -#if NET9_0_OR_GREATER _gate = new Lock(); -#else - _gate = new object(); -#endif _onDrainComplete = onDrainComplete; } #if NET9_0_OR_GREATER From 1c2be9c188b0c1857d4208800f7dc4a345ea9d48 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Mon, 22 Jun 2026 00:24:40 +0100 Subject: [PATCH 34/36] Unify gate parameter type to Lock Remove NET9_0_OR_GREATER conditional overloads and use the Lock type for gate parameters in DeliveryQueue and SharedDeliveryQueue. This eliminates object-based constructors and simplifies the code by unifying the gate type across these delivery queue implementations. --- src/DynamicData/Internal/DeliveryQueue.cs | 4 ---- src/DynamicData/Internal/SharedDeliveryQueue.cs | 7 ------- 2 files changed, 11 deletions(-) diff --git a/src/DynamicData/Internal/DeliveryQueue.cs b/src/DynamicData/Internal/DeliveryQueue.cs index 9f0206c26..a1225faa9 100644 --- a/src/DynamicData/Internal/DeliveryQueue.cs +++ b/src/DynamicData/Internal/DeliveryQueue.cs @@ -58,11 +58,7 @@ public DeliveryQueue(IObserver observer) /// /// The lock shared with the caller. /// The observer that receives delivered items. -#if NET9_0_OR_GREATER public DeliveryQueue(Lock gate, IObserver observer) -#else - public DeliveryQueue(object gate, IObserver observer) -#endif { _gate = gate; _observer = observer; diff --git a/src/DynamicData/Internal/SharedDeliveryQueue.cs b/src/DynamicData/Internal/SharedDeliveryQueue.cs index 9a4a9cf3f..afa19724f 100644 --- a/src/DynamicData/Internal/SharedDeliveryQueue.cs +++ b/src/DynamicData/Internal/SharedDeliveryQueue.cs @@ -69,17 +69,10 @@ public SharedDeliveryQueue(Action? onDrainComplete) _gate = new Lock(); _onDrainComplete = onDrainComplete; } -#if NET9_0_OR_GREATER /// Initializes a new instance of the class with a caller-provided lock. /// The gate value. public SharedDeliveryQueue(Lock gate) => _gate = gate; -#else - - /// Initializes a new instance of the class with a caller-provided lock. - /// The gate value. - public SharedDeliveryQueue(object gate) => _gate = gate; -#endif /// Gets whether this queue has been terminated. public bool IsTerminated From fefd786a966f7c692d2d2c997bd7069637fd8ef2 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Mon, 22 Jun 2026 01:01:13 +0100 Subject: [PATCH 35/36] Fix DeliveryQueue deadlock and add repro test Add a regression test (CrossCacheDeadlockRepro) that reproduces a cross-cache deadlock during concurrent PopulateInto updates. Rework DeliveryQueue to avoid deadlocks by introducing a dedicated queue lock and active-access tracking: _queueGate, _activeAccessCount, EnterAccess/ExitAccessAndDeliver and DeliverIfNeeded/TryTakeNotification/StopDelivery. Adjust delivery start/stop logic to honor in-flight caller-owned access, ensure proper termination handling, and expose HasPendingNotifications. Update ScopedAccess and ReadOnlyScopedAccess to use the new access semantics. Include conditional APIs for NET9_0_OR_GREATER to use Lock where available. --- .../Internal/CrossCacheDeadlockRepro.cs | 55 +++++ src/DynamicData/Internal/DeliveryQueue.cs | 226 ++++++++++++++---- 2 files changed, 230 insertions(+), 51 deletions(-) create mode 100644 src/DynamicData.Tests/Internal/CrossCacheDeadlockRepro.cs diff --git a/src/DynamicData.Tests/Internal/CrossCacheDeadlockRepro.cs b/src/DynamicData.Tests/Internal/CrossCacheDeadlockRepro.cs new file mode 100644 index 000000000..808a32696 --- /dev/null +++ b/src/DynamicData.Tests/Internal/CrossCacheDeadlockRepro.cs @@ -0,0 +1,55 @@ +// CrossCacheDeadlockRepro.cs +// Reproduction for: Cross-cache deadlock when concurrent updates notify subscribers that modify other SourceCache instances +// Requires: DynamicData 9.x, xunit, FluentAssertions +// +// This test deadlocks on DynamicData main. It should complete in under 10 seconds. + +namespace DynamicData.Tests.Internal; + +public class CrossCacheDeadlockRepro : IDisposable +{ + private readonly SourceCache _cacheA = new(static x => x.GetHashCode()); + private readonly SourceCache _cacheB = new(static x => x.GetHashCode()); + + [Fact] + public void ConcurrentPopulateIntoShouldNotDeadlock() + { + // Arrange + using var destination = new SourceCache(static x => x.GetHashCode()); + using var subA = _cacheA.Connect().PopulateInto(destination); + using var subB = _cacheB.Connect().PopulateInto(destination); + + var count = 0; + using var feedback = destination.Connect().Subscribe(_ => Interlocked.Increment(ref count)); + + // Act — concurrent updates from two threads + var completed = Task.WaitAll( + [ + Task.Run(() => + { + for (var i = 0; i < 100; i++) + { + _cacheA.AddOrUpdate($"A-{i}"); + } + }), + Task.Run(() => + { + for (var i = 0; i < 100; i++) + { + _cacheB.AddOrUpdate($"B-{i}"); + } + }), + ], + TimeSpan.FromSeconds(10)); + + // Assert + completed.Should().BeTrue("concurrent PopulateInto should not deadlock"); + count.Should().BeGreaterThan(0, "destination should have received changeset notifications"); + } + + public void Dispose() + { + _cacheA.Dispose(); + _cacheB.Dispose(); + } +} diff --git a/src/DynamicData/Internal/DeliveryQueue.cs b/src/DynamicData/Internal/DeliveryQueue.cs index a1225faa9..d558d0e56 100644 --- a/src/DynamicData/Internal/DeliveryQueue.cs +++ b/src/DynamicData/Internal/DeliveryQueue.cs @@ -28,11 +28,21 @@ internal sealed class DeliveryQueue : IObserver, IDisposable /// private readonly Lock _gate; + /// + /// The _queueGate field. + /// + private readonly Lock _queueGate = new(); + /// /// The _observer field. /// private readonly IObserver _observer; + /// + /// The _activeAccessCount field. + /// + private int _activeAccessCount; + /// /// The _drainThreadId field. /// @@ -77,16 +87,26 @@ public DeliveryQueue(Lock gate, IObserver observer) /// private void EnsureDeliveryComplete() { - using (AcquireReadLock()) + var isDrainThread = false; + + EnterQueueLock(); + try { _isTerminated = true; _queue.Clear(); + isDrainThread = _drainThreadId == Environment.CurrentManagedThreadId; + } + finally + { + ExitQueueLock(); + } - // If we're being called from within the drain loop (e.g., downstream - // disposed during OnNext), the current thread IS the deliverer. - // The drain loop will see _isTerminated and exit after we return. - if (_drainThreadId == Environment.CurrentManagedThreadId) - return; + // If we're being called from within the drain loop (e.g., downstream + // disposed during OnNext), the current thread IS the deliverer. + // The drain loop will see _isTerminated and exit after we return. + if (isDrainThread) + { + return; } SpinWait spinner = default; @@ -155,6 +175,60 @@ public void OnCompleted() /// private void ExitLock() => Monitor.Exit(_gate); #endif +#if NET9_0_OR_GREATER + + /// + /// Executes the EnterQueueLock operation. + /// + private void EnterQueueLock() => _queueGate.Enter(); + + /// + /// Executes the ExitQueueLock operation. + /// + private void ExitQueueLock() => _queueGate.Exit(); +#else + + /// + /// Executes the EnterQueueLock operation. + /// + private void EnterQueueLock() => Monitor.Enter(_queueGate); + + /// + /// Executes the ExitQueueLock operation. + /// + private void ExitQueueLock() => Monitor.Exit(_queueGate); +#endif + + /// + /// Enters caller-owned access and prevents queue draining until the access is released. + /// + private void EnterAccess() + { + Interlocked.Increment(ref _activeAccessCount); + + try + { + EnterLock(); + } + catch + { + Interlocked.Decrement(ref _activeAccessCount); + throw; + } + } + + /// + /// Releases caller-owned access and starts delivery if this was the final active access. + /// + private void ExitAccessAndDeliver() + { + ExitLock(); + + if (Interlocked.Decrement(ref _activeAccessCount) == 0) + { + DeliverIfNeeded(); + } + } /// /// Executes the EnqueueNotification operation. @@ -162,21 +236,28 @@ public void OnCompleted() /// The item value. private void EnqueueNotification(Notification item) { - if (_isTerminated) + EnterQueueLock(); + try { - return; - } + if (_isTerminated) + { + return; + } - _queue.Enqueue(item); + _queue.Enqueue(item); + } + finally + { + ExitQueueLock(); + } } /// - /// Executes the ExitLockAndDeliver operation. + /// Executes the DeliverIfNeeded operation. /// - private void ExitLockAndDeliver() + private void DeliverIfNeeded() { var shouldDeliver = TryStartDelivery(); - ExitLock(); if (shouldDeliver) { @@ -185,13 +266,21 @@ private void ExitLockAndDeliver() bool TryStartDelivery() { - if (_drainThreadId != -1 || _queue.Count == 0) + EnterQueueLock(); + try { - return false; - } + if (_drainThreadId != -1 || _queue.Count == 0 || _isTerminated || Volatile.Read(ref _activeAccessCount) != 0) + { + return false; + } - _drainThreadId = Environment.CurrentManagedThreadId; - return true; + Volatile.Write(ref _drainThreadId, Environment.CurrentManagedThreadId); + return true; + } + finally + { + ExitQueueLock(); + } } void DeliverAll() @@ -200,25 +289,9 @@ void DeliverAll() { while (true) { - Notification notification; - - using (AcquireReadLock()) + if (!TryTakeNotification(out var notification)) { - if (_queue.Count == 0 || _isTerminated) - { - _drainThreadId = -1; - return; - } - - notification = _queue.Dequeue(); - - // Mark terminated BEFORE delivery so concurrent code - // (e.g., InvokePreview) sees the terminal state immediately. - if (notification.IsTerminal) - { - _isTerminated = true; - _queue.Clear(); - } + return; } // Deliver outside the lock @@ -226,27 +299,79 @@ void DeliverAll() if (notification.IsTerminal) { - using (AcquireReadLock()) - { - _drainThreadId = -1; - } - + StopDelivery(); return; } } } catch { - using (AcquireReadLock()) + StopDelivery(); + throw; + } + } + + bool TryTakeNotification(out Notification notification) + { + EnterQueueLock(); + try + { + if (_queue.Count == 0 || _isTerminated || Volatile.Read(ref _activeAccessCount) != 0) { - _drainThreadId = -1; + Volatile.Write(ref _drainThreadId, -1); + notification = default; + return false; } - throw; + notification = _queue.Dequeue(); + + // Mark terminated BEFORE delivery so concurrent code + // (e.g., InvokePreview) sees the terminal state immediately. + if (notification.IsTerminal) + { + _isTerminated = true; + _queue.Clear(); + } + + return true; + } + finally + { + ExitQueueLock(); + } + } + + void StopDelivery() + { + EnterQueueLock(); + try + { + Volatile.Write(ref _drainThreadId, -1); + } + finally + { + ExitQueueLock(); } } } + /// + /// Gets whether queue delivery is currently pending or in progress. + /// + /// when there are queued or in-flight notifications. + private bool HasPendingNotifications() + { + EnterQueueLock(); + try + { + return _queue.Count > 0 || _drainThreadId != -1; + } + finally + { + ExitQueueLock(); + } + } + /// /// Scoped access for enqueueing notifications under the gate lock. /// @@ -264,7 +389,7 @@ public ref struct ScopedAccess internal ScopedAccess(DeliveryQueue owner) { _owner = owner; - owner.EnterLock(); + owner.EnterAccess(); } /// Enqueues an OnNext notification. @@ -288,12 +413,12 @@ public void Dispose() } _owner = null; - owner.ExitLockAndDeliver(); + owner.ExitAccessAndDeliver(); } } /// -/// Read-only scoped access. Disposing releases the gate without triggering delivery. +/// Read-only scoped access. Disposing releases the gate and resumes any deferred delivery. /// public ref struct ReadOnlyScopedAccess { @@ -309,12 +434,11 @@ public ref struct ReadOnlyScopedAccess internal ReadOnlyScopedAccess(DeliveryQueue owner) { _owner = owner; - owner.EnterLock(); + owner.EnterAccess(); } /// Gets whether there are notifications pending delivery. - public readonly bool HasPending => - _owner is not null && (_owner._queue.Count > 0 || _owner._drainThreadId != -1); + public readonly bool HasPending => _owner?.HasPendingNotifications() == true; /// Releases the gate lock. public void Dispose() @@ -326,7 +450,7 @@ public void Dispose() } _owner = null; - owner.ExitLock(); + owner.ExitAccessAndDeliver(); } } } From 3259677b180e1f2b7b330a7fa5999be9ac6af390 Mon Sep 17 00:00:00 2001 From: Chris Pulman Date: Mon, 22 Jun 2026 22:42:57 +0100 Subject: [PATCH 36/36] Add deadlock tests and refactor list delivery Add DeadlockTortureTest to exercise bidirectional pipelines and ensure operators no longer deadlock under concurrent writes. Introduce DeliveryQueue.IsDeliveringOnCurrentThread. Refactor ExpireAfter to track source items and use an ExpiringItem buffer with TryGetCurrentIndex to robustly handle expirations, moves and removals. Rework SourceList to use a DeliveryQueue for notifications, add versioning and read-lock semantics to avoid holding the internal locker during downstream delivery, and change LoadFromSource/NotifyCompleted/NotifyError to enqueue notifications instead of direct synchronous delivery. Also add ListUpdateObserver to dispatch updates and count notifications, and improve disposal/waiting logic to avoid deadlocks during termination. --- .../List/DeadlockTortureTest.cs | 133 +++++++++ src/DynamicData/Internal/DeliveryQueue.cs | 5 + src/DynamicData/List/Internal/ExpireAfter.cs | 93 +++++- src/DynamicData/List/SourceList.cs | 282 ++++++++++++------ 4 files changed, 402 insertions(+), 111 deletions(-) create mode 100644 src/DynamicData.Tests/List/DeadlockTortureTest.cs diff --git a/src/DynamicData.Tests/List/DeadlockTortureTest.cs b/src/DynamicData.Tests/List/DeadlockTortureTest.cs new file mode 100644 index 000000000..cb2b8f85e --- /dev/null +++ b/src/DynamicData.Tests/List/DeadlockTortureTest.cs @@ -0,0 +1,133 @@ +using DynamicData.Binding; +using DynamicData.Tests; +using DynamicData.Tests.Domain; + +namespace DynamicData.Tests.List; + +/// +/// Deadlock torture test for list operators. Every operator that previously used +/// Synchronize(locker) (holding the lock during downstream delivery) is wired into a +/// bidirectional cross-list pipeline. Two threads write simultaneously, creating the ABBA +/// lock cycle: +/// Thread A: sourceA._locker -> operator lock -> PopulateInto -> sourceB._locker +/// Thread B: sourceB._locker -> operator lock -> PopulateInto -> sourceA._locker +/// +/// On origin/main (Synchronize(lock)): deadlocks reliably within seconds. +/// On the PR branch (SynchronizeSafe queue-drain): no deadlock possible. +/// +[Collection(IntegrationTestFixtureBase.CollectionName)] +public sealed class DeadlockTortureTest +{ + private const int ItemCount = 200; + private const int Iterations = 50; + private const int TimeoutSeconds = 15; + + private static async Task RunBidirectionalDeadlockTest( + Func>, IObservable>> pipeline, + int iterations = Iterations) + { + for (var iter = 0; iter < iterations; iter++) + { + using var sourceA = new SourceList(); + using var sourceB = new SourceList(); + + // Filter prefixes prevent the feedback loop: items from A flowing into B keep their + // "A" prefix, so the B-to-A filter rejects them. Likewise for the reverse direction. + using var aToB = pipeline(sourceA.Connect().Filter(p => p.Name.StartsWith("A"))).PopulateInto(sourceB); + using var bToA = pipeline(sourceB.Connect().Filter(p => p.Name.StartsWith("B"))).PopulateInto(sourceA); + + using var barrier = new Barrier(2); + var taskA = Task.Run(() => { barrier.SignalAndWait(); for (var i = 0; i < ItemCount; i++) sourceA.Add(new Person("A-" + iter + "-" + i, i)); }); + var taskB = Task.Run(() => { barrier.SignalAndWait(); for (var i = 0; i < ItemCount; i++) sourceB.Add(new Person("B-" + iter + "-" + i, i)); }); + + var completed = Task.WhenAll(taskA, taskB); + if (await Task.WhenAny(completed, Task.Delay(TimeSpan.FromSeconds(TimeoutSeconds))) != completed) + return false; + } + return true; + } + + [Fact] + public async Task Sort_DoesNotDeadlock() => + (await RunBidirectionalDeadlockTest(s => s.Sort(SortExpressionComparer.Ascending(p => p.Age)))).Should().BeTrue(); + + [Fact] + public async Task AutoRefresh_DoesNotDeadlock() => + (await RunBidirectionalDeadlockTest(s => s.AutoRefresh(p => p.Age))).Should().BeTrue(); + + [Fact] + public async Task Page_DoesNotDeadlock() + { + using var req = new StateSignal(new PageRequest(1, 50)); + (await RunBidirectionalDeadlockTest(s => s.Sort(SortExpressionComparer.Ascending(p => p.Age)).Page(req))).Should().BeTrue(); + } + + [Fact] + public async Task Virtualise_DoesNotDeadlock() + { + using var req = new StateSignal(new VirtualRequest(0, 50)); + (await RunBidirectionalDeadlockTest(s => s.Sort(SortExpressionComparer.Ascending(p => p.Age)).Virtualise(req))).Should().BeTrue(); + } + + [Fact] + public async Task FilterDynamic_DoesNotDeadlock() + { + using var pred = new StateSignal>(_ => true); + (await RunBidirectionalDeadlockTest(s => s.Filter(pred))).Should().BeTrue(); + } + + [Fact] + public async Task BufferIf_DoesNotDeadlock() => + (await RunBidirectionalDeadlockTest(s => s.BufferIf(new StateSignal(false), false, (TimeSpan?)null))).Should().BeTrue(); + + [Fact] + public async Task DisposeMany_DoesNotDeadlock() => + (await RunBidirectionalDeadlockTest(s => s.DisposeMany())).Should().BeTrue(); + + [Fact] + public async Task GroupOn_DoesNotDeadlock() => + (await RunBidirectionalDeadlockTest(s => s.GroupOn(p => p.Age % 3).MergeMany(g => g.List.Connect()))).Should().BeTrue(); + + [Fact] + public async Task TransformMany_DoesNotDeadlock() => + (await RunBidirectionalDeadlockTest(s => s.TransformMany(p => new[] { p }))).Should().BeTrue(); + + [Fact] + public async Task AllDangerous_Stacked_DoNotDeadlock() + { + using var pageReq = new StateSignal(new PageRequest(1, 100)); + using var pred = new StateSignal>(_ => true); + (await RunBidirectionalDeadlockTest( + s => s.AutoRefresh(p => p.Age) + .Filter(pred) + .DisposeMany() + .Sort(SortExpressionComparer.Ascending(p => p.Age)) + .Page(pageReq), + iterations: Iterations * 2)).Should().BeTrue(); + } + + [Fact] + public async Task ThreeWayCircular_DoesNotDeadlock() + { + for (var iter = 0; iter < Iterations; iter++) + { + using var a = new SourceList(); + using var b = new SourceList(); + using var c = new SourceList(); + + using var ab = a.Connect().Filter(p => p.Name.StartsWith("A")).Sort(SortExpressionComparer.Ascending(p => p.Age)).PopulateInto(b); + using var bc = b.Connect().Filter(p => p.Name.StartsWith("A")).AutoRefresh(p => p.Age).PopulateInto(c); + using var ca = c.Connect().Filter(p => p.Name.StartsWith("A")).Transform(p => new Person("C-" + p.Name, p.Age)).Filter(p => p.Name.StartsWith("C")).PopulateInto(a); + + using var barrier = new Barrier(3); + var tasks = new[] + { + Task.Run(() => { barrier.SignalAndWait(); for (var i = 0; i < ItemCount; i++) a.Add(new Person("A-" + iter + "-" + i, i)); }), + Task.Run(() => { barrier.SignalAndWait(); for (var i = 0; i < ItemCount; i++) b.Add(new Person("B-" + iter + "-" + i, i)); }), + Task.Run(() => { barrier.SignalAndWait(); for (var i = 0; i < ItemCount; i++) c.Add(new Person("CC-" + iter + "-" + i, i)); }), + }; + var completed = Task.WhenAll(tasks); + (await Task.WhenAny(completed, Task.Delay(TimeSpan.FromSeconds(TimeoutSeconds)))).Should().BeSameAs(completed, "iteration " + iter); + } + } +} diff --git a/src/DynamicData/Internal/DeliveryQueue.cs b/src/DynamicData/Internal/DeliveryQueue.cs index d558d0e56..85b366b7b 100644 --- a/src/DynamicData/Internal/DeliveryQueue.cs +++ b/src/DynamicData/Internal/DeliveryQueue.cs @@ -79,6 +79,11 @@ public DeliveryQueue(Lock gate, IObserver observer) /// public bool IsTerminated => _isTerminated; + /// + /// Gets whether the current thread is delivering queued notifications. + /// + internal bool IsDeliveringOnCurrentThread => Volatile.Read(ref _drainThreadId) == Environment.CurrentManagedThreadId; + /// /// Terminates the queue (rejecting further enqueues) and blocks until /// any in-flight delivery has completed. After this returns, no more diff --git a/src/DynamicData/List/Internal/ExpireAfter.cs b/src/DynamicData/List/Internal/ExpireAfter.cs index 04d50a594..b6b0858f9 100644 --- a/src/DynamicData/List/Internal/ExpireAfter.cs +++ b/src/DynamicData/List/Internal/ExpireAfter.cs @@ -59,9 +59,14 @@ private abstract class SubscriptionBase private readonly List _expirationDueTimes; /// - /// The _expiringIndexesBuffer field. + /// The _items field. /// - private readonly List _expiringIndexesBuffer; + private readonly List _items; + + /// + /// The _expiringItemsBuffer field. + /// + private readonly List _expiringItemsBuffer; /// /// The _observer field. @@ -125,7 +130,8 @@ protected SubscriptionBase( _onEditingSource = OnEditingSource; _expirationDueTimes = new(); - _expiringIndexesBuffer = new(); + _items = new(); + _expiringItemsBuffer = new(); _sourceSubscription = PrimitivesLinqExtensions.SubscribeSafe( source @@ -237,7 +243,7 @@ private void OnEditingSource(IExtendedList updater) { if ((_expirationDueTimes[i] is { } dueTime) && (dueTime <= now)) { - _expiringIndexesBuffer.Add(i); + _expiringItemsBuffer.Add(new ExpiringItem(i, _items[i])); // This shouldn't be necessary, but it guarantees we don't accidentally expire an item more than once, // in the event of a race condition or something we haven't predicted. @@ -246,22 +252,30 @@ private void OnEditingSource(IExtendedList updater) } // I'm pretty sure it shouldn't be possible to end up with no removals here, but it costs basically nothing to check. - if (_expiringIndexesBuffer.Count is not 0) + if (_expiringItemsBuffer.Count is not 0) { // Processing removals in reverse-index order eliminates the need for us to adjust index of each .RemoveAt() call, as we go. - _expiringIndexesBuffer.Sort(static (x, y) => y.CompareTo(x)); + _expiringItemsBuffer.Sort(static (x, y) => y.Index.CompareTo(x.Index)); - var removedItems = new T[_expiringIndexesBuffer.Count]; - for (var i = 0; i < _expiringIndexesBuffer.Count; ++i) + var removedItems = new List(_expiringItemsBuffer.Count); + for (var i = 0; i < _expiringItemsBuffer.Count; ++i) { - var removedIndex = _expiringIndexesBuffer[i]; - removedItems[i] = updater[removedIndex]; + var expiringItem = _expiringItemsBuffer[i]; + if (!TryGetCurrentIndex(updater, expiringItem, out var removedIndex)) + { + continue; + } + + removedItems.Add(updater[removedIndex]); updater.RemoveAt(removedIndex); } - _observer.OnNext(removedItems); + if (removedItems.Count != 0) + { + _observer.OnNext(removedItems); + } - _expiringIndexesBuffer.Clear(); + _expiringItemsBuffer.Clear(); } OnExpirationsManaged(thisScheduledManagement.DueTime); @@ -351,6 +365,10 @@ private void OnSourceNext(IChangeSet changes) { var dueTime = now + _timeSelector.Invoke(change.Item.Current); + _items.Insert( + index: change.Item.CurrentIndex, + item: change.Item.Current); + _expirationDueTimes.Insert( index: change.Item.CurrentIndex, item: dueTime); @@ -368,6 +386,10 @@ private void OnSourceNext(IChangeSet changes) { var dueTime = now + _timeSelector.Invoke(item); + _items.Insert( + index: itemIndex, + item: item); + _expirationDueTimes.Insert( index: itemIndex, item: dueTime); @@ -390,12 +412,19 @@ private void OnSourceNext(IChangeSet changes) } _expirationDueTimes.Clear(); + _items.Clear(); break; case ListChangeReason.Moved: { + var item = _items[change.Item.PreviousIndex]; var expirationDueTime = _expirationDueTimes[change.Item.PreviousIndex]; + _items.RemoveAt(change.Item.PreviousIndex); + _items.Insert( + index: change.Item.CurrentIndex, + item: item); + _expirationDueTimes.RemoveAt(change.Item.PreviousIndex); _expirationDueTimes.Insert( index: change.Item.CurrentIndex, @@ -411,6 +440,7 @@ private void OnSourceNext(IChangeSet changes) } _expirationDueTimes.RemoveAt(change.Item.CurrentIndex); + _items.RemoveAt(change.Item.CurrentIndex); } break; @@ -427,6 +457,7 @@ private void OnSourceNext(IChangeSet changes) } _expirationDueTimes.RemoveRange(change.Range.Index, change.Range.Count); + _items.RemoveRange(change.Range.Index, change.Range.Count); } break; @@ -438,6 +469,7 @@ private void OnSourceNext(IChangeSet changes) // Ignoring the possibility that the item's index has changed as well, because ISourceList does not allow for this. _expirationDueTimes[change.Item.CurrentIndex] = newDueTime; + _items[change.Item.CurrentIndex] = change.Item.Current; haveExpirationDueTimesChanged |= newDueTime != oldDueTime; } @@ -467,6 +499,43 @@ private void TryCancelNextScheduledManagement() _nextScheduledManagement = null; } + /// + /// Attempts to find the current source index for an item scheduled for expiration. + /// + /// The updater value. + /// The expiringItem value. + /// The index value. + /// when the item is still present in the source list. + private static bool TryGetCurrentIndex(IExtendedList updater, ExpiringItem expiringItem, out int index) + { + if (expiringItem.Index >= 0 && + expiringItem.Index < updater.Count && + EqualityComparer.Default.Equals(updater[expiringItem.Index], expiringItem.Item)) + { + index = expiringItem.Index; + return true; + } + + for (var i = 0; i < updater.Count; ++i) + { + if (EqualityComparer.Default.Equals(updater[i], expiringItem.Item)) + { + index = i; + return true; + } + } + + index = -1; + return false; + } + +/// +/// The source item and index captured when an expiration becomes due. +/// +/// The Index value. +/// The Item value. +private readonly record struct ExpiringItem(int Index, T Item); + /// /// Represents the ScheduledManagement record. /// diff --git a/src/DynamicData/List/SourceList.cs b/src/DynamicData/List/SourceList.cs index 55b66e46a..dc903e2f3 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.cs @@ -56,11 +56,26 @@ public sealed class SourceList : ISourceList /// private readonly ReaderWriter _readerWriter = new(); + /// + /// The _notifications field. + /// + private readonly DeliveryQueue _notifications; + /// /// The _editLevel field. /// private int _editLevel; + /// + /// The _currentVersion field. + /// + private long _currentVersion; + + /// + /// The _currentDeliveryVersion field. + /// + private long _currentDeliveryVersion; + /// /// The _isDisposed field. /// @@ -72,17 +87,15 @@ public sealed class SourceList : ISourceList /// The source. public SourceList(IObservable>? source = null) { + _notifications = new DeliveryQueue(_locker, new ListUpdateObserver(this)); + var loader = source is null ? Disposable.Empty : LoadFromSource(source); _cleanUp = Disposable.Create( () => { loader.Dispose(); - OnCompleted(); - if (_countChanged.IsValueCreated) - { - _countChanged.Value.OnCompleted(); - } + NotifyCompleted(); }); } @@ -94,18 +107,22 @@ public SourceList(IObservable>? source = null) Observable.Create( observer => { - lock (_locker) + using var readLock = _notifications.AcquireReadLock(); + + if (_isDisposed) { - if (_isDisposed) - { - observer.OnNext(_readerWriter.Count); - observer.OnCompleted(); - return Disposable.Empty; - } - - var source = _countChanged.Value.StartWith(_readerWriter.Count).DistinctUntilChanged(); - return source.SubscribeSafe(observer); + observer.OnNext(_readerWriter.Count); + observer.OnCompleted(); + return Disposable.Empty; } + + var snapshotVersion = _currentVersion; + var countChanged = readLock.HasPending + ? _countChanged.Value.SkipWhile(_ => Volatile.Read(ref _currentDeliveryVersion) <= snapshotVersion) + : _countChanged.Value; + + var source = countChanged.StartWith(_readerWriter.Count).DistinctUntilChanged(); + return source.SubscribeSafe(observer); }); /// @@ -119,27 +136,31 @@ public IObservable> Connect(Func? predicate = null) var observable = Observable.Create>( observer => { - lock (_locker) + using var readLock = _notifications.AcquireReadLock(); + + if (_readerWriter.Items.Length > 0) { - if (_readerWriter.Items.Length > 0) - { - observer.OnNext( - new ChangeSet - { - new(ListChangeReason.AddRange, _readerWriter.Items, 0) - }); - } - - if (_isDisposed) - { - observer.OnCompleted(); - return Disposable.Empty; - } - - var source = _changes.Finally(observer.OnCompleted); - - return source.SubscribeSafe(observer); + observer.OnNext( + new ChangeSet + { + new(ListChangeReason.AddRange, _readerWriter.Items, 0) + }); } + + if (_isDisposed) + { + observer.OnCompleted(); + return Disposable.Empty; + } + + var snapshotVersion = _currentVersion; + var changes = readLock.HasPending + ? _changes.SkipWhile(_ => Volatile.Read(ref _currentDeliveryVersion) <= snapshotVersion) + : (IObservable>)_changes; + + var source = changes.Finally(observer.OnCompleted); + + return source.SubscribeSafe(observer); }); if (predicate is not null) @@ -153,7 +174,7 @@ public IObservable> Connect(Func? predicate = null) /// public void Dispose() { - lock (_locker) + using (var notifications = _notifications.AcquireLock()) { if (_isDisposed) { @@ -164,6 +185,19 @@ public void Dispose() } _cleanUp.Dispose(); + + if (_notifications.IsDeliveringOnCurrentThread) + { + return; + } + + SpinWait spinner = default; + while (!_notifications.IsTerminated) + { + spinner.SpinOnce(); + } + + _notifications.Dispose(); _changesPreview.Dispose(); _changes.Dispose(); if (_countChanged.IsValueCreated) @@ -178,32 +212,31 @@ public void Edit(Action> updateAction) { ArgumentExceptionHelper.ThrowIfNull(updateAction); - lock (_locker) + using var notifications = _notifications.AcquireLock(); + + if (_isDisposed) { - if (_isDisposed) - { - throw new ObjectDisposedException(nameof(SourceList)); - } + throw new ObjectDisposedException(nameof(SourceList)); + } - IChangeSet? changes = null; + IChangeSet? changes = null; - _editLevel++; + _editLevel++; - if (_editLevel == 1) - { - changes = _changesPreview.HasObservers ? _readerWriter.WriteWithPreview(updateAction, InvokeNextPreview) : _readerWriter.Write(updateAction); - } - else - { - _readerWriter.WriteNested(updateAction); - } + if (_editLevel == 1) + { + changes = _changesPreview.HasObservers ? _readerWriter.WriteWithPreview(updateAction, InvokeNextPreview) : _readerWriter.Write(updateAction); + } + else + { + _readerWriter.WriteNested(updateAction); + } - _editLevel--; + _editLevel--; - if (changes is not null && _editLevel == 0) - { - InvokeNext(changes); - } + if (changes is not null && changes.Count != 0 && _editLevel == 0) + { + notifications.EnqueueNext(new ListUpdate(changes, _readerWriter.Count, ++_currentVersion)); } } @@ -215,16 +248,15 @@ public IObservable> Preview(Func? predicate = null) var observable = Observable.Create>( observer => { - lock (_locker) - { - if (_isDisposed) - { - observer.OnCompleted(); - return Disposable.Empty; - } + using var readLock = _notifications.AcquireReadLock(); - return _changesPreview.SubscribeSafe(observer); + if (_isDisposed) + { + observer.OnCompleted(); + return Disposable.Empty; } + + return _changesPreview.SubscribeSafe(observer); }); if (predicate is not null) @@ -235,35 +267,13 @@ public IObservable> Preview(Func? predicate = null) return observable; } - /// - /// Executes the InvokeNext operation. - /// - /// The changes value. - private void InvokeNext(IChangeSet changes) - { - if (changes.Count == 0) - { - return; - } - - lock (_locker) - { - _changes.OnNext(changes); - - if (_countChanged.IsValueCreated) - { - _countChanged.Value.OnNext(_readerWriter.Count); - } - } - } - /// /// Executes the InvokeNextPreview operation. /// /// The changes value. private void InvokeNextPreview(IChangeSet changes) { - if (changes.Count == 0) + if (changes.Count == 0 || _notifications.IsTerminated) { return; } @@ -279,30 +289,104 @@ private void InvokeNextPreview(IChangeSet changes) /// /// The source value. /// The result of the operation. - private IDisposable LoadFromSource(IObservable> source) => source.Synchronize(_locker).Finally(OnCompleted).Select(_readerWriter.Write).Subscribe(InvokeNext, OnError, OnCompleted); + private IDisposable LoadFromSource(IObservable> source) => + source.Subscribe( + changes => + { + using var notifications = _notifications.AcquireLock(); + + if (_isDisposed) + { + return; + } + + var capturedChanges = _readerWriter.Write(changes); + if (capturedChanges.Count != 0) + { + notifications.EnqueueNext(new ListUpdate(capturedChanges, _readerWriter.Count, ++_currentVersion)); + } + }, + NotifyError, + NotifyCompleted); /// - /// Executes the OnCompleted operation. + /// Executes the NotifyCompleted operation. /// - private void OnCompleted() + private void NotifyCompleted() { - lock (_locker) - { - _changesPreview.OnCompleted(); - _changes.OnCompleted(); - } + using var notifications = _notifications.AcquireLock(); + notifications.EnqueueCompleted(); } /// - /// Executes the OnError operation. + /// Executes the NotifyError operation. /// /// The exception value. - private void OnError(Exception exception) + private void NotifyError(Exception exception) { - lock (_locker) + using var notifications = _notifications.AcquireLock(); + notifications.EnqueueError(exception); + } + + /// + /// The notification payload for list delivery. Null Changes = count-only notification. + /// + /// The Changes value. + /// The Count value. + /// The Version value. + private readonly record struct ListUpdate(IChangeSet? Changes, int Count, long Version = 0); + + /// + /// Observer that dispatches items to the list's downstream subjects. + /// + /// The source list value. + private sealed class ListUpdateObserver(SourceList sourceList) : IObserver + { + /// + /// Executes the OnNext operation. + /// + /// The value value. + public void OnNext(ListUpdate value) { - _changesPreview.OnError(exception); - _changes.OnError(exception); + if (value.Changes is not null) + { + Volatile.Write(ref sourceList._currentDeliveryVersion, value.Version); + sourceList._changes.OnNext(value.Changes); + } + + if (sourceList._countChanged.IsValueCreated) + { + sourceList._countChanged.Value.OnNext(value.Count); + } + } + + /// + /// Executes the OnError operation. + /// + /// The error value. + public void OnError(Exception error) + { + sourceList._changesPreview.OnError(error); + sourceList._changes.OnError(error); + + if (sourceList._countChanged.IsValueCreated) + { + sourceList._countChanged.Value.OnError(error); + } + } + + /// + /// Executes the OnCompleted operation. + /// + public void OnCompleted() + { + sourceList._changesPreview.OnCompleted(); + sourceList._changes.OnCompleted(); + + if (sourceList._countChanged.IsValueCreated) + { + sourceList._countChanged.Value.OnCompleted(); + } } } }