From 06044099209502f605821a35b83bf6f17fcf5478 Mon Sep 17 00:00:00 2001 From: Jake Meiergerd Date: Fri, 9 Oct 2026 15:18:40 -0500 Subject: [PATCH 01/10] Deleted old, un-maintained DynamicData.Profile test project. Unsure what the purpose of this used to be, but it hasn't been included in the main solution for years, and and doesn't even build anymore. (#1195) --- .../DynamicData.Profile/Allocations.cs | 20 --- .../DynamicData.Profile/AllocationsCount.cs | 26 ---- .../CacheAllocationChecks.cs | 60 --------- .../CheapAndDirtyAllocationTest.cs | 119 ------------------ .../DynamicData.Profile.csproj | 20 --- NonProduction/DynamicData.Profile/Person.cs | 18 --- 6 files changed, 263 deletions(-) delete mode 100644 NonProduction/DynamicData.Profile/Allocations.cs delete mode 100644 NonProduction/DynamicData.Profile/AllocationsCount.cs delete mode 100644 NonProduction/DynamicData.Profile/CacheAllocationChecks.cs delete mode 100644 NonProduction/DynamicData.Profile/CheapAndDirtyAllocationTest.cs delete mode 100644 NonProduction/DynamicData.Profile/DynamicData.Profile.csproj delete mode 100644 NonProduction/DynamicData.Profile/Person.cs diff --git a/NonProduction/DynamicData.Profile/Allocations.cs b/NonProduction/DynamicData.Profile/Allocations.cs deleted file mode 100644 index 0ebe7bf41..000000000 --- a/NonProduction/DynamicData.Profile/Allocations.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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; - -namespace DynamicData.Profile -{ - public static class Allocations - { - public static AllocationsCount Run(Action action) - { - var initial = GC.GetAllocatedBytesForCurrentThread(); - action(); - var final = GC.GetAllocatedBytesForCurrentThread(); - - return new AllocationsCount(initial, final); - } - } -} \ No newline at end of file diff --git a/NonProduction/DynamicData.Profile/AllocationsCount.cs b/NonProduction/DynamicData.Profile/AllocationsCount.cs deleted file mode 100644 index 4e9f7a441..000000000 --- a/NonProduction/DynamicData.Profile/AllocationsCount.cs +++ /dev/null @@ -1,26 +0,0 @@ -// 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. - -namespace DynamicData.Profile -{ - public class AllocationsCount - { - - public long InitialSize { get; } - public long FinalSize { get; } - public long Size => FinalSize - InitialSize; - - /// Initializes a new instance of the class. - public AllocationsCount(long initialSize, long finalSize) - { - InitialSize = initialSize; - FinalSize = finalSize; - } - - public override string ToString() - { - return $"Allocation Bytes: {Size:N0}"; - } - } -} \ No newline at end of file diff --git a/NonProduction/DynamicData.Profile/CacheAllocationChecks.cs b/NonProduction/DynamicData.Profile/CacheAllocationChecks.cs deleted file mode 100644 index 96f5dc0c7..000000000 --- a/NonProduction/DynamicData.Profile/CacheAllocationChecks.cs +++ /dev/null @@ -1,60 +0,0 @@ -// 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.Linq; -using Xunit; - -namespace DynamicData.Profile -{ - - public class CacheAllocationChecks - { - [Fact] - public void PopulateCache_NoObservers() - { - var items = Enumerable.Range(1, 10_000).Select(j => new Person("P" + j, j)).ToList(); - - var cache = new SourceCache(p=>p.Name); - - var result = Allocations.Run(() => - { - cache.AddOrUpdate(items); - }); - Console.WriteLine(result); - } - - [Fact] - public void PopulateCache_Observers() - { - var items = Enumerable.Range(1, 10_000).Select(j => new Person("P" + j, j)).ToList(); - - var cache = new SourceCache(p => p.Name); - var subscribed = cache.Connect().Subscribe(); - var result = Allocations.Run(() => - { - cache.AddOrUpdate(items); - }); - Console.WriteLine(result); - } - - [Fact] - public void Connect() - { - var items = Enumerable.Range(1, 10_000).Select(j => new Person("P" + j, j)).ToList(); - - var cache = new SourceCache(p => p.Name); - cache.Connect().Subscribe();//do warm up - - var added = Allocations.Run(() => cache.AddOrUpdate(items)); - Console.WriteLine(added); - - var connected = Allocations.Run(() => cache.Connect().Subscribe()); - Console.WriteLine(connected); - - var filtered = Allocations.Run(() => cache.Connect(p=>p.Age <5000).Subscribe()); - Console.WriteLine(filtered); - } - } -} diff --git a/NonProduction/DynamicData.Profile/CheapAndDirtyAllocationTest.cs b/NonProduction/DynamicData.Profile/CheapAndDirtyAllocationTest.cs deleted file mode 100644 index d2939e177..000000000 --- a/NonProduction/DynamicData.Profile/CheapAndDirtyAllocationTest.cs +++ /dev/null @@ -1,119 +0,0 @@ -// 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.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using DynamicData.Kernel; -using Xunit; - -namespace DynamicData.Profile -{ - public class CheapAndDirtyAllocationTest - { - - [Fact] - public void ChangeSetAllocations() - { - // Arrange - var iList = Enumerable.Range(1, 100) - .Select(j => new Person("P" + j, j)) - .Select(p => new Change(ChangeReason.Add, p.Name, p)) - .ToList(); - - var changes = new ChangeSet(iList); - - var startAllocs = GC.GetAllocatedBytesForCurrentThread(); - - // Assert - var i = 0; - foreach (var item in changes) - { - i++; - } - - var endAllocs = GC.GetAllocatedBytesForCurrentThread(); - var diff = endAllocs - startAllocs; - Assert.Equal(startAllocs, endAllocs); - Assert.Equal(iList.Count, i); - } - - [Fact(Skip = "Allocation is not as originally expected, this test has not been run for some time due to a solution fault in loading the test")] - public void ChangeSetAllocations2() - { - // Arrange - var iList = Enumerable.Range(1, 100) - .Select(j => new Person("P" + j, j)) - .Select(p => new Change(ChangeReason.Add, p.Name, p)) - .ToList(); - - var changes = new ChangeSet(iList); - - var startAllocs = GC.GetAllocatedBytesForCurrentThread(); - - // Act - EnumerableIList> eIList = changes; - - // Assert - var i = 0; - var count = changes.Count; - foreach (var item in eIList) - { - i++; - } - - var endAllocs = GC.GetAllocatedBytesForCurrentThread(); - var diff = endAllocs - startAllocs; - Assert.Equal(startAllocs, endAllocs); - Assert.Equal(iList.Count, i); - } - - [Fact] - public void NoAllocations() - { - // Arrange - IList iList = new[] { 1, 2, 3, 4, 5, 6, 7 }.ToImmutableArray(); - - // Act - var eIList = EnumerableIList.Create(iList); - var startAllocs = GC.GetAllocatedBytesForCurrentThread(); - - // Assert - var i = 0; - foreach (var item in eIList) - { - i++; - } - - var endAllocs = GC.GetAllocatedBytesForCurrentThread(); - - Assert.Equal(startAllocs, endAllocs); - Assert.Equal(iList.Count, i); - } - - [Fact] - public void WithAllocations() - { - // Arrange - IList iList = new[] { 1, 2, 3, 4, 5, 6, 7 }.ToImmutableArray(); - - // Act - var eIList = EnumerableIList.Create(iList); - var startAllocs = GC.GetAllocatedBytesForCurrentThread(); - - // Assert - var i = 0; - foreach (var item in eIList) - { - i++; - } - - var endAllocs = GC.GetAllocatedBytesForCurrentThread(); - - Assert.Equal(startAllocs, endAllocs); - Assert.Equal(iList.Count, i); - } - } -} diff --git a/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj b/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj deleted file mode 100644 index 504b3165c..000000000 --- a/NonProduction/DynamicData.Profile/DynamicData.Profile.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - net8.0 - $(NoWarn);CS0618 - - - - - - - - - - - - - - - - diff --git a/NonProduction/DynamicData.Profile/Person.cs b/NonProduction/DynamicData.Profile/Person.cs deleted file mode 100644 index 2e8ccc0b9..000000000 --- a/NonProduction/DynamicData.Profile/Person.cs +++ /dev/null @@ -1,18 +0,0 @@ -// 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. - -namespace DynamicData.Profile -{ - public class Person - { - public string Name { get; } - public int Age { get; } - - public Person(string name, int age) - { - Name = name; - Age = age; - } - } -} \ No newline at end of file From 9c82487963a8c5db2547d492ff63822857076a3f Mon Sep 17 00:00:00 2001 From: "Darrin W. Cullop" Date: Sat, 10 Oct 2026 20:01:31 -0700 Subject: [PATCH 02/10] Convert to Central Package Management (#1203) Package versions now live in src/Directory.Packages.props. Build tooling and analyzers (Nerdbank.GitVersioning, SourceLink, StyleCop, Roslynator) are GlobalPackageReferences with the same project conditions as before. Floating versions are enabled only for test and benchmark projects; their PackageVersion items are hidden from the library so any float there fails restore with NU1011. Microsoft.Bcl.AsyncInterfaces moves into DynamicData.csproj, the only netstandard2.0 project. --- src/Directory.Build.props | 13 ------ src/Directory.Packages.props | 45 +++++++++++++++++++ .../DynamicData.Benchmarks.csproj | 4 +- .../DynamicData.Tests.csproj | 21 +++++---- src/DynamicData.sln | 1 + src/DynamicData/DynamicData.csproj | 6 ++- 6 files changed, 63 insertions(+), 27 deletions(-) create mode 100644 src/Directory.Packages.props diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 7d002a3bb..d6620c0e7 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -46,24 +46,11 @@ - - - $(MSBuildThisFileDirectory) - - - - - - - - - - diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 000000000..2dc0bb025 --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,45 @@ + + + + + true + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj index 451ac4697..4bfce5b16 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/DynamicData.Tests/DynamicData.Tests.csproj b/src/DynamicData.Tests/DynamicData.Tests.csproj index 4b9e28c65..6335ae8a1 100644 --- a/src/DynamicData.Tests/DynamicData.Tests.csproj +++ b/src/DynamicData.Tests/DynamicData.Tests.csproj @@ -2,7 +2,6 @@ net9.0 $(NoWarn);CS0618;CA1801;CA1812;CA1816;CA1062;CA1063;CS8767;CS8602;CS8618;IDE1006 - 2.* @@ -10,16 +9,16 @@ - - - - - - - - - - + + + + + + + + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/DynamicData.sln b/src/DynamicData.sln index e5ce72ac8..5cd5e815d 100644 --- a/src/DynamicData.sln +++ b/src/DynamicData.sln @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".other", ".other", "{DFCC45 ..\.github\workflows\ci-build.yml = ..\.github\workflows\ci-build.yml Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets + Directory.Packages.props = Directory.Packages.props ..\nuget.config = ..\nuget.config ..\README.md = ..\README.md ..\.github\workflows\release.yml = ..\.github\workflows\release.yml diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index 1b45eb1b3..e20496a0f 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -8,7 +8,11 @@ - + + + + + From 663e51cb4b6482a468043b1ae19f88cb8f80146d Mon Sep 17 00:00:00 2001 From: "Darrin W. Cullop" Date: Sat, 10 Oct 2026 20:17:39 -0700 Subject: [PATCH 03/10] Append to the inherited NoWarn in the benchmarks project (#1202) The benchmarks NoWarn replaced the list from Directory.Build.props instead of appending to it, so VSX1000 and CA1510 were not suppressed there. Co-authored-by: Jake Meiergerd --- src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj index 4bfce5b16..ee9d9489e 100644 --- a/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj +++ b/src/DynamicData.Benchmarks/DynamicData.Benchmarks.csproj @@ -5,7 +5,7 @@ net9.0 AnyCPU false - ;1591;1701;1702;1705;CA1822;CA1001 + $(NoWarn);CA1822;CA1001 From 183c1175b8aececa3f70710b9b5e3c85282cc3f5 Mon Sep 17 00:00:00 2001 From: Jake Meiergerd Date: Sat, 10 Oct 2026 22:50:22 -0500 Subject: [PATCH 04/10] Migrated the main DynamicData codebase to leverage Simon Cropp's Polyfills library. (#1201) This library ships polyfill source code and uses MSBuild directives to inject it directly into the target projects, allowing them to be kept internal and to leverage the syntactic sugar of extension blocks: basically, accomplishing every goal we had by writing our own. In turn, I eliminated all of the existing polyfills within the project, and where those polyfills were not actuallly drop-in polyfills for the missing APIs, I migrated existing code to target the proper native APIs. Mostly, this involved swapping to use proper "Throw" helper methods such as `ArgumentNullException.ThrowIfNull()`. The other big adjustment is getting rid of all use of locks upon any type other than `System.Threading.Lock`. The `Lock` polyfill introduced ultimately just aliases normal `Monitor`-based `object` locking, so while we don't get any of the actual mechanical benefits of the true `Lock` class, we no longer need to litter the codebase with `#if` blocks to swap between using `Lock` or `object`, depending on the target framework. All target frameworks can just use code that targets `Lock` and compiles unconditionally. Shoutout to Chris Pullman for putting us on to Simon's library, and building the initial draft of most of these changes. As a small side-effect, several operators were discovered to be incorrectly throwing `ArgumentNullException` for an empty input collection: the `And`, `Except`, `Or`, and `Xor` operators upon `ObservableCacheEx`. These have been fixed to throw `ArgumentException` with an appropriate message. --------- Co-authored-by: Chris Pulman --- src/Directory.Packages.props | 1 + src/DynamicData/Aggregation/AggregationEx.cs | 12 +-- src/DynamicData/Aggregation/AvgEx.cs | 10 +-- src/DynamicData/Aggregation/MaxEx.cs | 8 +- src/DynamicData/Aggregation/StdDevEx.cs | 10 +-- src/DynamicData/Aggregation/SumEx.cs | 36 ++++----- src/DynamicData/Alias/ObservableCacheAlias.cs | 46 +++++------ src/DynamicData/Alias/ObservableListAlias.cs | 16 ++-- src/DynamicData/Binding/BindingListAdaptor.cs | 4 +- src/DynamicData/Binding/BindingListEx.cs | 12 +-- src/DynamicData/Binding/ExpressionBuilder.cs | 5 +- src/DynamicData/Binding/IObservableListEx.cs | 15 +--- .../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 | 6 +- src/DynamicData/Cache/Internal/BatchIf.cs | 46 ++++++++--- src/DynamicData/Cache/Internal/Cache.cs | 2 +- .../Cache/Internal/CacheUpdater.cs | 26 +++--- src/DynamicData/Cache/Internal/Combiner.cs | 4 - .../Cache/Internal/DeferUntilLoaded.cs | 2 +- .../Cache/Internal/DynamicCombiner.cs | 21 +++-- .../Cache/Internal/ExpireAfter.ForSource.cs | 16 ++-- .../Cache/Internal/ExpireAfter.ForStream.cs | 16 ++-- .../Cache/Internal/Filter.Dynamic.cs | 64 ++++++--------- .../Cache/Internal/Filter.Static.cs | 4 +- src/DynamicData/Cache/Internal/FullJoin.cs | 2 +- src/DynamicData/Cache/Internal/InnerJoin.cs | 2 +- src/DynamicData/Cache/Internal/LeftJoin.cs | 2 +- .../Cache/Internal/LockFreeObservableCache.cs | 5 +- src/DynamicData/Cache/Internal/MergeMany.cs | 2 +- .../Cache/Internal/MergeManyItems.cs | 5 +- .../Cache/Internal/ReaderWriter.cs | 10 +-- src/DynamicData/Cache/Internal/RefCount.cs | 4 - src/DynamicData/Cache/Internal/RightJoin.cs | 2 +- .../Cache/Internal/SubscribeMany.cs | 2 +- .../Cache/Internal/ToObservableChangeSet.cs | 4 - .../Cache/Internal/TransformMany.cs | 2 +- src/DynamicData/Cache/ObservableCache.cs | 8 +- .../Cache/ObservableCacheEx.Adapt.cs | 8 +- .../Cache/ObservableCacheEx.AddOrUpdate.cs | 12 +-- .../Cache/ObservableCacheEx.And.cs | 16 ++-- .../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 | 44 +++++----- .../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 | 18 ++--- .../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.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 | 18 ++--- .../Cache/ObservableCacheEx.PopulateFrom.cs | 4 +- .../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.StartWithItem.cs | 4 +- .../Cache/ObservableCacheEx.SubscribeMany.cs | 8 +- .../Cache/ObservableCacheEx.Switch.cs | 4 +- ...ObservableCacheEx.ToObservableChangeSet.cs | 8 +- .../ObservableCacheEx.ToObservableOptional.cs | 2 +- .../Cache/ObservableCacheEx.Transform.cs | 36 ++++----- .../Cache/ObservableCacheEx.TransformAsync.cs | 32 ++++---- .../ObservableCacheEx.TransformImmutable.cs | 4 +- .../ObservableCacheEx.TransformManyAsync.cs | 12 +-- ...bservableCacheEx.TransformManySafeAsync.cs | 18 ++--- ...ObservableCacheEx.TransformOnObservable.cs | 6 +- .../Cache/ObservableCacheEx.TransformSafe.cs | 30 +++---- .../ObservableCacheEx.TransformSafeAsync.cs | 44 +++++----- .../ObservableCacheEx.TransformToTree.cs | 4 +- ...rvableCacheEx.TransformWithInlineUpdate.cs | 28 +++---- ...ObservableCacheEx.TreatMovesAsRemoveAdd.cs | 2 +- .../Cache/ObservableCacheEx.TrueForAny.cs | 6 +- .../ObservableCacheEx.VirtualiseAndPage.cs | 48 +++++------ .../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 | 2 +- .../Cache/ObservableCacheEx.Xor.cs | 18 ++--- src/DynamicData/Cache/Tests/TestEx.cs | 10 +-- .../Diagnostics/DiagnosticOperators.cs | 4 +- src/DynamicData/DynamicData.csproj | 17 ++++ src/DynamicData/EnumerableEx.cs | 6 +- .../Experimental/ExperimentalEx.cs | 2 +- src/DynamicData/Experimental/Watcher.cs | 4 - src/DynamicData/Internal/DeliveryQueue.cs | 30 +------ src/DynamicData/Internal/ExceptionMixins.cs | 17 ---- src/DynamicData/Internal/KeyedDisposable.cs | 4 - src/DynamicData/Internal/Notification.cs | 2 +- src/DynamicData/Internal/ObservableEx.cs | 27 +++++++ src/DynamicData/Internal/Rxx.cs | 41 ---------- .../Internal/SharedDeliveryQueue.cs | 65 +++++---------- src/DynamicData/Internal/SwappableLock.cs | 51 ------------ .../Internal/SynchronizeSafeExtensions.cs | 4 - src/DynamicData/Kernel/EnumerableEx.cs | 14 ++-- src/DynamicData/Kernel/InternalEx.cs | 8 +- src/DynamicData/Kernel/OptionElse.cs | 2 +- src/DynamicData/Kernel/OptionExtensions.cs | 26 +++--- .../Kernel/OptionObservableExtensions.cs | 34 ++++---- src/DynamicData/Kernel/ParallelEx.cs | 4 +- src/DynamicData/List/ChangeAwareList.cs | 23 ++---- src/DynamicData/List/ChangeSetEx.cs | 10 +-- .../List/Internal/AnonymousObservableList.cs | 2 +- src/DynamicData/List/Internal/AutoRefresh.cs | 2 +- src/DynamicData/List/Internal/BufferIf.cs | 2 +- src/DynamicData/List/Internal/Combiner.cs | 4 - src/DynamicData/List/Internal/DisposeMany.cs | 6 +- .../List/Internal/DynamicCombiner.cs | 4 - src/DynamicData/List/Internal/ExpireAfter.cs | 16 ++-- .../List/Internal/Filter.Dynamic.cs | 2 +- .../List/Internal/Filter.Static.cs | 4 +- .../Internal/Filter.WithPredicateState.cs | 79 ++++++++++-------- .../List/Internal/FilterOnObservable.cs | 8 +- src/DynamicData/List/Internal/GroupOn.cs | 2 +- .../List/Internal/GroupOnImmutable.cs | 2 +- src/DynamicData/List/Internal/LimitSizeTo.cs | 5 -- .../List/Internal/MergeChangeSets.cs | 12 +-- src/DynamicData/List/Internal/MergeMany.cs | 2 +- .../List/Internal/MergeManyCacheChangeSets.cs | 2 +- .../List/Internal/MergeManyListChangeSets.cs | 2 +- src/DynamicData/List/Internal/OnItemAdded.cs | 4 +- .../List/Internal/OnItemRefreshed.cs | 4 +- .../List/Internal/OnItemRemoved.cs | 4 +- src/DynamicData/List/Internal/Pager.cs | 2 +- src/DynamicData/List/Internal/ReaderWriter.cs | 14 ++-- src/DynamicData/List/Internal/RefCount.cs | 4 - .../List/Internal/ReferenceCountTracker.cs | 4 +- src/DynamicData/List/Internal/Sort.cs | 2 +- .../List/Internal/ToObservableChangeSet.cs | 8 +- .../List/Internal/TransformAsync.cs | 4 +- .../List/Internal/TransformMany.cs | 4 +- src/DynamicData/List/Internal/Transformer.cs | 4 +- src/DynamicData/List/Internal/Virtualiser.cs | 2 +- src/DynamicData/List/ListEx.cs | 60 +++++++------- .../List/ObservableListEx.Adapt.cs | 6 +- .../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 | 6 +- .../List/ObservableListEx.Clone.cs | 2 +- .../List/ObservableListEx.Combine.cs | 12 +-- .../List/ObservableListEx.Convert.cs | 4 +- .../List/ObservableListEx.DeferUntilLoaded.cs | 4 +- .../List/ObservableListEx.DisposeMany.cs | 2 +- .../List/ObservableListEx.DistinctValues.cs | 4 +- .../List/ObservableListEx.Except.cs | 2 +- .../List/ObservableListEx.Filter.cs | 4 +- .../ObservableListEx.FilterOnObservable.cs | 2 +- .../List/ObservableListEx.FilterOnProperty.cs | 6 +- .../List/ObservableListEx.ForEachChange.cs | 4 +- .../ObservableListEx.ForEachItemChange.cs | 4 +- .../List/ObservableListEx.GroupOn.cs | 4 +- .../List/ObservableListEx.GroupOnProperty.cs | 4 +- ...istEx.GroupOnPropertyWithImmutableState.cs | 4 +- ...bservableListEx.GroupWithImmutableState.cs | 4 +- .../List/ObservableListEx.LimitSizeTo.cs | 4 +- .../List/ObservableListEx.MergeChangeSets.cs | 24 +++--- .../List/ObservableListEx.MergeMany.cs | 4 +- .../ObservableListEx.MergeManyChangeSets.cs | 21 ++--- .../List/ObservableListEx.NotEmpty.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.SubscribeMany.cs | 4 +- .../List/ObservableListEx.Switch.cs | 4 +- src/DynamicData/List/ObservableListEx.Top.cs | 8 +- .../List/ObservableListEx.Transform.cs | 16 ++-- .../List/ObservableListEx.TransformAsync.cs | 20 ++--- .../List/ObservableListEx.TransformMany.cs | 4 +- .../List/ObservableListEx.Virtualise.cs | 4 +- ...ObservableListEx.WhenAnyPropertyChanged.cs | 2 +- .../ObservableListEx.WhenPropertyChanged.cs | 4 +- .../List/ObservableListEx.WhenValueChanged.cs | 4 +- .../List/ObservableListEx.WhereReasonsAre.cs | 2 +- .../ObservableListEx.WhereReasonsAreNot.cs | 2 +- src/DynamicData/List/ObservableListEx.Xor.cs | 2 +- src/DynamicData/List/SourceList.cs | 6 +- .../List/SourceListEditConvenienceEx.cs | 28 +++---- src/DynamicData/List/SourceListEx.cs | 4 +- src/DynamicData/ObservableChangeSet.cs | 48 +++++------ .../Platforms/net45/ParallelOperators.cs | 28 +++---- .../CompilerFeatureRequiredAttribute.cs | 23 ------ .../DynamicallyAccessedMembersAttribute.cs | 39 --------- src/DynamicData/Polyfills/EnumEx.cs | 18 ----- src/DynamicData/Polyfills/IsExternalInit.cs | 10 --- .../Polyfills/ListEnsureCapacity.cs | 16 ---- .../Polyfills/RequiredMemberAttribute.cs | 14 ---- 253 files changed, 1198 insertions(+), 1524 deletions(-) delete mode 100644 src/DynamicData/Internal/ExceptionMixins.cs delete mode 100644 src/DynamicData/Internal/Rxx.cs delete mode 100644 src/DynamicData/Polyfills/CompilerFeatureRequiredAttribute.cs delete mode 100644 src/DynamicData/Polyfills/DynamicallyAccessedMembersAttribute.cs delete mode 100644 src/DynamicData/Polyfills/EnumEx.cs delete mode 100644 src/DynamicData/Polyfills/IsExternalInit.cs delete mode 100644 src/DynamicData/Polyfills/ListEnsureCapacity.cs delete mode 100644 src/DynamicData/Polyfills/RequiredMemberAttribute.cs diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 2dc0bb025..fc4c2ad01 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -7,6 +7,7 @@ + diff --git a/src/DynamicData/Aggregation/AggregationEx.cs b/src/DynamicData/Aggregation/AggregationEx.cs index c90e35520..9e5faed42 100644 --- a/src/DynamicData/Aggregation/AggregationEx.cs +++ b/src/DynamicData/Aggregation/AggregationEx.cs @@ -23,7 +23,7 @@ public static IObservable> ForAggregation (IAggregateChangeSet)new AggregateEnumerator(changeSet)); } @@ -36,7 +36,7 @@ public static IObservable> ForAggregation> ForAggregation(this IObservable> source) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Select(changeSet => (IAggregateChangeSet)new AggregateEnumerator(changeSet)); } @@ -108,10 +108,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(accessor); + ArgumentNullException.ThrowIfNull(addAction); + ArgumentNullException.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 f042bba71..8f80f41c0 100644 --- a/src/DynamicData/Aggregation/AvgEx.cs +++ b/src/DynamicData/Aggregation/AvgEx.cs @@ -409,11 +409,11 @@ public static IObservable Avg(this IObservable> source, 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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(addAction); + ArgumentNullException.ThrowIfNull(removeAction); + ArgumentNullException.ThrowIfNull(resultAction); return source.Scan(default(Avg), (state, changes) => changes.Aggregate(state, (current, aggregateItem) => diff --git a/src/DynamicData/Aggregation/MaxEx.cs b/src/DynamicData/Aggregation/MaxEx.cs index beb4d6e10..a8cf6821d 100644 --- a/src/DynamicData/Aggregation/MaxEx.cs +++ b/src/DynamicData/Aggregation/MaxEx.cs @@ -83,8 +83,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Scan( default(TResult?), @@ -147,7 +147,7 @@ private static IObservable> ToChangesAndCollection where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Publish( shared => @@ -161,7 +161,7 @@ private static IObservable> ToChangesAndCollection private static IObservable> ToChangesAndCollection(this IObservable> source) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Publish( shared => diff --git a/src/DynamicData/Aggregation/StdDevEx.cs b/src/DynamicData/Aggregation/StdDevEx.cs index ad8453440..7c08577e9 100644 --- a/src/DynamicData/Aggregation/StdDevEx.cs +++ b/src/DynamicData/Aggregation/StdDevEx.cs @@ -222,11 +222,11 @@ private static IObservable StdDevCalc( 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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(addAction); + ArgumentNullException.ThrowIfNull(removeAction); + ArgumentNullException.ThrowIfNull(resultAction); return source .Scan( diff --git a/src/DynamicData/Aggregation/SumEx.cs b/src/DynamicData/Aggregation/SumEx.cs index 6d3f59a9a..e456b9ffa 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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Accumulate(0, valueSelector, (current, value) => current + value, (current, value) => current - value); } @@ -262,8 +262,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Accumulate(0, valueSelector, (current, value) => current + value, (current, value) => current - value); } @@ -277,8 +277,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Accumulate(0L, t => valueSelector(t).ValueOr(0), (current, value) => current + value, (current, value) => current - value); } @@ -292,8 +292,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Accumulate(0, valueSelector, (current, value) => current + value, (current, value) => current - value); } @@ -307,8 +307,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Accumulate(0D, t => valueSelector(t).ValueOr(0), (current, value) => current + value, (current, value) => current - value); } @@ -322,8 +322,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Accumulate(0, valueSelector, (current, value) => current + value, (current, value) => current - value); } @@ -337,8 +337,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Accumulate(0M, t => valueSelector(t).ValueOr(0), (current, value) => current + value, (current, value) => current - value); } @@ -352,8 +352,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Accumulate(0, valueSelector, (current, value) => current + value, (current, value) => current - value); } @@ -367,8 +367,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 12b0b3ca8..b89cb2626 100644 --- a/src/DynamicData/Alias/ObservableCacheAlias.cs +++ b/src/DynamicData/Alias/ObservableCacheAlias.cs @@ -31,9 +31,9 @@ public static IObservable> Select> Select> SelectSafe> SelectSafe> SelectSafe, TKey>> SelectTree> Where(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Filter(filter); } @@ -286,8 +286,8 @@ public static IObservable> Where(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - predicateChanged.ThrowArgumentNullExceptionIfNull(nameof(predicateChanged)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(predicateChanged); return source.Filter(predicateChanged); } @@ -305,9 +305,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(predicateChanged); + ArgumentNullException.ThrowIfNull(reapplyFilter); return source.Filter(predicateChanged, reapplyFilter); } diff --git a/src/DynamicData/Alias/ObservableListAlias.cs b/src/DynamicData/Alias/ObservableListAlias.cs index ca7d9eb7b..589334f3b 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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(predicate); return source.Filter(predicate); } diff --git a/src/DynamicData/Binding/BindingListAdaptor.cs b/src/DynamicData/Binding/BindingListAdaptor.cs index 06cc41aff..f71571ae7 100644 --- a/src/DynamicData/Binding/BindingListAdaptor.cs +++ b/src/DynamicData/Binding/BindingListAdaptor.cs @@ -28,7 +28,7 @@ public class BindingListAdaptor<[DynamicallyAccessedMembers(DynamicallyAccessedM /// public void Adapt(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentNullException.ThrowIfNull(changes); if (changes.TotalChanges - changes.Refreshes > refreshThreshold || !_loaded) { @@ -68,7 +68,7 @@ public class BindingListAdaptor<[DynamicallyAccessedMembers(DynamicallyAccessedM /// public void Adapt(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentNullException.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 1b5804bba..32991a88e 100644 --- a/src/DynamicData/Binding/BindingListEx.cs +++ b/src/DynamicData/Binding/BindingListEx.cs @@ -34,7 +34,7 @@ public static IObservable> ObserveCollectionC public static IObservable> ToObservableChangeSet<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this BindingList source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return ToObservableChangeSet, T>(source); } @@ -55,8 +55,8 @@ public static IObservable> ObserveCollectionC where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(keySelector); return ToObservableChangeSet, TObject>(source).AddKey(keySelector); } @@ -74,7 +74,7 @@ public static IObservable> ToObservableChangeSet(t where TCollection : IBindingList, IEnumerable where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return Observable.Create>( observer => @@ -137,8 +137,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(changes); foreach (var item in changes) { diff --git a/src/DynamicData/Binding/ExpressionBuilder.cs b/src/DynamicData/Binding/ExpressionBuilder.cs index 76b71c3bb..3bf085163 100644 --- a/src/DynamicData/Binding/ExpressionBuilder.cs +++ b/src/DynamicData/Binding/ExpressionBuilder.cs @@ -29,6 +29,8 @@ internal static Func> CreatePropertyChangedFactory(thi internal static Func CreateInvoker(this Expression source) { + ArgumentNullException.ThrowIfNull(source); + switch (source) { case MemberExpression memberExpression: @@ -57,9 +59,6 @@ internal static Func> CreatePropertyChangedFactory(thi return Expression.Lambda>(Expression.Convert(converted, typeof(object)), parameter).Compile(); - case null: - throw new ArgumentNullException(nameof(source)); - default: throw new ArgumentException($"Unable to parse expression: Node type {source.NodeType} not supported", nameof(source)); } diff --git a/src/DynamicData/Binding/IObservableListEx.cs b/src/DynamicData/Binding/IObservableListEx.cs index cf7d3a37a..fee1b2bec 100644 --- a/src/DynamicData/Binding/IObservableListEx.cs +++ b/src/DynamicData/Binding/IObservableListEx.cs @@ -26,10 +26,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)); - } + ArgumentNullException.ThrowIfNull(source); // Load our source list with the change set. // Each change set we need to convert to remove the key. @@ -58,10 +55,7 @@ public static IObservable> BindToObservableList> BindToObservableList< where TObject : notnull where TKey : notnull { - if (source is null) - { - throw new ArgumentNullException(nameof(source)); - } + ArgumentNullException.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/Binding/NotifyPropertyChangedEx.cs b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs index a0d33df32..e42e048fd 100644 --- a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs +++ b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs @@ -23,7 +23,7 @@ public static class NotifyPropertyChangedEx public static IObservable WhenAnyPropertyChanged(this TObject source, params string[] propertiesToMonitor) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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); } @@ -45,9 +45,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(p1); + ArgumentNullException.ThrowIfNull(resultSelector); return source.WhenChanged(p1, true, p1Fallback).Select(v => resultSelector(source, v)); } @@ -72,10 +72,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(p1); + ArgumentNullException.ThrowIfNull(p2); + ArgumentNullException.ThrowIfNull(resultSelector); return source.WhenChanged(p1, true, p1Fallback).CombineLatest(source.WhenChanged(p2, true, p2Fallback), (v1, v2) => resultSelector(source, v1, v2)); } @@ -103,11 +103,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(p1); + ArgumentNullException.ThrowIfNull(p2); + ArgumentNullException.ThrowIfNull(p3); + ArgumentNullException.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)); } @@ -138,12 +138,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(p1); + ArgumentNullException.ThrowIfNull(p2); + ArgumentNullException.ThrowIfNull(p3); + ArgumentNullException.ThrowIfNull(p4); + ArgumentNullException.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)); } @@ -177,13 +177,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(p1); + ArgumentNullException.ThrowIfNull(p2); + ArgumentNullException.ThrowIfNull(p3); + ArgumentNullException.ThrowIfNull(p4); + ArgumentNullException.ThrowIfNull(p5); + ArgumentNullException.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)); } @@ -220,14 +220,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(p1); + ArgumentNullException.ThrowIfNull(p2); + ArgumentNullException.ThrowIfNull(p3); + ArgumentNullException.ThrowIfNull(p4); + ArgumentNullException.ThrowIfNull(p5); + ArgumentNullException.ThrowIfNull(p6); + ArgumentNullException.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)); } @@ -249,8 +249,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(propertyAccessor); var cache = ObservablePropertyFactoryCache.Instance.GetFactory(propertyAccessor); return cache.Create(source, notifyOnInitialValue).Where(pv => !pv.UnobtainableValue || (pv.UnobtainableValue && fallbackValue is not null)); @@ -272,8 +272,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(propertyAccessor); return source.WhenChanged(propertyAccessor, notifyOnInitialValue, fallbackValue); } diff --git a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs index 4715aba25..8f709c35a 100644 --- a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs @@ -56,7 +56,7 @@ public ObservableCollectionAdaptor(IObservableCollection collection, BindingO /// The changes. public void Adapt(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentNullException.ThrowIfNull(changes); if (changes.TotalChanges - changes.Refreshes > refreshThreshold || (!_loaded && resetOnFirstTimeLoad)) { @@ -110,8 +110,8 @@ public ObservableCollectionAdaptor(BindingOptions options) /// The collection. public void Adapt(IChangeSet changes, IObservableCollection collection) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); - collection.ThrowArgumentNullExceptionIfNull(nameof(collection)); + ArgumentNullException.ThrowIfNull(changes); + ArgumentNullException.ThrowIfNull(collection); _cache.Clone(changes); diff --git a/src/DynamicData/Binding/ObservableCollectionEx.cs b/src/DynamicData/Binding/ObservableCollectionEx.cs index 9b181ddeb..e6e53b6f5 100644 --- a/src/DynamicData/Binding/ObservableCollectionEx.cs +++ b/src/DynamicData/Binding/ObservableCollectionEx.cs @@ -32,7 +32,7 @@ public static class ObservableCollectionEx public static IObservable> ToObservableChangeSet(this ObservableCollection source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return ToObservableChangeSet, T>(source); } @@ -53,8 +53,8 @@ public static IObservable> ToObservableChangeSet, TObject>(source).AddKey(keySelector); } @@ -70,7 +70,7 @@ public static IObservable> ToObservableChangeSet> ToObservableChangeSet(this ReadOnlyObservableCollection source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return ToObservableChangeSet, T>(source); } @@ -91,8 +91,8 @@ public static IObservable> ToObservableChangeSet, TObject>(source).AddKey(keySelector); } @@ -111,7 +111,7 @@ public static IObservable> ToObservableChangeSet(t where TCollection : INotifyCollectionChanged, IEnumerable where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return Observable.Create>( observer => diff --git a/src/DynamicData/Binding/ObservableCollectionExtended.cs b/src/DynamicData/Binding/ObservableCollectionExtended.cs index f99d9b9b4..9bb427b24 100644 --- a/src/DynamicData/Binding/ObservableCollectionExtended.cs +++ b/src/DynamicData/Binding/ObservableCollectionExtended.cs @@ -51,7 +51,7 @@ public ObservableCollectionExtended(IEnumerable collection) /// is null. public void AddRange(IEnumerable collection) { - collection.ThrowArgumentNullExceptionIfNull(nameof(collection)); + ArgumentNullException.ThrowIfNull(collection); foreach (var item in collection) { @@ -68,7 +68,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)); + ArgumentNullException.ThrowIfNull(collection); foreach (var item in collection) { @@ -82,7 +82,7 @@ public void InsertRange(IEnumerable collection, int index) /// The items. public void Load(IEnumerable items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentNullException.ThrowIfNull(items); CheckReentrancy(); Clear(); @@ -164,7 +164,7 @@ protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) /// The instance containing the event data. protected override void OnPropertyChanged(PropertyChangedEventArgs e) { - e.ThrowArgumentNullExceptionIfNull(nameof(e)); + ArgumentNullException.ThrowIfNull(e); if (_suspendCount && e.PropertyName == "Count") { diff --git a/src/DynamicData/Binding/SortedBindingListAdaptor.cs b/src/DynamicData/Binding/SortedBindingListAdaptor.cs index 81956791a..c833dab6b 100644 --- a/src/DynamicData/Binding/SortedBindingListAdaptor.cs +++ b/src/DynamicData/Binding/SortedBindingListAdaptor.cs @@ -28,7 +28,7 @@ public class SortedBindingListAdaptor<[DynamicallyAccessedMembers(DynamicallyAcc /// public void Adapt(ISortedChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentNullException.ThrowIfNull(changes); switch (changes.SortedItems.SortReason) { diff --git a/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs b/src/DynamicData/Binding/SortedObservableCollectionAdaptor.cs index 21c4c3e0c..eddd1994c 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)); + ArgumentNullException.ThrowIfNull(changes); + ArgumentNullException.ThrowIfNull(collection); switch (changes.SortedItems.SortReason) { diff --git a/src/DynamicData/Cache/CacheChangeSetEx.cs b/src/DynamicData/Cache/CacheChangeSetEx.cs index 2d03df512..7caef62c7 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 3230a9946..fa5798566 100644 --- a/src/DynamicData/Cache/ChangeAwareCache.cs +++ b/src/DynamicData/Cache/ChangeAwareCache.cs @@ -111,7 +111,7 @@ public void Clear() /// public void Clone(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentNullException.ThrowIfNull(changes); foreach (var change in changes.ToConcreteType()) { @@ -146,7 +146,7 @@ public void Clone(IChangeSet changes) /// The keys to refresh. public void Refresh(IEnumerable keys) { - keys.ThrowArgumentNullExceptionIfNull(nameof(keys)); + ArgumentNullException.ThrowIfNull(keys); if (keys is IList list) { @@ -187,7 +187,7 @@ public void Refresh(TKey key) /// The keys. public void Remove(IEnumerable keys) { - keys.ThrowArgumentNullExceptionIfNull(nameof(keys)); + ArgumentNullException.ThrowIfNull(keys); if (keys is IList list) { diff --git a/src/DynamicData/Cache/IntermediateCache.cs b/src/DynamicData/Cache/IntermediateCache.cs index 4494449a5..6a2e03caa 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)); + ArgumentNullException.ThrowIfNull(source); _innerCache = new ObservableCache(source); } diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index be5e8d189..2ddc25cbb 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs @@ -18,7 +18,7 @@ internal sealed class AnonymousObservableCache : IObservableCache public AnonymousObservableCache(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); _cache = new ObservableCache(source); diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index 8699e1c58..97feda5a3 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs @@ -18,8 +18,8 @@ public static IObservable> Create( IObservable> source, Action> disposalsCompletedAccessor) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - disposalsCompletedAccessor.ThrowArgumentNullExceptionIfNull(nameof(disposalsCompletedAccessor)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(disposalsCompletedAccessor); return Observable .Create>(downstreamObserver => @@ -105,4 +105,4 @@ void TryDisposeItem(TObject item) }); } } -#endif \ No newline at end of file +#endif diff --git a/src/DynamicData/Cache/Internal/BatchIf.cs b/src/DynamicData/Cache/Internal/BatchIf.cs index 76af20a61..2ae4d660d 100644 --- a/src/DynamicData/Cache/Internal/BatchIf.cs +++ b/src/DynamicData/Cache/Internal/BatchIf.cs @@ -9,22 +9,42 @@ namespace DynamicData.Cache.Internal; -internal sealed class BatchIf(IObservable> source, IObservable pauseIfTrueSelector, TimeSpan? timeOut, bool initialPauseState = false, IObservable? intervalTimer = null, IScheduler? scheduler = null) +internal sealed class BatchIf where TObject : notnull where TKey : notnull { - private readonly IObservable _pauseIfTrueSelector = pauseIfTrueSelector ?? throw new ArgumentNullException(nameof(pauseIfTrueSelector)); - - private readonly IScheduler _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; - - private readonly IObservable> _source = source ?? throw new ArgumentNullException(nameof(source)); + private readonly bool _initialPauseState; + private readonly IObservable? _intervalTimer; + private readonly IObservable _pauseIfTrueSelector; + private readonly IScheduler _scheduler; + private readonly IObservable> _source; + private readonly TimeSpan? _timeOut; + + public BatchIf( + IObservable> source, + IObservable pauseIfTrueSelector, + TimeSpan? timeOut, + bool initialPauseState = false, + IObservable? intervalTimer = null, + IScheduler? scheduler = null) + { + ArgumentNullException.ThrowIfNull(pauseIfTrueSelector); + ArgumentNullException.ThrowIfNull(source); + + _initialPauseState = initialPauseState; + _intervalTimer = intervalTimer; + _pauseIfTrueSelector = pauseIfTrueSelector; + _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; + _source = source; + _timeOut = timeOut; + } public IObservable> Run() => Observable.Create>( observer => { var batchedChanges = new List>(); var queue = new SharedDeliveryQueue(); - var paused = initialPauseState; + var paused = _initialPauseState; var timeoutDisposer = new SerialDisposable(); var intervalTimerDisposer = new SerialDisposable(); @@ -46,18 +66,18 @@ void ResumeAction() } IDisposable IntervalFunction() => - intervalTimer.SynchronizeSafe(queue).Finally(() => paused = false).Subscribe( + _intervalTimer.SynchronizeSafe(queue).Finally(() => paused = false).Subscribe( _ => { paused = false; ResumeAction(); - if (intervalTimer is not null) + if (_intervalTimer is not null) { paused = true; } }); - if (intervalTimer is not null) + if (_intervalTimer is not null) { intervalTimerDisposer.Disposable = IntervalFunction(); } @@ -69,16 +89,16 @@ IDisposable IntervalFunction() => if (!p) { // pause window has closed, so reset timer - if (timeOut.HasValue) + if (_timeOut.HasValue) { timeoutDisposer.Disposable = Disposable.Empty; } ResumeAction(); } - else if (timeOut.HasValue) + else if (_timeOut.HasValue) { - timeoutDisposer.Disposable = Observable.Timer(timeOut.Value, _scheduler).SynchronizeSafe(queue).Subscribe( + timeoutDisposer.Disposable = Observable.Timer(_timeOut.Value, _scheduler).SynchronizeSafe(queue).Subscribe( _ => { paused = false; diff --git a/src/DynamicData/Cache/Internal/Cache.cs b/src/DynamicData/Cache/Internal/Cache.cs index 0a882ad88..95f9cfeba 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)); + ArgumentNullException.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 8eb6eadf8..f1d2c331f 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)); + ArgumentNullException.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)); + ArgumentNullException.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)); - } + ArgumentNullException.ThrowIfNull(items); + ArgumentNullException.ThrowIfNull(comparer); if (_keySelector is null) { @@ -194,7 +190,7 @@ public IEnumerable> GetKeyValues(IEnumerable items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentNullException.ThrowIfNull(items); Clear(); AddOrUpdate(items); @@ -221,7 +217,7 @@ public Optional Lookup(TObject item) public void Refresh(IEnumerable items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.ThrowIfNull(keys); _cache.Remove(keys); } diff --git a/src/DynamicData/Cache/Internal/Combiner.cs b/src/DynamicData/Cache/Internal/Combiner.cs index c7734512d..87eb9af11 100644 --- a/src/DynamicData/Cache/Internal/Combiner.cs +++ b/src/DynamicData/Cache/Internal/Combiner.cs @@ -15,11 +15,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/DeferUntilLoaded.cs b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs index 0402b7b5f..bfcea5f34 100644 --- a/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/Internal/DeferUntilLoaded.cs @@ -14,7 +14,7 @@ internal sealed class DeferUntilLoaded public DeferUntilLoaded(IObservableCache source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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/DynamicCombiner.cs b/src/DynamicData/Cache/Internal/DynamicCombiner.cs index 41c7e3a8d..9e2907a78 100644 --- a/src/DynamicData/Cache/Internal/DynamicCombiner.cs +++ b/src/DynamicData/Cache/Internal/DynamicCombiner.cs @@ -7,11 +7,22 @@ namespace DynamicData.Cache.Internal; -internal sealed class DynamicCombiner(IObservableList>> source, CombineOperator type) +internal sealed class DynamicCombiner where TObject : notnull where TKey : notnull { - private readonly IObservableList>> _source = source ?? throw new ArgumentNullException(nameof(source)); + private readonly IObservableList>> _source; + private readonly CombineOperator _type; + + public DynamicCombiner( + IObservableList>> source, + CombineOperator type) + { + ArgumentNullException.ThrowIfNull(source); + + _source = source; + _type = type; + } public IObservable> Run() => Observable.Create>( observer => @@ -48,7 +59,7 @@ public IObservable> Run() => Observable.Create mc2.Cache.KeyValues); ProcessChanges(resultCache, sourceLists.Items.AsArray(), itemsToCheck); @@ -67,7 +78,7 @@ public IObservable> Run() => Observable.Create>> Create( TimeSpan? pollingInterval = null, IScheduler? scheduler = null) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - timeSelector.ThrowArgumentNullExceptionIfNull(nameof(timeSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(timeSelector); return Observable.Create>>(observer => (pollingInterval is { } pollingIntervalValue) ? new PollingSubscription( @@ -50,6 +50,7 @@ private abstract class SubscriptionBase private readonly IScheduler _scheduler; private readonly ISourceCache _source; private readonly IDisposable _sourceSubscription; + private readonly Lock _synchronizationGate; private readonly Func _timeSelector; private bool _hasSourceCompleted; @@ -66,6 +67,7 @@ protected SubscriptionBase( _timeSelector = timeSelector; _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; + _synchronizationGate = new(); _onEditingSource = OnEditingSource; @@ -77,7 +79,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) + .Synchronize(_synchronizationGate) .SubscribeSafe( onNext: OnSourceNext, onError: OnSourceError, @@ -86,7 +88,7 @@ protected SubscriptionBase( public void Dispose() { - lock (SynchronizationGate) + lock (_synchronizationGate) { _sourceSubscription.Dispose(); @@ -97,10 +99,6 @@ public void Dispose() 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. - protected object SynchronizationGate - => _expirationDueTimesByKey; - protected abstract DateTimeOffset? GetNextManagementDueTime(); protected DateTimeOffset? GetNextProposedExpirationDueTime() @@ -134,7 +132,7 @@ private void ManageExpirations() private void OnEditingSource(ISourceUpdater updater) { - lock (SynchronizationGate) + lock (_synchronizationGate) { // The scheduler only promises "best effort" to cancel scheduled operations, so we need to make sure. if (_nextScheduledManagement is not { } thisScheduledManagement) diff --git a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs index d128ada8f..1f5724715 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -22,8 +22,8 @@ public static IObservable> Create( TimeSpan? pollingInterval = null, IScheduler? scheduler = null) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - timeSelector.ThrowArgumentNullExceptionIfNull(nameof(timeSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(timeSelector); return Observable.Create>(observer => (pollingInterval is { } pollingIntervalValue) ? new PollingSubscription( @@ -48,6 +48,7 @@ private abstract class SubscriptionBase private readonly List _proposedExpirationsQueue; private readonly IScheduler _scheduler; private readonly IDisposable _sourceSubscription; + private readonly Lock _synchronizationGate; private readonly Func _timeSelector; private bool _hasSourceCompleted; @@ -63,13 +64,14 @@ protected SubscriptionBase( _timeSelector = timeSelector; _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; + _synchronizationGate = new(); _expirationDueTimesByKey = []; _itemsCache = new(); _proposedExpirationsQueue = []; _sourceSubscription = source - .Synchronize(SynchronizationGate) + .Synchronize(_synchronizationGate) .SubscribeSafe( onNext: OnSourceNext, onError: OnSourceError, @@ -78,7 +80,7 @@ protected SubscriptionBase( public void Dispose() { - lock (SynchronizationGate) + lock (_synchronizationGate) { _sourceSubscription.Dispose(); @@ -89,10 +91,6 @@ public void Dispose() 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. - protected object SynchronizationGate - => _expirationDueTimesByKey; - protected abstract DateTimeOffset? GetNextManagementDueTime(); protected DateTimeOffset? GetNextProposedExpirationDueTime() @@ -110,7 +108,7 @@ private void ClearExpiration(TKey key) private void ManageExpirations() { - lock (SynchronizationGate) + lock (_synchronizationGate) { // The scheduler only promises "best effort" to cancel scheduled operations, so we need to make sure. if (_nextScheduledManagement is not { } thisScheduledManagement) diff --git a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs index 350ae272b..1ca4a1731 100644 --- a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/Cache/Internal/Filter.Dynamic.cs @@ -21,10 +21,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(predicateState); + ArgumentNullException.ThrowIfNull(predicate); + ArgumentNullException.ThrowIfNull(reapplyFilter); return Observable.Create>(downstreamObserver => new Subscription( downstreamObserver: downstreamObserver, @@ -40,17 +40,14 @@ private sealed class Subscription { private readonly List> _downstreamChangesBuffer; private readonly IObserver> _downstreamObserver; + private readonly Lock _downstreamSynchronizationGate; private readonly Dictionary _itemStatesByKey; private readonly Func _predicate; private readonly IDisposable? _predicateStateSubscription; private readonly IDisposable? _reapplyFilterSubscription; 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 readonly Lock _upstreamSynchronizationGate; private bool _hasInitialized; private bool _hasPredicateStateCompleted; @@ -71,6 +68,9 @@ public Subscription( _predicate = predicate; _suppressEmptyChangeSets = suppressEmptyChangeSets; + _downstreamSynchronizationGate = new(); + _upstreamSynchronizationGate = new(); + _downstreamChangesBuffer = []; _itemStatesByKey = []; @@ -78,7 +78,7 @@ public Subscription( var onError = new Action(OnError); - using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); + using var @lock = SwappableLock.CreateAndEnter(_upstreamSynchronizationGate); _predicateStateSubscription = predicateState .SubscribeSafe( @@ -108,7 +108,7 @@ public Subscription( if (needToComplete) { - @lock.SwapTo(DownstreamSynchronizationGate); + @lock.SwapTo(_downstreamSynchronizationGate); _downstreamObserver.OnCompleted(); } @@ -121,20 +121,6 @@ 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() { if (_downstreamChangesBuffer.Count is 0) @@ -148,19 +134,19 @@ private ChangeSet AssembleDownstreamChanges() private void OnError(Exception error) { - using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); + using var @lock = SwappableLock.CreateAndEnter(_upstreamSynchronizationGate); _predicateStateSubscription?.Dispose(); _sourceSubscription?.Dispose(); - @lock.SwapTo(DownstreamSynchronizationGate); + @lock.SwapTo(_downstreamSynchronizationGate); _downstreamObserver.OnError(error); } private void OnPredicateStateCompleted() { - using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); + using var @lock = SwappableLock.CreateAndEnter(_upstreamSynchronizationGate); _hasPredicateStateCompleted = true; @@ -170,7 +156,7 @@ private void OnPredicateStateCompleted() && ((_hasReapplyFilterCompleted && _hasSourceCompleted) || (!_isLatestPredicateStateValid && _suppressEmptyChangeSets))) { - @lock.SwapTo(DownstreamSynchronizationGate); + @lock.SwapTo(_downstreamSynchronizationGate); _downstreamObserver.OnCompleted(); } @@ -178,7 +164,7 @@ private void OnPredicateStateCompleted() private void OnPredicateStateNext(TState predicateState) { - using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); + using var @lock = SwappableLock.CreateAndEnter(_upstreamSynchronizationGate); _latestPredicateState = predicateState; _isLatestPredicateStateValid = true; @@ -188,7 +174,7 @@ private void OnPredicateStateNext(TState predicateState) var downstreamChanges = AssembleDownstreamChanges(); if (((downstreamChanges.Count is not 0) || !_suppressEmptyChangeSets) && _hasInitialized) { - @lock.SwapTo(DownstreamSynchronizationGate); + @lock.SwapTo(_downstreamSynchronizationGate); _downstreamObserver.OnNext(downstreamChanges); } @@ -196,14 +182,14 @@ private void OnPredicateStateNext(TState predicateState) private void OnReapplyFilterCompleted() { - using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); + using var @lock = SwappableLock.CreateAndEnter(_upstreamSynchronizationGate); _hasReapplyFilterCompleted = true; // If the other two sources have also completed, there's no chance of us ever needing to emit further changesets. if (_hasPredicateStateCompleted && _hasSourceCompleted) { - @lock.SwapTo(DownstreamSynchronizationGate); + @lock.SwapTo(_downstreamSynchronizationGate); _downstreamObserver.OnCompleted(); } @@ -211,7 +197,7 @@ private void OnReapplyFilterCompleted() private void OnReapplyFilterNext(Unit value) { - using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); + using var @lock = SwappableLock.CreateAndEnter(_upstreamSynchronizationGate); if (_isLatestPredicateStateValid) ReFilter(_latestPredicateState); @@ -219,7 +205,7 @@ private void OnReapplyFilterNext(Unit value) var downstreamChanges = AssembleDownstreamChanges(); if (((downstreamChanges.Count is not 0) || !_suppressEmptyChangeSets) && _hasInitialized) { - @lock.SwapTo(DownstreamSynchronizationGate); + @lock.SwapTo(_downstreamSynchronizationGate); _downstreamObserver.OnNext(downstreamChanges); } @@ -227,7 +213,7 @@ private void OnReapplyFilterNext(Unit value) private void OnSourceCompleted() { - using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); + using var @lock = SwappableLock.CreateAndEnter(_upstreamSynchronizationGate); _hasSourceCompleted = true; @@ -238,7 +224,7 @@ private void OnSourceCompleted() && ((_itemStatesByKey.Count is 0) || (_hasPredicateStateCompleted && !_isLatestPredicateStateValid)))) { - @lock.SwapTo(DownstreamSynchronizationGate); + @lock.SwapTo(_downstreamSynchronizationGate); _downstreamObserver.OnCompleted(); } @@ -246,7 +232,7 @@ private void OnSourceCompleted() private void OnSourceNext(IChangeSet upstreamChanges) { - using var @lock = SwappableLock.CreateAndEnter(UpstreamSynchronizationGate); + using var @lock = SwappableLock.CreateAndEnter(_upstreamSynchronizationGate); foreach (var change in upstreamChanges.ToConcreteType()) { @@ -370,7 +356,7 @@ private void OnSourceNext(IChangeSet upstreamChanges) var downstreamChanges = AssembleDownstreamChanges(); if ((downstreamChanges.Count is not 0) || !_suppressEmptyChangeSets) { - @lock.SwapTo(DownstreamSynchronizationGate); + @lock.SwapTo(_downstreamSynchronizationGate); _downstreamObserver.OnNext(downstreamChanges); } diff --git a/src/DynamicData/Cache/Internal/Filter.Static.cs b/src/DynamicData/Cache/Internal/Filter.Static.cs index e53a479bc..58b8bfb91 100644 --- a/src/DynamicData/Cache/Internal/Filter.Static.cs +++ b/src/DynamicData/Cache/Internal/Filter.Static.cs @@ -17,8 +17,8 @@ public static IObservable> Create( Func filter, bool suppressEmptyChangeSets) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - filter.ThrowArgumentNullExceptionIfNull(nameof(filter)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(filter); return Observable.Create>(downstreamObserver => { diff --git a/src/DynamicData/Cache/Internal/FullJoin.cs b/src/DynamicData/Cache/Internal/FullJoin.cs index 46bdb663f..a8d851454 100644 --- a/src/DynamicData/Cache/Internal/FullJoin.cs +++ b/src/DynamicData/Cache/Internal/FullJoin.cs @@ -25,7 +25,7 @@ internal sealed class FullJoin public IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var queue = new SharedDeliveryQueue(locker); // create local backing stores diff --git a/src/DynamicData/Cache/Internal/InnerJoin.cs b/src/DynamicData/Cache/Internal/InnerJoin.cs index e27c565c6..9b16ef51e 100644 --- a/src/DynamicData/Cache/Internal/InnerJoin.cs +++ b/src/DynamicData/Cache/Internal/InnerJoin.cs @@ -25,7 +25,7 @@ internal sealed class InnerJoin> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var queue = new SharedDeliveryQueue(locker); // create local backing stores diff --git a/src/DynamicData/Cache/Internal/LeftJoin.cs b/src/DynamicData/Cache/Internal/LeftJoin.cs index f0709cb75..44ee18898 100644 --- a/src/DynamicData/Cache/Internal/LeftJoin.cs +++ b/src/DynamicData/Cache/Internal/LeftJoin.cs @@ -25,7 +25,7 @@ internal sealed class LeftJoin public IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var queue = new SharedDeliveryQueue(locker); // create local backing stores diff --git a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs index be539b82c..b682ddc03 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs @@ -118,10 +118,7 @@ public IObservable> Connect(Func? predi /// The edit action. public void Edit(Action> editAction) { - if (editAction is null) - { - throw new ArgumentNullException(nameof(editAction)); - } + ArgumentNullException.ThrowIfNull(editAction); editAction(_updater); _changes.OnNext(_innerCache.CaptureChanges()); diff --git a/src/DynamicData/Cache/Internal/MergeMany.cs b/src/DynamicData/Cache/Internal/MergeMany.cs index fe2eecc75..490317e38 100644 --- a/src/DynamicData/Cache/Internal/MergeMany.cs +++ b/src/DynamicData/Cache/Internal/MergeMany.cs @@ -24,7 +24,7 @@ public MergeMany(IObservable> source, Func> source, Func> observableSelector) { - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(observableSelector); _source = source ?? throw new ArgumentNullException(nameof(source)); _observableSelector = (t, _) => observableSelector(t); diff --git a/src/DynamicData/Cache/Internal/MergeManyItems.cs b/src/DynamicData/Cache/Internal/MergeManyItems.cs index 26b85614b..d0b9032c2 100644 --- a/src/DynamicData/Cache/Internal/MergeManyItems.cs +++ b/src/DynamicData/Cache/Internal/MergeManyItems.cs @@ -22,10 +22,7 @@ public MergeManyItems(IObservable> source, Func> source, Func> observableSelector) { - if (observableSelector is null) - { - throw new ArgumentNullException(nameof(observableSelector)); - } + ArgumentNullException.ThrowIfNull(observableSelector); _source = source ?? throw new ArgumentNullException(nameof(source)); _observableSelector = (t, _) => observableSelector(t); diff --git a/src/DynamicData/Cache/Internal/ReaderWriter.cs b/src/DynamicData/Cache/Internal/ReaderWriter.cs index bbe56eb14..cc321851c 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; @@ -97,21 +93,21 @@ public Optional Lookup(TKey key) public ChangeSet Write(IChangeSet changes, Action>? previewHandler, bool collectChanges) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentNullException.ThrowIfNull(changes); return DoUpdate(updater => updater.Clone(changes), previewHandler, collectChanges); } public ChangeSet Write(Action> updateAction, Action>? previewHandler, bool collectChanges) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentNullException.ThrowIfNull(updateAction); return DoUpdate(updateAction, previewHandler, collectChanges); } public ChangeSet Write(Action> updateAction, Action>? previewHandler, bool collectChanges) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentNullException.ThrowIfNull(updateAction); return DoUpdate(updateAction, previewHandler, collectChanges); } diff --git a/src/DynamicData/Cache/Internal/RefCount.cs b/src/DynamicData/Cache/Internal/RefCount.cs index 4c4736391..8787853af 100644 --- a/src/DynamicData/Cache/Internal/RefCount.cs +++ b/src/DynamicData/Cache/Internal/RefCount.cs @@ -11,11 +11,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 85163f75e..ef7b679e9 100644 --- a/src/DynamicData/Cache/Internal/RightJoin.cs +++ b/src/DynamicData/Cache/Internal/RightJoin.cs @@ -25,7 +25,7 @@ internal sealed class RightJoin> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var queue = new SharedDeliveryQueue(locker); // create local backing stores diff --git a/src/DynamicData/Cache/Internal/SubscribeMany.cs b/src/DynamicData/Cache/Internal/SubscribeMany.cs index 78579fbeb..cf6c90ca3 100644 --- a/src/DynamicData/Cache/Internal/SubscribeMany.cs +++ b/src/DynamicData/Cache/Internal/SubscribeMany.cs @@ -18,7 +18,7 @@ internal sealed class SubscribeMany public SubscribeMany(IObservable> source, Func subscriptionFactory) { - subscriptionFactory.ThrowArgumentNullExceptionIfNull(nameof(subscriptionFactory)); + ArgumentNullException.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 f3634dac3..230e84d45 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -65,11 +65,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; diff --git a/src/DynamicData/Cache/Internal/TransformMany.cs b/src/DynamicData/Cache/Internal/TransformMany.cs index a356d09c9..46c2c9a42 100644 --- a/src/DynamicData/Cache/Internal/TransformMany.cs +++ b/src/DynamicData/Cache/Internal/TransformMany.cs @@ -104,7 +104,7 @@ private IObservable> CreateWithChangeS (t, _) => { // Only skip initial for first time Adds where there is initial data records - var locker = InternalEx.NewLock(); + var locker = new Lock(); var changes = childChanges(t).Synchronize(locker).Skip(1); return new ManyContainer( () => diff --git a/src/DynamicData/Cache/ObservableCache.cs b/src/DynamicData/Cache/ObservableCache.cs index 745e06ba1..e73a035a3 100644 --- a/src/DynamicData/Cache/ObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCache.cs @@ -30,11 +30,7 @@ internal sealed class ObservableCache : IObservableCache _suspensionTracker; -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif private readonly ReaderWriter _readerWriter; @@ -150,7 +146,7 @@ public IDisposable SuspendNotifications() internal void UpdateFromIntermediate(Action> updateAction) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentNullException.ThrowIfNull(updateAction); using var notifications = _notifications.AcquireLock(); @@ -187,7 +183,7 @@ internal void UpdateFromIntermediate(Action> update internal void UpdateFromSource(Action> updateAction) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentNullException.ThrowIfNull(updateAction); using var notifications = _notifications.AcquireLock(); diff --git a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs index f99f46747..8ae6e1643 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs @@ -47,8 +47,8 @@ public static IObservable> Adapt(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - adaptor.ThrowArgumentNullExceptionIfNull(nameof(adaptor)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(adaptor); return source.Do(adaptor.Adapt); } @@ -61,8 +61,8 @@ public static IObservable> Adapt(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - adaptor.ThrowArgumentNullExceptionIfNull(nameof(adaptor)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(adaptor); return source.Do(adaptor.Adapt); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs index 3b217f6ed..6993a191f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs @@ -50,7 +50,7 @@ public static void AddOrUpdate(this ISourceCache s where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.AddOrUpdate(item)); } @@ -64,7 +64,7 @@ public static void AddOrUpdate(this ISourceCache s where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.AddOrUpdate(item, equalityComparer)); } @@ -77,7 +77,7 @@ public static void AddOrUpdate(this ISourceCache s where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.AddOrUpdate(items)); } @@ -91,7 +91,7 @@ public static void AddOrUpdate(this ISourceCache s where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.AddOrUpdate(items, equalityComparer)); } @@ -105,8 +105,8 @@ 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 bae09dd4e..22aa4c861 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.And.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.And.cs @@ -35,15 +35,17 @@ public static partial class ObservableCacheEx /// The additional streams to combine with. /// An observable which emits change sets. /// source or others. + /// Throws if is empty. /// public static IObservable> And(this IObservable> source, params IObservable>[] others) where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(others); - return others is null || others.Length == 0 - ? throw new ArgumentNullException(nameof(others)) + return others.Length == 0 + ? throw new ArgumentException("At least one additional stream must be supplied", nameof(others)) : source.Combine(CombineOperator.And, others); } @@ -63,7 +65,7 @@ public static IObservable> And(this ICo where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.And); } @@ -80,7 +82,7 @@ public static IObservable> And(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.And); } @@ -97,7 +99,7 @@ public static IObservable> And(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.And); } @@ -114,7 +116,7 @@ public static IObservable> And(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.And); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs index 3a9f58875..55eab0c4c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs @@ -38,7 +38,7 @@ public static IObservableCache AsObservableCache(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new AnonymousObservableCache(source); } @@ -66,7 +66,7 @@ public static IObservableCache AsObservableCache(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); if (applyLocking) { diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs index 1e7bfb428..fbc3edac7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs @@ -40,7 +40,7 @@ public static IObservable> AutoRefresh( where TObject : INotifyPropertyChanged where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.AutoRefreshOnObservable( (t, _) => @@ -72,7 +72,7 @@ public static IObservable> AutoRefresh diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs index 39a04294e..684f88152 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs @@ -59,8 +59,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 1ed843deb..5b8a7c7a0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs @@ -57,7 +57,7 @@ public static IObservable> Batch(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 40d48977e..6fad6c183 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs @@ -84,8 +84,8 @@ public static IObservable> BatchIf(this where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pauseIfTrueSelector.ThrowArgumentNullExceptionIfNull(nameof(pauseIfTrueSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 ec591efa2..79eb57e8e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs @@ -40,7 +40,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); + ArgumentNullException.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 @@ -67,7 +67,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); + ArgumentNullException.ThrowIfNull(destination); return source?.Bind(destination, new ObservableCollectionAdaptor(options)) ?? throw new ArgumentNullException(nameof(source)); } @@ -86,13 +86,13 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); - updater.ThrowArgumentNullExceptionIfNull(nameof(updater)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(destination); + ArgumentNullException.ThrowIfNull(updater); return Observable.Create>( observer => - source.SynchronizeSafe(InternalEx.NewLock()).Select( + source.SynchronizeSafe(new Lock()).Select( changes => { updater.Adapt(changes, destination); @@ -114,7 +114,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); var target = new ObservableCollectionExtended(); readOnlyObservableCollection = new ReadOnlyObservableCollection(target); @@ -137,7 +137,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); if (adaptor is not null) { @@ -170,8 +170,8 @@ public static IObservable> Bind(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(destination); return source.Bind(destination, DynamicDataOptions.Binding); } @@ -190,8 +190,8 @@ public static IObservable> Bind(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(destination); var updater = new SortedObservableCollectionAdaptor(options); return source.Bind(destination, updater); @@ -211,13 +211,13 @@ public static IObservable> Bind(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - destination.ThrowArgumentNullExceptionIfNull(nameof(destination)); - updater.ThrowArgumentNullExceptionIfNull(nameof(updater)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(destination); + ArgumentNullException.ThrowIfNull(updater); return Observable.Create>( observer => - source.SynchronizeSafe(InternalEx.NewLock()).Select( + source.SynchronizeSafe(new Lock()).Select( changes => { updater.Adapt(changes, destination); @@ -239,7 +239,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); var target = new ObservableCollectionExtended(); var result = new ReadOnlyObservableCollection(target); @@ -264,7 +264,7 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 @@ -299,8 +299,8 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - bindingList.ThrowArgumentNullExceptionIfNull(nameof(bindingList)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(bindingList); return source.Adapt(new BindingListAdaptor(bindingList, resetThreshold)); } @@ -323,8 +323,8 @@ public static IObservable> Bind(this IO where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - bindingList.ThrowArgumentNullExceptionIfNull(nameof(bindingList)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 90aa68b00..81d492d88 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs @@ -51,7 +51,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 53dc96e5d..58fd8aa54 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs @@ -50,8 +50,8 @@ public static IObservable> ChangeKey @@ -71,8 +71,8 @@ public static IObservable> ChangeKey diff --git a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs index d29301dc8..48b728854 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs @@ -45,7 +45,7 @@ public static void Clear(this ISourceCache source) where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.Clear()); } @@ -55,7 +55,7 @@ public static void Clear(this IIntermediateCache s where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.Clear()); } @@ -65,7 +65,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 1f635fc58..7dfcf3d6b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs @@ -47,8 +47,8 @@ public static IObservable> Clone(this I where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - target.ThrowArgumentNullExceptionIfNull(nameof(target)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(target); return source.Do( changes => diff --git a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs index eb46b86b3..0e8696250 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs @@ -29,7 +29,7 @@ private static IObservable> Combine(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return Observable.Create>( observer => @@ -44,7 +44,7 @@ private static IObservable> Combine(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return Observable.Create>( observer => @@ -59,7 +59,7 @@ private static IObservable> Combine(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new DynamicCombiner(source, type).Run(); } @@ -68,7 +68,7 @@ private static IObservable> Combine(thi where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return Observable.Create>( observer => @@ -105,7 +105,7 @@ private static IObservable> Combine(thi where TObject : notnull where TKey : notnull { - combineTarget.ThrowArgumentNullExceptionIfNull(nameof(combineTarget)); + ArgumentNullException.ThrowIfNull(combineTarget); return Observable.Create>( observer => diff --git a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs index bf6d26c18..b6a37a345 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs @@ -40,8 +40,8 @@ public static IObservable> Convert diff --git a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs index 89cebf0da..c0725b0de 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs @@ -41,7 +41,7 @@ public static IObservable> DeferUntilLoaded(source).Run(); } @@ -51,7 +51,7 @@ public static IObservable> DeferUntilLoaded(source).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs index 52ad51274..df1db9684 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs @@ -64,7 +64,7 @@ public static IObservable> DisposeMany( where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new DisposeMany(source).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs index 6007f055c..05148c640 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs @@ -45,8 +45,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 86a68c29a..da9eed2f2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs @@ -37,9 +37,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(allItems); + ArgumentNullException.ThrowIfNull(equalityComparer); source.EditDiff(allItems, equalityComparer.Equals); } @@ -67,9 +67,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(allItems); + ArgumentNullException.ThrowIfNull(areItemsEqual); var editDiff = new EditDiff(source, areItemsEqual); editDiff.Edit(allItems); @@ -101,8 +101,8 @@ public static IObservable> EditDiff(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(keySelector); return new EditDiffChangeSet(source, keySelector, equalityComparer).Run(); } @@ -131,8 +131,8 @@ public static IObservable> EditDiff(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 f3ec6e103..8606b0d93 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs @@ -47,7 +47,7 @@ public static IObservable> EnsureUniqueKeys(source).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Except.cs b/src/DynamicData/Cache/ObservableCacheEx.Except.cs index 19699c8d2..0cb153b48 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Except.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Except.cs @@ -39,17 +39,17 @@ public static partial class ObservableCacheEx /// or /// others. /// + /// Throws if is empty. /// public static IObservable> Except(this IObservable> source, params IObservable>[] others) where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(others); - if (others is null || others.Length == 0) - { - throw new ArgumentNullException(nameof(others)); - } + if (others.Length == 0) + throw new ArgumentException("At least one additional stream must be supplied", nameof(others)); return source.Combine(CombineOperator.Except, others); } @@ -71,7 +71,7 @@ public static IObservable> Except(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Except); } @@ -88,7 +88,7 @@ public static IObservable> Except(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Except); } @@ -105,7 +105,7 @@ public static IObservable> Except(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Except); } @@ -122,7 +122,7 @@ public static IObservable> Except(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Except); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs index 3c4d432a7..4d9ff918a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs @@ -60,8 +60,8 @@ public static IObservable> FilterImmutable( predicate: predicate, diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs index 82733f25a..0b7cba486 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs @@ -73,8 +73,8 @@ public static IObservable> FilterOnObservable(source, filterFactory, buffer, scheduler).Run(); } @@ -87,8 +87,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 b50111d6b..8202530ac 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs @@ -35,8 +35,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 23052c9e5..27f751a52 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs @@ -39,7 +39,7 @@ public static IObservable> Flatten(this IOb where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.SelectMany(changes => changes); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs index 357b859ac..212720b1f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs @@ -38,7 +38,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 fb23c04b6..d1031451a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs @@ -54,8 +54,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 9328527e2..a6cbe1d6d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs @@ -38,10 +38,10 @@ public static IObservable> FullJoin resultSelector(leftValue, rightValue)); } @@ -96,10 +96,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 c2e5894bc..5fdd48cbf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs @@ -38,10 +38,10 @@ public static IObservable> FullJoinMany resultSelector(leftValue, rightValue)); } @@ -97,10 +97,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 b803146d8..de997e83e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Group.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Group.cs @@ -44,9 +44,9 @@ public static IObservable> Group(source, groupSelector, resultGroupSource).Run(); } @@ -87,8 +87,8 @@ public static IObservable> Group(source, groupSelectorKey, null).Run(); } @@ -104,9 +104,9 @@ public static IObservable> Group(source, groupSelectorKey, regrouper).Run(); } @@ -143,8 +143,8 @@ public static IObservable> Group(source, groupSelectorKeyObservable, regrouper).Run(); } @@ -159,7 +159,7 @@ public static IObservable> Group), regrouper); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs index 31115d013..1aa9f3ec4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs @@ -77,8 +77,8 @@ public static IObservable> GroupOnObse where TKey : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - groupObservableSelector.ThrowArgumentNullExceptionIfNull(nameof(groupObservableSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(groupObservableSelector); return new GroupOnObservable(source, groupObservableSelector).Run(); } @@ -97,7 +97,7 @@ public static IObservable> GroupOnObse where TKey : notnull where TGroupKey : notnull { - groupObservableSelector.ThrowArgumentNullExceptionIfNull(nameof(groupObservableSelector)); + ArgumentNullException.ThrowIfNull(groupObservableSelector); return source.GroupOnObservable(AdaptSelector>(groupObservableSelector)); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs index 5165d4091..06b9148fb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs @@ -42,8 +42,8 @@ public static IObservable> GroupOnProp where TKey : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertySelector.ThrowArgumentNullExceptionIfNull(nameof(propertySelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 2be1f5ca0..299dcd825 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs @@ -42,8 +42,8 @@ public static IObservable> Gr where TKey : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertySelector.ThrowArgumentNullExceptionIfNull(nameof(propertySelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 1284a4b4f..be73aeee4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs @@ -58,8 +58,8 @@ public static IObservable> Gr where TKey : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - groupSelectorKey.ThrowArgumentNullExceptionIfNull(nameof(groupSelectorKey)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 2c1a2e020..8f5f41f31 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs @@ -38,8 +38,8 @@ public static IObservable> IncludeUpdateWhen diff --git a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs index 8a80e640d..311bd3f27 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs @@ -38,10 +38,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)); + ArgumentNullException.ThrowIfNull(left); + ArgumentNullException.ThrowIfNull(right); + ArgumentNullException.ThrowIfNull(rightKeySelector); + ArgumentNullException.ThrowIfNull(resultSelector); return left.InnerJoin(right, rightKeySelector, (_, leftValue, rightValue) => resultSelector(leftValue, rightValue)); } @@ -96,10 +96,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)); + ArgumentNullException.ThrowIfNull(left); + ArgumentNullException.ThrowIfNull(right); + ArgumentNullException.ThrowIfNull(rightKeySelector); + ArgumentNullException.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 60bf2a343..e94ed1c92 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs @@ -38,10 +38,10 @@ public static IObservable> InnerJoinMany resultSelector(leftValue, rightValue)); } @@ -96,10 +96,10 @@ public static IObservable> InnerJoinMany(left, right, rightKeySelector, resultSelector).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs index 5da9d2abe..eb8db273d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs @@ -38,10 +38,10 @@ public static IObservable> LeftJoin resultSelector(leftValue, rightValue)); } @@ -96,10 +96,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 726ec5f1f..38f5bb44e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs @@ -38,10 +38,10 @@ public static IObservable> LeftJoinMany resultSelector(leftValue, rightValue)); } @@ -96,10 +96,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 810f118d0..0a2d4f902 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs @@ -49,7 +49,7 @@ public static IObservable> LimitSizeTo( where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); if (size <= 0) { @@ -75,7 +75,7 @@ public static IObservable>> LimitSizeTo< where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); if (sizeLimit <= 0) { diff --git a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs index c29bd2a6b..0ad190f8b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs @@ -76,7 +76,7 @@ public static IObservable> MergeChangeSets(source, equalityComparer: null, comparer: null).Run(); } @@ -96,8 +96,8 @@ public static IObservable> MergeChangeSets(source, equalityComparer: null, comparer).Run(); } @@ -117,8 +117,8 @@ public static IObservable> MergeChangeSets(source, equalityComparer, comparer: null).Run(); } @@ -138,9 +138,9 @@ public static IObservable> MergeChangeSets(source, equalityComparer, comparer).Run(); } @@ -161,8 +161,8 @@ public static IObservable> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets> MergeChangeSets(source, equalityComparer: null, comparer: null, completable, scheduler).Run(); } @@ -379,8 +379,8 @@ public static IObservable> MergeChangeSets(source, equalityComparer: null, comparer, completable, scheduler).Run(); } @@ -402,8 +402,8 @@ public static IObservable> MergeChangeSets(source, equalityComparer, comparer: null, completable, scheduler).Run(); } @@ -425,9 +425,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 b3c290d34..b68d82ee9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs @@ -62,8 +62,8 @@ public static IObservable MergeMany(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); return new MergeMany(source, observableSelector).Run(); } @@ -75,8 +75,8 @@ public static IObservable MergeMany(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 5fcbb9ed0..5abef697b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs @@ -46,7 +46,7 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), comparer); } @@ -70,9 +70,9 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); + ArgumentNullException.ThrowIfNull(comparer); return source.MergeManyChangeSets(observableSelector, equalityComparer: null, comparer: comparer); } @@ -97,8 +97,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), equalityComparer, comparer); } @@ -169,8 +169,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); return new MergeManyCacheChangeSets(source, observableSelector, equalityComparer, comparer).Run(); } @@ -197,8 +197,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), sourceComparer, DefaultResortOnSourceRefresh, equalityComparer: null, childComparer); } @@ -245,8 +245,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), sourceComparer, resortOnSourceRefresh, equalityComparer: null, childComparer); } @@ -294,8 +294,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), sourceComparer, DefaultResortOnSourceRefresh, equalityComparer, childComparer); } @@ -343,8 +343,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); return source.MergeManyChangeSets((t, _) => observableSelector(t), sourceComparer, resortOnSourceRefresh, equalityComparer, childComparer); } @@ -383,9 +383,9 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); - sourceComparer.ThrowArgumentNullExceptionIfNull(nameof(sourceComparer)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); + ArgumentNullException.ThrowIfNull(sourceComparer); return new MergeManyCacheChangeSetsSourceCompare(source, observableSelector, sourceComparer, equalityComparer, childComparer, resortOnSourceRefresh).Run(); } @@ -407,8 +407,8 @@ public static IObservable> MergeManyChangeSets(source, observableSelector, equalityComparer).Run(); } @@ -429,7 +429,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 b2581c6c8..f00e2a522 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs @@ -41,8 +41,8 @@ public static IObservable> MergeManyItems(source, observableSelector).Run(); } @@ -54,8 +54,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 a267d1511..0aa975d17 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs @@ -38,7 +38,7 @@ public static IObservable> NotEmpty(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 dd12ae230..a821c0d3b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs @@ -50,7 +50,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 40e47a95b..85a2414cd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs @@ -57,8 +57,8 @@ public static IObservable> OnItemAdded( where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - addAction.ThrowArgumentNullExceptionIfNull(nameof(addAction)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 13441fd02..f8acb562b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs @@ -55,8 +55,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 a0de6f338..749bb2c67 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Or.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Or.cs @@ -47,6 +47,7 @@ public static partial class ObservableCacheEx /// /// /// or is . + /// Throws if is empty. /// /// /// @@ -56,12 +57,11 @@ public static IObservable> Or(this IObs where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(others); - if (others is null || others.Length == 0) - { - throw new ArgumentNullException(nameof(others)); - } + if (others.Length == 0) + throw new ArgumentException("At least one additional stream must be given", nameof(others)); return source.Combine(CombineOperator.Or, others); } @@ -73,7 +73,7 @@ public static IObservable> Or(this ICol where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Or); } @@ -90,7 +90,7 @@ public static IObservable> Or(this IObs where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Or); } @@ -107,7 +107,7 @@ public static IObservable> Or(this IObs where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Or); } @@ -124,7 +124,7 @@ public static IObservable> Or(this IObs where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Or); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs index 24d4d407e..3a3472989 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs @@ -43,7 +43,7 @@ public static IDisposable PopulateFrom(this ISourceCache(this ISourceCache(this IObservable destination.Edit(updater => updater.Clone(changes))); } @@ -69,8 +69,8 @@ public static IDisposable PopulateInto(this IObservable destination.Edit(updater => updater.Clone(changes))); } @@ -83,8 +83,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 f294f119c..9142aeb4b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs @@ -46,8 +46,8 @@ public static IObservable QueryWhenChanged> QueryWhenChanged where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new QueryWhenChanged(source).Run(); } @@ -83,8 +83,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 66c8315b5..9ffd8f263 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs @@ -38,7 +38,7 @@ public static IObservable> RefCount(thi where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new RefCount(source).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs index 4e9947f28..64ff32064 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs @@ -42,7 +42,7 @@ public static void Refresh(this ISourceCache sourc where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.Refresh(item)); } @@ -59,7 +59,7 @@ public static void Refresh(this ISourceCache sourc where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.Refresh(items)); } @@ -75,7 +75,7 @@ public static void Refresh(this ISourceCache sourc where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.Refresh()); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs index d835ff00b..f230d46d2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs @@ -43,7 +43,7 @@ public static void Remove(this ISourceCache source where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.Remove(item)); } @@ -60,7 +60,7 @@ public static void Remove(this ISourceCache source where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.Remove(key)); } @@ -78,7 +78,7 @@ public static void Remove(this ISourceCache source where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.Remove(items)); } @@ -96,7 +96,7 @@ public static void Remove(this ISourceCache source where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.Remove(keys)); } @@ -109,7 +109,7 @@ public static void Remove(this IIntermediateCache where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(updater => updater.Remove(key)); } @@ -122,7 +122,7 @@ public static void Remove(this IIntermediateCache where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 6e9f3ecd6..293cb67f5 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs @@ -39,7 +39,7 @@ public static IObservable> RemoveKey(this IOb where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Select( changes => @@ -61,7 +61,7 @@ public static void RemoveKey(this ISourceCache sou where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 837bf45f3..79cfe7949 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs @@ -37,7 +37,7 @@ public static void RemoveKeys(this ISourceCache so where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 7bd66b375..79af47e7e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs @@ -38,10 +38,10 @@ public static IObservable> RightJoin resultSelector(leftValue, rightValue)); } @@ -96,10 +96,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 cb6a5a924..e3b76a0ac 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs @@ -38,10 +38,10 @@ public static IObservable> RightJoinMany resultSelector(leftValue, rightValue)); } @@ -97,10 +97,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 6a2ed2db4..c6c5966f7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs @@ -40,7 +40,7 @@ public static IObservable> SkipInitial( where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.DeferUntilLoaded().Skip(1); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs index 87bccebe5..e9427c83a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs @@ -46,8 +46,8 @@ public static IObservable> Sort(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(comparer); return new Sort(source, comparer, sortOptimisations, resetThreshold: resetThreshold).Run(); } @@ -67,8 +67,8 @@ public static IObservable> Sort(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - comparerObservable.ThrowArgumentNullExceptionIfNull(nameof(comparerObservable)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(comparerObservable); return new Sort(source, null, sortOptimisations, comparerObservable, resetThreshold: resetThreshold).Run(); } @@ -89,8 +89,8 @@ public static IObservable> Sort(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - comparerObservable.ThrowArgumentNullExceptionIfNull(nameof(comparerObservable)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(comparerObservable); return new Sort(source, null, sortOptimisations, comparerObservable, resorter, resetThreshold).Run(); } @@ -111,8 +111,8 @@ public static IObservable> Sort(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - resorter.ThrowArgumentNullExceptionIfNull(nameof(resorter)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(resorter); return new Sort(source, comparer, sortOptimisations, null, resorter, resetThreshold).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs index 560f53723..eded4a622 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs @@ -33,7 +33,7 @@ public static IObservable> StartWithItem where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.StartWithItem(item, item.Key); } @@ -52,7 +52,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 4149907ba..9bf1b13ba 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs @@ -63,8 +63,8 @@ public static IObservable> SubscribeMany(source, subscriptionFactory).Run(); } @@ -77,8 +77,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 36d66b59c..852c52cdf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs @@ -32,7 +32,7 @@ public static IObservable> Switch(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Select(cache => cache.Connect()).Switch(); } @@ -58,7 +58,7 @@ public static IObservable> Switch(this where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return new Switch(sources).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs index f04d2c998..eab09f58a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs @@ -48,8 +48,8 @@ public static IObservable> ToObservableChangeSet.Create( source: source, @@ -82,8 +82,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 89615148e..476631326 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs @@ -56,7 +56,7 @@ public static IObservable> ToObservableOptional where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new ToObservableOptional(source, key, equalityComparer).Run(); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs index 8319591d0..2798408cc 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs @@ -33,8 +33,8 @@ public static IObservable> Transform transformFactory(current), transformOnRefresh); } @@ -46,8 +46,8 @@ public static IObservable> Transform transformFactory(current, key), transformOnRefresh); } @@ -59,8 +59,8 @@ public static IObservable> Transform(source, transformFactory, transformOnRefresh: transformOnRefresh).Run(); } @@ -72,8 +72,8 @@ public static IObservable> Transform transformFactory(current), forceTransform?.ForForced()); } @@ -85,8 +85,8 @@ public static IObservable> Transform transformFactory(current, key), forceTransform); } @@ -134,8 +134,8 @@ public static IObservable> Transform(source, transformFactory, forceTransform).Run(); @@ -158,9 +158,9 @@ public static IObservable> Transform transformFactory(cur, key), forceTransform.ForForced()); } @@ -172,9 +172,9 @@ public static IObservable> Transform()); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs index 5e76e6cb8..4fee5e5cd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs @@ -34,8 +34,8 @@ public static IObservable> TransformAsync transformFactory(current), forceTransform); } @@ -48,8 +48,8 @@ public static IObservable> TransformAsync transformFactory(current, key), forceTransform); } @@ -62,8 +62,8 @@ public static IObservable> TransformAsync transformFactory(current, previous, key), forceTransform); } @@ -107,8 +107,8 @@ public static IObservable> TransformAsync(source, transformFactory, null, forceTransform).Run(); } @@ -121,8 +121,8 @@ public static IObservable> TransformAsync transformFactory(current), options); } @@ -135,8 +135,8 @@ public static IObservable> TransformAsync transformFactory(current, key), options); } @@ -149,8 +149,8 @@ public static IObservable> TransformAsync transformFactory(current, previous, key), options); } @@ -163,8 +163,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 940746e7a..df1dc7522 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs @@ -58,8 +58,8 @@ public static IObservable> TransformImmutable( source: source, diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs index 4a6ac6005..baa9785b4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs @@ -58,8 +58,8 @@ public static IObservable> TransformMa where TSource : notnull where TSourceKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(manySelector); return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer).Run(); } @@ -84,8 +84,8 @@ public static IObservable> TransformMa where TSourceKey : notnull where TCollection : INotifyCollectionChanged, IEnumerable { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(manySelector); return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer).Run(); } @@ -110,8 +110,8 @@ public static IObservable> TransformMa where TSource : notnull where TSourceKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 5e9d2c062..e18e4c7ee 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs @@ -50,9 +50,9 @@ public static IObservable> TransformMa where TSource : notnull where TSourceKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); - errorHandler.ThrowArgumentNullExceptionIfNull(nameof(errorHandler)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(manySelector); + ArgumentNullException.ThrowIfNull(errorHandler); return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer, errorHandler).Run(); } @@ -77,9 +77,9 @@ public static IObservable> TransformMa where TSourceKey : notnull where TCollection : INotifyCollectionChanged, IEnumerable { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); - errorHandler.ThrowArgumentNullExceptionIfNull(nameof(errorHandler)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(manySelector); + ArgumentNullException.ThrowIfNull(errorHandler); return new TransformManyAsync(source, CreateChangeSetTransformer(manySelector, keySelector), equalityComparer, comparer, errorHandler).Run(); } @@ -104,9 +104,9 @@ public static IObservable> TransformMa where TSource : notnull where TSourceKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - manySelector.ThrowArgumentNullExceptionIfNull(nameof(manySelector)); - errorHandler.ThrowArgumentNullExceptionIfNull(nameof(errorHandler)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(manySelector); + ArgumentNullException.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 24d9e5e04..cc960dbad 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs @@ -73,8 +73,8 @@ public static IObservable> TransformOnObservable< where TKey : notnull where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - transformFactory.ThrowArgumentNullExceptionIfNull(nameof(transformFactory)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(transformFactory); return new TransformOnObservable(source, transformFactory).Run(); } @@ -86,7 +86,7 @@ public static IObservable> TransformOnObservable< where TKey : notnull where TDestination : notnull { - transformFactory.ThrowArgumentNullExceptionIfNull(nameof(transformFactory)); + ArgumentNullException.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 f8e68385d..f57f3a987 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs @@ -32,9 +32,9 @@ public static IObservable> TransformSafe transformFactory(current), errorHandler, forceTransform.ForForced()); } @@ -46,9 +46,9 @@ public static IObservable> TransformSafe transformFactory(current, key), errorHandler, forceTransform); } @@ -79,9 +79,9 @@ public static IObservable> TransformSafe(source, transformFactory, forceTransform, errorHandler).Run(); @@ -104,9 +104,9 @@ public static IObservable> TransformSafe transformFactory(cur, key), errorHandler, forceTransform.ForForced()); } @@ -118,9 +118,9 @@ public static IObservable> TransformSafe()); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs index be4ac35fa..cee0308b0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs @@ -33,9 +33,9 @@ public static IObservable> TransformSafeAsync transformFactory(current), errorHandler, forceTransform); } @@ -48,9 +48,9 @@ public static IObservable> TransformSafeAsync transformFactory(current, key), errorHandler, forceTransform); } @@ -62,9 +62,9 @@ public static IObservable> TransformSafeAsync transformFactory(s, p, k), errorHandler, forceTransform); } @@ -89,9 +89,9 @@ public static IObservable> TransformSafeAsync(source, transformFactory, errorHandler, forceTransform).Run(); } @@ -104,9 +104,9 @@ public static IObservable> TransformSafeAsync transformFactory(current), errorHandler, options); } @@ -119,9 +119,9 @@ public static IObservable> TransformSafeAsync transformFactory(current, key), errorHandler, options); } @@ -134,7 +134,7 @@ public static IObservable> TransformSafeAsync transformFactory(current, previous, key), errorHandler, options); } @@ -147,9 +147,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 e0020280d..d7229910e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs @@ -51,8 +51,8 @@ public static IObservable, TKey>> TransformToTree where TObject : class where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pivotOn.ThrowArgumentNullExceptionIfNull(nameof(pivotOn)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 99004fa73..c990fb2ed 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs @@ -32,9 +32,9 @@ public static IObservable> TransformWithInlineUpd where TSource : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - transformFactory.ThrowArgumentNullExceptionIfNull(nameof(transformFactory)); - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(transformFactory); + ArgumentNullException.ThrowIfNull(updateAction); return source.TransformWithInlineUpdate(transformFactory, updateAction, false); } @@ -46,9 +46,9 @@ public static IObservable> TransformWithInlineUpd where TSource : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - transformFactory.ThrowArgumentNullExceptionIfNull(nameof(transformFactory)); - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(transformFactory); + ArgumentNullException.ThrowIfNull(updateAction); return new TransformWithInlineUpdate(source, transformFactory, updateAction, transformOnRefresh: transformOnRefresh).Run(); } @@ -60,10 +60,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(transformFactory); + ArgumentNullException.ThrowIfNull(updateAction); + ArgumentNullException.ThrowIfNull(errorHandler); return source.TransformWithInlineUpdate(transformFactory, updateAction, errorHandler, false); } @@ -101,10 +101,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(transformFactory); + ArgumentNullException.ThrowIfNull(updateAction); + ArgumentNullException.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 965001488..41b5fda47 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs @@ -36,7 +36,7 @@ public static IObservable> TreatMovesAsRemoveAdd where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); static IEnumerable> ReplaceMoves(IChangeSet items) { diff --git a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs index f98e5270a..674d89f58 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs @@ -63,9 +63,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); + ArgumentNullException.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 2dbeaf1e6..99712be19 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs @@ -30,8 +30,8 @@ public static IObservable>> So where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - virtualRequests.ThrowArgumentNullExceptionIfNull(nameof(virtualRequests)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(virtualRequests); return source.SortAndVirtualize(comparerChanged, virtualRequests, new SortAndVirtualizeOptions()); } @@ -74,8 +74,8 @@ public static IObservable>> So where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - virtualRequests.ThrowArgumentNullExceptionIfNull(nameof(virtualRequests)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(virtualRequests); return new SortAndVirtualize(source, comparer, virtualRequests, options).Run(); } @@ -118,8 +118,8 @@ public static IObservable>> So where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - virtualRequests.ThrowArgumentNullExceptionIfNull(nameof(virtualRequests)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(virtualRequests); return new SortAndVirtualize(source, comparerChanged, virtualRequests, options).Run(); } @@ -138,8 +138,8 @@ public static IObservable> Virtualise(source, virtualRequests).Run(); } @@ -168,13 +168,10 @@ public static IObservable>> To where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(comparer); - if (size <= 0) - { - throw new ArgumentOutOfRangeException(nameof(size), "Size should be greater than zero"); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(size); return source.SortAndVirtualize(comparer, Observable.Return(new VirtualRequest(0, size))); } @@ -194,12 +191,9 @@ public static IObservable> Top(t where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); - if (size <= 0) - { - throw new ArgumentOutOfRangeException(nameof(size), "Size should be greater than zero"); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(size); return new Virtualise(source, Observable.Return(new VirtualRequest(0, size))).Run(); } @@ -222,8 +216,8 @@ public static IObservable>> SortA where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pageRequests.ThrowArgumentNullExceptionIfNull(nameof(pageRequests)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(pageRequests); return source.SortAndPage(comparerChanged, pageRequests, new SortAndPageOptions()); } @@ -265,8 +259,8 @@ public static IObservable>> SortA where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pageRequests.ThrowArgumentNullExceptionIfNull(nameof(pageRequests)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(pageRequests); return new SortAndPage(source, comparer, pageRequests, options).Run(); } @@ -308,8 +302,8 @@ public static IObservable>> SortA where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pageRequests.ThrowArgumentNullExceptionIfNull(nameof(pageRequests)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(pageRequests); return new SortAndPage(source, comparerChanged, pageRequests, options).Run(); } @@ -327,8 +321,8 @@ public static IObservable> Page(th where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - pageRequests.ThrowArgumentNullExceptionIfNull(nameof(pageRequests)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 8cccf6088..1f100206b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs @@ -48,7 +48,7 @@ public static IObservable> Watch(this IObse where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 50929fb3a..1c846024d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs @@ -55,7 +55,7 @@ public static IObservable WatchValue(this IObservableCac where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Watch(key).Select(u => u.Current); } @@ -68,7 +68,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 15c3196dc..9f08fe7cf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs @@ -58,7 +58,7 @@ public static partial class ObservableCacheEx where TObject : INotifyPropertyChanged where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 9efbb2791..7e2b7daf8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs @@ -56,8 +56,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 b27e31c4f..976cd9736 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs @@ -59,8 +59,8 @@ public static partial class ObservableCacheEx where TObject : INotifyPropertyChanged where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - propertyAccessor.ThrowArgumentNullExceptionIfNull(nameof(propertyAccessor)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 095e1ec11..deb554af3 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs @@ -42,8 +42,8 @@ public static IObservable> WhereReasonsAre> WhereReasonsAreNot /// /// or is . + /// Throws if is empty. /// /// /// @@ -57,12 +58,11 @@ public static IObservable> Xor(this IOb where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(others); - if (others is null || others.Length == 0) - { - throw new ArgumentNullException(nameof(others)); - } + if (others.Length == 0) + throw new ArgumentException("At least one additional stream must be given", nameof(others)); return source.Combine(CombineOperator.Xor, others); } @@ -74,7 +74,7 @@ public static IObservable> Xor(this ICo where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Xor); } @@ -91,7 +91,7 @@ public static IObservable> Xor(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Xor); } @@ -108,7 +108,7 @@ public static IObservable> Xor(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Xor); } @@ -125,7 +125,7 @@ public static IObservable> Xor(this IOb where TObject : notnull where TKey : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Combine(CombineOperator.Xor); } diff --git a/src/DynamicData/Cache/Tests/TestEx.cs b/src/DynamicData/Cache/Tests/TestEx.cs index aada3066a..87662cb2b 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)); + ArgumentNullException.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/Diagnostics/DiagnosticOperators.cs b/src/DynamicData/Diagnostics/DiagnosticOperators.cs index 0e13e735c..bdf17fadc 100644 --- a/src/DynamicData/Diagnostics/DiagnosticOperators.cs +++ b/src/DynamicData/Diagnostics/DiagnosticOperators.cs @@ -23,7 +23,7 @@ public static IObservable CollectUpdateStats(this where TSource : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Scan( ChangeSummary.Empty, @@ -53,7 +53,7 @@ public static IObservable CollectUpdateStats(this public static IObservable CollectUpdateStats(this IObservable> source) where TSource : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Scan( ChangeSummary.Empty, diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index e20496a0f..cf6bfc2ae 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -8,9 +8,21 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + true + + true + + @@ -29,6 +41,11 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int + + + $(NoWarn);CS9216 + + diff --git a/src/DynamicData/EnumerableEx.cs b/src/DynamicData/EnumerableEx.cs index 124a4da30..207ec85e9 100644 --- a/src/DynamicData/EnumerableEx.cs +++ b/src/DynamicData/EnumerableEx.cs @@ -29,8 +29,8 @@ public static IObservable> AsObservableChangeSet>( obs => @@ -59,7 +59,7 @@ public static IObservable> AsObservableChangeSet> AsObservableChangeSet(this IEnumerable source, bool completable = false) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return Observable.Create>( obs => diff --git a/src/DynamicData/Experimental/ExperimentalEx.cs b/src/DynamicData/Experimental/ExperimentalEx.cs index 69f7d3adc..c10391abe 100644 --- a/src/DynamicData/Experimental/ExperimentalEx.cs +++ b/src/DynamicData/Experimental/ExperimentalEx.cs @@ -24,7 +24,7 @@ public static IWatcher AsWatcher(this IObservable< where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new Watcher(source, scheduler ?? GlobalConfig.DefaultScheduler); } diff --git a/src/DynamicData/Experimental/Watcher.cs b/src/DynamicData/Experimental/Watcher.cs index 9825ae686..d60417c79 100644 --- a/src/DynamicData/Experimental/Watcher.cs +++ b/src/DynamicData/Experimental/Watcher.cs @@ -15,11 +15,7 @@ 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")] private readonly IObservableCache _source; diff --git a/src/DynamicData/Internal/DeliveryQueue.cs b/src/DynamicData/Internal/DeliveryQueue.cs index 74a688f25..b35c3fcc2 100644 --- a/src/DynamicData/Internal/DeliveryQueue.cs +++ b/src/DynamicData/Internal/DeliveryQueue.cs @@ -14,11 +14,7 @@ internal sealed class DeliveryQueue : IObserver, IDisposable { 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; @@ -30,11 +26,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; } @@ -43,11 +35,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; @@ -118,16 +106,6 @@ public void OnCompleted() scope.EnqueueCompleted(); } -#if NET9_0_OR_GREATER - private void EnterLock() => _gate.Enter(); - - private void ExitLock() => _gate.Exit(); -#else - private void EnterLock() => Monitor.Enter(_gate); - - private void ExitLock() => Monitor.Exit(_gate); -#endif - private void EnqueueNotification(Notification item) { if (_isTerminated) @@ -141,7 +119,7 @@ private void EnqueueNotification(Notification item) private void ExitLockAndDeliver() { var shouldDeliver = TryStartDelivery(); - ExitLock(); + _gate.Exit(); if (shouldDeliver) { @@ -222,7 +200,7 @@ public ref struct ScopedAccess internal ScopedAccess(DeliveryQueue owner) { _owner = owner; - owner.EnterLock(); + owner._gate.Enter(); } /// Enqueues an OnNext notification. @@ -258,7 +236,7 @@ public ref struct ReadOnlyScopedAccess internal ReadOnlyScopedAccess(DeliveryQueue owner) { _owner = owner; - owner.EnterLock(); + owner._gate.Enter(); } /// Gets whether there are notifications pending delivery. @@ -275,7 +253,7 @@ public void Dispose() } _owner = null; - owner.ExitLock(); + owner._gate.Exit(); } } } 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/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 9e3eaf4a0..30bb0270c 100644 --- a/src/DynamicData/Internal/Notification.cs +++ b/src/DynamicData/Internal/Notification.cs @@ -29,7 +29,7 @@ private Notification(Optional value, Exception? error) /// Creates an OnError notification (terminal). public static Notification CreateError(Exception error) { - error.ThrowArgumentNullExceptionIfNull(nameof(error)); + ArgumentNullException.ThrowIfNull(error); return new(Optional.None(), error); } diff --git a/src/DynamicData/Internal/ObservableEx.cs b/src/DynamicData/Internal/ObservableEx.cs index 8fce9a875..c998f3d5b 100644 --- a/src/DynamicData/Internal/ObservableEx.cs +++ b/src/DynamicData/Internal/ObservableEx.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for full license information. using System.Reactive; +using System.Reactive.Linq; namespace DynamicData.Internal; @@ -20,6 +21,32 @@ public static IDisposable SubscribeSafe(this IObservable observable, Actio public static IDisposable SubscribeSafe(this IObservable observable, Action onError) => observable.SubscribeSafe(Observer.Create(Stub.Ignore, onError)); + public static IObservable Synchronize( + this IObservable source, + Lock gate) + => Observable.Create(observer => source.SubscribeSafe( + onNext: value => + { + lock (gate) + { + observer.OnNext(value); + } + }, + onError: error => + { + lock (gate) + { + observer.OnError(error); + } + }, + onCompleted: () => + { + lock (gate) + { + observer.OnCompleted(); + } + })); + private static class Stub { public static readonly Action Ignore = static _ => { }; 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/SharedDeliveryQueue.cs b/src/DynamicData/Internal/SharedDeliveryQueue.cs index 8d971d9cf..1974f6dec 100644 --- a/src/DynamicData/Internal/SharedDeliveryQueue.cs +++ b/src/DynamicData/Internal/SharedDeliveryQueue.cs @@ -36,11 +36,7 @@ internal sealed class SharedDeliveryQueue : IDisposable /// private readonly Queue _order = new(); -#if NET9_0_OR_GREATER private readonly Lock _gate; -#else - private readonly object _gate; -#endif private int _drainThreadId = -1; private volatile bool _isTerminated; @@ -48,20 +44,11 @@ internal sealed class SharedDeliveryQueue : IDisposable /// Initializes a new instance of the class with its own internal lock. public SharedDeliveryQueue() { -#if NET9_0_OR_GREATER _gate = new Lock(); -#else - _gate = new object(); -#endif } -#if NET9_0_OR_GREATER /// Initializes a new instance of the class with a caller-provided lock. public SharedDeliveryQueue(Lock gate) => _gate = gate; -#else - /// Initializes a new instance of the class with a caller-provided lock. - public SharedDeliveryQueue(object gate) => _gate = gate; -#endif /// Gets a value indicating whether this queue has been terminated. public bool IsTerminated @@ -84,18 +71,18 @@ public bool IsTerminated /// public void Dispose() { - EnterLock(); + _gate.Enter(); _isTerminated = true; _order.Clear(); if (_drainThreadId == Environment.CurrentManagedThreadId) { - ExitLock(); + _gate.Exit(); return; } - ExitLock(); + _gate.Exit(); SpinWait spinner = default; while (Volatile.Read(ref _drainThreadId) != -1) @@ -106,19 +93,11 @@ public void Dispose() [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void EnqueueOrder(DrainableBase source) => _order.Enqueue(source); -#if NET9_0_OR_GREATER [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void EnterLock() => _gate.Enter(); [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void ExitLock() => _gate.Exit(); -#else - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void EnterLock() => Monitor.Enter(_gate); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ExitLock() => Monitor.Exit(_gate); -#endif /// /// Releases the lock after has enqueued, and delivers. @@ -137,7 +116,7 @@ internal void ExitLockAndDrain(DrainableBase source) if (_drainThreadId == currentThreadId) { var inlineCount = _isTerminated ? 0 : source.InlineDeliverableCount; - ExitLock(); + _gate.Exit(); DeliverInline(source, inlineCount); return; } @@ -149,7 +128,7 @@ internal void ExitLockAndDrain(DrainableBase source) shouldDrain = true; } - ExitLock(); + _gate.Exit(); if (shouldDrain) { @@ -172,16 +151,16 @@ private void DrainAll() // Atomically re-check for work and release ownership if there is none. Checking // and releasing in separate lock scopes would let a producer enqueue in between, // see that a drain is in progress, and rely on us to deliver an item we never saw. - EnterLock(); + _gate.Enter(); if (_order.Count != 0 && !_isTerminated) { - ExitLock(); + _gate.Exit(); continue; } _drainThreadId = -1; - ExitLock(); + _gate.Exit(); return; } } @@ -195,9 +174,9 @@ private void DrainAll() [MethodImpl(MethodImplOptions.AggressiveInlining)] private void ReleaseDrainOwnership() { - EnterLock(); + _gate.Enter(); _drainThreadId = -1; - ExitLock(); + _gate.Exit(); } /// @@ -209,17 +188,17 @@ private bool DrainPending() { while (true) { - EnterLock(); + _gate.Enter(); if (_isTerminated) { - ExitLock(); + _gate.Exit(); return false; } if (_order.Count == 0) { - ExitLock(); + _gate.Exit(); return true; } @@ -229,7 +208,7 @@ private bool DrainPending() // has been disposed since, which drops its pending notifications. Skip it. if (!source.TryStageNext()) { - ExitLock(); + _gate.Exit(); continue; } @@ -252,11 +231,11 @@ private void DeliverInline(DrainableBase source, int count) { for (var i = 0; i < count; i++) { - EnterLock(); + _gate.Enter(); if (_isTerminated || !source.TryStageInline()) { - ExitLock(); + _gate.Exit(); return; } @@ -277,7 +256,7 @@ private bool ExitLockAndDeliverStaged(DrainableBase source) { var isError = source.IsStagedError; - ExitLock(); + _gate.Exit(); source.DeliverStaged(); @@ -286,10 +265,10 @@ private bool ExitLockAndDeliverStaged(DrainableBase source) return true; } - EnterLock(); + _gate.Enter(); _isTerminated = true; _order.Clear(); - ExitLock(); + _gate.Exit(); return false; } @@ -302,7 +281,7 @@ public ref struct ReadOnlyScopedAccess internal ReadOnlyScopedAccess(SharedDeliveryQueue owner) { _owner = owner; - owner.EnterLock(); + owner._gate.Enter(); } /// Gets a value indicating whether any notification is pending or in flight. @@ -323,7 +302,7 @@ public void Dispose() } _owner = null; - owner.ExitLock(); + owner._gate.Exit(); } } } @@ -539,4 +518,4 @@ public void Dispose() owner._parent.ExitLockAndDrain(owner); } } -} \ No newline at end of file +} diff --git a/src/DynamicData/Internal/SwappableLock.cs b/src/DynamicData/Internal/SwappableLock.cs index 6b9fd31f3..09e79cd34 100644 --- a/src/DynamicData/Internal/SwappableLock.cs +++ b/src/DynamicData/Internal/SwappableLock.cs @@ -4,8 +4,6 @@ namespace DynamicData; -#if NET9_0_OR_GREATER - internal ref struct SwappableLock { public static SwappableLock CreateAndEnter(Lock gate) @@ -35,52 +33,3 @@ public void Dispose() private Lock? _gate; } - -#else - -internal ref struct SwappableLock -{ - public static SwappableLock CreateAndEnter(object gate) - { - var result = new SwappableLock() - { - _gate = gate - }; - - Monitor.Enter(gate, ref result._hasLock); - - return result; - } - - public void SwapTo(object gate) - { - if (_gate is null) - throw new InvalidOperationException("Lock is not initialized"); - - var hasNewLock = false; - Monitor.Enter(gate, ref hasNewLock); - - if (_hasLock) - { - Monitor.Exit(_gate); - } - - _hasLock = hasNewLock; - _gate = gate; - } - - public void Dispose() - { - if (_hasLock && (_gate is not null)) - { - Monitor.Exit(_gate); - _hasLock = false; - _gate = null; - } - } - - private bool _hasLock; - private object? _gate; -} - -#endif diff --git a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs index 063e9270a..d662bb542 100644 --- a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs +++ b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs @@ -41,11 +41,7 @@ public static IObservable SynchronizeSafe(this IObservable source, Shar // Routes the source through an implicitly created DeliveryQueue. Drop-in replacement // for Observable.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 Observable.Create(observer => { var queue = new DeliveryQueue(gate, observer); diff --git a/src/DynamicData/Kernel/EnumerableEx.cs b/src/DynamicData/Kernel/EnumerableEx.cs index afeca3d3e..521acea3a 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)); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(itemsToFind); + ArgumentNullException.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 68e6fa47d..341d345b2 100644 --- a/src/DynamicData/Kernel/InternalEx.cs +++ b/src/DynamicData/Kernel/InternalEx.cs @@ -14,12 +14,6 @@ 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. /// @@ -84,7 +78,7 @@ public static IDisposable ScheduleRecurringAction(this IScheduler scheduler, Tim /// A disposable that will stop the schedule. public static IDisposable ScheduleRecurringAction(this IScheduler scheduler, Func interval, Action action) { - interval.ThrowArgumentNullExceptionIfNull(nameof(interval)); + ArgumentNullException.ThrowIfNull(interval); return scheduler.Schedule( interval(), diff --git a/src/DynamicData/Kernel/OptionElse.cs b/src/DynamicData/Kernel/OptionElse.cs index d644e62de..f17e6751b 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)); + ArgumentNullException.ThrowIfNull(action); if (_shouldRunAction) { diff --git a/src/DynamicData/Kernel/OptionExtensions.cs b/src/DynamicData/Kernel/OptionExtensions.cs index 0c6c982cc..8acc06178 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)); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.ThrowIfNull(converter); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.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 bbb23a052..c79825797 100644 --- a/src/DynamicData/Kernel/OptionObservableExtensions.cs +++ b/src/DynamicData/Kernel/OptionObservableExtensions.cs @@ -26,8 +26,8 @@ public static IObservable> Convert where TSource : notnull where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(converter); return source.Select(optional => optional.HasValue ? converter(optional.Value) : Optional.None()); } @@ -47,8 +47,8 @@ public static IObservable> Convert where TSource : notnull where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - converter.ThrowArgumentNullExceptionIfNull(nameof(converter)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(converter); return source.Select(optional => optional.HasValue ? converter(optional.Value) : Optional.None()); } @@ -73,9 +73,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(converter); + ArgumentNullException.ThrowIfNull(fallbackConverter); return source.Select(optional => optional.HasValue ? converter(optional.Value) : fallbackConverter()); } @@ -96,8 +96,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(fallbackOperation); return source.Select(optional => optional.HasValue ? optional : fallbackOperation()); } @@ -114,8 +114,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(action); return source.Do(optional => optional.IfHasValue(action).Else(() => elseAction?.Invoke())); } @@ -131,8 +131,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(action); return source.Do(optional => optional.IfHasValue(val => elseAction?.Invoke(val)).Else(action)); } @@ -161,7 +161,7 @@ public static IObservable SelectValues(this IObservable> sourc public static IObservable ValueOr(this IObservable> source, Func valueSelector) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Select(optional => optional.HasValue ? optional.Value : valueSelector()); } @@ -176,7 +176,7 @@ public static IObservable ValueOr(this IObservable> source, Fu public static IObservable ValueOrDefault(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Select(optional => optional.ValueOrDefault()); } @@ -194,9 +194,9 @@ public static IObservable ValueOr(this IObservable> source, Fu public static IObservable ValueOrThrow(this IObservable> source, Func exceptionGenerator) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); - exceptionGenerator.ThrowArgumentNullExceptionIfNull(nameof(exceptionGenerator)); + ArgumentNullException.ThrowIfNull(exceptionGenerator); return Observable.Create(observer => source.Subscribe( diff --git a/src/DynamicData/Kernel/ParallelEx.cs b/src/DynamicData/Kernel/ParallelEx.cs index c5b1ff14d..c2377e9a5 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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 90d8e3abc..dfd1e130f 100644 --- a/src/DynamicData/List/ChangeAwareList.cs +++ b/src/DynamicData/List/ChangeAwareList.cs @@ -33,7 +33,7 @@ public ChangeAwareList(int capacity = -1) => /// The items to seed the change aware list with. public ChangeAwareList(IEnumerable items) { - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentNullException.ThrowIfNull(items); var list = items.ToList(); @@ -53,7 +53,7 @@ public ChangeAwareList(IEnumerable items) /// Should the list of changes also be copied over?. public ChangeAwareList(ChangeAwareList list, bool copyChanges) { - list.ThrowArgumentNullExceptionIfNull(nameof(list)); + ArgumentNullException.ThrowIfNull(list); _innerList = new List(list._innerList); @@ -375,15 +375,8 @@ public bool Remove(T item) /// The index to remove the item at. public void RemoveAt(int index) { - if (index < 0) - { - throw new ArgumentException($"{nameof(index)} cannot be negative"); - } - - if (index > _innerList.Count) - { - throw new ArgumentOutOfRangeException(nameof(index), $"{nameof(index)} cannot be greater than the size of the collection"); - } + ArgumentOutOfRangeException.ThrowIfNegative(index); + ArgumentOutOfRangeException.ThrowIfGreaterThan(index, _innerList.Count); RemoveItem(index); } @@ -394,10 +387,10 @@ public void RemoveAt(int index) /// 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 . public void RemoveRange(int index, int count) { - if (index >= _innerList.Count || index + count > _innerList.Count) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } + ArgumentOutOfRangeException.ThrowIfNegative(index); + ArgumentOutOfRangeException.ThrowIfNegative(count); + ArgumentOutOfRangeException.ThrowIfGreaterThan(count, _innerList.Count); + ArgumentOutOfRangeException.ThrowIfGreaterThan(index, _innerList.Count - count); var toRemove = _innerList.Skip(index).Take(count).ToList(); if (toRemove.Count == 0) diff --git a/src/DynamicData/List/ChangeSetEx.cs b/src/DynamicData/List/ChangeSetEx.cs index 7abe7c5fa..3110bf823 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)); + ArgumentNullException.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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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)); + ArgumentNullException.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)); + ArgumentNullException.ThrowIfNull(source); return new UnifiedChangeEnumerator(source); } diff --git a/src/DynamicData/List/Internal/AnonymousObservableList.cs b/src/DynamicData/List/Internal/AnonymousObservableList.cs index 79051b1d6..643b01d77 100644 --- a/src/DynamicData/List/Internal/AnonymousObservableList.cs +++ b/src/DynamicData/List/Internal/AnonymousObservableList.cs @@ -17,7 +17,7 @@ internal sealed class AnonymousObservableList : IObservableList public AnonymousObservableList(IObservable> source) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); _sourceList = new SourceList(source); _cleanUp = _sourceList; diff --git a/src/DynamicData/List/Internal/AutoRefresh.cs b/src/DynamicData/List/Internal/AutoRefresh.cs index da2e4dc6a..fa25f1583 100644 --- a/src/DynamicData/List/Internal/AutoRefresh.cs +++ b/src/DynamicData/List/Internal/AutoRefresh.cs @@ -17,7 +17,7 @@ internal sealed class AutoRefresh(IObservable public IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var allItems = new List(); diff --git a/src/DynamicData/List/Internal/BufferIf.cs b/src/DynamicData/List/Internal/BufferIf.cs index 8f7d1993c..5456279e1 100644 --- a/src/DynamicData/List/Internal/BufferIf.cs +++ b/src/DynamicData/List/Internal/BufferIf.cs @@ -23,7 +23,7 @@ internal sealed class BufferIf(IObservable> source, IObservable public IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var paused = initialPauseState; var buffer = new ChangeSet(); var timeoutSubscriber = new SerialDisposable(); diff --git a/src/DynamicData/List/Internal/Combiner.cs b/src/DynamicData/List/Internal/Combiner.cs index 64882a3ba..249c91cad 100644 --- a/src/DynamicData/List/Internal/Combiner.cs +++ b/src/DynamicData/List/Internal/Combiner.cs @@ -12,11 +12,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)); diff --git a/src/DynamicData/List/Internal/DisposeMany.cs b/src/DynamicData/List/Internal/DisposeMany.cs index 046e19e4d..1d75a909c 100644 --- a/src/DynamicData/List/Internal/DisposeMany.cs +++ b/src/DynamicData/List/Internal/DisposeMany.cs @@ -14,11 +14,11 @@ internal sealed class DisposeMany(IObservable> source) public IObservable> Run() => Observable.Create>(observer => { - // Will be locking on cachedItems directly, instead of using an anonymous gate object. This is acceptable, since it's a privately-held object, there's no risk of deadlock from other consumers locking on it. + var synchronizationGate = new Lock(); var cachedItems = new List(); var sourceSubscription = source - .Synchronize(cachedItems) + .Synchronize(synchronizationGate) .SubscribeSafe(Observer.Create>( onNext: changeSet => { @@ -77,7 +77,7 @@ public IObservable> Run() { sourceSubscription.Dispose(); - lock (cachedItems) + lock (synchronizationGate) { ProcessFinalization(cachedItems); } diff --git a/src/DynamicData/List/Internal/DynamicCombiner.cs b/src/DynamicData/List/Internal/DynamicCombiner.cs index bb3091378..fd3a41645 100644 --- a/src/DynamicData/List/Internal/DynamicCombiner.cs +++ b/src/DynamicData/List/Internal/DynamicCombiner.cs @@ -12,11 +12,7 @@ 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)); diff --git a/src/DynamicData/List/Internal/ExpireAfter.cs b/src/DynamicData/List/Internal/ExpireAfter.cs index 97a39c84e..47445ea60 100644 --- a/src/DynamicData/List/Internal/ExpireAfter.cs +++ b/src/DynamicData/List/Internal/ExpireAfter.cs @@ -19,8 +19,8 @@ public static IObservable> Create( TimeSpan? pollingInterval = null, IScheduler? scheduler = null) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - timeSelector.ThrowArgumentNullExceptionIfNull(nameof(timeSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(timeSelector); return Observable.Create>(observer => (pollingInterval is { } pollingIntervalValue) ? new PollingSubscription( @@ -46,6 +46,7 @@ private abstract class SubscriptionBase private readonly IScheduler _scheduler; private readonly ISourceList _source; private readonly IDisposable _sourceSubscription; + private readonly Lock _synchronizationGate; private readonly Func _timeSelector; private bool _hasSourceCompleted; @@ -62,6 +63,7 @@ protected SubscriptionBase( _timeSelector = timeSelector; _scheduler = scheduler ?? GlobalConfig.DefaultScheduler; + _synchronizationGate = new(); _onEditingSource = OnEditingSource; @@ -72,7 +74,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) + .Synchronize(_synchronizationGate) .SubscribeSafe( onNext: OnSourceNext, onError: OnSourceError, @@ -81,7 +83,7 @@ protected SubscriptionBase( public void Dispose() { - lock (SynchronizationGate) + lock (_synchronizationGate) { _sourceSubscription.Dispose(); @@ -92,10 +94,6 @@ public void Dispose() 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. - protected object SynchronizationGate - => _expirationDueTimes; - protected abstract DateTimeOffset? GetNextManagementDueTime(); protected DateTimeOffset? GetNextProposedExpirationDueTime() @@ -131,7 +129,7 @@ private void ManageExpirations() private void OnEditingSource(IExtendedList updater) { - lock (SynchronizationGate) + lock (_synchronizationGate) { // The scheduler only promises "best effort" to cancel scheduled operations, so we need to make sure. if (_nextScheduledManagement is not { } thisScheduledManagement) diff --git a/src/DynamicData/List/Internal/Filter.Dynamic.cs b/src/DynamicData/List/Internal/Filter.Dynamic.cs index 8d9b5e8dc..c94680aab 100644 --- a/src/DynamicData/List/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/List/Internal/Filter.Dynamic.cs @@ -36,7 +36,7 @@ public Dynamic(IObservable> source, Func predicate, ListF public IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); Func predicate = _ => false; var all = new List(); diff --git a/src/DynamicData/List/Internal/Filter.Static.cs b/src/DynamicData/List/Internal/Filter.Static.cs index 48b12020c..0d435cde9 100644 --- a/src/DynamicData/List/Internal/Filter.Static.cs +++ b/src/DynamicData/List/Internal/Filter.Static.cs @@ -16,8 +16,8 @@ public static IObservable> Create( Func predicate, bool suppressEmptyChangesets) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 c9f04be4f..0f448aaf6 100644 --- a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs +++ b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs @@ -20,11 +20,11 @@ public static IObservable> Create( ListFilterPolicy filterPolicy = ListFilterPolicy.CalculateDiff, bool suppressEmptyChangeSets = true) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - predicateState.ThrowArgumentNullExceptionIfNull(nameof(predicateState)); - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(predicateState); + ArgumentNullException.ThrowIfNull(predicate); - if (!EnumEx.IsDefined(filterPolicy)) + if (!Enum.IsDefined(filterPolicy)) throw new ArgumentException($"Invalid {nameof(ListFilterPolicy)} value {filterPolicy}"); return Observable.Create>(observer => @@ -52,11 +52,13 @@ private abstract class SubscriptionBase { private readonly List> _downstreamChangesBuffer; private readonly IObserver> _downstreamObserver; + private readonly Lock _downstreamSynchronizationGate; private readonly List _itemsBuffer; private readonly List _itemStates; private readonly List _itemStatesBuffer; private readonly Func _predicate; private readonly bool _suppressEmptyChangeSets; + private readonly Lock _upstreamSynchronizationGate; private bool _hasPredicateStateCompleted; private bool _hasSourceCompleted; @@ -74,6 +76,9 @@ protected SubscriptionBase( _predicate = predicate; _suppressEmptyChangeSets = suppressEmptyChangeSets; + _downstreamSynchronizationGate = new(); + _upstreamSynchronizationGate = new(); + _downstreamChangesBuffer = new(); _itemsBuffer = new(); _itemStates = new(); @@ -146,12 +151,6 @@ protected Func Predicate protected abstract void PerformReplace(ItemChange change); - private object DownstreamSynchronizationGate - => _downstreamChangesBuffer; - - private object UpstreamSynchronizationGate - => _itemStates; - private IChangeSet AssembleDownstreamChanges() { if (_downstreamChangesBuffer.Count is 0) @@ -169,17 +168,19 @@ private void OnError(Exception error) var hasDownstreamLock = false; try { - Monitor.Enter(UpstreamSynchronizationGate, ref hasUpstreamLock); + _upstreamSynchronizationGate.Enter(); + hasUpstreamLock = true; _predicateStateSubscription?.Dispose(); _sourceSubscription?.Dispose(); - Monitor.Enter(DownstreamSynchronizationGate, ref hasDownstreamLock); + _downstreamSynchronizationGate.Enter(); + hasDownstreamLock = true; if (hasUpstreamLock) { - Monitor.Exit(UpstreamSynchronizationGate); hasUpstreamLock = false; + _upstreamSynchronizationGate.Exit(); } _downstreamObserver.OnError(error); @@ -187,10 +188,10 @@ private void OnError(Exception error) finally { if (hasUpstreamLock) - Monitor.Exit(UpstreamSynchronizationGate); + _upstreamSynchronizationGate.Exit(); if (hasDownstreamLock) - Monitor.Exit(DownstreamSynchronizationGate); + _downstreamSynchronizationGate.Exit(); } } @@ -200,7 +201,8 @@ private void OnPredicateStateCompleted() var hasDownstreamLock = false; try { - Monitor.Enter(UpstreamSynchronizationGate, ref hasUpstreamLock); + _upstreamSynchronizationGate.Enter(); + hasUpstreamLock = true; _hasPredicateStateCompleted = true; @@ -208,12 +210,13 @@ private void OnPredicateStateCompleted() // no matter how many items come through from source, so just go ahead and complete now. if (_hasSourceCompleted || (!_isLatestPredicateStateValid && _suppressEmptyChangeSets)) { - Monitor.Enter(DownstreamSynchronizationGate, ref hasDownstreamLock); + _downstreamSynchronizationGate.Enter(); + hasDownstreamLock = true; if (hasUpstreamLock) { - Monitor.Exit(UpstreamSynchronizationGate); hasUpstreamLock = false; + _upstreamSynchronizationGate.Exit(); } _downstreamObserver.OnCompleted(); @@ -222,10 +225,10 @@ private void OnPredicateStateCompleted() finally { if (hasUpstreamLock) - Monitor.Exit(UpstreamSynchronizationGate); + _upstreamSynchronizationGate.Exit(); if (hasDownstreamLock) - Monitor.Exit(DownstreamSynchronizationGate); + _downstreamSynchronizationGate.Exit(); } } @@ -235,7 +238,8 @@ private void OnPredicateStateNext(TState predicateState) var hasDownstreamLock = false; try { - Monitor.Enter(UpstreamSynchronizationGate, ref hasUpstreamLock); + _upstreamSynchronizationGate.Enter(); + hasUpstreamLock = true; _latestPredicateState = predicateState; _isLatestPredicateStateValid = true; @@ -246,12 +250,13 @@ private void OnPredicateStateNext(TState predicateState) if ((downstreamChanges.Count is not 0) || !_suppressEmptyChangeSets) { - Monitor.Enter(DownstreamSynchronizationGate, ref hasDownstreamLock); + _downstreamSynchronizationGate.Enter(); + hasDownstreamLock = true; if (hasUpstreamLock) { - Monitor.Exit(UpstreamSynchronizationGate); hasUpstreamLock = false; + _upstreamSynchronizationGate.Exit(); } _downstreamObserver.OnNext(downstreamChanges); @@ -260,10 +265,10 @@ private void OnPredicateStateNext(TState predicateState) finally { if (hasUpstreamLock) - Monitor.Exit(UpstreamSynchronizationGate); + _upstreamSynchronizationGate.Exit(); if (hasDownstreamLock) - Monitor.Exit(DownstreamSynchronizationGate); + _downstreamSynchronizationGate.Exit(); } } @@ -273,7 +278,8 @@ private void OnSourceCompleted() var hasDownstreamLock = false; try { - Monitor.Enter(UpstreamSynchronizationGate, ref hasUpstreamLock); + _upstreamSynchronizationGate.Enter(); + hasUpstreamLock = true; _hasSourceCompleted = true; @@ -281,12 +287,13 @@ 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)) { - Monitor.Enter(DownstreamSynchronizationGate, ref hasDownstreamLock); + _downstreamSynchronizationGate.Enter(); + hasDownstreamLock = true; if (hasUpstreamLock) { - Monitor.Exit(UpstreamSynchronizationGate); hasUpstreamLock = false; + _upstreamSynchronizationGate.Exit(); } _downstreamObserver.OnCompleted(); @@ -295,10 +302,10 @@ private void OnSourceCompleted() finally { if (hasUpstreamLock) - Monitor.Exit(UpstreamSynchronizationGate); + _upstreamSynchronizationGate.Exit(); if (hasDownstreamLock) - Monitor.Exit(DownstreamSynchronizationGate); + _downstreamSynchronizationGate.Exit(); } } @@ -308,7 +315,8 @@ private void OnSourceNext(IChangeSet upstreamChanges) var hasDownstreamLock = false; try { - Monitor.Enter(UpstreamSynchronizationGate, ref hasUpstreamLock); + _upstreamSynchronizationGate.Enter(); + hasUpstreamLock = true; foreach (var change in upstreamChanges) { @@ -354,12 +362,13 @@ private void OnSourceNext(IChangeSet upstreamChanges) if ((downstreamChanges.Count is not 0) || !_suppressEmptyChangeSets) { - Monitor.Enter(DownstreamSynchronizationGate, ref hasDownstreamLock); + _downstreamSynchronizationGate.Enter(); + hasDownstreamLock = true; if (hasUpstreamLock) { - Monitor.Exit(UpstreamSynchronizationGate); hasUpstreamLock = false; + _upstreamSynchronizationGate.Exit(); } _downstreamObserver.OnNext(downstreamChanges); @@ -368,10 +377,10 @@ private void OnSourceNext(IChangeSet upstreamChanges) finally { if (hasUpstreamLock) - Monitor.Exit(UpstreamSynchronizationGate); + _upstreamSynchronizationGate.Exit(); if (hasDownstreamLock) - Monitor.Exit(DownstreamSynchronizationGate); + _downstreamSynchronizationGate.Exit(); } } diff --git a/src/DynamicData/List/Internal/FilterOnObservable.cs b/src/DynamicData/List/Internal/FilterOnObservable.cs index 1d2dae5e0..7a18fbc85 100644 --- a/src/DynamicData/List/Internal/FilterOnObservable.cs +++ b/src/DynamicData/List/Internal/FilterOnObservable.cs @@ -17,7 +17,7 @@ internal sealed class FilterOnObservable(IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var allItems = new List(); @@ -49,9 +49,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(itemsToFind); + ArgumentNullException.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/GroupOn.cs b/src/DynamicData/List/Internal/GroupOn.cs index 6ea7deccd..0afd2f250 100644 --- a/src/DynamicData/List/Internal/GroupOn.cs +++ b/src/DynamicData/List/Internal/GroupOn.cs @@ -27,7 +27,7 @@ public IObservable>> Run() => Observable.C // capture the grouping up front which has the benefit that the group key is only selected once var itemsWithGroup = _source.Transform((t, previous) => new ItemWithGroupKey(t, _groupSelector(t), previous.Convert(p => p.Group)), true); - var locker = InternalEx.NewLock(); + var locker = new Lock(); var shared = itemsWithGroup.Synchronize(locker).Publish(); var grouper = shared.Select(changes => Process(groupings, groupCache, changes)); diff --git a/src/DynamicData/List/Internal/GroupOnImmutable.cs b/src/DynamicData/List/Internal/GroupOnImmutable.cs index 2b4a08be8..d389561f9 100644 --- a/src/DynamicData/List/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/List/Internal/GroupOnImmutable.cs @@ -30,7 +30,7 @@ public IObservable>> Run() => Observabl // capture the grouping up front which has the benefit that the group key is only selected once var itemsWithGroup = _source.Transform((t, previous) => new ItemWithGroupKey(t, _groupSelector(t), previous.Convert(p => p.Group)), true); - var locker = InternalEx.NewLock(); + var locker = new Lock(); var shared = itemsWithGroup.Synchronize(locker).Publish(); var grouper = shared.Select(changes => Process(groupings, groupCache, changes)); diff --git a/src/DynamicData/List/Internal/LimitSizeTo.cs b/src/DynamicData/List/Internal/LimitSizeTo.cs index c2ed74896..53cb0442a 100644 --- a/src/DynamicData/List/Internal/LimitSizeTo.cs +++ b/src/DynamicData/List/Internal/LimitSizeTo.cs @@ -7,12 +7,7 @@ namespace DynamicData.List.Internal; -#if NET9_0_OR_GREATER internal sealed class LimitSizeTo(ISourceList sourceList, int sizeLimit, IScheduler scheduler, Lock locker) -#else -internal sealed class LimitSizeTo(ISourceList sourceList, int sizeLimit, IScheduler scheduler, object locker) -#endif - where T : notnull { private readonly IScheduler _scheduler = scheduler ?? throw new ArgumentNullException(nameof(scheduler)); diff --git a/src/DynamicData/List/Internal/MergeChangeSets.cs b/src/DynamicData/List/Internal/MergeChangeSets.cs index 480c69b3a..6248ef7ea 100644 --- a/src/DynamicData/List/Internal/MergeChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeChangeSets.cs @@ -21,7 +21,7 @@ public MergeChangeSets(IEnumerable>> source, IEq public IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); // This is manages all of the changes var changeTracker = new ChangeSetMergeTracker(); @@ -49,20 +49,10 @@ private static IObservable>> CreateObservable(IE } // Can optimize for the Add case because that's the only one that applies -#if NET9_0_OR_GREATER 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 private IObservable>> CreateClonedListObservable(IObservable>> source, Lock locker) => source.Select(src => new ChangeSet>(new[] { CreateChange(src, locker) })); -#else - 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 - 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 65b238068..1151bcb3c 100644 --- a/src/DynamicData/List/Internal/MergeMany.cs +++ b/src/DynamicData/List/Internal/MergeMany.cs @@ -19,7 +19,7 @@ public IObservable Run() => Observable.Create( observer => { var counter = new SubscriptionCounter(); - var locker = InternalEx.NewLock(); + var locker = new Lock(); var disposable = _source.Concat(counter.DeferCleanup) .SubscribeMany(t => { diff --git a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs index 3b63ea231..92601637d 100644 --- a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs @@ -20,7 +20,7 @@ internal sealed class MergeManyCacheChangeSets> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var list = new List>(); var parentUpdate = false; diff --git a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs index 482c4f46b..7682cccf5 100644 --- a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyListChangeSets.cs @@ -18,7 +18,7 @@ internal sealed class MergeManyListChangeSets(IObservable public IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var parentUpdate = false; // This is manages all of the changes diff --git a/src/DynamicData/List/Internal/OnItemAdded.cs b/src/DynamicData/List/Internal/OnItemAdded.cs index c99b48d92..c041b3575 100644 --- a/src/DynamicData/List/Internal/OnItemAdded.cs +++ b/src/DynamicData/List/Internal/OnItemAdded.cs @@ -13,8 +13,8 @@ public static IObservable> Create( IObservable> source, Action addAction) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - addAction.ThrowArgumentNullExceptionIfNull(nameof(addAction)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(addAction); return source.Do(changeSet => { diff --git a/src/DynamicData/List/Internal/OnItemRefreshed.cs b/src/DynamicData/List/Internal/OnItemRefreshed.cs index f12e68294..527237cdc 100644 --- a/src/DynamicData/List/Internal/OnItemRefreshed.cs +++ b/src/DynamicData/List/Internal/OnItemRefreshed.cs @@ -13,8 +13,8 @@ public static IObservable> Create( IObservable> source, Action refreshAction) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - refreshAction.ThrowArgumentNullExceptionIfNull(nameof(refreshAction)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(refreshAction); return source.Do(changeSet => { diff --git a/src/DynamicData/List/Internal/OnItemRemoved.cs b/src/DynamicData/List/Internal/OnItemRemoved.cs index 178066bf2..6629d265f 100644 --- a/src/DynamicData/List/Internal/OnItemRemoved.cs +++ b/src/DynamicData/List/Internal/OnItemRemoved.cs @@ -14,8 +14,8 @@ public static IObservable> Create( Action removeAction, bool invokeOnUnsubscribe) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - removeAction.ThrowArgumentNullExceptionIfNull(nameof(removeAction)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(removeAction); var removalProcessor = source.Do(changeSet => { diff --git a/src/DynamicData/List/Internal/Pager.cs b/src/DynamicData/List/Internal/Pager.cs index bd3238d2a..abdf04d4d 100644 --- a/src/DynamicData/List/Internal/Pager.cs +++ b/src/DynamicData/List/Internal/Pager.cs @@ -17,7 +17,7 @@ internal sealed class Pager(IObservable> source, IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var all = new List(); var paged = new ChangeAwareList(); diff --git a/src/DynamicData/List/Internal/ReaderWriter.cs b/src/DynamicData/List/Internal/ReaderWriter.cs index 57b413867..13f9c746e 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(); @@ -43,7 +39,7 @@ public T[] Items public IChangeSet Write(IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentNullException.ThrowIfNull(changes); IChangeSet result; @@ -58,7 +54,7 @@ public IChangeSet Write(IChangeSet changes) public IChangeSet Write(Action> updateAction) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentNullException.ThrowIfNull(updateAction); IChangeSet result; @@ -82,7 +78,7 @@ public IChangeSet Write(Action> updateAction) /// The action to perform on the list. public void WriteNested(Action> updateAction) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentNullException.ThrowIfNull(updateAction); lock (_locker) { @@ -97,8 +93,8 @@ public void WriteNested(Action> updateAction) public IChangeSet WriteWithPreview(Action> updateAction, Action> previewHandler) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); - previewHandler.ThrowArgumentNullExceptionIfNull(nameof(previewHandler)); + ArgumentNullException.ThrowIfNull(updateAction); + ArgumentNullException.ThrowIfNull(previewHandler); IChangeSet result; diff --git a/src/DynamicData/List/Internal/RefCount.cs b/src/DynamicData/List/Internal/RefCount.cs index b40036c3e..66279974e 100644 --- a/src/DynamicData/List/Internal/RefCount.cs +++ b/src/DynamicData/List/Internal/RefCount.cs @@ -10,11 +10,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/ReferenceCountTracker.cs b/src/DynamicData/List/Internal/ReferenceCountTracker.cs index 6959b83eb..89afcd861 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)); + ArgumentNullException.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)); + ArgumentNullException.ThrowIfNull(item); var currentCount = ReferenceCounts[item]; diff --git a/src/DynamicData/List/Internal/Sort.cs b/src/DynamicData/List/Internal/Sort.cs index ff03e2e70..730f42f07 100644 --- a/src/DynamicData/List/Internal/Sort.cs +++ b/src/DynamicData/List/Internal/Sort.cs @@ -19,7 +19,7 @@ internal sealed class Sort(IObservable> source, IComparer? c public IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var original = new List(); var target = new ChangeAwareList(); diff --git a/src/DynamicData/List/Internal/ToObservableChangeSet.cs b/src/DynamicData/List/Internal/ToObservableChangeSet.cs index 8d1f853d2..3dcc3dc56 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -19,7 +19,7 @@ public static IObservable> Create( int limitSizeTo, IScheduler? scheduler) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return Observable.Create>(downstreamObserver => { @@ -45,7 +45,7 @@ public static IObservable> Create( int limitSizeTo, IScheduler? scheduler) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return Observable.Create>(downstreamObserver => new Subscription( downstreamObserver: downstreamObserver, @@ -65,11 +65,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; diff --git a/src/DynamicData/List/Internal/TransformAsync.cs b/src/DynamicData/List/Internal/TransformAsync.cs index 31f45b1a4..c9fa87282 100644 --- a/src/DynamicData/List/Internal/TransformAsync.cs +++ b/src/DynamicData/List/Internal/TransformAsync.cs @@ -20,7 +20,7 @@ public TransformAsync( Func, int, CancellationToken, Task> factory, bool transformOnRefresh) { - factory.ThrowArgumentNullExceptionIfNull(nameof(factory)); + ArgumentNullException.ThrowIfNull(factory); _source = source ?? throw new ArgumentNullException(nameof(source)); _transformOnRefresh = transformOnRefresh; @@ -89,7 +89,7 @@ private async Task Transform( IChangeSet changes, CancellationToken cancel) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentNullException.ThrowIfNull(changes); foreach (var item in changes) { diff --git a/src/DynamicData/List/Internal/TransformMany.cs b/src/DynamicData/List/Internal/TransformMany.cs index d7bb2a69e..83df7e1c0 100644 --- a/src/DynamicData/List/Internal/TransformMany.cs +++ b/src/DynamicData/List/Internal/TransformMany.cs @@ -116,13 +116,13 @@ private IObservable> CreateWithChangeSet() var transformed = _source.Transform( t => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var collection = manySelector(t); var changes = childChanges(t).Synchronize(locker).Skip(1); 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); diff --git a/src/DynamicData/List/Internal/Transformer.cs b/src/DynamicData/List/Internal/Transformer.cs index 69dbb11b2..3df97995a 100644 --- a/src/DynamicData/List/Internal/Transformer.cs +++ b/src/DynamicData/List/Internal/Transformer.cs @@ -18,7 +18,7 @@ internal sealed class Transformer public Transformer(IObservable> source, Func, int, TDestination> factory, bool transformOnRefresh) { - factory.ThrowArgumentNullExceptionIfNull(nameof(factory)); + ArgumentNullException.ThrowIfNull(factory); _source = source ?? throw new ArgumentNullException(nameof(source)); _transformOnRefresh = transformOnRefresh; @@ -40,7 +40,7 @@ private IObservable> RunImpl() => _source.Scan(new Chan private void Transform(ChangeAwareList transformed, IChangeSet changes) { - changes.ThrowArgumentNullExceptionIfNull(nameof(changes)); + ArgumentNullException.ThrowIfNull(changes); foreach (var item in changes) { diff --git a/src/DynamicData/List/Internal/Virtualiser.cs b/src/DynamicData/List/Internal/Virtualiser.cs index bb2f894c2..ced3b742b 100644 --- a/src/DynamicData/List/Internal/Virtualiser.cs +++ b/src/DynamicData/List/Internal/Virtualiser.cs @@ -16,7 +16,7 @@ internal sealed class Virtualiser(IObservable> source, IObserva public IObservable> Run() => Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); var all = new List(); var virtualised = new ChangeAwareList(); diff --git a/src/DynamicData/List/ListEx.cs b/src/DynamicData/List/ListEx.cs index 7035b1d4d..a001792f0 100644 --- a/src/DynamicData/List/ListEx.cs +++ b/src/DynamicData/List/ListEx.cs @@ -25,8 +25,8 @@ public static class ListEx /// public static void Add(this IList source, IEnumerable items) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(items); items.ForEach(source.Add); } @@ -40,8 +40,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(items); switch (source) { @@ -87,8 +87,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(items); switch (source) { @@ -114,8 +114,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(items); switch (source) { @@ -150,7 +150,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)); + ArgumentNullException.ThrowIfNull(comparer); return list.BinarySearch(value, comparer.Compare); } @@ -167,8 +167,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)); + ArgumentNullException.ThrowIfNull(list); + ArgumentNullException.ThrowIfNull(comparer); var lower = 0; var upper = list.Count - 1; @@ -238,8 +238,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(changes); foreach (var item in changes) { @@ -266,8 +266,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(equalityComparer); var i = 0; foreach (var candidate in source) @@ -311,8 +311,8 @@ public static Optional> IndexOfOptional(this IEnumerable /// public static void Remove(this IList source, IEnumerable items) { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - items.ThrowArgumentNullExceptionIfNull(nameof(items)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(items); items.ForEach(t => source.Remove(t)); } @@ -330,8 +330,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(itemsToRemove); var toRemoveArray = itemsToRemove.AsArray(); @@ -367,9 +367,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(original); + ArgumentNullException.ThrowIfNull(replaceWith); var index = source.IndexOf(original); if (index == -1) @@ -393,10 +393,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(original); + ArgumentNullException.ThrowIfNull(replaceWith); + ArgumentNullException.ThrowIfNull(comparer); var index = source.IndexOf(original); if (index == -1) @@ -419,9 +419,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(original); + ArgumentNullException.ThrowIfNull(replaceWith); var index = source.IndexOf(original); if (index == -1) @@ -627,7 +627,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)); + ArgumentNullException.ThrowIfNull(source); switch (source) { diff --git a/src/DynamicData/List/ObservableListEx.Adapt.cs b/src/DynamicData/List/ObservableListEx.Adapt.cs index 942d943c7..f1616cb84 100644 --- a/src/DynamicData/List/ObservableListEx.Adapt.cs +++ b/src/DynamicData/List/ObservableListEx.Adapt.cs @@ -42,13 +42,13 @@ 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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(adaptor); return Observable.Create>( observer => { - var locker = InternalEx.NewLock(); + var locker = new Lock(); return source.Synchronize(locker).Select( changes => { diff --git a/src/DynamicData/List/ObservableListEx.AddKey.cs b/src/DynamicData/List/ObservableListEx.AddKey.cs index 0ead13a87..69936e9d1 100644 --- a/src/DynamicData/List/ObservableListEx.AddKey.cs +++ b/src/DynamicData/List/ObservableListEx.AddKey.cs @@ -43,8 +43,8 @@ public static IObservable> AddKey(this where TObject : notnull where TKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 2dee36d90..aa31e0ddb 100644 --- a/src/DynamicData/List/ObservableListEx.And.cs +++ b/src/DynamicData/List/ObservableListEx.And.cs @@ -54,7 +54,7 @@ public static partial class ObservableListEx public static IObservable> And(this IObservable> source, params IObservable>[] others) where T : notnull { - others.ThrowArgumentNullExceptionIfNull(nameof(others)); + ArgumentNullException.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 478ae5b63..b40781f11 100644 --- a/src/DynamicData/List/ObservableListEx.AsObservableList.cs +++ b/src/DynamicData/List/ObservableListEx.AsObservableList.cs @@ -33,7 +33,7 @@ public static partial class ObservableListEx public static IObservableList AsObservableList(this ISourceList source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new AnonymousObservableList(source); } @@ -57,7 +57,7 @@ public static IObservableList AsObservableList(this ISourceList source) public static IObservableList AsObservableList(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new AnonymousObservableList(source); } diff --git a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs index d5e0660f8..98244f523 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs @@ -57,7 +57,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)); + ArgumentNullException.ThrowIfNull(source); return source.AutoRefreshOnObservable( t => @@ -82,8 +82,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(propertyAccessor); return source.AutoRefreshOnObservable( t => diff --git a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs index dc3ede92c..c3b7d88b0 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs @@ -55,8 +55,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 fe14bece5..423430dc5 100644 --- a/src/DynamicData/List/ObservableListEx.Bind.cs +++ b/src/DynamicData/List/ObservableListEx.Bind.cs @@ -57,8 +57,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 @@ -78,8 +78,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(targetCollection); var adaptor = new ObservableCollectionAdaptor(targetCollection, options); return source.Adapt(adaptor); @@ -98,7 +98,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)); + ArgumentNullException.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 @@ -123,7 +123,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)); + ArgumentNullException.ThrowIfNull(source); var target = new ObservableCollectionExtended(); var result = new ReadOnlyObservableCollection(target); @@ -140,8 +140,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 37224290f..1794fbd0b 100644 --- a/src/DynamicData/List/ObservableListEx.BufferIf.cs +++ b/src/DynamicData/List/ObservableListEx.BufferIf.cs @@ -39,8 +39,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(pauseIfTrueSelector); return BufferIf(source, pauseIfTrueSelector, initialPauseState, null, scheduler); } @@ -84,8 +84,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 7c0f9aad7..bdda8da92 100644 --- a/src/DynamicData/List/ObservableListEx.Cast.cs +++ b/src/DynamicData/List/ObservableListEx.Cast.cs @@ -35,7 +35,7 @@ public static partial class ObservableListEx public static IObservable> Cast(this IObservable> source) where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Select(changes => changes.Transform(t => (TDestination)t)); } @@ -56,9 +56,9 @@ public static IObservable> Cast( where TSource : notnull where TDestination : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); - conversionFactory.ThrowArgumentNullExceptionIfNull(nameof(conversionFactory)); + ArgumentNullException.ThrowIfNull(conversionFactory); return source.Select(changes => changes.Transform(conversionFactory)); } diff --git a/src/DynamicData/List/ObservableListEx.Clone.cs b/src/DynamicData/List/ObservableListEx.Clone.cs index 2588c8927..5d352e664 100644 --- a/src/DynamicData/List/ObservableListEx.Clone.cs +++ b/src/DynamicData/List/ObservableListEx.Clone.cs @@ -39,7 +39,7 @@ public static partial class ObservableListEx public static IObservable> Clone(this IObservable> source, IList target) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Do(target.Clone); } diff --git a/src/DynamicData/List/ObservableListEx.Combine.cs b/src/DynamicData/List/ObservableListEx.Combine.cs index 13a617439..3c9f6e37d 100644 --- a/src/DynamicData/List/ObservableListEx.Combine.cs +++ b/src/DynamicData/List/ObservableListEx.Combine.cs @@ -26,7 +26,7 @@ public static partial class ObservableListEx private static IObservable> Combine(this ICollection>> sources, CombineOperator type) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return new Combiner(sources, type).Run(); } @@ -34,8 +34,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(others); if (others.Length == 0) { @@ -49,7 +49,7 @@ private static IObservable> Combine(this IObservable> Combine(this IObservableList> sources, CombineOperator type) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return Observable.Create>( observer => @@ -63,7 +63,7 @@ private static IObservable> Combine(this IObservableList> Combine(this IObservableList> sources, CombineOperator type) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return Observable.Create>( observer => @@ -77,7 +77,7 @@ private static IObservable> Combine(this IObservableList> Combine(this IObservableList>> sources, CombineOperator type) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.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 4380c296d..1cec7f00a 100644 --- a/src/DynamicData/List/ObservableListEx.Convert.cs +++ b/src/DynamicData/List/ObservableListEx.Convert.cs @@ -37,9 +37,9 @@ public static IObservable> Convert changes.Transform(conversionFactory)); } diff --git a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs index 1e6b5d037..680eaa3d4 100644 --- a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs +++ b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs @@ -41,7 +41,7 @@ public static partial class ObservableListEx public static IObservable> DeferUntilLoaded(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new DeferUntilLoaded(source).Run(); } @@ -54,7 +54,7 @@ public static IObservable> DeferUntilLoaded(this IObservable> DeferUntilLoaded(this IObservableList source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Connect().DeferUntilLoaded(); } diff --git a/src/DynamicData/List/ObservableListEx.DisposeMany.cs b/src/DynamicData/List/ObservableListEx.DisposeMany.cs index ec463f21d..12690c3f8 100644 --- a/src/DynamicData/List/ObservableListEx.DisposeMany.cs +++ b/src/DynamicData/List/ObservableListEx.DisposeMany.cs @@ -53,7 +53,7 @@ public static partial class ObservableListEx public static IObservable> DisposeMany(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new DisposeMany(source).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.DistinctValues.cs b/src/DynamicData/List/ObservableListEx.DistinctValues.cs index 39181d6c8..3ec80ce62 100644 --- a/src/DynamicData/List/ObservableListEx.DistinctValues.cs +++ b/src/DynamicData/List/ObservableListEx.DistinctValues.cs @@ -51,9 +51,9 @@ public static IObservable> DistinctValues(th where TObject : notnull where TValue : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); - valueSelector.ThrowArgumentNullExceptionIfNull(nameof(valueSelector)); + ArgumentNullException.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 7c19912d8..dda249733 100644 --- a/src/DynamicData/List/ObservableListEx.Except.cs +++ b/src/DynamicData/List/ObservableListEx.Except.cs @@ -57,7 +57,7 @@ public static partial class ObservableListEx public static IObservable> Except(this IObservable> source, params IObservable>[] others) where T : notnull { - others.ThrowArgumentNullExceptionIfNull(nameof(others)); + ArgumentNullException.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 2165375b0..fefbf6b69 100644 --- a/src/DynamicData/List/ObservableListEx.Filter.cs +++ b/src/DynamicData/List/ObservableListEx.Filter.cs @@ -97,9 +97,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)); + ArgumentNullException.ThrowIfNull(source); - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); + ArgumentNullException.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 bd49bf1db..3def7723f 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs @@ -59,7 +59,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)); + ArgumentNullException.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 b9b297d77..5407a576c 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs @@ -43,11 +43,11 @@ 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)); + ArgumentNullException.ThrowIfNull(source); - propertySelector.ThrowArgumentNullExceptionIfNull(nameof(propertySelector)); + ArgumentNullException.ThrowIfNull(propertySelector); - predicate.ThrowArgumentNullExceptionIfNull(nameof(predicate)); + ArgumentNullException.ThrowIfNull(predicate); return new FilterOnProperty(source, propertySelector, predicate, propertyChangedThrottle, scheduler).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.ForEachChange.cs b/src/DynamicData/List/ObservableListEx.ForEachChange.cs index f4066e413..fcea5f87f 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachChange.cs @@ -49,9 +49,9 @@ public static partial class ObservableListEx public static IObservable> ForEachChange(this IObservable> source, Action> action) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentNullException.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 f39760fac..e908219b9 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs @@ -42,9 +42,9 @@ public static partial class ObservableListEx public static IObservable> ForEachItemChange(this IObservable> source, Action> action) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); - action.ThrowArgumentNullExceptionIfNull(nameof(action)); + ArgumentNullException.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 180c98ff6..301a8a12f 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOn.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOn.cs @@ -55,9 +55,9 @@ 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 4bf1bb98a..1ded39b63 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs @@ -48,9 +48,9 @@ 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 dad726079..92d456a85 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs @@ -49,9 +49,9 @@ public static partial class ObservableListEx where TObject : INotifyPropertyChanged where TGroup : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); - propertySelector.ThrowArgumentNullExceptionIfNull(nameof(propertySelector)); + ArgumentNullException.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 b607a56f4..1aff4860d 100644 --- a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs @@ -47,9 +47,9 @@ public static partial class ObservableListEx where TObject : notnull where TGroupKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); - groupSelectorKey.ThrowArgumentNullExceptionIfNull(nameof(groupSelectorKey)); + ArgumentNullException.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 fd01dcfa6..a726fc040 100644 --- a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs +++ b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs @@ -47,14 +47,14 @@ public static partial class ObservableListEx public static IObservable> LimitSizeTo(this ISourceList source, int sizeLimit, IScheduler? scheduler = null) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); if (sizeLimit <= 0) { throw new ArgumentException("sizeLimit cannot be zero", nameof(sizeLimit)); } - var locker = InternalEx.NewLock(); + var locker = new Lock(); var limiter = new LimitSizeTo(source, sizeLimit, scheduler ?? GlobalConfig.DefaultScheduler, locker); return limiter.Run().Synchronize(locker).Do(source.RemoveMany); diff --git a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs index 4f58c05cc..ffd9dab13 100644 --- a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs @@ -33,7 +33,7 @@ public static partial class ObservableListEx public static IObservable> MergeChangeSets(this IObservable>> source, IEqualityComparer? equalityComparer = null) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new MergeChangeSets(source, equalityComparer).Run(); } @@ -50,8 +50,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(other); return new[] { source, other }.MergeChangeSets(equalityComparer, scheduler, completable); } @@ -68,8 +68,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(others); return source.EnumerateOne().Concat(others).MergeChangeSets(equalityComparer, scheduler, completable); } @@ -105,7 +105,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)); + ArgumentNullException.ThrowIfNull(source); return new MergeChangeSets(source, equalityComparer, completable, scheduler).Run(); } @@ -117,7 +117,7 @@ public static IObservable> MergeChangeSets(this IEn public static IObservable> MergeChangeSets(this IObservableList>> source, IEqualityComparer? equalityComparer = null) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Connect().MergeChangeSets(equalityComparer); } @@ -130,7 +130,7 @@ public static IObservable> MergeChangeSets(this IOb public static IObservable> MergeChangeSets(this IObservable>>> source, IEqualityComparer? equalityComparer = null) where TObject : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.MergeManyChangeSets(static src => src, equalityComparer); } @@ -163,7 +163,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 55dfa4f19..0b83871d3 100644 --- a/src/DynamicData/List/ObservableListEx.MergeMany.cs +++ b/src/DynamicData/List/ObservableListEx.MergeMany.cs @@ -50,9 +50,9 @@ public static partial class ObservableListEx public static IObservable MergeMany(this IObservable> source, Func> observableSelector) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.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 e10118cef..3fff768e9 100644 --- a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs @@ -54,15 +54,8 @@ public static IObservable> MergeManyChangeSets(source, observableSelector, equalityComparer).Run(); } @@ -89,9 +82,9 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); - comparer.ThrowArgumentNullExceptionIfNull(nameof(comparer)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); + ArgumentNullException.ThrowIfNull(comparer); return source.MergeManyChangeSets(observableSelector, equalityComparer: null, comparer: comparer); } @@ -138,8 +131,8 @@ public static IObservable> MergeManyCh where TDestination : notnull where TDestinationKey : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - observableSelector.ThrowArgumentNullExceptionIfNull(nameof(observableSelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 efc183cb6..e2d591daa 100644 --- a/src/DynamicData/List/ObservableListEx.NotEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.NotEmpty.cs @@ -35,7 +35,7 @@ public static partial class ObservableListEx public static IObservable> NotEmpty(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.Where(s => s.Count != 0); } diff --git a/src/DynamicData/List/ObservableListEx.Or.cs b/src/DynamicData/List/ObservableListEx.Or.cs index b47acd986..e25648668 100644 --- a/src/DynamicData/List/ObservableListEx.Or.cs +++ b/src/DynamicData/List/ObservableListEx.Or.cs @@ -61,7 +61,7 @@ public static IObservable> Or(this ICollection> Or(this IObservable> source, params IObservable>[] others) where T : notnull { - others.ThrowArgumentNullExceptionIfNull(nameof(others)); + ArgumentNullException.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 da8dc2c3d..2045d1783 100644 --- a/src/DynamicData/List/ObservableListEx.Page.cs +++ b/src/DynamicData/List/ObservableListEx.Page.cs @@ -45,8 +45,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 d5431ff4a..2278e8487 100644 --- a/src/DynamicData/List/ObservableListEx.PopulateInto.cs +++ b/src/DynamicData/List/ObservableListEx.PopulateInto.cs @@ -40,8 +40,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 0e9984894..d6c3d1b24 100644 --- a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs +++ b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs @@ -42,8 +42,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(resultSelector); return source.QueryWhenChanged().Select(resultSelector); } @@ -66,7 +66,7 @@ public static IObservable QueryWhenChanged( public static IObservable> QueryWhenChanged(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new QueryWhenChanged(source).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.RefCount.cs b/src/DynamicData/List/ObservableListEx.RefCount.cs index 4e8f03a10..88ed48761 100644 --- a/src/DynamicData/List/ObservableListEx.RefCount.cs +++ b/src/DynamicData/List/ObservableListEx.RefCount.cs @@ -38,7 +38,7 @@ public static partial class ObservableListEx public static IObservable> RefCount(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return new RefCount(source).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs index 9f0e434f7..d6ebbfb60 100644 --- a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs +++ b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs @@ -37,7 +37,7 @@ public static partial class ObservableListEx public static IObservable> RemoveIndex(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 757954e35..291ca278d 100644 --- a/src/DynamicData/List/ObservableListEx.Reverse.cs +++ b/src/DynamicData/List/ObservableListEx.Reverse.cs @@ -38,7 +38,7 @@ public static IObservable> Reverse(this IObservable(); - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 a7d50fbf0..3fd0a3031 100644 --- a/src/DynamicData/List/ObservableListEx.SkipInitial.cs +++ b/src/DynamicData/List/ObservableListEx.SkipInitial.cs @@ -45,7 +45,7 @@ public static partial class ObservableListEx public static IObservable> SkipInitial(this IObservable> source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); return source.DeferUntilLoaded().Skip(1); } diff --git a/src/DynamicData/List/ObservableListEx.Sort.cs b/src/DynamicData/List/ObservableListEx.Sort.cs index c0c67e484..3766273fa 100644 --- a/src/DynamicData/List/ObservableListEx.Sort.cs +++ b/src/DynamicData/List/ObservableListEx.Sort.cs @@ -58,8 +58,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(comparer); return new Sort(source, comparer, options, resort, comparerChanged, resetThreshold).Run(); } @@ -79,8 +79,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(comparerChanged); return new Sort(source, null, options, resort, comparerChanged, resetThreshold).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs index 6f4745a2a..39858fc77 100644 --- a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs +++ b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs @@ -50,8 +50,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 c4de93f57..e9e9ea89b 100644 --- a/src/DynamicData/List/ObservableListEx.Switch.cs +++ b/src/DynamicData/List/ObservableListEx.Switch.cs @@ -38,7 +38,7 @@ public static partial class ObservableListEx public static IObservable> Switch(this IObservable> sources) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return sources.Select(cache => cache.Connect()).Switch(); } @@ -59,7 +59,7 @@ public static IObservable> Switch(this IObservable> Switch(this IObservable>> sources) where T : notnull { - sources.ThrowArgumentNullExceptionIfNull(nameof(sources)); + ArgumentNullException.ThrowIfNull(sources); return new Switch(sources).Run(); } diff --git a/src/DynamicData/List/ObservableListEx.Top.cs b/src/DynamicData/List/ObservableListEx.Top.cs index 17a128f99..302f62bbf 100644 --- a/src/DynamicData/List/ObservableListEx.Top.cs +++ b/src/DynamicData/List/ObservableListEx.Top.cs @@ -41,12 +41,8 @@ public static partial class ObservableListEx public static IObservable> Top(this IObservable> source, int numberOfItems) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); - - if (numberOfItems <= 0) - { - throw new ArgumentOutOfRangeException(nameof(numberOfItems), "Number of items should be greater than zero"); - } + ArgumentNullException.ThrowIfNull(source); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(numberOfItems); return source.Virtualise(Observable.Return(new VirtualRequest(0, numberOfItems))); } diff --git a/src/DynamicData/List/ObservableListEx.Transform.cs b/src/DynamicData/List/ObservableListEx.Transform.cs index 64a856a24..8407322e4 100644 --- a/src/DynamicData/List/ObservableListEx.Transform.cs +++ b/src/DynamicData/List/ObservableListEx.Transform.cs @@ -60,9 +60,9 @@ public static IObservable> Transform((t, _, _) => transformFactory(t), transformOnRefresh); } @@ -75,8 +75,8 @@ public static IObservable> Transform((t, _, idx) => transformFactory(t, idx), transformOnRefresh); } @@ -90,8 +90,8 @@ public static IObservable> Transform((t, previous, _) => transformFactory(t, previous), transformOnRefresh); } @@ -105,8 +105,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 d130fa3b9..c50cf0bc0 100644 --- a/src/DynamicData/List/ObservableListEx.TransformAsync.cs +++ b/src/DynamicData/List/ObservableListEx.TransformAsync.cs @@ -58,8 +58,8 @@ public static IObservable> TransformAsync((t, _, _) => transformFactory(t), transformOnRefresh); } @@ -76,8 +76,8 @@ public static IObservable> TransformAsync((t, _, i) => transformFactory(t, i), transformOnRefresh); } @@ -94,8 +94,8 @@ public static IObservable> TransformAsync((t, d, _) => transformFactory(t, d), transformOnRefresh); } @@ -112,8 +112,8 @@ public static IObservable> TransformAsync(source, (t, d, i, _) => transformFactory(t, d, i), transformOnRefresh).Run(); } @@ -130,8 +130,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 6b3e3e327..28750767f 100644 --- a/src/DynamicData/List/ObservableListEx.TransformMany.cs +++ b/src/DynamicData/List/ObservableListEx.TransformMany.cs @@ -50,8 +50,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 a2d2ec09d..d790a8bd7 100644 --- a/src/DynamicData/List/ObservableListEx.Virtualise.cs +++ b/src/DynamicData/List/ObservableListEx.Virtualise.cs @@ -43,9 +43,9 @@ public static partial class ObservableListEx public static IObservable> Virtualise(this IObservable> source, IObservable requests) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); - requests.ThrowArgumentNullExceptionIfNull(nameof(requests)); + ArgumentNullException.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 a6529e3f3..9e3aedb93 100644 --- a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs @@ -43,7 +43,7 @@ public static partial class ObservableListEx public static IObservable WhenAnyPropertyChanged(this IObservable> source, params string[] propertiesToMonitor) where TObject : INotifyPropertyChanged { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.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 4a91bd035..5682e7a5b 100644 --- a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs @@ -44,8 +44,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 0328218fc..e75630066 100644 --- a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs @@ -41,8 +41,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.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 c2e61653d..87cfe93fe 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs @@ -43,7 +43,7 @@ public static partial class ObservableListEx public static IObservable> WhereReasonsAre(this IObservable> source, params ListChangeReason[] reasons) where T : notnull { - reasons.ThrowArgumentNullExceptionIfNull(nameof(reasons)); + ArgumentNullException.ThrowIfNull(reasons); if (reasons.Length == 0) { diff --git a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs index aabb2b3c2..5daefa9e8 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs @@ -46,7 +46,7 @@ public static partial class ObservableListEx public static IObservable> WhereReasonsAreNot(this IObservable> source, params ListChangeReason[] reasons) where T : notnull { - reasons.ThrowArgumentNullExceptionIfNull(nameof(reasons)); + ArgumentNullException.ThrowIfNull(reasons); if (reasons.Length == 0) { diff --git a/src/DynamicData/List/ObservableListEx.Xor.cs b/src/DynamicData/List/ObservableListEx.Xor.cs index b63b5c6d0..70d5d2c40 100644 --- a/src/DynamicData/List/ObservableListEx.Xor.cs +++ b/src/DynamicData/List/ObservableListEx.Xor.cs @@ -54,7 +54,7 @@ public static partial class ObservableListEx public static IObservable> Xor(this IObservable> source, params IObservable>[] others) where T : notnull { - others.ThrowArgumentNullExceptionIfNull(nameof(others)); + ArgumentNullException.ThrowIfNull(others); return source.Combine(CombineOperator.Xor, others); } diff --git a/src/DynamicData/List/SourceList.cs b/src/DynamicData/List/SourceList.cs index a159af490..754ed7970 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.cs @@ -28,11 +28,7 @@ public sealed class SourceList : ISourceList private readonly Lazy> _countChanged = new(() => new Subject()); -#if NET9_0_OR_GREATER private readonly Lock _locker = new(); -#else - private readonly object _locker = new(); -#endif private readonly ReaderWriter _readerWriter = new(); @@ -116,7 +112,7 @@ public void Dispose() /// public void Edit(Action> updateAction) { - updateAction.ThrowArgumentNullExceptionIfNull(nameof(updateAction)); + ArgumentNullException.ThrowIfNull(updateAction); lock (_locker) { diff --git a/src/DynamicData/List/SourceListEditConvenienceEx.cs b/src/DynamicData/List/SourceListEditConvenienceEx.cs index 7c08529f8..408eeee7e 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)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list.Add(item)); } @@ -35,7 +35,7 @@ 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)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list.AddRange(items)); } @@ -48,7 +48,7 @@ public static void AddRange(this ISourceList source, IEnumerable items) public static void Clear(this ISourceList source) where T : notnull { - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list.Clear()); } @@ -64,8 +64,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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(allItems); var editDiff = new EditDiff(source, equalityComparer); editDiff.Edit(allItems); @@ -81,7 +81,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)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list.Insert(index, item)); } @@ -96,7 +96,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)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list.AddRange(items, index)); } @@ -111,7 +111,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)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list.Move(original, destination)); } @@ -127,7 +127,7 @@ public static bool Remove(this ISourceList source, T item) where T : notnull { var removed = false; - source.ThrowArgumentNullExceptionIfNull(nameof(source)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => removed = list.Remove(item)); return removed; @@ -142,7 +142,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)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list.RemoveAt(index)); } @@ -156,7 +156,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)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list.RemoveMany(itemsToRemove)); } @@ -173,7 +173,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)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list.RemoveRange(index, count)); } @@ -188,7 +188,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)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list.Replace(original, destination)); } @@ -203,7 +203,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)); + ArgumentNullException.ThrowIfNull(source); source.Edit(list => list[index] = item); } diff --git a/src/DynamicData/List/SourceListEx.cs b/src/DynamicData/List/SourceListEx.cs index 78ca4d971..027b605a5 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)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(conversionFactory); return source.Connect().Cast(conversionFactory); } diff --git a/src/DynamicData/ObservableChangeSet.cs b/src/DynamicData/ObservableChangeSet.cs index e9106b3e3..7c2441e7b 100644 --- a/src/DynamicData/ObservableChangeSet.cs +++ b/src/DynamicData/ObservableChangeSet.cs @@ -24,8 +24,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(subscribe); + ArgumentNullException.ThrowIfNull(keySelector); return Create( cache => @@ -48,8 +48,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(subscribe); + ArgumentNullException.ThrowIfNull(keySelector); return Observable.Create>( observer => @@ -82,8 +82,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(subscribe); + ArgumentNullException.ThrowIfNull(keySelector); return Create(async (cache, _) => await subscribe(cache).ConfigureAwait(false), keySelector); } @@ -100,8 +100,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(subscribe); + ArgumentNullException.ThrowIfNull(keySelector); return Observable.Create>( async (observer, ct) => @@ -135,8 +135,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(subscribe); + ArgumentNullException.ThrowIfNull(keySelector); return Create((cache, _) => subscribe(cache), keySelector); } @@ -153,8 +153,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(subscribe); + ArgumentNullException.ThrowIfNull(keySelector); return Observable.Create>( async (observer, ct) => @@ -197,8 +197,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(subscribe); + ArgumentNullException.ThrowIfNull(keySelector); return Observable.Create>( async observer => @@ -231,8 +231,8 @@ public static IObservable> Create(Func< where TObject : notnull where TKey : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); - keySelector.ThrowArgumentNullExceptionIfNull(nameof(keySelector)); + ArgumentNullException.ThrowIfNull(subscribe); + ArgumentNullException.ThrowIfNull(keySelector); return Observable.Create>( async (observer, ct) => @@ -262,7 +262,7 @@ public static IObservable> Create(Func< public static IObservable> Create(Func, Action> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentNullException.ThrowIfNull(subscribe); return Create( list => @@ -281,7 +281,7 @@ public static IObservable> Create(Func, Action> public static IObservable> Create(Func, IDisposable> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentNullException.ThrowIfNull(subscribe); return Observable.Create>( observer => @@ -319,7 +319,7 @@ public static IObservable> Create(Func, IDisposa public static IObservable> Create(Func, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentNullException.ThrowIfNull(subscribe); return Create((list, _) => subscribe(list)); } @@ -333,7 +333,7 @@ public static IObservable> Create(Func, Task> Create(Func, CancellationToken, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentNullException.ThrowIfNull(subscribe); return Observable.Create>( async (observer, ct) => @@ -374,7 +374,7 @@ public static IObservable> Create(Func, Cancella public static IObservable> Create(Func, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentNullException.ThrowIfNull(subscribe); return Create(async (list, _) => await subscribe(list).ConfigureAwait(false)); } @@ -388,7 +388,7 @@ public static IObservable> Create(Func, Task> Create(Func, CancellationToken, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentNullException.ThrowIfNull(subscribe); return Observable.Create>( async (observer, ct) => @@ -428,7 +428,7 @@ public static IObservable> Create(Func, Cancella public static IObservable> Create(Func, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentNullException.ThrowIfNull(subscribe); return Observable.Create>( async observer => @@ -458,7 +458,7 @@ public static IObservable> Create(Func, Task> su public static IObservable> Create(Func, CancellationToken, Task> subscribe) where T : notnull { - subscribe.ThrowArgumentNullExceptionIfNull(nameof(subscribe)); + ArgumentNullException.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..653990aa9 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)); + ArgumentNullException.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/CompilerFeatureRequiredAttribute.cs b/src/DynamicData/Polyfills/CompilerFeatureRequiredAttribute.cs deleted file mode 100644 index cdcff56c9..000000000 --- a/src/DynamicData/Polyfills/CompilerFeatureRequiredAttribute.cs +++ /dev/null @@ -1,23 +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 !NET7_0_OR_GREATER -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.All, AllowMultiple = true, Inherited = false)] -internal sealed class CompilerFeatureRequiredAttribute(string featureName) - : Attribute -{ - public const string RefStructs - = nameof(RefStructs); - - public const string RequiredMembers - = nameof(RequiredMembers); - - public string FeatureName { get; } = featureName; - - public bool IsOptional { get; init; } -} -#endif diff --git a/src/DynamicData/Polyfills/DynamicallyAccessedMembersAttribute.cs b/src/DynamicData/Polyfills/DynamicallyAccessedMembersAttribute.cs deleted file mode 100644 index 7c591011b..000000000 --- a/src/DynamicData/Polyfills/DynamicallyAccessedMembersAttribute.cs +++ /dev/null @@ -1,39 +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 !NET5_0_OR_GREATER -namespace System.Diagnostics.CodeAnalysis; - -[Flags] -internal enum DynamicallyAccessedMemberTypes -{ - All = -1, - None = 0, - PublicParameterlessConstructor = 1, - PublicConstructors = 3, - NonPublicConstructors = 4, - PublicMethods = 8, - NonPublicMethods = 16, - PublicFields = 32, - NonPublicFields = 64, - PublicNestedTypes = 128, - NonPublicNestedTypes = 256, - PublicProperties = 512, - NonPublicProperties = 1024, - PublicEvents = 2048, - NonPublicEvents = 4096, - Interfaces = 8192 -} - -[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 -{ - public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes) - { - MemberTypes = memberTypes; - } - - public DynamicallyAccessedMemberTypes MemberTypes { get; } -} -#endif diff --git a/src/DynamicData/Polyfills/EnumEx.cs b/src/DynamicData/Polyfills/EnumEx.cs deleted file mode 100644 index 1e590a8b3..000000000 --- a/src/DynamicData/Polyfills/EnumEx.cs +++ /dev/null @@ -1,18 +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 System; - -internal static class EnumEx -{ - #if NET5_0_OR_GREATER - public static bool IsDefined(TEnum value) - where TEnum : struct, Enum - => Enum.IsDefined(value); - #else - public static bool IsDefined(TEnum value) - where TEnum : struct, Enum - => Enum.IsDefined(typeof(TEnum), value); - #endif -} diff --git a/src/DynamicData/Polyfills/IsExternalInit.cs b/src/DynamicData/Polyfills/IsExternalInit.cs deleted file mode 100644 index 4542c2eed..000000000 --- a/src/DynamicData/Polyfills/IsExternalInit.cs +++ /dev/null @@ -1,10 +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 !NETCOREAPP -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; -#endif diff --git a/src/DynamicData/Polyfills/ListEnsureCapacity.cs b/src/DynamicData/Polyfills/ListEnsureCapacity.cs deleted file mode 100644 index 671b66760..000000000 --- a/src/DynamicData/Polyfills/ListEnsureCapacity.cs +++ /dev/null @@ -1,16 +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 !NETCOREAPP -namespace System.Collections.Generic; - -internal static class ListEnsureCapacity -{ - public static void EnsureCapacity(this List list, int capacity) - { - if (list.Capacity < capacity) - list.Capacity = capacity; - } -} -#endif diff --git a/src/DynamicData/Polyfills/RequiredMemberAttribute.cs b/src/DynamicData/Polyfills/RequiredMemberAttribute.cs deleted file mode 100644 index b1bbc836d..000000000 --- a/src/DynamicData/Polyfills/RequiredMemberAttribute.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. - -#if !NET7_0_OR_GREATER -using System.ComponentModel; - -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)] -internal sealed class RequiredMemberAttribute : Attribute; -#endif From 97ec2733296ad86b5a881e5bc6b8e703b6276bc2 Mon Sep 17 00:00:00 2001 From: Jake Meiergerd Date: Mon, 12 Oct 2026 22:00:20 -0500 Subject: [PATCH 05/10] =?UTF-8?q?Fixed=20bogus=20lookup=20logic=20within?= =?UTF-8?q?=20list-land=20`.TransformAsync()`,=E2=80=A6=20(#1171)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed bogus lookup logic within list-land `.TransformAsync()`, for processing changes with unspecified indexes, which resulted in `Remove` and `RemoveRange` changes with unspecified indexes to be ignored completely. * Added equivalent fixes (and tests) to `.Transform()`, and consolidated logic for handling index lookup, when indexes are missing from changesets, into a shared allocation-free helper method. --- .../List/TransformAsyncFixture.cs | 68 +++++++++++++- .../List/TransformFixture.cs | 64 ++++++++++++- .../List/Internal/TransformAsync.cs | 61 +++++++----- src/DynamicData/List/Internal/Transformer.cs | 94 +++++++++++-------- 4 files changed, 221 insertions(+), 66 deletions(-) diff --git a/src/DynamicData.Tests/List/TransformAsyncFixture.cs b/src/DynamicData.Tests/List/TransformAsyncFixture.cs index be4b8f623..7d3b1f1e3 100755 --- a/src/DynamicData.Tests/List/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/List/TransformAsyncFixture.cs @@ -1,12 +1,14 @@ using System; using System.Linq; -using System.Threading; +using System.Reactive.Linq; using System.Threading.Tasks; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; + using FluentAssertions; using Xunit; +using DynamicData.Tests.Domain; +using DynamicData.Tests.Utilities; + namespace DynamicData.Tests.List; [Obsolete("Not obsolete - test commented out due to test run freezing on Appveyor")] @@ -187,4 +189,64 @@ public void TransformAsyncCancelsTokenOnUnSubscribe() sub.Dispose(); Assert.True(tcs.Task.IsCanceled); } + + // Covers https://github.com/reactivemarbles/DynamicData/issues/1169 + [Fact] + public void RemoveWithoutIndex() + { + var source = Enumerable.Empty>() + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.AddRange, + items: new[] { 1, 2, 3, 2, 1 }) // Include a duplicate of the item to be removed + }) + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.Remove, + current: 2) + }) + .ToObservable(); + + using var subscription = source + .TransformAsync(static item => Task.FromResult(item.ToString())) + .ValidateChangeSets() + .RecordListItems(out var results); + + results.Error.Should().BeNull("no errors should have occurred"); + results.RecordedChangeSets.Count.Should().Be(2, "2 source operations were performed"); + results.RecordedItems.Should().BeEquivalentTo(new[] { "1", "3", "2", "1" }, static options => options.WithStrictOrdering(), "The first occurrence of the given item should have been removed"); + results.HasCompleted.Should().BeTrue("the source, and all asynchronous operations, have completed"); + } + + // Covers https://github.com/reactivemarbles/DynamicData/issues/1169 + [Fact] + public void RemoveRangeWithoutIndex() + { + var source = Enumerable.Empty>() + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.AddRange, + items: new[] { 1, 2, 3, 4, 5, 4, 3, 2, 1 }) // Include duplicates of the items to be removed. + }) + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.RemoveRange, + items: new[] { 1, 3, 5 }) + }) + .ToObservable(); + + using var subscription = source + .TransformAsync(static item => Task.FromResult(item.ToString())) + .ValidateChangeSets() + .RecordListItems(out var results); + + results.Error.Should().BeNull("no errors should have occurred"); + results.RecordedChangeSets.Count.Should().Be(2, "2 source operations were performed"); + results.RecordedItems.Should().BeEquivalentTo(new[] { "2", "4", "4", "3", "2", "1" }, static options => options.WithStrictOrdering(), "The first occurrence of each odd-numbered item in the list should have been removed"); + results.HasCompleted.Should().BeTrue("the source, and all asynchronous operations, have completed"); + } } diff --git a/src/DynamicData.Tests/List/TransformFixture.cs b/src/DynamicData.Tests/List/TransformFixture.cs index 0841ae4f4..e3c966be0 100644 --- a/src/DynamicData.Tests/List/TransformFixture.cs +++ b/src/DynamicData.Tests/List/TransformFixture.cs @@ -1,7 +1,9 @@ using System; using System.Linq; +using System.Reactive.Linq; using DynamicData.Tests.Domain; +using DynamicData.Tests.Utilities; using FluentAssertions; using Xunit; @@ -88,7 +90,7 @@ public void Remove() } [Fact] - public void RemoveWithoutIndex() + public void RemoveObjectWithoutIndex() { const string key = "Adult1"; var person = new Person(key, 50); @@ -104,6 +106,66 @@ public void RemoveWithoutIndex() results.Data.Count.Should().Be(0, "Should be nothing cached"); } + // Mirrors coverage for https://github.com/reactivemarbles/DynamicData/issues/1169 + [Fact] + public void RemoveRangeWithoutIndex() + { + var source = Enumerable.Empty>() + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.AddRange, + items: new[] { 1, 2, 3, 4, 5, 4, 3, 2, 1 }) + }) + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.RemoveRange, + items: new[] { 1, 3, 5 }) + }) + .ToObservable(); + + using var subscription = source + .Transform(static item => item.ToString()) + .ValidateChangeSets() + .RecordListItems(out var results); + + results.Error.Should().BeNull("no errors should have occurred"); + results.RecordedChangeSets.Count.Should().Be(2, "2 source operations were performed"); + results.RecordedItems.Should().BeEquivalentTo(new[] { "2", "4", "4", "3", "2", "1" }, static options => options.WithStrictOrdering(), "The first occurrence of each odd-numbered item in the list should have been removed"); + results.HasCompleted.Should().BeTrue("the source, and all asynchronous operations, have completed"); + } + + // Mirrors coverage for https://github.com/reactivemarbles/DynamicData/issues/1169 + [Fact] + public void RemoveValueWithoutIndex() + { + var source = Enumerable.Empty>() + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.AddRange, + items: new[] { 1, 2, 3, 2, 1 }) + }) + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.Remove, + current: 2) + }) + .ToObservable(); + + using var subscription = source + .Transform(static item => item.ToString()) + .ValidateChangeSets() + .RecordListItems(out var results); + + results.Error.Should().BeNull("no errors should have occurred"); + results.RecordedChangeSets.Count.Should().Be(2, "2 source operations were performed"); + results.RecordedItems.Should().BeEquivalentTo(new[] { "1", "3", "2", "1" }, static options => options.WithStrictOrdering(), "The first occurrence of the given item should have been removed"); + results.HasCompleted.Should().BeTrue("the source, and all asynchronous operations, have completed"); + } + [Fact] public void SameKeyChanges() { diff --git a/src/DynamicData/List/Internal/TransformAsync.cs b/src/DynamicData/List/Internal/TransformAsync.cs index c9fa87282..ed4c54afc 100644 --- a/src/DynamicData/List/Internal/TransformAsync.cs +++ b/src/DynamicData/List/Internal/TransformAsync.cs @@ -134,16 +134,24 @@ await _containerFactory( case ListChangeReason.Refresh: { var change = item.Item; + var index = change.CurrentIndex; + + if (index < 0) + { + index = transformed.FindItemIndex(change.Current); + if (index < 0) + break; + } + if (_transformOnRefresh) { - Optional previous = transformed[change.CurrentIndex].Destination; - var container = await _containerFactory(change.Current, previous, change.CurrentIndex, cancel) + var container = await _containerFactory(change.Current, transformed[index].Destination, index, cancel) .ConfigureAwait(false); - transformed[change.CurrentIndex] = container; + transformed[index] = container; } else { - transformed.RefreshAt(change.CurrentIndex); + transformed.RefreshAt(index); } break; @@ -152,16 +160,23 @@ await _containerFactory( case ListChangeReason.Replace: { var change = item.Item; + var currentIndex = change.CurrentIndex; + var previousIndex = change.PreviousIndex; + + if (previousIndex < 0) + previousIndex = transformed.FindItemIndex(change.Previous.Value); - Optional previous = transformed[change.PreviousIndex].Destination; - if (change.CurrentIndex == change.PreviousIndex) + if (currentIndex < 0) + currentIndex = previousIndex; + + if (currentIndex == previousIndex) { - transformed[change.CurrentIndex] = await _containerFactory(change.Current, previous, change.CurrentIndex, cancel); + transformed[currentIndex] = await _containerFactory(change.Current, transformed[previousIndex].Destination, currentIndex, cancel); } else { - transformed.RemoveAt(change.PreviousIndex); - transformed.Insert(change.CurrentIndex, await _containerFactory(change.Current, Optional.None, change.CurrentIndex, cancel)); + transformed.RemoveAt(previousIndex); + transformed.Insert(currentIndex, await _containerFactory(change.Current, Optional.None, currentIndex, cancel)); } break; @@ -170,22 +185,16 @@ await _containerFactory( case ListChangeReason.Remove: { var change = item.Item; - var hasIndex = change.CurrentIndex >= 0; + var index = change.CurrentIndex; - if (hasIndex) + if (index < 0) { - transformed.RemoveAt(item.Item.CurrentIndex); - } - else - { - var toRemove = transformed.FirstOrDefault(t => ReferenceEquals(t.Source, t)); - - if (toRemove is not null) - { - transformed.Remove(toRemove); - } + index = transformed.FindItemIndex(change.Current); + if (index < 0) + break; } + transformed.RemoveAt(index); break; } @@ -197,8 +206,14 @@ await _containerFactory( } else { - var toRemove = transformed.Where(t => ReferenceEquals(t.Source, t)).ToArray(); - transformed.RemoveMany(toRemove); + foreach (var current in item.Range) + { + var index = transformed.FindItemIndex(current); + if (index < 0) + continue; + + transformed.RemoveAt(index); + } } break; diff --git a/src/DynamicData/List/Internal/Transformer.cs b/src/DynamicData/List/Internal/Transformer.cs index 3df97995a..5256f02a8 100644 --- a/src/DynamicData/List/Internal/Transformer.cs +++ b/src/DynamicData/List/Internal/Transformer.cs @@ -6,6 +6,24 @@ namespace DynamicData.List.Internal; +internal static class Transformer +{ + public static int FindItemIndex( + this ChangeAwareList.TransformedItemContainer> transformations, + TSource sourceItem) + where TSource : notnull + where TDestination : notnull + { + for (var i = 0; i < transformations.Count; ++i) + { + if (EqualityComparer.Default.Equals(transformations[i].Source, sourceItem)) + return i; + } + + return -1; + } +} + internal sealed class Transformer where TSource : notnull where TDestination : notnull @@ -77,13 +95,9 @@ private void Transform(ChangeAwareList transformed, IC var index = change.CurrentIndex; if (index < 0) { - // Find the corresponding index - var current = transformed.FirstOrDefault(x => x.Source.Equals(change.Current)); - index = current switch - { - { } tic when transformed.IndexOf(tic) is int i and (>= 0) => i, - _ => throw new UnspecifiedIndexException($"Cannot find index of {change.Current}"), - }; + index = transformed.FindItemIndex(change.Current); + if (index < 0) + throw new UnspecifiedIndexException($"Cannot find index of {change.Current}"); } if (_transformOnRefresh) @@ -103,30 +117,29 @@ private void Transform(ChangeAwareList transformed, IC { var change = item.Item; - if (change.CurrentIndex == -1 || change.PreviousIndex == -1) + var currentIndex = change.CurrentIndex; + var previousIndex = change.PreviousIndex; + + if (change.PreviousIndex < 0) { - // Find the original, with it's corresponding index - var previous = transformed.First(x => x.Source.Equals(change.Previous.Value)); - var index = transformed.IndexOf(previous); - if (index == -1) - { + previousIndex = transformed.FindItemIndex(change.Previous.Value); + if (previousIndex < 0) throw new UnspecifiedIndexException($"Cannot find index of {change.Previous.Value}"); - } + } - transformed[index] = _containerFactory(change.Current, previous.Destination, index); + if (currentIndex < 0) + { + currentIndex = previousIndex; + } + + if (currentIndex == previousIndex) + { + transformed[currentIndex] = _containerFactory(change.Current, transformed[previousIndex].Destination, currentIndex); } else { - Optional previous = transformed[change.PreviousIndex].Destination; - if (change.CurrentIndex == change.PreviousIndex) - { - transformed[change.CurrentIndex] = _containerFactory(change.Current, previous, change.CurrentIndex); - } - else - { - transformed.RemoveAt(change.PreviousIndex); - transformed.Insert(change.CurrentIndex, _containerFactory(change.Current, Optional.None, change.CurrentIndex)); - } + transformed.RemoveAt(previousIndex); + transformed.Insert(currentIndex, _containerFactory(change.Current, Optional.None, currentIndex)); } break; @@ -135,22 +148,16 @@ private void Transform(ChangeAwareList transformed, IC case ListChangeReason.Remove: { var change = item.Item; - var hasIndex = change.CurrentIndex >= 0; + var index = change.CurrentIndex; - if (hasIndex) - { - transformed.RemoveAt(change.CurrentIndex); - } - else + if (index < 0) { - var toRemove = transformed.FirstOrDefault(t => ReferenceEquals(t.Source, change.Current)); - - if (toRemove is not null) - { - transformed.Remove(toRemove); - } + index = transformed.FindItemIndex(change.Current); + if (index < 0) + break; } + transformed.RemoveAt(index); break; } @@ -162,8 +169,17 @@ private void Transform(ChangeAwareList transformed, IC } else { - var toRemove = transformed.Where(t => item.Range.Any(current => ReferenceEquals(t.Source, current))); - transformed.RemoveMany(toRemove); + var manyToRemove = new List(capacity: item.Range.Count); + foreach (var current in item.Range) + { + var index = transformed.FindItemIndex(current); + if (index < 0) + continue; + + manyToRemove.Add(transformed[index]); + } + + transformed.RemoveMany(manyToRemove); } break; From 65016e5ba22a7c889b0a06cc1094e389281612c3 Mon Sep 17 00:00:00 2001 From: Jake Meiergerd Date: Tue, 13 Oct 2026 00:39:22 -0500 Subject: [PATCH 06/10] Refactored for global import definitions (#1197) Consolidated namespace imports to a set of global definitions, across each project, and removed all redundant import definitions. Co-authored-by: Chris Pulman Co-authored-by: Darrin Cullop --- .github/copilot-instructions.md | 13 +++++ src/Directory.Build.props | 1 + .../Cache/DeliveryQueueBenchmarks.cs | 10 ---- .../Cache/DisposeMany_Cache.cs | 4 -- src/DynamicData.Benchmarks/Cache/EditDiff.cs | 11 +---- .../Cache/ExpireAfter_Cache_ForSource.cs | 10 +--- .../Cache/ExpireAfter_Cache_ForStream.cs | 11 +---- .../Cache/FilterImmutable.cs | 8 +-- .../Cache/Filter_Cache_WithPredicateState.cs | 11 +---- .../Cache/SortAndBindChange.cs | 10 +--- .../Cache/SortAndBindInitial.cs | 9 +--- .../Cache/SourceCache.cs | 5 -- .../Cache/StatelessFiltering.cs | 8 +-- .../Cache/StatelessTransforming.cs | 9 +--- src/DynamicData.Benchmarks/Cache/Sum_Cache.cs | 6 --- .../Cache/ToObservableChangeSet_Cache.cs | 10 +--- .../Cache/TransformImmutable.cs | 9 +--- .../Cache/TransformMany.cs | 9 +--- src/DynamicData.Benchmarks/Global.cs | 25 ++++++++++ .../List/DisposeMany_List.cs | 5 -- .../List/ExpireAfter_List.cs | 10 +--- ...lter_List_Static_RandomizedBoundedEdits.cs | 12 +---- ...er_List_Static_RandomizedUnboundedEdits.cs | 12 +---- .../List/Filter_List_WithPredicateState.cs | 11 +---- src/DynamicData.Benchmarks/List/GroupAdd.cs | 6 --- .../List/GroupRemove.cs | 6 --- src/DynamicData.Benchmarks/List/SourceList.cs | 5 -- src/DynamicData.Benchmarks/List/Sum_List.cs | 6 --- .../List/ToObservableChangeSet_List.cs | 8 +-- .../Miscellaneous/LockImplementations.cs | 3 -- .../Polyfills/RequiredMemberAttribute.cs | 2 - src/DynamicData.Benchmarks/Program.cs | 6 --- src/DynamicData.Tests/API/ApiApprovalTests.cs | 6 +-- src/DynamicData.Tests/API/ApiExtensions.cs | 10 +--- .../AggregationTests/AggregationFixture.cs | 9 ---- ...gFixture.ForCache.ForAggregateChangeSet.cs | 8 --- .../AvgFixture.ForCache.ForChangeSet.cs | 6 --- ...vgFixture.ForList.ForAggregateChangeSet.cs | 8 --- .../AvgFixture.ForList.ForChangeSet.cs | 5 -- .../AggregationTests/MaxFixture.cs | 7 --- .../AggregationTests/MinFixture.cs | 7 --- .../AggregationTests/StdDevFixture.cs | 12 ----- .../AggregationTests/SumFixture.ForCache.cs | 8 --- .../AggregationTests/SumFixture.ForList.cs | 8 --- src/DynamicData.Tests/AutoRefreshFilter.cs | 13 +---- .../Binding/AvaloniaDictionaryFixture.cs | 15 +----- .../Binding/BindingLIstBindListFixture.cs | 10 ---- .../Binding/BindingListBindCacheFixture.cs | 10 ---- .../BindingListBindCacheSortedFixture.cs | 12 ----- .../Binding/BindingListToChangeSetFixture.cs | 12 +---- ...eeplyNestedNotifyPropertyChangedFixture.cs | 18 ++----- .../IObservableListBindCacheFixture.cs | 12 +---- .../IObservableListBindCacheSortedFixture.cs | 12 ----- .../Binding/IObservableListBindListFixture.cs | 12 ----- .../Binding/NotifyPropertyChangedExFixture.cs | 16 +----- .../ObservableCollectionBindCacheFixture.cs | 15 +----- ...ervableCollectionBindCacheSortedFixture.cs | 13 ----- .../ObservableCollectionBindListFixture.cs | 10 ---- ...bleCollectionExtendedToChangeSetFixture.cs | 10 ---- .../ObservableCollectionToChangeSetFixture.cs | 11 ----- ...yObservableCollectionToChangeSetFixture.cs | 11 ----- .../ReadonlyCollectionBindCacheFixture.cs | 12 +---- ...angedFixture.IntegrationTests.DeepChain.cs | 16 ------ ...ChangedFixture.IntegrationTests.Shallow.cs | 16 ------ ...PropertyChangedFixture.IntegrationTests.cs | 11 ----- ...rtyChangedFixture.UnitTests.Conversions.cs | 12 ----- ...pertyChangedFixture.UnitTests.DeepChain.cs | 12 ----- ...ropertyChangedFixture.UnitTests.Shallow.cs | 11 ----- ...tyChangedFixture.UnitTests.Subscription.cs | 10 ---- .../WhenPropertyChangedFixture.UnitTests.cs | 12 ----- .../Binding/WhenPropertyChangedFixture.cs | 3 -- src/DynamicData.Tests/Cache/AndFixture.cs | 12 +---- ...syncDisposeManyFixture.IntegrationTests.cs | 16 +----- .../AsyncDisposeManyFixture.UnitTests.cs | 17 +------ .../Cache/AsyncDisposeManyFixture.cs | 5 +- .../Cache/AutoRefreshFixture.Base.cs | 13 ----- ...AutoRefreshFixture.WithPropertyAccessor.cs | 11 ----- ...oRefreshFixture.WithoutPropertyAccessor.cs | 9 ---- .../Cache/AutoRefreshFixture.cs | 4 +- .../AutoRefreshOnObservableFixture.Base.cs | 14 ------ .../AutoRefreshOnObservableFixture.WithKey.cs | 8 --- ...toRefreshOnObservableFixture.WithoutKey.cs | 8 --- .../Cache/AutoRefreshOnObservableFixture.cs | 6 --- src/DynamicData.Tests/Cache/BatchFixture.cs | 10 ---- .../Cache/BatchIfFixture.Overloads.cs | 10 ---- src/DynamicData.Tests/Cache/BatchIfFixture.cs | 13 ----- .../Cache/BatchIfWithTimeOutFixture.cs | 13 ----- .../Cache/BufferInitialFixture.cs | 12 ----- .../Cache/CrossCacheDeadlockStressTest.cs | 24 +-------- .../Cache/DeadlockTortureTest.cs | 12 ----- .../Cache/DeferUntilLoadedFixture.cs | 9 ---- .../Cache/DisposeManyFixture.cs | 9 ---- .../Cache/DistinctFixture.cs | 12 +---- .../Cache/DynamicAndFixture.cs | 9 ---- .../Cache/DynamicExceptFixture.cs | 9 ---- .../Cache/DynamicOrFixture.cs | 9 ---- .../Cache/DynamicXorFixture.cs | 9 ---- .../Cache/EditDiffChangeSetFixture.cs | 10 +--- .../Cache/EditDiffChangeSetOptionalFixture.cs | 13 +---- .../Cache/EditDiffFixture.cs | 11 +---- .../Cache/EnsureUniqueKeysFixture.cs | 9 +--- src/DynamicData.Tests/Cache/ExceptFixture.cs | 11 +---- .../Cache/ExpireAfterFixture.ForSource.cs | 17 +------ .../Cache/ExpireAfterFixture.ForStream.cs | 18 +------ .../Cache/ExpireAfterFixture.cs | 7 +-- .../Cache/FilterFixture.Base.cs | 12 +---- ...xture.DynamicPredicate.IntegrationTests.cs | 14 +----- ...ilterFixture.DynamicPredicate.UnitTests.cs | 13 +---- ...redicateAndReFiltering.IntegrationTests.cs | 15 +----- ...ynamicPredicateAndReFiltering.UnitTests.cs | 13 +---- ....DynamicPredicateState.IntegrationTests.cs | 13 +---- ...Fixture.DynamicPredicateState.UnitTests.cs | 12 +---- .../Cache/FilterFixture.Static.cs | 17 +------ src/DynamicData.Tests/Cache/FilterFixture.cs | 8 +-- .../Cache/FilterImmutableFixture.cs | 13 +---- .../Cache/FilterOnConnectFixture.cs | 6 +-- .../Cache/FilterOnObservableFixture.cs | 13 +---- .../Cache/FilterParallelFixture.cs | 10 ---- .../Cache/ForEachChangeFixture.cs | 9 ---- .../Cache/FromAsyncFixture.cs | 16 +----- .../Cache/FullJoinFixture.cs | 9 ---- .../Cache/FullJoinManyFixture.cs | 12 +---- .../Cache/GroupControllerFixture.cs | 11 ----- .../GroupControllerForFilteredItemsFixture.cs | 11 ----- src/DynamicData.Tests/Cache/GroupFixture.cs | 14 +----- .../Cache/GroupFromDistinctFixture.cs | 11 ----- .../Cache/GroupImmutableFixture.cs | 12 +---- .../Cache/GroupOnDynamicFixture.cs | 18 +------ .../Cache/GroupOnObservableFixture.cs | 18 +------ .../Cache/GroupOnPropertyFixture.cs | 11 +---- ...roupOnPropertyWithImmutableStateFixture.cs | 12 +---- .../Cache/IgnoreUpdateFixture.cs | 10 +--- .../Cache/IncludeUpdateFixture.cs | 10 +--- .../Cache/InnerJoinFixture.cs | 10 +--- .../Cache/InnerJoinFixtureRaceCondition.cs | 6 --- .../Cache/InnerJoinManyFixture.cs | 12 +---- .../Cache/KeyValueCollectionEx.cs | 3 -- .../Cache/LeftJoinFixture.cs | 12 +---- .../Cache/LeftJoinManyFixture.cs | 12 +---- .../Cache/MergeChangeSetsFixture.cs | 14 +----- ...ets.WithSourceComparer.IntegrationTests.cs | 19 ------- ...ChangeSets.WithSourceComparer.UnitTests.cs | 15 ------ ....WithoutSourceComparer.IntegrationTests.cs | 18 ------- ...ngeSets.WithoutSourceComparer.UnitTests.cs | 15 ------ ...anyChangeSetsFixture.ForCacheChangeSets.cs | 4 -- ...ture.ForListChangesets.IntegrationTests.cs | 15 ------ ...SetsFixture.ForListChangesets.UnitTests.cs | 17 ------- ...ManyChangeSetsFixture.ForListChangesets.cs | 8 --- .../Cache/MergeManyFixture.cs | 8 --- .../Cache/MergeManyItemsFixture.cs | 8 --- .../Cache/MergeManyWithKeyOverloadFixture.cs | 8 --- .../Cache/MonitorStatusFixture.cs | 12 +---- .../Cache/ObservableCachePreviewFixture.cs | 9 +--- .../Cache/ObservableChangeSetFixture.cs | 22 ++------- src/DynamicData.Tests/Cache/OfTypeFixture.cs | 12 +---- src/DynamicData.Tests/Cache/OnItemFixture.cs | 11 +---- src/DynamicData.Tests/Cache/OrFixture.cs | 12 +---- src/DynamicData.Tests/Cache/PageFixture.cs | 12 ----- .../Cache/QueryWhenChangedFixture.cs | 8 --- .../Cache/RefCountFixture.cs | 13 +---- .../Cache/RemoveKeyFixture.cs | 19 +------ .../Cache/RightJoinFixture.cs | 12 +---- .../Cache/RightJoinManyFixture.cs | 12 +---- .../Cache/SizeLimitFixture.cs | 12 ----- .../Cache/SortAndBindFixture.cs | 13 ----- .../Cache/SortAndBindObservableFixture.cs | 12 +---- .../Cache/SortAndPageAndBindFixture.cs | 13 +---- .../Cache/SortAndPageFixture.cs | 13 +---- .../Cache/SortAndVirtualizeAndBindFixture.cs | 12 +---- .../Cache/SortAndVirtualizeFixture.cs | 16 +----- src/DynamicData.Tests/Cache/SortFixture.cs | 18 ------- .../Cache/SortObservableFixtureFixture.cs | 14 +----- .../SourceCacheFixture.IntegrationTests.cs | 9 ---- .../Cache/SourceCacheFixture.UnitTests.cs | 13 ----- .../Cache/SubscribeManyFixture.cs | 10 +--- ...ndNotificationsFixture.IntegrationTests.cs | 10 ---- .../SuspendNotificationsFixture.UnitTests.cs | 15 +----- .../SwitchFixture.SubscriptionLifetime.cs | 16 +----- src/DynamicData.Tests/Cache/SwitchFixture.cs | 13 +---- .../Cache/ToCollectionFixture.cs | 11 ----- ...ChangeSetFixture.Items.IntegrationTests.cs | 13 +---- ...ervableChangeSetFixture.Items.UnitTests.cs | 14 +----- ...geSetFixture.Sequences.IntegrationTests.cs | 13 +---- ...bleChangeSetFixture.Sequences.UnitTests.cs | 15 +----- .../Cache/ToObservableChangeSetFixture.cs | 4 +- ...oObservableOptionalFixture.InitialValue.cs | 17 +------ .../Cache/ToObservableOptionalFixture.cs | 14 +----- .../Cache/ToSortedCollectionFixture.cs | 17 +------ .../Cache/TransformAsyncFixture.cs | 20 -------- .../Cache/TransformFixture.cs | 13 +---- .../Cache/TransformFixtureParallel.cs | 10 ---- .../Cache/TransformImmutableFixture.cs | 11 +---- .../Cache/TransformManyAsyncFixture.cs | 15 +----- .../Cache/TransformManyFixture.cs | 11 +---- .../TransformManyObservableCacheFixture.cs | 17 ++----- .../Cache/TransformManyRefreshFixture.cs | 11 +---- .../Cache/TransformManySimpleFixture.cs | 10 +--- .../Cache/TransformOnObservableFixture.cs | 18 +------ ...formSafeAsyncFixture.ArgumentValidation.cs | 10 ---- .../Cache/TransformSafeAsyncFixture.cs | 13 ----- .../Cache/TransformSafeFixture.cs | 11 ----- .../Cache/TransformSafeParallelFixture.cs | 11 ----- .../Cache/TransformTreeFixture.cs | 25 +++------- .../Cache/TransformTreeWithRefreshFixture.cs | 13 +---- .../Cache/TransformWithInlineUpdateFixture.cs | 10 +--- .../Cache/TrueForAllFixture.cs | 8 --- .../Cache/TrueForAnyFixture.cs | 10 ---- src/DynamicData.Tests/Cache/WatchFixture.cs | 7 --- src/DynamicData.Tests/Cache/WatcherFixture.cs | 19 +------ src/DynamicData.Tests/Cache/XorFixture.cs | 11 +---- src/DynamicData.Tests/Domain/Animal.cs | 8 +-- src/DynamicData.Tests/Domain/AnimalOwner.cs | 8 +-- src/DynamicData.Tests/Domain/Fakers.cs | 7 +-- src/DynamicData.Tests/Domain/Market.cs | 11 +---- src/DynamicData.Tests/Domain/MarketPrice.cs | 8 +-- .../Domain/ParentAndChildren.cs | 6 +-- src/DynamicData.Tests/Domain/Person.cs | 7 +-- .../Domain/PersonEmployment.cs | 6 +-- src/DynamicData.Tests/Domain/PersonObs.cs | 8 +-- .../Domain/PersonWithChildren.cs | 3 -- .../Domain/PersonWithEmployment.cs | 2 - .../Domain/PersonWithFriends.cs | 5 -- .../Domain/PersonWithGender.cs | 3 +- .../Domain/PersonWithRelations.cs | 3 -- .../Domain/RandomPersonGenerator.cs | 6 +-- .../Domain/SelfObservingPerson.cs | 5 +- src/DynamicData.Tests/EnumerableExFixtures.cs | 10 +--- .../EnumerableIListFixture.cs | 11 +---- src/DynamicData.Tests/Global.cs | 49 +++++++++++++++++++ .../IntegrationTestFixtureBase.cs | 4 +- .../CacheParentSubscriptionFixture.cs | 18 +------ .../Internal/DeliveryQueueFixture.cs | 11 ----- .../Internal/DeliveryQueueMergeFixture.cs | 17 +------ .../Internal/KeyedDisposableFixture.cs | 7 --- .../Internal/NotificationFixture.cs | 7 --- .../Internal/SharedDeliveryQueueFixture.cs | 15 +----- .../Internal/SwappableLockFixture.cs | 7 +-- .../UnsynchronizedCombineLatestFixture.cs | 10 ---- .../Internal/UnsynchronizedMergeFixture.cs | 12 +---- .../Issues/EmptyToChangeSetIssue.cs | 8 +-- .../Issues/OnItemRemovedIssue.cs | 8 +-- .../Kernal/CacheUpdaterFixture.cs | 11 +---- .../Kernal/DistinctUpdateFixture.cs | 11 +---- src/DynamicData.Tests/Kernal/EnumerableEx.cs | 3 -- .../Kernal/KeyValueFixture.cs | 10 +--- src/DynamicData.Tests/Kernal/OptionFixture.cs | 11 +---- .../Kernal/OptionObservableFixture.cs | 12 +---- .../Kernal/SourceUpdaterFixture.cs | 9 ---- src/DynamicData.Tests/Kernal/UpdateFixture.cs | 11 +---- src/DynamicData.Tests/List/AndFixture.cs | 10 +--- .../List/AutoRefreshFixture.cs | 15 +----- src/DynamicData.Tests/List/BatchFixture.cs | 11 ----- src/DynamicData.Tests/List/BatchIfFixture.cs | 12 ----- .../List/BatchIfWithTimeOutFixture.cs | 11 ----- src/DynamicData.Tests/List/BufferFixture.cs | 11 ----- .../List/BufferInitialFixture.cs | 12 ----- src/DynamicData.Tests/List/CastFixture.cs | 9 +--- .../List/ChangeAwareListFixture.cs | 11 +---- .../List/ChangeSetFixture.cs | 19 +------ .../List/CloneChangesFixture.cs | 12 +---- src/DynamicData.Tests/List/CloneFixture.cs | 13 +---- .../List/CreationFixtures.cs | 12 +---- .../List/DeferUntilLoadedFixture.cs | 9 ---- .../List/DisposeManyFixture.cs | 10 ---- .../List/DistinctValuesFixture.cs | 9 ---- .../List/DynamicAndFixture.cs | 7 --- .../List/DynamicExceptFixture.cs | 7 --- .../List/DynamicOrFixture.cs | 7 --- .../List/DynamicXOrFixture.cs | 7 --- src/DynamicData.Tests/List/EditDiffFixture.cs | 11 +---- src/DynamicData.Tests/List/ExceptFixture.cs | 10 +--- .../List/ExpireAfterFixture.cs | 17 ------- ...terControllerFixtureWithClearAndReplace.cs | 10 ---- .../FilterControllerFixtureWithDiffSet.cs | 10 ---- .../List/FilterFixture.Base.cs | 10 +--- .../List/FilterFixture.Static.cs | 17 +------ .../List/FilterFixture.WithPredicateState.cs | 17 +------ .../List/FilterOnObservableFixture.cs | 10 ---- .../List/FilterOnPropertyFixture.cs | 9 ---- .../List/FilterWithObservable.cs | 10 ---- .../List/ForEachChangeFixture.cs | 10 ---- .../List/FromAsyncFixture.cs | 16 +----- .../List/GroupImmutableFixture.cs | 14 +----- src/DynamicData.Tests/List/GroupOnFixture.cs | 9 ---- .../List/GroupOnPropertyFixture.cs | 12 +---- ...roupOnPropertyWithImmutableStateFixture.cs | 12 +---- .../List/MergeChangeSetsFixture.cs | 18 +------ .../List/MergeManyChangeSetsCacheFixture.cs | 18 +------ .../List/MergeManyChangeSetsFixture.cs | 5 -- .../List/MergeManyChangeSetsListFixture.cs | 17 +------ .../List/MergeManyFixture.cs | 8 --- .../List/OnItemAddedFixture.cs | 9 ---- .../List/OnItemRefreshedFixture.cs | 9 ---- .../List/OnItemRemovedFixture.cs | 10 ---- src/DynamicData.Tests/List/OrFixture.cs | 12 +---- src/DynamicData.Tests/List/PageFixture.cs | 13 ----- .../List/QueryWhenChangedFixture.cs | 8 --- .../List/RecursiveTransformManyFixture.cs | 9 ---- src/DynamicData.Tests/List/RefCountFixture.cs | 11 ----- .../List/RemoveManyFixture.cs | 8 --- src/DynamicData.Tests/List/ReverseFixture.cs | 9 +--- src/DynamicData.Tests/List/SelectFixture.cs | 10 +--- .../List/SizeLimitFixture.cs | 11 ----- src/DynamicData.Tests/List/SortFixture.cs | 13 +---- .../List/SortMutableFixture.cs | 14 ------ .../List/SortPrimitiveFixture.cs | 10 ---- .../List/SourceListFixture.cs | 12 +---- .../List/SourceListPreviewFixture.cs | 7 +-- .../List/SubscribeManyFixture.cs | 8 --- src/DynamicData.Tests/List/SwitchFixture.cs | 15 +----- .../List/ToCollectionFixture.cs | 8 +-- ...ChangeSetFixture.Items.IntegrationTests.cs | 13 +---- ...ervableChangeSetFixture.Items.UnitTests.cs | 14 +----- ...geSetFixture.Sequences.IntegrationTests.cs | 13 +---- ...bleChangeSetFixture.Sequences.UnitTests.cs | 15 +----- .../List/ToObservableChangeSetFixture.cs | 4 +- .../List/TransformAsyncFixture.cs | 11 ----- .../List/TransformFixture.cs | 12 +---- .../List/TransformManyFixture.cs | 11 ----- ...ransformManyObservableCollectionFixture.cs | 12 +---- .../List/TransformManyProjectionFixture.cs | 13 +---- .../List/TransformManyRefreshFixture.cs | 10 ---- .../List/VirtualisationFixture.cs | 11 ----- src/DynamicData.Tests/List/XOrFixture.cs | 10 +--- .../ObservableCollectionExFixture.cs | 11 +---- .../Utilities/CacheChangeSetAssertions.cs | 7 +-- .../Utilities/CacheItemRecordingObserver.cs | 5 +- .../CacheItemRecordingObserverAssertions.cs | 4 +- .../Utilities/ComparerExtensions.cs | 6 +-- .../Utilities/FakeScheduler.cs | 7 +-- .../Utilities/FakerExtensions.cs | 8 +-- .../Utilities/FunctionalExtensions.cs | 4 +- .../Utilities/ListChangeSetAssertions.cs | 7 +-- .../Utilities/ListItemRecordingObserver.cs | 5 +- .../Utilities/ObservableEx.cs | 6 +-- .../Utilities/ObservableExtensions.cs | 17 ++----- .../Utilities/ObservableSpy.cs | 14 ++---- .../Utilities/RandomizerExtensions.cs | 7 +-- .../Utilities/RawAnonymousObservable.cs | 4 +- .../Utilities/RawAnonymousObserver.cs | 4 +- .../Utilities/RecordingObserverBase.cs | 14 ++---- .../Utilities/SelectManyExtensions.cs | 6 +-- .../Utilities/StressAddRemoveExtensions.cs | 7 +-- .../Utilities/TestSourceCache.cs | 10 +--- .../Utilities/TestSourceList.cs | 9 +--- .../UnsynchronizedNotificationException.cs | 9 ++-- .../Utilities/ValueRecordingObserver.cs | 5 +- .../Aggregation/AggregateEnumerator.cs | 4 -- src/DynamicData/Aggregation/AggregationEx.cs | 3 -- src/DynamicData/Aggregation/AvgEx.cs | 2 - src/DynamicData/Aggregation/CountEx.cs | 2 - src/DynamicData/Aggregation/MaxEx.cs | 2 - src/DynamicData/Aggregation/StdDevEx.cs | 2 - src/DynamicData/Alias/ObservableCacheAlias.cs | 2 - src/DynamicData/Attributes.cs | 7 --- .../Binding/AbstractNotifyPropertyChanged.cs | 5 -- src/DynamicData/Binding/BindPaged.cs | 5 -- src/DynamicData/Binding/BindVirtualized.cs | 5 -- src/DynamicData/Binding/BindingListAdaptor.cs | 5 -- .../Binding/BindingListEventsSuspender.cs | 4 -- src/DynamicData/Binding/BindingListEx.cs | 6 --- src/DynamicData/Binding/ExpressionBuilder.cs | 6 --- .../Binding/IObservableCollection.cs | 3 -- src/DynamicData/Binding/IObservableListEx.cs | 5 +- .../Binding/NotifyPropertyChangedEx.cs | 4 -- src/DynamicData/Binding/Observable.cs | 2 - .../Binding/ObservableCollectionAdaptor.cs | 4 -- .../Binding/ObservableCollectionEx.cs | 7 +-- .../Binding/ObservableCollectionExtended.cs | 5 -- .../Binding/ObservablePropertyFactory.cs | 9 ---- .../Binding/ObservablePropertyFactoryCache.cs | 5 -- .../Binding/ObservablePropertyPart.cs | 4 -- src/DynamicData/Binding/SortAndBind.cs | 7 --- src/DynamicData/Binding/SortAndBindOptions.cs | 2 - .../Binding/SortedBindingListAdaptor.cs | 2 - src/DynamicData/Cache/CacheChangeSetEx.cs | 2 +- src/DynamicData/Cache/ChangeAwareCache.cs | 4 +- src/DynamicData/Cache/IPagedChangeSet.cs | 2 - src/DynamicData/Cache/IntermediateCache.cs | 3 -- .../Internal/AnonymousObservableCache.cs | 5 +- .../Cache/Internal/AsyncDisposeMany.cs | 5 -- src/DynamicData/Cache/Internal/AutoRefresh.cs | 4 -- src/DynamicData/Cache/Internal/BatchIf.cs | 5 -- src/DynamicData/Cache/Internal/Cache.cs | 2 - src/DynamicData/Cache/Internal/Cast.cs | 2 - .../Cache/Internal/ChangeSetCache.cs | 2 - src/DynamicData/Cache/Internal/Combiner.cs | 2 - .../Cache/Internal/DeferUntilLoaded.cs | 2 - src/DynamicData/Cache/Internal/DisposeMany.cs | 4 -- .../Cache/Internal/DistinctCalculator.cs | 2 - .../Cache/Internal/DynamicCombiner.cs | 3 -- .../Cache/Internal/DynamicGrouper.cs | 3 -- .../Internal/EditDiffChangeSetOptional.cs | 2 - .../Cache/Internal/ExpireAfter.ForSource.cs | 6 --- .../Cache/Internal/ExpireAfter.ForStream.cs | 6 --- .../Cache/Internal/Filter.Dynamic.cs | 4 -- .../Cache/Internal/Filter.Static.cs | 2 - .../Cache/Internal/FilterImmutable.cs | 3 -- .../Cache/Internal/FilterOnObservable.cs | 3 -- src/DynamicData/Cache/Internal/FinallySafe.cs | 3 -- src/DynamicData/Cache/Internal/FullJoin.cs | 3 -- src/DynamicData/Cache/Internal/GroupOn.cs | 6 --- .../Cache/Internal/GroupOnDynamic.cs | 6 --- .../Cache/Internal/GroupOnImmutable.cs | 4 -- .../Cache/Internal/GroupOnObservable.cs | 3 -- .../Cache/Internal/GroupOnProperty.cs | 5 -- .../GroupOnPropertyWithImmutableState.cs | 5 -- .../Cache/Internal/IndexAndNode.cs | 2 - src/DynamicData/Cache/Internal/InnerJoin.cs | 3 -- src/DynamicData/Cache/Internal/KeySelector.cs | 2 - .../Cache/Internal/KeyValueCollection.cs | 2 - src/DynamicData/Cache/Internal/LeftJoin.cs | 3 -- .../Cache/Internal/LockFreeObservableCache.cs | 11 ++--- .../Cache/Internal/MergeChangeSets.cs | 4 -- src/DynamicData/Cache/Internal/MergeMany.cs | 4 -- .../Internal/MergeManyCacheChangeSets.cs | 3 -- .../MergeManyCacheChangeSetsSourceCompare.cs | 3 -- .../Cache/Internal/MergeManyItems.cs | 2 - .../Cache/Internal/MergeManyListChangeSets.cs | 4 -- .../Cache/Internal/ObservableWithValue.cs | 2 - src/DynamicData/Cache/Internal/OfType.cs | 3 -- .../Cache/Internal/OnBeingRemoved.cs | 3 -- src/DynamicData/Cache/Internal/Page.cs | 3 -- .../Cache/Internal/QueryWhenChanged.cs | 3 -- src/DynamicData/Cache/Internal/RefCount.cs | 3 -- .../Cache/Internal/RemoveKeyEnumerator.cs | 2 - src/DynamicData/Cache/Internal/RightJoin.cs | 3 -- src/DynamicData/Cache/Internal/SizeExpirer.cs | 3 -- src/DynamicData/Cache/Internal/Sort.cs | 4 -- src/DynamicData/Cache/Internal/SortAndPage.cs | 4 -- .../Cache/Internal/SortAndVirtualize.cs | 4 -- .../Cache/Internal/SortExtensions.cs | 2 - .../Internal/SortedKeyValueApplicator.cs | 2 - .../Cache/Internal/SpecifiedGrouper.cs | 3 -- .../Cache/Internal/StatusMonitor.cs | 4 -- .../Cache/Internal/SubscribeMany.cs | 4 -- src/DynamicData/Cache/Internal/Switch.cs | 3 -- .../Cache/Internal/ToObservableChangeSet.cs | 6 --- .../Cache/Internal/ToObservableOptional.cs | 2 - src/DynamicData/Cache/Internal/Transform.cs | 2 - .../Cache/Internal/TransformAsync.cs | 6 --- .../Cache/Internal/TransformImmutable.cs | 3 -- .../Cache/Internal/TransformMany.cs | 8 --- .../Cache/Internal/TransformManyAsync.cs | 3 -- .../Cache/Internal/TransformOnObservable.cs | 3 -- .../Internal/TransformWithForcedTransform.cs | 3 -- .../Internal/TransformWithInlineUpdate.cs | 2 - src/DynamicData/Cache/Internal/TreeBuilder.cs | 7 --- src/DynamicData/Cache/Internal/TrueFor.cs | 3 -- .../Cache/Internal/UniquenessEnforcer.cs | 2 - src/DynamicData/Cache/Internal/Virtualise.cs | 3 -- src/DynamicData/Cache/Node.cs | 4 +- src/DynamicData/Cache/ObservableCache.cs | 16 ++---- .../Cache/ObservableCacheEx.Adapt.cs | 14 ------ .../Cache/ObservableCacheEx.AdaptSelector.cs | 14 ------ .../Cache/ObservableCacheEx.AddOrUpdate.cs | 14 ------ .../Cache/ObservableCacheEx.And.cs | 14 ------ .../ObservableCacheEx.AsObservableCache.cs | 14 ------ .../ObservableCacheEx.AsyncDisposeMany.cs | 17 +------ .../Cache/ObservableCacheEx.AutoRefresh.cs | 14 ------ ...servableCacheEx.AutoRefreshOnObservable.cs | 14 ------ .../Cache/ObservableCacheEx.Batch.cs | 14 ------ .../Cache/ObservableCacheEx.BatchIf.cs | 14 ------ .../Cache/ObservableCacheEx.Bind.cs | 14 ------ .../Cache/ObservableCacheEx.BufferInitial.cs | 14 ------ .../Cache/ObservableCacheEx.Cast.cs | 14 ------ .../Cache/ObservableCacheEx.ChangeKey.cs | 14 ------ .../Cache/ObservableCacheEx.Clear.cs | 14 ------ .../Cache/ObservableCacheEx.Clone.cs | 14 ------ .../Cache/ObservableCacheEx.Combine.cs | 14 ------ .../Cache/ObservableCacheEx.Convert.cs | 14 ------ ...vableCacheEx.CreateChangeSetTransformer.cs | 14 ------ .../ObservableCacheEx.DeferUntilLoaded.cs | 14 ------ .../Cache/ObservableCacheEx.DisposeMany.cs | 14 ------ .../Cache/ObservableCacheEx.DistinctValues.cs | 14 ------ .../Cache/ObservableCacheEx.EditDiff.cs | 14 ------ .../ObservableCacheEx.EnsureUniqueKeys.cs | 14 ------ .../Cache/ObservableCacheEx.Except.cs | 14 ------ .../Cache/ObservableCacheEx.ExpireAfter.cs | 29 ++++------- .../Cache/ObservableCacheEx.Filter.cs | 23 +++------ .../ObservableCacheEx.FilterImmutable.cs | 14 ------ .../ObservableCacheEx.FilterOnObservable.cs | 14 ------ .../Cache/ObservableCacheEx.FinallySafe.cs | 14 ------ .../Cache/ObservableCacheEx.Flatten.cs | 14 ------ .../ObservableCacheEx.FlattenBufferResult.cs | 14 ------ .../Cache/ObservableCacheEx.ForEachChange.cs | 14 ------ .../Cache/ObservableCacheEx.ForForced.cs | 14 ------ .../Cache/ObservableCacheEx.FullJoin.cs | 14 ------ .../Cache/ObservableCacheEx.FullJoinMany.cs | 14 ------ .../Cache/ObservableCacheEx.Group.cs | 14 ------ .../ObservableCacheEx.GroupOnObservable.cs | 14 ------ .../ObservableCacheEx.GroupOnProperty.cs | 14 ------ ...cheEx.GroupOnPropertyWithImmutableState.cs | 14 ------ ...servableCacheEx.GroupWithImmutableState.cs | 14 ------ ...rvableCacheEx.IgnoreSameReferenceUpdate.cs | 14 ------ .../ObservableCacheEx.IgnoreUpdateWhen.cs | 14 ------ .../ObservableCacheEx.IncludeUpdateWhen.cs | 14 ------ .../Cache/ObservableCacheEx.InnerJoin.cs | 14 ------ .../Cache/ObservableCacheEx.InnerJoinMany.cs | 14 ------ .../Cache/ObservableCacheEx.InvokeEvaluate.cs | 14 ------ .../Cache/ObservableCacheEx.LeftJoin.cs | 14 ------ .../Cache/ObservableCacheEx.LeftJoinMany.cs | 14 ------ .../Cache/ObservableCacheEx.LimitSizeTo.cs | 14 ------ .../ObservableCacheEx.MergeChangeSets.cs | 14 ------ .../Cache/ObservableCacheEx.MergeMany.cs | 14 ------ .../ObservableCacheEx.MergeManyChangeSets.cs | 14 ------ .../Cache/ObservableCacheEx.MergeManyItems.cs | 14 ------ .../Cache/ObservableCacheEx.MonitorStatus.cs | 14 ------ .../Cache/ObservableCacheEx.NotEmpty.cs | 14 ------ .../Cache/ObservableCacheEx.OfType.cs | 14 ------ .../Cache/ObservableCacheEx.OnChangeAction.cs | 14 ------ .../Cache/ObservableCacheEx.OnItemAdded.cs | 14 ------ .../ObservableCacheEx.OnItemRefreshed.cs | 14 ------ .../Cache/ObservableCacheEx.OnItemRemoved.cs | 14 ------ .../Cache/ObservableCacheEx.OnItemUpdated.cs | 14 ------ src/DynamicData/Cache/ObservableCacheEx.Or.cs | 14 ------ .../Cache/ObservableCacheEx.PopulateFrom.cs | 14 ------ .../Cache/ObservableCacheEx.PopulateInto.cs | 14 ------ .../ObservableCacheEx.QueryWhenChanged.cs | 14 ------ .../Cache/ObservableCacheEx.RefCount.cs | 14 ------ .../Cache/ObservableCacheEx.Refresh.cs | 14 ------ .../Cache/ObservableCacheEx.Remove.cs | 14 ------ .../Cache/ObservableCacheEx.RemoveKey.cs | 14 ------ .../Cache/ObservableCacheEx.RemoveKeys.cs | 14 ------ .../Cache/ObservableCacheEx.RightJoin.cs | 14 ------ .../Cache/ObservableCacheEx.RightJoinMany.cs | 14 ------ .../Cache/ObservableCacheEx.SkipInitial.cs | 14 ------ .../Cache/ObservableCacheEx.Sort.cs | 14 ------ .../Cache/ObservableCacheEx.SortAndBind.cs | 4 -- .../Cache/ObservableCacheEx.SortBy.cs | 14 ------ .../Cache/ObservableCacheEx.StartWithEmpty.cs | 14 ------ .../Cache/ObservableCacheEx.StartWithItem.cs | 14 ------ .../Cache/ObservableCacheEx.SubscribeMany.cs | 14 ------ .../ObservableCacheEx.SuppressRefresh.cs | 14 ------ .../Cache/ObservableCacheEx.Switch.cs | 14 ------ .../Cache/ObservableCacheEx.ToCollection.cs | 14 ------ ...ObservableCacheEx.ToObservableChangeSet.cs | 14 ------ .../ObservableCacheEx.ToObservableOptional.cs | 14 ------ .../ObservableCacheEx.ToSortedCollection.cs | 14 ------ .../Cache/ObservableCacheEx.Transform.cs | 14 ------ .../Cache/ObservableCacheEx.TransformAsync.cs | 14 ------ .../ObservableCacheEx.TransformImmutable.cs | 14 ------ .../Cache/ObservableCacheEx.TransformMany.cs | 14 ------ .../ObservableCacheEx.TransformManyAsync.cs | 14 ------ ...bservableCacheEx.TransformManySafeAsync.cs | 14 ------ ...ObservableCacheEx.TransformOnObservable.cs | 14 ------ .../Cache/ObservableCacheEx.TransformSafe.cs | 14 ------ .../ObservableCacheEx.TransformSafeAsync.cs | 14 ------ .../ObservableCacheEx.TransformToTree.cs | 14 ------ ...rvableCacheEx.TransformWithInlineUpdate.cs | 14 ------ ...ObservableCacheEx.TreatMovesAsRemoveAdd.cs | 14 ------ .../Cache/ObservableCacheEx.TrueFor.cs | 14 ------ .../Cache/ObservableCacheEx.TrueForAll.cs | 14 ------ .../Cache/ObservableCacheEx.TrueForAny.cs | 14 ------ .../Cache/ObservableCacheEx.UpdateIndex.cs | 14 ------ .../ObservableCacheEx.VirtualiseAndPage.cs | 3 -- .../Cache/ObservableCacheEx.Watch.cs | 14 ------ .../Cache/ObservableCacheEx.WatchValue.cs | 14 ------ ...bservableCacheEx.WhenAnyPropertyChanged.cs | 14 ------ .../ObservableCacheEx.WhenPropertyChanged.cs | 14 ------ .../ObservableCacheEx.WhenValueChanged.cs | 14 ------ .../ObservableCacheEx.WhereReasonsAre.cs | 14 ------ .../ObservableCacheEx.WhereReasonsAreNot.cs | 14 ------ .../Cache/ObservableCacheEx.Xor.cs | 14 ------ src/DynamicData/Cache/ObservableCacheEx.cs | 14 ------ src/DynamicData/Cache/PageContext.cs | 2 - src/DynamicData/Cache/PageResponse.cs | 2 - src/DynamicData/Cache/PagedChangeSet.cs | 3 -- src/DynamicData/Cache/SortAndPageOptions.cs | 2 - .../Cache/SortAndVirtualizeOptions.cs | 2 - src/DynamicData/Cache/SortedChangeSet.cs | 2 - src/DynamicData/Cache/SourceCache.cs | 3 -- .../Cache/Tests/ChangeSetAggregator.cs | 5 -- .../Tests/DistinctChangeSetAggregator.cs | 5 -- .../Cache/Tests/GroupChangeSetAggregator.cs | 5 -- .../Cache/Tests/PagedChangeSetAggregator.cs | 5 -- .../Cache/Tests/SortedChangeSetAggregator.cs | 5 -- .../Cache/Tests/VirtualChangeSetAggregator.cs | 5 -- src/DynamicData/Cache/VirtualChangeSet.cs | 2 - .../Diagnostics/DiagnosticOperators.cs | 2 - src/DynamicData/DynamicData.csproj | 6 --- src/DynamicData/DynamicDataOptions.cs | 2 - src/DynamicData/EnumerableEx.cs | 3 -- .../Experimental/ExperimentalEx.cs | 2 - .../Experimental/ISubjectWithRefCount.cs | 2 - .../Experimental/SubjectWithRefCount.cs | 3 -- src/DynamicData/Experimental/Watcher.cs | 9 +--- src/DynamicData/Global.cs | 35 +++++++++++++ src/DynamicData/GlobalConfig.cs | 2 - .../Internal/CacheParentSubscription.cs | 4 -- .../Internal/DeliveryQueueMergeExtensions.cs | 4 -- src/DynamicData/Internal/Notification.cs | 2 - src/DynamicData/Internal/ObservableEx.cs | 3 -- .../Internal/SharedDeliveryQueue.cs | 2 - .../Internal/SynchronizeSafeExtensions.cs | 4 -- src/DynamicData/Kernel/EnumerableEx.cs | 2 + src/DynamicData/Kernel/EnumerableIList.cs | 3 -- src/DynamicData/Kernel/EnumeratorIList.cs | 2 - src/DynamicData/Kernel/Error.cs | 2 +- src/DynamicData/Kernel/InternalEx.cs | 5 -- .../Kernel/OptionObservableExtensions.cs | 2 - src/DynamicData/Kernel/Optional.cs | 2 - .../Kernel/ReadOnlyCollectionLight.cs | 2 - src/DynamicData/List/ChangeAwareList.cs | 2 - .../List/ChangeAwareListWithRefCounts.cs | 2 - src/DynamicData/List/ChangeSetEx.cs | 3 -- src/DynamicData/List/IPageChangeSet.cs | 2 - .../List/Internal/AnonymousObservableList.cs | 5 +- src/DynamicData/List/Internal/AutoRefresh.cs | 4 -- src/DynamicData/List/Internal/BufferIf.cs | 5 -- .../List/Internal/ClonedListChangeSet.cs | 2 - src/DynamicData/List/Internal/Combiner.cs | 7 +-- .../List/Internal/DeferUntilLoaded.cs | 2 - src/DynamicData/List/Internal/DisposeMany.cs | 4 -- src/DynamicData/List/Internal/Distinct.cs | 2 - .../List/Internal/DynamicCombiner.cs | 7 +-- src/DynamicData/List/Internal/ExpireAfter.cs | 6 --- .../List/Internal/Filter.Dynamic.cs | 2 - .../List/Internal/Filter.Static.cs | 2 - .../Internal/Filter.WithPredicateState.cs | 4 -- .../List/Internal/FilterOnObservable.cs | 4 -- .../List/Internal/FilterOnProperty.cs | 4 -- src/DynamicData/List/Internal/FilterStatic.cs | 2 - src/DynamicData/List/Internal/GroupOn.cs | 4 -- .../List/Internal/GroupOnImmutable.cs | 4 -- .../List/Internal/GroupOnProperty.cs | 5 -- .../GroupOnPropertyWithImmutableState.cs | 5 -- src/DynamicData/List/Internal/LimitSizeTo.cs | 3 -- .../List/Internal/MergeChangeSets.cs | 3 -- src/DynamicData/List/Internal/MergeMany.cs | 4 -- .../List/Internal/MergeManyCacheChangeSets.cs | 5 -- .../List/Internal/MergeManyListChangeSets.cs | 4 -- src/DynamicData/List/Internal/OnItemAdded.cs | 2 - .../List/Internal/OnItemRefreshed.cs | 2 - .../List/Internal/OnItemRemoved.cs | 2 - src/DynamicData/List/Internal/Pager.cs | 3 -- .../List/Internal/QueryWhenChanged.cs | 2 - src/DynamicData/List/Internal/RefCount.cs | 3 -- src/DynamicData/List/Internal/Sort.cs | 3 -- .../List/Internal/SubscribeMany.cs | 4 -- src/DynamicData/List/Internal/Switch.cs | 3 -- .../List/Internal/ToObservableChangeSet.cs | 6 --- .../List/Internal/TransformAsync.cs | 2 - .../List/Internal/TransformMany.cs | 7 --- src/DynamicData/List/Internal/Transformer.cs | 2 - src/DynamicData/List/Internal/Virtualiser.cs | 2 - src/DynamicData/List/Linq/AddKeyEnumerator.cs | 2 - .../List/Linq/ItemChangeEnumerator.cs | 2 - .../List/Linq/UnifiedChangeEnumerator.cs | 4 -- .../List/Linq/WithoutIndexEnumerator.cs | 2 - src/DynamicData/List/ListEx.cs | 2 - .../List/ObservableListEx.Adapt.cs | 13 ----- .../List/ObservableListEx.AddKey.cs | 13 ----- src/DynamicData/List/ObservableListEx.And.cs | 13 ----- .../List/ObservableListEx.AsObservableList.cs | 13 ----- .../List/ObservableListEx.AutoRefresh.cs | 13 ----- ...bservableListEx.AutoRefreshOnObservable.cs | 13 ----- src/DynamicData/List/ObservableListEx.Bind.cs | 13 ----- .../List/ObservableListEx.BufferIf.cs | 13 ----- .../List/ObservableListEx.BufferInitial.cs | 13 ----- src/DynamicData/List/ObservableListEx.Cast.cs | 13 ----- .../List/ObservableListEx.CastToObject.cs | 13 ----- .../List/ObservableListEx.Clone.cs | 13 ----- .../List/ObservableListEx.Combine.cs | 13 ----- .../List/ObservableListEx.Convert.cs | 13 ----- .../List/ObservableListEx.DeferUntilLoaded.cs | 13 ----- .../List/ObservableListEx.DisposeMany.cs | 13 ----- .../List/ObservableListEx.DistinctValues.cs | 13 ----- .../List/ObservableListEx.Except.cs | 13 ----- .../List/ObservableListEx.ExpireAfter.cs | 16 +----- .../List/ObservableListEx.Filter.cs | 24 +++------ .../ObservableListEx.FilterOnObservable.cs | 13 ----- .../List/ObservableListEx.FilterOnProperty.cs | 13 ----- .../ObservableListEx.FlattenBufferResult.cs | 13 ----- .../List/ObservableListEx.ForEachChange.cs | 13 ----- .../ObservableListEx.ForEachItemChange.cs | 13 ----- .../List/ObservableListEx.GroupOn.cs | 13 ----- .../List/ObservableListEx.GroupOnProperty.cs | 13 ----- ...istEx.GroupOnPropertyWithImmutableState.cs | 13 ----- ...bservableListEx.GroupWithImmutableState.cs | 13 ----- .../List/ObservableListEx.LimitSizeTo.cs | 13 ----- .../List/ObservableListEx.MergeChangeSets.cs | 13 ----- .../List/ObservableListEx.MergeMany.cs | 13 ----- .../ObservableListEx.MergeManyChangeSets.cs | 13 ----- .../List/ObservableListEx.NotEmpty.cs | 13 ----- .../List/ObservableListEx.OnItemAdded.cs | 16 +----- .../List/ObservableListEx.OnItemRefreshed.cs | 16 +----- .../List/ObservableListEx.OnItemRemoved.cs | 16 +----- src/DynamicData/List/ObservableListEx.Or.cs | 13 ----- src/DynamicData/List/ObservableListEx.Page.cs | 13 ----- .../List/ObservableListEx.PopulateInto.cs | 13 ----- .../List/ObservableListEx.QueryWhenChanged.cs | 13 ----- .../List/ObservableListEx.RefCount.cs | 13 ----- .../List/ObservableListEx.RemoveIndex.cs | 13 ----- .../List/ObservableListEx.Reverse.cs | 13 ----- .../List/ObservableListEx.SkipInitial.cs | 13 ----- src/DynamicData/List/ObservableListEx.Sort.cs | 13 ----- .../List/ObservableListEx.StartWithEmpty.cs | 13 ----- .../List/ObservableListEx.SubscribeMany.cs | 13 ----- .../List/ObservableListEx.SuppressRefresh.cs | 13 ----- .../List/ObservableListEx.Switch.cs | 13 ----- .../List/ObservableListEx.ToCollection.cs | 13 ----- .../ObservableListEx.ToObservableChangeSet.cs | 37 ++++++-------- .../ObservableListEx.ToSortedCollection.cs | 13 ----- src/DynamicData/List/ObservableListEx.Top.cs | 13 ----- .../List/ObservableListEx.Transform.cs | 13 ----- .../List/ObservableListEx.TransformAsync.cs | 23 ++------- .../List/ObservableListEx.TransformMany.cs | 13 ----- .../List/ObservableListEx.Virtualise.cs | 13 ----- ...ObservableListEx.WhenAnyPropertyChanged.cs | 13 ----- .../ObservableListEx.WhenPropertyChanged.cs | 13 ----- .../List/ObservableListEx.WhenValueChanged.cs | 13 ----- .../List/ObservableListEx.WhereReasonsAre.cs | 13 ----- .../ObservableListEx.WhereReasonsAreNot.cs | 13 ----- src/DynamicData/List/ObservableListEx.Xor.cs | 13 ----- src/DynamicData/List/ObservableListEx.cs | 13 ----- src/DynamicData/List/PageChangeSet.cs | 4 -- src/DynamicData/List/RangeChange.cs | 2 - src/DynamicData/List/SourceList.cs | 9 +--- .../List/SourceListEditConvenienceEx.cs | 2 - .../List/Tests/ChangeSetAggregator.cs | 3 -- src/DynamicData/List/VirtualChangeSet.cs | 2 - src/DynamicData/ObservableChangeSet.cs | 3 -- src/DynamicData/Platforms/net45/PFilter.cs | 4 -- .../Platforms/net45/PSubscribeMany.cs | 3 -- src/DynamicData/Platforms/net45/PTransform.cs | 4 +- 726 files changed, 428 insertions(+), 6569 deletions(-) create mode 100644 src/DynamicData.Benchmarks/Global.cs create mode 100644 src/DynamicData.Tests/Global.cs delete mode 100644 src/DynamicData/Attributes.cs create mode 100644 src/DynamicData/Global.cs diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 8d9261e1d..c5ec3abbf 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -89,6 +89,19 @@ src/ │ └── Domain/ # Test domain types using Bogus fakers ``` +## Usings and Namespaces + +**Do not add `using` directives to source files.** Each project declares its namespaces once, as `global using` directives in its own `Global.cs` (`src/DynamicData/Global.cs`, `src/DynamicData.Tests/Global.cs`, `src/DynamicData.Benchmarks/Global.cs`). `ImplicitUsings` is disabled, so `Global.cs` is the complete list. If you need a namespace that is not in scope, add it there. + +Two DynamicData namespaces are the exception and **must** stay file-level, because importing them globally silently rebinds existing calls: + +| Namespace | Why | +|---|---| +| `DynamicData.Alias` | Supplies `Select`, `Where` and `SelectMany` for changeset streams. They are more specific than the Rx operators of the same name, so importing globally silently rebinds calls such as `.Where(_ => flag)` to `Filter`. | +| `DynamicData.Aggregation` | Supplies `Count`, `Sum`, `Avg`, `Maximum` and `Minimum` for changeset streams. `Count()` is more specific than Rx's `Count()` and returns the same type, so importing globally silently turns a count of emitted changesets into a live item count. | + +If a global namespace makes a name ambiguous, qualify the call site or add a global alias in `Global.cs`. Do not move the namespace back into the file. Already handled: `System.Reactive.Notification` is qualified wherever the tests mean the Rx type rather than `DynamicData.Internal.Notification`, and the tests' `Global.cs` aliases `Person` to the domain type so it wins over `Bogus.Person`. + ## Operator Architecture Pattern Most operators follow the same two-part pattern: diff --git a/src/Directory.Build.props b/src/Directory.Build.props index d6620c0e7..73840a9f8 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -7,6 +7,7 @@ AnyCPU enable latest + disable $(MSBuildProjectName.Contains('Tests')) $(MSBuildProjectName.Contains('Benchmarks')) embedded diff --git a/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs b/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs index f5e397006..35795043a 100644 --- a/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.cs +++ b/src/DynamicData.Benchmarks/Cache/DeliveryQueueBenchmarks.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; -using System.Linq; -using System.Reactive.Linq; -using System.Threading; -using System.Threading.Tasks; - -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 1e4f83e65..fc1b34c15 100644 --- a/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/DisposeMany_Cache.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; - -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 a6b4fd53d..81c3d0dc7 100644 --- a/src/DynamicData.Benchmarks/Cache/EditDiff.cs +++ b/src/DynamicData.Benchmarks/Cache/EditDiff.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; - -using BenchmarkDotNet.Attributes; - -using DynamicData.Kernel; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs index 3c437f89f..cad902d57 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForSource.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; - -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs index a13cefbf0..09a58d931 100644 --- a/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs +++ b/src/DynamicData.Benchmarks/Cache/ExpireAfter_Cache_ForStream.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs index 6bde5da17..c34bc974f 100644 --- a/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/FilterImmutable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs index 0404b7c54..1cbbc0acd 100644 --- a/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/Cache/Filter_Cache_WithPredicateState.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs index 484e544e1..76eb445b8 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindChange.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Subjects; -using BenchmarkDotNet.Attributes; -using DynamicData.Binding; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs index a27b082bd..4d73f583d 100644 --- a/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs +++ b/src/DynamicData.Benchmarks/Cache/SortAndBindInitial.cs @@ -1,11 +1,4 @@ -using BenchmarkDotNet.Attributes; -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Subjects; -using DynamicData.Binding; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/SourceCache.cs b/src/DynamicData.Benchmarks/Cache/SourceCache.cs index f2157221d..567f88803 100644 --- a/src/DynamicData.Benchmarks/Cache/SourceCache.cs +++ b/src/DynamicData.Benchmarks/Cache/SourceCache.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.Linq; - -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 b4a806afb..5766288ff 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessFiltering.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs index 9328dd956..33b029399 100644 --- a/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs +++ b/src/DynamicData.Benchmarks/Cache/StatelessTransforming.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/Sum_Cache.cs b/src/DynamicData.Benchmarks/Cache/Sum_Cache.cs index 008192d9b..94c42b71d 100644 --- a/src/DynamicData.Benchmarks/Cache/Sum_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/Sum_Cache.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - using DynamicData.Aggregation; namespace DynamicData.Benchmarks.Cache; diff --git a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs index eca407d03..61949a4ca 100644 --- a/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs +++ b/src/DynamicData.Benchmarks/Cache/ToObservableChangeSet_Cache.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Columns; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs index 3bbd28d8f..072b6e05c 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformImmutable.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Cache/TransformMany.cs b/src/DynamicData.Benchmarks/Cache/TransformMany.cs index 5b91eaa41..a2e9fc723 100644 --- a/src/DynamicData.Benchmarks/Cache/TransformMany.cs +++ b/src/DynamicData.Benchmarks/Cache/TransformMany.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; - -using BenchmarkDotNet.Attributes; - -namespace DynamicData.Benchmarks.Cache; +namespace DynamicData.Benchmarks.Cache; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Global.cs b/src/DynamicData.Benchmarks/Global.cs new file mode 100644 index 000000000..0c1b3e25a --- /dev/null +++ b/src/DynamicData.Benchmarks/Global.cs @@ -0,0 +1,25 @@ +global using System; +global using System.Collections.Generic; +global using System.Collections.Immutable; +global using System.Collections.ObjectModel; +global using System.ComponentModel; +global using System.IO; +global using System.Linq; +global using System.Reactive.Disposables; +global using System.Reactive.Linq; +global using System.Reactive.Subjects; +global using System.Reflection; +global using System.Runtime.CompilerServices; +global using System.Threading; +global using System.Threading.Tasks; + +global using BenchmarkDotNet.Attributes; +global using BenchmarkDotNet.Columns; +global using BenchmarkDotNet.Configs; +global using BenchmarkDotNet.Jobs; +global using BenchmarkDotNet.Running; + +global using Bogus; + +global using DynamicData.Binding; +global using DynamicData.Kernel; diff --git a/src/DynamicData.Benchmarks/List/DisposeMany_List.cs b/src/DynamicData.Benchmarks/List/DisposeMany_List.cs index 53cbe5d5e..8f0d698e1 100644 --- a/src/DynamicData.Benchmarks/List/DisposeMany_List.cs +++ b/src/DynamicData.Benchmarks/List/DisposeMany_List.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.Reactive.Disposables; - -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 ec9a39316..d5930adaf 100644 --- a/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs +++ b/src/DynamicData.Benchmarks/List/ExpireAfter_List.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; - -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.List; +namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs index 6e4ab39ee..439f45160 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedBoundedEdits.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using System.Reactive.Subjects; -using System.Reflection; -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.List; +namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs index e9065ef17..3f3a30eec 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_Static_RandomizedUnboundedEdits.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using System.Reactive.Subjects; -using System.Reflection; -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.List; +namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs index 3707767be..dde27a14d 100644 --- a/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs +++ b/src/DynamicData.Benchmarks/List/Filter_List_WithPredicateState.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Immutable; -using System.Linq; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - -using Bogus; - -namespace DynamicData.Benchmarks.List; +namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/List/GroupAdd.cs b/src/DynamicData.Benchmarks/List/GroupAdd.cs index 92572496e..0037925eb 100644 --- a/src/DynamicData.Benchmarks/List/GroupAdd.cs +++ b/src/DynamicData.Benchmarks/List/GroupAdd.cs @@ -2,12 +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; - namespace DynamicData.Benchmarks.List { [SimpleJob(RuntimeMoniker.NetCoreApp31)] diff --git a/src/DynamicData.Benchmarks/List/GroupRemove.cs b/src/DynamicData.Benchmarks/List/GroupRemove.cs index d4ba95e05..dee140d07 100644 --- a/src/DynamicData.Benchmarks/List/GroupRemove.cs +++ b/src/DynamicData.Benchmarks/List/GroupRemove.cs @@ -2,12 +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; - namespace DynamicData.Benchmarks.List { [SimpleJob(RuntimeMoniker.NetCoreApp31)] diff --git a/src/DynamicData.Benchmarks/List/SourceList.cs b/src/DynamicData.Benchmarks/List/SourceList.cs index 6556d6ecf..1c29970e5 100644 --- a/src/DynamicData.Benchmarks/List/SourceList.cs +++ b/src/DynamicData.Benchmarks/List/SourceList.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.Linq; - -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; - namespace DynamicData.Benchmarks.List { [SimpleJob(RuntimeMoniker.NetCoreApp31)] diff --git a/src/DynamicData.Benchmarks/List/Sum_List.cs b/src/DynamicData.Benchmarks/List/Sum_List.cs index 87a90c97e..a7c204cf3 100644 --- a/src/DynamicData.Benchmarks/List/Sum_List.cs +++ b/src/DynamicData.Benchmarks/List/Sum_List.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; - using DynamicData.Aggregation; namespace DynamicData.Benchmarks.List; diff --git a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs index 0908c20f9..30437c289 100644 --- a/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs +++ b/src/DynamicData.Benchmarks/List/ToObservableChangeSet_List.cs @@ -1,10 +1,4 @@ -using System; -using System.Reactive.Subjects; - -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Columns; - -namespace DynamicData.Benchmarks.List; +namespace DynamicData.Benchmarks.List; [MemoryDiagnoser] [MarkdownExporterAttribute.GitHub] diff --git a/src/DynamicData.Benchmarks/Miscellaneous/LockImplementations.cs b/src/DynamicData.Benchmarks/Miscellaneous/LockImplementations.cs index cce51279f..1ffea6a22 100644 --- a/src/DynamicData.Benchmarks/Miscellaneous/LockImplementations.cs +++ b/src/DynamicData.Benchmarks/Miscellaneous/LockImplementations.cs @@ -1,6 +1,3 @@ -using System.Threading; -using BenchmarkDotNet.Attributes; - namespace DynamicData.Benchmarks.Miscellaneous; [MemoryDiagnoser] diff --git a/src/DynamicData.Benchmarks/Polyfills/RequiredMemberAttribute.cs b/src/DynamicData.Benchmarks/Polyfills/RequiredMemberAttribute.cs index 14566ea3c..7456b3949 100644 --- a/src/DynamicData.Benchmarks/Polyfills/RequiredMemberAttribute.cs +++ b/src/DynamicData.Benchmarks/Polyfills/RequiredMemberAttribute.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.ComponentModel; - namespace System.Runtime.CompilerServices; // Allows use of the C#11 `required` keyword, internally within this library, when targeting frameworks older than .NET 7. diff --git a/src/DynamicData.Benchmarks/Program.cs b/src/DynamicData.Benchmarks/Program.cs index 5bf5d888f..657936f2c 100644 --- a/src/DynamicData.Benchmarks/Program.cs +++ b/src/DynamicData.Benchmarks/Program.cs @@ -2,12 +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; -using BenchmarkDotNet.Running; - namespace DynamicData.Benchmarks { public static class Program diff --git a/src/DynamicData.Tests/API/ApiApprovalTests.cs b/src/DynamicData.Tests/API/ApiApprovalTests.cs index 4799b73eb..716ce9d16 100644 --- a/src/DynamicData.Tests/API/ApiApprovalTests.cs +++ b/src/DynamicData.Tests/API/ApiApprovalTests.cs @@ -1,8 +1,4 @@ -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; -using Xunit; - -namespace DynamicData.APITests +namespace DynamicData.APITests { /// /// Tests for handling API approval. diff --git a/src/DynamicData.Tests/API/ApiExtensions.cs b/src/DynamicData.Tests/API/ApiExtensions.cs index cd465eb86..26fb54740 100644 --- a/src/DynamicData.Tests/API/ApiExtensions.cs +++ b/src/DynamicData.Tests/API/ApiExtensions.cs @@ -1,12 +1,4 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Threading.Tasks; -using PublicApiGenerator; -using VerifyXunit; - -namespace DynamicData.APITests; +namespace DynamicData.APITests; /// /// A helper for doing API approvals. diff --git a/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs b/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs index 4755cddbc..a63d2a2b2 100644 --- a/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/AggregationFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Reactive.Linq; - using DynamicData.Aggregation; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/AvgFixture.ForCache.ForAggregateChangeSet.cs b/src/DynamicData.Tests/AggregationTests/AvgFixture.ForCache.ForAggregateChangeSet.cs index d0ea08177..dbf0b9786 100644 --- a/src/DynamicData.Tests/AggregationTests/AvgFixture.ForCache.ForAggregateChangeSet.cs +++ b/src/DynamicData.Tests/AggregationTests/AvgFixture.ForCache.ForAggregateChangeSet.cs @@ -1,12 +1,4 @@ -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/AvgFixture.ForCache.ForChangeSet.cs b/src/DynamicData.Tests/AggregationTests/AvgFixture.ForCache.ForChangeSet.cs index 7e8b36996..0b6d9ecfa 100644 --- a/src/DynamicData.Tests/AggregationTests/AvgFixture.ForCache.ForChangeSet.cs +++ b/src/DynamicData.Tests/AggregationTests/AvgFixture.ForCache.ForChangeSet.cs @@ -1,10 +1,4 @@ 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/AvgFixture.ForList.ForAggregateChangeSet.cs b/src/DynamicData.Tests/AggregationTests/AvgFixture.ForList.ForAggregateChangeSet.cs index e2bde9597..4b4619cbf 100644 --- a/src/DynamicData.Tests/AggregationTests/AvgFixture.ForList.ForAggregateChangeSet.cs +++ b/src/DynamicData.Tests/AggregationTests/AvgFixture.ForList.ForAggregateChangeSet.cs @@ -1,12 +1,4 @@ -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/AvgFixture.ForList.ForChangeSet.cs b/src/DynamicData.Tests/AggregationTests/AvgFixture.ForList.ForChangeSet.cs index f643e3c43..62b4cc365 100644 --- a/src/DynamicData.Tests/AggregationTests/AvgFixture.ForList.ForChangeSet.cs +++ b/src/DynamicData.Tests/AggregationTests/AvgFixture.ForList.ForChangeSet.cs @@ -1,9 +1,4 @@ using DynamicData.Aggregation; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/MaxFixture.cs b/src/DynamicData.Tests/AggregationTests/MaxFixture.cs index 89f274619..0fafb256c 100644 --- a/src/DynamicData.Tests/AggregationTests/MaxFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/MaxFixture.cs @@ -1,11 +1,4 @@ -using System; - using DynamicData.Aggregation; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/MinFixture.cs b/src/DynamicData.Tests/AggregationTests/MinFixture.cs index 168babdbd..d3bcf25a4 100644 --- a/src/DynamicData.Tests/AggregationTests/MinFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/MinFixture.cs @@ -1,11 +1,4 @@ -using System; - using DynamicData.Aggregation; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/StdDevFixture.cs b/src/DynamicData.Tests/AggregationTests/StdDevFixture.cs index f19e7ce31..1f9daed27 100644 --- a/src/DynamicData.Tests/AggregationTests/StdDevFixture.cs +++ b/src/DynamicData.Tests/AggregationTests/StdDevFixture.cs @@ -2,19 +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.Linq; -using System.Reactive.Linq; - -using Bogus; - using DynamicData.Aggregation; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; -using Xunit.Abstractions; namespace DynamicData.Tests.AggregationTests; diff --git a/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs b/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs index 078a8f1b0..0a079c619 100644 --- a/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs +++ b/src/DynamicData.Tests/AggregationTests/SumFixture.ForCache.cs @@ -1,12 +1,4 @@ -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 94226edb9..2e5438565 100644 --- a/src/DynamicData.Tests/AutoRefreshFilter.cs +++ b/src/DynamicData.Tests/AutoRefreshFilter.cs @@ -1,15 +1,4 @@ -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; - -using Xunit; - -namespace DynamicData.Tests; +namespace DynamicData.Tests; public class AutoRefreshFilter { diff --git a/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs b/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs index 478fa6807..db6e50a7b 100644 --- a/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs +++ b/src/DynamicData.Tests/Binding/AvaloniaDictionaryFixture.cs @@ -1,17 +1,4 @@ -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.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class AvaloniaDictionaryFixture { diff --git a/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs b/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs index 750aaf1ae..af3033c78 100644 --- a/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingLIstBindListFixture.cs @@ -1,15 +1,5 @@ #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 f76ff68bf..a62c6847d 100644 --- a/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListBindCacheFixture.cs @@ -1,15 +1,5 @@ #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 a706c4aea..06356313a 100644 --- a/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListBindCacheSortedFixture.cs @@ -1,17 +1,5 @@ #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 b9818d8bc..395585999 100644 --- a/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/BindingListToChangeSetFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.ComponentModel; -using System.Linq; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +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 e233c5c6a..a8acf9cd3 100644 --- a/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs +++ b/src/DynamicData.Tests/Binding/DeeplyNestedNotifyPropertyChangedFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class DeeplyNestedNotifyPropertyChangedFixture { @@ -251,8 +239,8 @@ public void WithoutInitialValue() // [Fact] // [Trait("Manual run for benchmarking","xx")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Manual run for benchmarking")] + [SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] + [SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Manual run for benchmarking")] private void StressIt() { var list = new SourceList(); diff --git a/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs b/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs index 2c01a256d..8303bf4f7 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindCacheFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +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 35aa4eb1f..c2af9c298 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindCacheSortedFixture.cs @@ -1,15 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -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 9dceabfb2..bc2574421 100644 --- a/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/IObservableListBindListFixture.cs @@ -1,15 +1,3 @@ -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; - -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..8aaa7af1f 100644 --- a/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs +++ b/src/DynamicData.Tests/Binding/NotifyPropertyChangedExFixture.cs @@ -1,18 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Runtime.CompilerServices; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class NotifyPropertyChangedExFixture { diff --git a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs index 6d68b12c0..31faf108f 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheFixture.cs @@ -1,17 +1,4 @@ -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; - -using Xunit; - -namespace DynamicData.Tests.Binding; +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 c5df8ce24..ad693d760 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindCacheSortedFixture.cs @@ -1,16 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; -using Xunit; - 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 8e71766e3..2129abc33 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionBindListFixture.cs @@ -1,13 +1,3 @@ -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..b56a4aee5 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionExtendedToChangeSetFixture.cs @@ -1,13 +1,3 @@ -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..193b2f706 100644 --- a/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ObservableCollectionToChangeSetFixture.cs @@ -1,14 +1,3 @@ -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..e76c36abf 100644 --- a/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs +++ b/src/DynamicData.Tests/Binding/ReadOnlyObservableCollectionToChangeSetFixture.cs @@ -1,14 +1,3 @@ -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 492448b73..f7b4b32d3 100644 --- a/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs +++ b/src/DynamicData.Tests/Binding/ReadonlyCollectionBindCacheFixture.cs @@ -1,14 +1,4 @@ -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; -using Xunit; - -namespace DynamicData.Tests.Binding; +namespace DynamicData.Tests.Binding; public class ReadonlyCollectionBindCacheFixture : IDisposable { diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.DeepChain.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.DeepChain.cs index eb6b35173..c4712ad42 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.DeepChain.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.DeepChain.cs @@ -1,19 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using System.Reactive; - -using Bogus; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Binding; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Binding; public static partial class WhenPropertyChangedFixture diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.Shallow.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.Shallow.cs index 0545fdb8b..6ff6266a2 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.Shallow.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.Shallow.cs @@ -1,19 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using System.Reactive; - -using Bogus; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Binding; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Binding; public static partial class WhenPropertyChangedFixture diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.cs index 56e2acfd2..6256dff17 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.IntegrationTests.cs @@ -1,14 +1,3 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading; -using System.Threading.Tasks; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Binding; public static partial class WhenPropertyChangedFixture diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Conversions.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Conversions.cs index a18655e0c..b1179dffa 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Conversions.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Conversions.cs @@ -1,15 +1,3 @@ -using System; -using System.ComponentModel; -using System.Linq.Expressions; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Binding; public static partial class WhenPropertyChangedFixture diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.DeepChain.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.DeepChain.cs index c3d950cb9..4f58ef81d 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.DeepChain.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.DeepChain.cs @@ -1,15 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Concurrency; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Binding; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Binding; public static partial class WhenPropertyChangedFixture diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Shallow.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Shallow.cs index bb60b30f7..551175b38 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Shallow.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Shallow.cs @@ -1,14 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Concurrency; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Binding; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Binding; public static partial class WhenPropertyChangedFixture diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Subscription.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Subscription.cs index 5cf37f3b9..cde596cf6 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Subscription.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.Subscription.cs @@ -1,13 +1,3 @@ -using System.Linq; -using System.Reactive.Linq; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Binding; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Binding; public static partial class WhenPropertyChangedFixture diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.cs index a25da1c05..feedfe85f 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.UnitTests.cs @@ -1,15 +1,3 @@ -using System; -using System.Linq; - -using Bogus; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Binding; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Binding; public static partial class WhenPropertyChangedFixture diff --git a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.cs b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.cs index 2bfded56b..35c602b6d 100644 --- a/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.cs +++ b/src/DynamicData.Tests/Binding/WhenPropertyChangedFixture.cs @@ -1,6 +1,3 @@ -using System; -using System.ComponentModel; - namespace DynamicData.Tests.Binding; public static partial class WhenPropertyChangedFixture diff --git a/src/DynamicData.Tests/Cache/AndFixture.cs b/src/DynamicData.Tests/Cache/AndFixture.cs index 0f0ec2ad0..99164e2ac 100644 --- a/src/DynamicData.Tests/Cache/AndFixture.cs +++ b/src/DynamicData.Tests/Cache/AndFixture.cs @@ -1,13 +1,3 @@ -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 @@ -32,7 +22,7 @@ public abstract class AndFixtureBase : IDisposable private readonly ChangeSetAggregator _results; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] + [SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] protected AndFixtureBase() { _source1 = new SourceCache(p => p.Name); diff --git a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs index 3fe7de711..8905331e5 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.IntegrationTests.cs @@ -1,18 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using DynamicData.Kernel; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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 c6eea36b0..9f07784d7 100644 --- a/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/AsyncDisposeManyFixture.UnitTests.cs @@ -1,19 +1,4 @@ -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; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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 ebdc26950..42c3a90b6 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.Base.cs @@ -1,16 +1,3 @@ -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; - -using DynamicData.Tests.Utilities; - 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 c948aedb8..ea4519fd5 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithPropertyAccessor.cs @@ -1,14 +1,3 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - 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 402d175ff..9d89d4d0c 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshFixture.WithoutPropertyAccessor.cs @@ -1,12 +1,3 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - 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 a09e0ea9c..34a443bf0 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.Base.cs @@ -1,17 +1,3 @@ -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; - -using DynamicData.Tests.Utilities; - 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 4fa7ec9d7..2fc259bb8 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithKey.cs @@ -1,11 +1,3 @@ -using System; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -using FluentAssertions; -using Xunit; - 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 3e96d6e96..585c2f8e4 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.WithoutKey.cs @@ -1,11 +1,3 @@ -using System; -using System.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public static partial class AutoRefreshOnObservableFixture diff --git a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs index 4e6f974a2..34a4a3c83 100644 --- a/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/AutoRefreshOnObservableFixture.cs @@ -1,9 +1,3 @@ -using System; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -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 d22e060fe..84c9f2365 100644 --- a/src/DynamicData.Tests/Cache/BatchFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchFixture.cs @@ -1,13 +1,3 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - namespace DynamicData.Tests.Cache; public class BatchFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/BatchIfFixture.Overloads.cs b/src/DynamicData.Tests/Cache/BatchIfFixture.Overloads.cs index ed43bb8da..25fb3ab28 100644 --- a/src/DynamicData.Tests/Cache/BatchIfFixture.Overloads.cs +++ b/src/DynamicData.Tests/Cache/BatchIfFixture.Overloads.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; -using System.Reactive; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -using Randomizer = Bogus.Randomizer; - namespace DynamicData.Tests.Cache; public partial class BatchIfFixture diff --git a/src/DynamicData.Tests/Cache/BatchIfFixture.cs b/src/DynamicData.Tests/Cache/BatchIfFixture.cs index d8f95c0a2..19304be72 100644 --- a/src/DynamicData.Tests/Cache/BatchIfFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfFixture.cs @@ -1,16 +1,3 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; -using Xunit.Abstractions; - namespace DynamicData.Tests.Cache; public partial class BatchIfFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs index 239dba558..29aa9c775 100644 --- a/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/Cache/BatchIfWithTimeOutFixture.cs @@ -1,16 +1,3 @@ -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; public class BatchIfWithTimeoutFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/BufferInitialFixture.cs b/src/DynamicData.Tests/Cache/BufferInitialFixture.cs index eafe1bf6e..3535ce2e8 100644 --- a/src/DynamicData.Tests/Cache/BufferInitialFixture.cs +++ b/src/DynamicData.Tests/Cache/BufferInitialFixture.cs @@ -1,15 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -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 a26b0a90f..c47fc49c6 100644 --- a/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs +++ b/src/DynamicData.Tests/Cache/CrossCacheDeadlockStressTest.cs @@ -2,26 +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.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; - -using Bogus; - -using DynamicData.Binding; -using DynamicData.Kernel; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; /// @@ -235,7 +215,7 @@ public async Task AllOperators_CrossCache_NoDeadlock_CorrectResults() using var subs = new CompositeDisposable(); // Helpers - IObservableCache TrackCache(IObservable> pipeline, [System.Runtime.CompilerServices.CallerArgumentExpression(nameof(pipeline))] string? name = null) + IObservableCache TrackCache(IObservable> pipeline, [CallerArgumentExpression(nameof(pipeline))] string? name = null) where TObj : notnull where TKey : notnull { var pub = pipeline.Publish(); @@ -251,7 +231,7 @@ IObservableCache TrackCache(IObservable(m => m.Id); using var reverseTarget = new SourceCache(m => m.Id); - void TrackIntoCache(IObservable> pipeline, SourceCache target, [System.Runtime.CompilerServices.CallerArgumentExpression(nameof(pipeline))] string? name = null) + void TrackIntoCache(IObservable> pipeline, SourceCache target, [CallerArgumentExpression(nameof(pipeline))] string? name = null) { var pub = pipeline.Publish(); completionTasks.Add(pub.LastOrDefaultAsync().ToTask()); diff --git a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs index e320f3aee..dc8e552a4 100644 --- a/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs +++ b/src/DynamicData.Tests/Cache/DeadlockTortureTest.cs @@ -2,18 +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.Reactive.Subjects; -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..4007febfd 100644 --- a/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs +++ b/src/DynamicData.Tests/Cache/DeferUntilLoadedFixture.cs @@ -1,12 +1,3 @@ -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 b196e1431..4867168d5 100644 --- a/src/DynamicData.Tests/Cache/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/DisposeManyFixture.cs @@ -1,12 +1,3 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -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 fbbd36c7b..e714beffc 100644 --- a/src/DynamicData.Tests/Cache/DistinctFixture.cs +++ b/src/DynamicData.Tests/Cache/DistinctFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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..7056f859f 100644 --- a/src/DynamicData.Tests/Cache/DynamicAndFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicAndFixture.cs @@ -1,12 +1,3 @@ -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..d577351e6 100644 --- a/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicExceptFixture.cs @@ -1,12 +1,3 @@ -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..c1fe441eb 100644 --- a/src/DynamicData.Tests/Cache/DynamicOrFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicOrFixture.cs @@ -1,12 +1,3 @@ -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..ec75eb90c 100644 --- a/src/DynamicData.Tests/Cache/DynamicXorFixture.cs +++ b/src/DynamicData.Tests/Cache/DynamicXorFixture.cs @@ -1,12 +1,3 @@ -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 d178c9ea6..4bd1cd078 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class EditDiffChangeSetFixture { diff --git a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs index 280f7db33..8b8809269 100644 --- a/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffChangeSetOptionalFixture.cs @@ -1,15 +1,4 @@ -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; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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..8dfd360d2 100644 --- a/src/DynamicData.Tests/Cache/EditDiffFixture.cs +++ b/src/DynamicData.Tests/Cache/EditDiffFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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 fe2d05737..18a927837 100644 --- a/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs +++ b/src/DynamicData.Tests/Cache/EnsureUniqueKeysFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Mono.Cecil; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class EnsureUniqueKeysFixture: IDisposable { diff --git a/src/DynamicData.Tests/Cache/ExceptFixture.cs b/src/DynamicData.Tests/Cache/ExceptFixture.cs index 17c4996e8..458136a21 100644 --- a/src/DynamicData.Tests/Cache/ExceptFixture.cs +++ b/src/DynamicData.Tests/Cache/ExceptFixture.cs @@ -1,12 +1,3 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public class ExceptFixture : ExceptFixtureBase @@ -31,7 +22,7 @@ public abstract class ExceptFixtureBase : IDisposable private readonly ChangeSetAggregator _results; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] + [SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] protected ExceptFixtureBase() { _targetSource = new SourceCache(p => p.Name); diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs index ad88ee3a8..f170fe193 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForSource.cs @@ -1,19 +1,4 @@ -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; -using FluentAssertions; -using Xunit; -using Xunit.Abstractions; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +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 868fad2fd..9b399ac53 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.ForStream.cs @@ -1,20 +1,4 @@ -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; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ExpireAfterFixture { diff --git a/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs b/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs index f701d6a38..92c5be14b 100644 --- a/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs +++ b/src/DynamicData.Tests/Cache/ExpireAfterFixture.cs @@ -1,9 +1,4 @@ -using System; -using System.Reactive.Concurrency; - -using Microsoft.Reactive.Testing; - -namespace DynamicData.Tests.Cache; +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 24e645f15..ee6d28a56 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Base.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +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 8b5c76e4c..4c826bbbe 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.IntegrationTests.cs @@ -1,16 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using Bogus; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs index c8edb7e18..a06d07ec2 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicate.UnitTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +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 8491fe821..faaa55e8e 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.IntegrationTests.cs @@ -1,17 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using Bogus; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs index e1a1fb5eb..23c529f84 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateAndReFiltering.UnitTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +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 49654ba16..f3907c963 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.IntegrationTests.cs @@ -1,15 +1,4 @@ -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using Bogus; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { diff --git a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs index 6fa22b720..143658296 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.DynamicPredicateState.UnitTests.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +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 35f29c8cd..95fbddbad 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.Static.cs @@ -1,19 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Randomizer = Bogus.Randomizer; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using Person = DynamicData.Tests.Domain.Person; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class FilterFixture { diff --git a/src/DynamicData.Tests/Cache/FilterFixture.cs b/src/DynamicData.Tests/Cache/FilterFixture.cs index 8ff9a3a29..22b7b18a5 100644 --- a/src/DynamicData.Tests/Cache/FilterFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterFixture.cs @@ -1,10 +1,4 @@ -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; - -using Bogus; - -namespace DynamicData.Tests.Cache; +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 5abf88761..d4630fa42 100644 --- a/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterImmutableFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Tests.Utilities; - -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +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 7ed96e287..197c6395b 100644 --- a/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterOnConnectFixture.cs @@ -1,8 +1,4 @@ -using System.Linq; -using FluentAssertions; -using Xunit; - -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 84b487055..55b9f7e2e 100644 --- a/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterOnObservableFixture.cs @@ -1,15 +1,4 @@ -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; +namespace DynamicData.Tests.Cache; /// /// Test Fixture for the FilterOnObservable extension method. diff --git a/src/DynamicData.Tests/Cache/FilterParallelFixture.cs b/src/DynamicData.Tests/Cache/FilterParallelFixture.cs index bc1411684..6fbbd0127 100644 --- a/src/DynamicData.Tests/Cache/FilterParallelFixture.cs +++ b/src/DynamicData.Tests/Cache/FilterParallelFixture.cs @@ -1,13 +1,3 @@ -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..9a11f4b13 100644 --- a/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs +++ b/src/DynamicData.Tests/Cache/ForEachChangeFixture.cs @@ -1,12 +1,3 @@ -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 03f716d6d..c504b7389 100644 --- a/src/DynamicData.Tests/Cache/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/FromAsyncFixture.cs @@ -1,18 +1,4 @@ -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; +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..4a5a72d3d 100644 --- a/src/DynamicData.Tests/Cache/FullJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/FullJoinFixture.cs @@ -1,12 +1,3 @@ -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..fdaf2fa57 100644 --- a/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/FullJoinManyFixture.cs @@ -1,13 +1,3 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public class FullJoinManyFixture : IDisposable @@ -164,7 +154,7 @@ private void AssertDataIsCorrectlyFormed(Person[] allPeople) }); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] + [SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] private int CalculateParent(int index, int totalPeople) { if (index < 5) diff --git a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs index 31686cadd..d8b8e709d 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerFixture.cs @@ -1,14 +1,3 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -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 871f5498c..45f1a77dc 100644 --- a/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupControllerForFilteredItemsFixture.cs @@ -1,14 +1,3 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -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 c0139eed5..93f9ceb78 100644 --- a/src/DynamicData.Tests/Cache/GroupFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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..3af8c00db 100644 --- a/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupFromDistinctFixture.cs @@ -1,14 +1,3 @@ -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..fa334d1f9 100644 --- a/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupImmutableFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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 ab5fd0bd4..5fdeeb2f0 100644 --- a/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnDynamicFixture.cs @@ -1,20 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -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; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class GroupOnDynamicFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs index 1909b2abb..84f38c885 100644 --- a/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnObservableFixture.cs @@ -1,20 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -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; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class GroupOnObservableFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs b/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs index 7af362118..fe524c117 100644 --- a/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnPropertyFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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..3b016228c 100644 --- a/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs +++ b/src/DynamicData.Tests/Cache/GroupOnPropertyWithImmutableStateFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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..9f31af216 100644 --- a/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/IgnoreUpdateFixture.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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..49e160c37 100644 --- a/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/IncludeUpdateFixture.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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 bd5ffc054..183710b9b 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixture.cs @@ -1,11 +1,3 @@ -using System; - -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public class InnerJoinFixture : IDisposable @@ -430,7 +422,7 @@ public bool Equals(DeviceWithMetadata? other) return true; } - return string.Equals(Key, other.Key); + return Equals(Key, other.Key); } public override bool Equals(object? obj) diff --git a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs index bdad60ee9..61bdbc577 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinFixtureRaceCondition.cs @@ -1,9 +1,3 @@ -using System; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -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 edaad944a..8ca8a4c30 100644 --- a/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/InnerJoinManyFixture.cs @@ -1,13 +1,3 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public class InnerJoinManyFixture : IDisposable @@ -244,7 +234,7 @@ private void AssertDataIsCorrectlyFormed(Person[] allPeople, params string[] mis }); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] + [SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] private int CalculateParent(int index, int totalPeople) { if (index < 5) 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 c5d0fcd35..b7571f5ce 100644 --- a/src/DynamicData.Tests/Cache/LeftJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/LeftJoinFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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 dd4b22056..4e65740ab 100644 --- a/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/LeftJoinManyFixture.cs @@ -1,13 +1,3 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public class LeftJoinManyFixture : IDisposable @@ -246,7 +236,7 @@ private void AssertDataIsCorrectlyFormed(Person[] expected, params string[] miss }); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] + [SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] private int CalculateParent(int index, int totalPeople) { if (index < 5) diff --git a/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs b/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs index b6f3047e2..398870a04 100644 --- a/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeChangeSetsFixture.cs @@ -1,16 +1,4 @@ -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; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed partial class MergeChangeSetsFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithSourceComparer.IntegrationTests.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithSourceComparer.IntegrationTests.cs index 73d513786..4dd30ad0b 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithSourceComparer.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithSourceComparer.IntegrationTests.cs @@ -1,22 +1,3 @@ -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 FluentAssertions; - -using Xunit; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Cache; public static partial class MergeManyChangeSetsFixture diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithSourceComparer.UnitTests.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithSourceComparer.UnitTests.cs index 641cdd499..d4c756499 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithSourceComparer.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithSourceComparer.UnitTests.cs @@ -1,18 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; - -using Bogus; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Cache; public static partial class MergeManyChangeSetsFixture diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithoutSourceComparer.IntegrationTests.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithoutSourceComparer.IntegrationTests.cs index b13e201eb..104b3dea6 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithoutSourceComparer.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithoutSourceComparer.IntegrationTests.cs @@ -1,21 +1,3 @@ -using System; -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 FluentAssertions; - -using Xunit; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Cache; public static partial class MergeManyChangeSetsFixture diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithoutSourceComparer.UnitTests.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithoutSourceComparer.UnitTests.cs index 6ee493b6d..4e2b12373 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithoutSourceComparer.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.WithoutSourceComparer.UnitTests.cs @@ -1,18 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; - -using Bogus; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Cache; public static partial class MergeManyChangeSetsFixture diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.cs index dc14907d2..6e00c623c 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForCacheChangeSets.cs @@ -1,7 +1,3 @@ -using Bogus; - -using DynamicData.Tests.Domain; - namespace DynamicData.Tests.Cache; public static partial class MergeManyChangeSetsFixture diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.IntegrationTests.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.IntegrationTests.cs index 81b341fb6..99efd9461 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.IntegrationTests.cs @@ -1,18 +1,3 @@ -using System; -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 Xunit; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Cache; public static partial class MergeManyChangeSetsFixture diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.UnitTests.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.UnitTests.cs index 183cd68b4..82855adf2 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.UnitTests.cs @@ -1,20 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Threading; -using System.Threading.Tasks; - -using Bogus; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Cache; public static partial class MergeManyChangeSetsFixture diff --git a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.cs b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.cs index 296474d5c..b1047ec71 100644 --- a/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.cs +++ b/src/DynamicData.Tests/Cache/MergeManyChangeSetsFixture.ForListChangesets.cs @@ -1,11 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using DynamicData.Tests.Domain; - namespace DynamicData.Tests.Cache; public static partial class MergeManyChangeSetsFixture diff --git a/src/DynamicData.Tests/Cache/MergeManyFixture.cs b/src/DynamicData.Tests/Cache/MergeManyFixture.cs index 553bf452e..a46854f19 100644 --- a/src/DynamicData.Tests/Cache/MergeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyFixture.cs @@ -1,11 +1,3 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -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 e2a6be748..ee513a24e 100644 --- a/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyItemsFixture.cs @@ -1,11 +1,3 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -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 e6987e846..d9269e4c9 100644 --- a/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs +++ b/src/DynamicData.Tests/Cache/MergeManyWithKeyOverloadFixture.cs @@ -1,11 +1,3 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -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 6a6a33a38..e6958b706 100644 --- a/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs +++ b/src/DynamicData.Tests/Cache/MonitorStatusFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Kernel; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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..f9a734fe3 100644 --- a/src/DynamicData.Tests/Cache/ObservableCachePreviewFixture.cs +++ b/src/DynamicData.Tests/Cache/ObservableCachePreviewFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class ObservableCachePreviewFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs index 4460dad3e..154bb63dd 100644 --- a/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs +++ b/src/DynamicData.Tests/Cache/ObservableChangeSetFixture.cs @@ -1,26 +1,12 @@ -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; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class ObservableChangeSetFixture { // [Fact] //Disabled due to test failing when run with a test runner. Run locally in isolation and it works [Description("See https://github.com/reactivemarbles/DynamicData/issues/383")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Acceptable for test.")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Disabled due to test failing when run with a test runner")] + [SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Acceptable for test.")] + [SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Disabled due to test failing when run with a test runner")] private async Task AsyncSubscriptionCanReceiveMultipleResults() { @@ -211,7 +197,7 @@ public void LoadsAndDisposeUsingDisposableAsync() isDisposed.Should().BeTrue(); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] + [SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] private void SubscribeAndAssert(IObservable> observableChangeset, bool expectsError = false, Action>? checkContentAction = null) where TKey : notnull where TObject : notnull diff --git a/src/DynamicData.Tests/Cache/OfTypeFixture.cs b/src/DynamicData.Tests/Cache/OfTypeFixture.cs index ec38a0629..d0f9ca57d 100644 --- a/src/DynamicData.Tests/Cache/OfTypeFixture.cs +++ b/src/DynamicData.Tests/Cache/OfTypeFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Bogus; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; -using Xunit.Abstractions; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class OfTypeFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/OnItemFixture.cs b/src/DynamicData.Tests/Cache/OnItemFixture.cs index 97aeebc75..db08ccda7 100644 --- a/src/DynamicData.Tests/Cache/OnItemFixture.cs +++ b/src/DynamicData.Tests/Cache/OnItemFixture.cs @@ -1,13 +1,4 @@ -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; +namespace DynamicData.Tests.Cache; public class OnItemFixture { diff --git a/src/DynamicData.Tests/Cache/OrFixture.cs b/src/DynamicData.Tests/Cache/OrFixture.cs index 720d3f0b4..ddbb1250b 100644 --- a/src/DynamicData.Tests/Cache/OrFixture.cs +++ b/src/DynamicData.Tests/Cache/OrFixture.cs @@ -1,13 +1,3 @@ -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 @@ -32,7 +22,7 @@ public abstract class OrFixtureBase : IDisposable private readonly ChangeSetAggregator _results; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] + [SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] protected OrFixtureBase() { _source1 = new SourceCache(p => p.Name); diff --git a/src/DynamicData.Tests/Cache/PageFixture.cs b/src/DynamicData.Tests/Cache/PageFixture.cs index 8c31979d5..fc9b739af 100644 --- a/src/DynamicData.Tests/Cache/PageFixture.cs +++ b/src/DynamicData.Tests/Cache/PageFixture.cs @@ -1,15 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -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..8d268651a 100644 --- a/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs +++ b/src/DynamicData.Tests/Cache/QueryWhenChangedFixture.cs @@ -1,11 +1,3 @@ -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 14be2f16b..a94a6d7da 100644 --- a/src/DynamicData.Tests/Cache/RefCountFixture.cs +++ b/src/DynamicData.Tests/Cache/RefCountFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class RefCountFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/RemoveKeyFixture.cs b/src/DynamicData.Tests/Cache/RemoveKeyFixture.cs index 04d27f619..54bcf4573 100644 --- a/src/DynamicData.Tests/Cache/RemoveKeyFixture.cs +++ b/src/DynamicData.Tests/Cache/RemoveKeyFixture.cs @@ -1,27 +1,10 @@ -#region - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Disposables; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -#endregion - namespace DynamicData.Tests.Cache; public class RemoveKeyFixture : IDisposable { private readonly RandomPersonGenerator _generator = new(); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Handled with CompositeDisposable")] + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Handled with CompositeDisposable")] private readonly ISourceCache _source; private readonly CompositeDisposable _cleanup = new(); diff --git a/src/DynamicData.Tests/Cache/RightJoinFixture.cs b/src/DynamicData.Tests/Cache/RightJoinFixture.cs index 62aa30190..b8965f211 100644 --- a/src/DynamicData.Tests/Cache/RightJoinFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinFixture.cs @@ -1,13 +1,3 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public class RightJoinFixture : IDisposable @@ -448,7 +438,7 @@ public bool Equals(DeviceWithMetadata? other) return true; } - return string.Equals(Key, other.Key); + return Equals(Key, other.Key); } public override bool Equals(object? obj) diff --git a/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs b/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs index 24f013c3a..2afcf96de 100644 --- a/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs +++ b/src/DynamicData.Tests/Cache/RightJoinManyFixture.cs @@ -1,13 +1,3 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public class RightJoinManyFixture : IDisposable @@ -251,7 +241,7 @@ private void AssertDataIsCorrectlyFormed(Person[] allPeople, params string[] mis }); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] + [SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] private int CalculateParent(int index, int totalPeople) { if (index < 5) diff --git a/src/DynamicData.Tests/Cache/SizeLimitFixture.cs b/src/DynamicData.Tests/Cache/SizeLimitFixture.cs index 378b7fa6d..95abfe0b0 100644 --- a/src/DynamicData.Tests/Cache/SizeLimitFixture.cs +++ b/src/DynamicData.Tests/Cache/SizeLimitFixture.cs @@ -1,15 +1,3 @@ -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; public class SizeLimitFixture : IDisposable diff --git a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs index f4a68b701..dc8db1767 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindFixture.cs @@ -1,16 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -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; -using Xunit; - namespace DynamicData.Tests.Cache; // Bind to a list diff --git a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs index 9698c86e3..b688618c5 100644 --- a/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndBindObservableFixture.cs @@ -1,15 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; - // Bind to a readonly observable collection public sealed class SortAndBindObservableToReadOnlyObservableCollection : SortAndBindObservableFixture { @@ -46,7 +36,7 @@ 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.")] + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "By Design.")] protected readonly BehaviorSubject> ComparerObservable; diff --git a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs index 3b3466c85..6d89ba26f 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageAndBindFixture.cs @@ -1,15 +1,4 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; - +namespace DynamicData.Tests.Cache; public sealed class SortAndPageAndBindWithImplicitOptionsFixtureReadOnlyCollection : SortAndPageAndBindFixtureBase { diff --git a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs index 19f177cd4..52846a600 100644 --- a/src/DynamicData.Tests/Cache/SortAndPageFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndPageFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using System.Text; -using System.Threading.Tasks; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed class SortAndPageWithComparerChangesFixture : SortAndPageFixtureBase { diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs index bb8896aac..15445d153 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeAndBindFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; - +namespace DynamicData.Tests.Cache; public sealed class SortAndVirtualizeAndBindWithImplicitOptionsFixtureReadOnlyCollection : SortAndVirtualizeAndBindFixtureBase { diff --git a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs index f5d865369..cde724952 100644 --- a/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs +++ b/src/DynamicData.Tests/Cache/SortAndVirtualizeFixture.cs @@ -1,18 +1,4 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; - - - - +namespace DynamicData.Tests.Cache; public sealed class SortAndVirtualizeWithComparerChangesFixture : SortAndVirtualizeFixtureBase { diff --git a/src/DynamicData.Tests/Cache/SortFixture.cs b/src/DynamicData.Tests/Cache/SortFixture.cs index 0f228b173..27193096c 100644 --- a/src/DynamicData.Tests/Cache/SortFixture.cs +++ b/src/DynamicData.Tests/Cache/SortFixture.cs @@ -1,21 +1,3 @@ -#region - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -using DynamicData.Binding; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -#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 6175a0f5c..7e3be0438 100644 --- a/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs +++ b/src/DynamicData.Tests/Cache/SortObservableFixtureFixture.cs @@ -1,15 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public class SortObservableFixture : IDisposable @@ -18,7 +6,7 @@ public class SortObservableFixture : IDisposable private readonly SortExpressionComparer _comparer; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "By Design.")] + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "By Design.")] private readonly BehaviorSubject> _comparerObservable; private readonly RandomPersonGenerator _generator = new(); diff --git a/src/DynamicData.Tests/Cache/SourceCacheFixture.IntegrationTests.cs b/src/DynamicData.Tests/Cache/SourceCacheFixture.IntegrationTests.cs index 4aaf9d5ac..cefac139d 100644 --- a/src/DynamicData.Tests/Cache/SourceCacheFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/SourceCacheFixture.IntegrationTests.cs @@ -1,12 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public static partial class SourceCacheFixture diff --git a/src/DynamicData.Tests/Cache/SourceCacheFixture.UnitTests.cs b/src/DynamicData.Tests/Cache/SourceCacheFixture.UnitTests.cs index 20bf0772a..541963eb8 100644 --- a/src/DynamicData.Tests/Cache/SourceCacheFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/SourceCacheFixture.UnitTests.cs @@ -1,16 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using FluentAssertions; - -using Xunit; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Cache; public static partial class SourceCacheFixture diff --git a/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs b/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs index 5d6d26729..0ddc90d6c 100644 --- a/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs +++ b/src/DynamicData.Tests/Cache/SubscribeManyFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class SubscribeManyFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.IntegrationTests.cs b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.IntegrationTests.cs index 3ba800ee3..a92305bb5 100644 --- a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.IntegrationTests.cs @@ -1,13 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Threading; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public static partial class SuspendNotificationsFixture diff --git a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.UnitTests.cs b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.UnitTests.cs index be0bb6145..de2c1dd0f 100644 --- a/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/SuspendNotificationsFixture.UnitTests.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Kernel; -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class SuspendNotificationsFixture { diff --git a/src/DynamicData.Tests/Cache/SwitchFixture.SubscriptionLifetime.cs b/src/DynamicData.Tests/Cache/SwitchFixture.SubscriptionLifetime.cs index ec3df7f1b..ea5e417dd 100644 --- a/src/DynamicData.Tests/Cache/SwitchFixture.SubscriptionLifetime.cs +++ b/src/DynamicData.Tests/Cache/SwitchFixture.SubscriptionLifetime.cs @@ -1,18 +1,4 @@ -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.Subjects; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; -using Xunit.Abstractions; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public partial class SwitchFixture { diff --git a/src/DynamicData.Tests/Cache/SwitchFixture.cs b/src/DynamicData.Tests/Cache/SwitchFixture.cs index 03c41b14b..301789145 100644 --- a/src/DynamicData.Tests/Cache/SwitchFixture.cs +++ b/src/DynamicData.Tests/Cache/SwitchFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public partial class SwitchFixture { diff --git a/src/DynamicData.Tests/Cache/ToCollectionFixture.cs b/src/DynamicData.Tests/Cache/ToCollectionFixture.cs index e4d18f9aa..7f3ace12b 100644 --- a/src/DynamicData.Tests/Cache/ToCollectionFixture.cs +++ b/src/DynamicData.Tests/Cache/ToCollectionFixture.cs @@ -1,14 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; -using Xunit.Abstractions; - -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.Cache; public class ToCollectionFixture diff --git a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs index 8dd0ae91e..40fbe0836 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +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 892f55535..9d782a030 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -1,16 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +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 f6dece980..9aef8f2a3 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +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 94213315a..0b38d5ba0 100644 --- a/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/Cache/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -1,17 +1,4 @@ -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; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public static partial class ToObservableChangeSetFixture { 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.InitialValue.cs b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.InitialValue.cs index 06cd45c28..39fa2c350 100644 --- a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.InitialValue.cs +++ b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.InitialValue.cs @@ -1,19 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading; -using System.Threading.Tasks; -using Bogus; -using DynamicData.Kernel; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; -using Xunit.Abstractions; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public partial class ToObservableOptionalFixture { diff --git a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs index a9cb2212f..a42b23fd4 100644 --- a/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs +++ b/src/DynamicData.Tests/Cache/ToObservableOptionalFixture.cs @@ -1,16 +1,4 @@ -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; - -using Xunit; -using Xunit.Abstractions; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public partial class ToObservableOptionalFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs b/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs index 5c7e84f23..db09b633d 100644 --- a/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs +++ b/src/DynamicData.Tests/Cache/ToSortedCollectionFixture.cs @@ -1,19 +1,4 @@ -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; +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 ac6ce6cff..742886b3e 100644 --- a/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformAsyncFixture.cs @@ -1,23 +1,3 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Reactive.Threading.Tasks; -using System.Threading; -using System.Threading.Tasks; -using DynamicData.Binding; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; - -// Aliased rather than importing Bogus wholesale, which would make Person ambiguous against the -// domain type of the same name. -using Randomizer = Bogus.Randomizer; - namespace DynamicData.Tests.Cache; public class TransformAsyncFixture diff --git a/src/DynamicData.Tests/Cache/TransformFixture.cs b/src/DynamicData.Tests/Cache/TransformFixture.cs index d149276cd..690f86c66 100644 --- a/src/DynamicData.Tests/Cache/TransformFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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..62ad9cae8 100644 --- a/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs +++ b/src/DynamicData.Tests/Cache/TransformFixtureParallel.cs @@ -1,13 +1,3 @@ -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 4b529b345..d3ddc5aa8 100644 --- a/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformImmutableFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +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 3781b1a2a..284610236 100644 --- a/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyAsyncFixture.cs @@ -1,17 +1,4 @@ -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; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public sealed class TransformManyAsyncFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformManyFixture.cs b/src/DynamicData.Tests/Cache/TransformManyFixture.cs index fdfe3a1dd..480aae1c6 100644 --- a/src/DynamicData.Tests/Cache/TransformManyFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyFixture.cs @@ -1,13 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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 a15d1c051..183c74752 100644 --- a/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyObservableCacheFixture.cs @@ -1,15 +1,4 @@ -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; +namespace DynamicData.Tests.Cache; public class TransformManyObservableCollectionFixture { @@ -240,8 +229,8 @@ public Parent(int id) public ObservableCollection Children { get; } - public ReadOnlyObservableCollection ChildrenReadonly { get; } - + public ReadOnlyObservableCollection ChildrenReadonly { get; } + public IObservableCache ChildrenCache { get; } public int Id { get; } diff --git a/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs b/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs index 6d14af74c..238d17d53 100644 --- a/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManyRefreshFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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..465ce180e 100644 --- a/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformManySimpleFixture.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +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 cc37806b7..d43c026ca 100644 --- a/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformOnObservableFixture.cs @@ -1,20 +1,4 @@ -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; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformOnObservableFixture : IDisposable { diff --git a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.ArgumentValidation.cs b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.ArgumentValidation.cs index 41a730c32..efb6c881b 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.ArgumentValidation.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.ArgumentValidation.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; -using System.Threading.Tasks; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public partial class TransformSafeAsyncFixture diff --git a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs index 8509a016c..e8359c58f 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeAsyncFixture.cs @@ -1,16 +1,3 @@ -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; -using DynamicData.Tests.Domain; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Cache; public partial class TransformSafeAsyncFixture diff --git a/src/DynamicData.Tests/Cache/TransformSafeFixture.cs b/src/DynamicData.Tests/Cache/TransformSafeFixture.cs index cd9aabc7d..98e985f69 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeFixture.cs @@ -1,14 +1,3 @@ -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..cf31f7428 100644 --- a/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformSafeParallelFixture.cs @@ -1,14 +1,3 @@ -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 33bf44573..913c17c01 100644 --- a/src/DynamicData.Tests/Cache/TransformTreeFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformTreeFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformTreeFixture : IDisposable { @@ -78,7 +69,7 @@ public void AddMissingParent() [Fact] public void BuildTreeFromMixedData() { - _sourceCache.AddOrUpdate(TransformTreeFixture.CreateEmployees()); + _sourceCache.AddOrUpdate(CreateEmployees()); _result.Count.Should().Be(2); var firstNode = _result.Items[0]; @@ -91,7 +82,7 @@ public void BuildTreeFromMixedData() [Fact] public void ChangeParent() { - _sourceCache.AddOrUpdate(TransformTreeFixture.CreateEmployees()); + _sourceCache.AddOrUpdate(CreateEmployees()); _sourceCache.AddOrUpdate( new EmployeeDto(4) @@ -123,7 +114,7 @@ public void Dispose() [Fact] public void RemoveAChildNodeWillPushOrphansUpTheHierachy() { - _sourceCache.AddOrUpdate(TransformTreeFixture.CreateEmployees()); + _sourceCache.AddOrUpdate(CreateEmployees()); _sourceCache.Remove(4); //we expect the children of node 4 to be pushed up become new roots @@ -136,7 +127,7 @@ public void RemoveAChildNodeWillPushOrphansUpTheHierachy() [Fact] public void RemoveARootNodeWillPushOrphansUpTheHierachy() { - _sourceCache.AddOrUpdate(TransformTreeFixture.CreateEmployees()); + _sourceCache.AddOrUpdate(CreateEmployees()); _sourceCache.Remove(1); //we expect the original children nodes to be pushed up become new roots @@ -146,7 +137,7 @@ public void RemoveARootNodeWillPushOrphansUpTheHierachy() [Fact] public void UpdateAParentNode() { - _sourceCache.AddOrUpdate(TransformTreeFixture.CreateEmployees()); + _sourceCache.AddOrUpdate(CreateEmployees()); var changed = new EmployeeDto(1) { @@ -165,7 +156,7 @@ public void UpdateAParentNode() [Fact] public void UpdateChildNode() { - _sourceCache.AddOrUpdate(TransformTreeFixture.CreateEmployees()); + _sourceCache.AddOrUpdate(CreateEmployees()); var changed = new EmployeeDto(2) { @@ -186,7 +177,7 @@ public void UpdateChildNode() [Fact] public void UseCustomFilter() { - _sourceCache.AddOrUpdate(TransformTreeFixture.CreateEmployees()); + _sourceCache.AddOrUpdate(CreateEmployees()); _result.Count.Should().Be(2); diff --git a/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs b/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs index 68748a69b..3f1e92f80 100644 --- a/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformTreeWithRefreshFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformTreeWithRefreshFixture : IDisposable { @@ -96,7 +87,7 @@ public void UpdateTreeWhenParentIdOfRootItemChangedToNonExistingId() node1.Value.IsRoot.Should().BeTrue(); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] + [SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] private IEnumerable CreateEmployees() { yield return new EmployeeDto(1) diff --git a/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs b/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs index 0be034a13..1a742de38 100644 --- a/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs +++ b/src/DynamicData.Tests/Cache/TransformWithInlineUpdateFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Cache; +namespace DynamicData.Tests.Cache; public class TransformWithInlineUpdateFixture { diff --git a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs index f9dece32b..b38c98e22 100644 --- a/src/DynamicData.Tests/Cache/TrueForAllFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAllFixture.cs @@ -1,11 +1,3 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -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 ad5d9086d..d51d2ffe6 100644 --- a/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs +++ b/src/DynamicData.Tests/Cache/TrueForAnyFixture.cs @@ -1,13 +1,3 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -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..b2fc22345 100644 --- a/src/DynamicData.Tests/Cache/WatchFixture.cs +++ b/src/DynamicData.Tests/Cache/WatchFixture.cs @@ -1,10 +1,3 @@ -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 23faff11f..c841d58d3 100644 --- a/src/DynamicData.Tests/Cache/WatcherFixture.cs +++ b/src/DynamicData.Tests/Cache/WatcherFixture.cs @@ -1,21 +1,4 @@ -#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 +using DynamicData.Experimental; namespace DynamicData.Tests.Cache; diff --git a/src/DynamicData.Tests/Cache/XorFixture.cs b/src/DynamicData.Tests/Cache/XorFixture.cs index 8a320430a..dce5c289f 100644 --- a/src/DynamicData.Tests/Cache/XorFixture.cs +++ b/src/DynamicData.Tests/Cache/XorFixture.cs @@ -1,12 +1,3 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Cache; public class XOrFixture : XOrFixtureBase @@ -31,7 +22,7 @@ public abstract class XOrFixtureBase : IDisposable private readonly ChangeSetAggregator _results; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] + [SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] protected XOrFixtureBase() { _source1 = new SourceCache(p => p.Name); diff --git a/src/DynamicData.Tests/Domain/Animal.cs b/src/DynamicData.Tests/Domain/Animal.cs index 744b058ee..f51606c6b 100644 --- a/src/DynamicData.Tests/Domain/Animal.cs +++ b/src/DynamicData.Tests/Domain/Animal.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading; -using DynamicData.Binding; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public enum AnimalFamily { diff --git a/src/DynamicData.Tests/Domain/AnimalOwner.cs b/src/DynamicData.Tests/Domain/AnimalOwner.cs index 26049705b..5932a19f1 100644 --- a/src/DynamicData.Tests/Domain/AnimalOwner.cs +++ b/src/DynamicData.Tests/Domain/AnimalOwner.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections; -using System.Collections.ObjectModel; -using System.Reactive.Disposables; -using DynamicData.Binding; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; internal sealed class AnimalOwner(string name, Guid? id = null, bool include = true) : AbstractNotifyPropertyChanged, IDisposable { diff --git a/src/DynamicData.Tests/Domain/Fakers.cs b/src/DynamicData.Tests/Domain/Fakers.cs index 720b74565..af32b6fde 100644 --- a/src/DynamicData.Tests/Domain/Fakers.cs +++ b/src/DynamicData.Tests/Domain/Fakers.cs @@ -1,9 +1,4 @@ -using System; -using System.Linq; -using Bogus; -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; internal static class Fakers { diff --git a/src/DynamicData.Tests/Domain/Market.cs b/src/DynamicData.Tests/Domain/Market.cs index a100e6df3..b771e441e 100644 --- a/src/DynamicData.Tests/Domain/Market.cs +++ b/src/DynamicData.Tests/Domain/Market.cs @@ -1,13 +1,4 @@ -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; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; internal interface IMarket { diff --git a/src/DynamicData.Tests/Domain/MarketPrice.cs b/src/DynamicData.Tests/Domain/MarketPrice.cs index f8fb2c6ad..373b47141 100644 --- a/src/DynamicData.Tests/Domain/MarketPrice.cs +++ b/src/DynamicData.Tests/Domain/MarketPrice.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using Bogus; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; internal sealed class MarketPrice { diff --git a/src/DynamicData.Tests/Domain/ParentAndChildren.cs b/src/DynamicData.Tests/Domain/ParentAndChildren.cs index 746d45fa9..5f12d3cc2 100644 --- a/src/DynamicData.Tests/Domain/ParentAndChildren.cs +++ b/src/DynamicData.Tests/Domain/ParentAndChildren.cs @@ -1,8 +1,4 @@ -using System; - -using DynamicData.Kernel; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public class ParentAndChildren : IEquatable { diff --git a/src/DynamicData.Tests/Domain/Person.cs b/src/DynamicData.Tests/Domain/Person.cs index bca018cb6..519d7ecb3 100644 --- a/src/DynamicData.Tests/Domain/Person.cs +++ b/src/DynamicData.Tests/Domain/Person.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; - -using DynamicData.Binding; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public enum Color { diff --git a/src/DynamicData.Tests/Domain/PersonEmployment.cs b/src/DynamicData.Tests/Domain/PersonEmployment.cs index 7a84e19c0..d6bad8897 100644 --- a/src/DynamicData.Tests/Domain/PersonEmployment.cs +++ b/src/DynamicData.Tests/Domain/PersonEmployment.cs @@ -1,6 +1,6 @@ namespace DynamicData.Tests.Domain; -[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1066:Implement IEquatable when overriding Object.Equals", Justification = "Acceptable in a test.")] +[SuppressMessage("Design", "CA1066:Implement IEquatable when overriding Object.Equals", Justification = "Acceptable in a test.")] public readonly struct PersonEmpKey { private readonly string _name; @@ -13,7 +13,7 @@ public PersonEmpKey(string name, string company) _company = company; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Acceptable in a test.")] + [SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Acceptable in a test.")] public PersonEmpKey(PersonEmployment personEmployment) { _name = personEmployment.Name; @@ -90,6 +90,6 @@ public override int GetHashCode() public override string ToString() => string.Format("Name: {0}, Company: {1}", Name, Company); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Acceptable in a test.")] + [SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Acceptable in a test.")] protected bool Equals(PersonEmployment other) => string.Equals(Name, other.Name) && string.Equals(Company, other.Company); } diff --git a/src/DynamicData.Tests/Domain/PersonObs.cs b/src/DynamicData.Tests/Domain/PersonObs.cs index 08bd463b7..de0d2d578 100644 --- a/src/DynamicData.Tests/Domain/PersonObs.cs +++ b/src/DynamicData.Tests/Domain/PersonObs.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Subjects; +namespace DynamicData.Tests.Domain; -namespace DynamicData.Tests.Domain; - -[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1001:Types that own disposable fields should be disposable", Justification = "Acceptable in test.")] +[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); 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..9f5fe1a34 100644 --- a/src/DynamicData.Tests/Domain/PersonWithFriends.cs +++ b/src/DynamicData.Tests/Domain/PersonWithFriends.cs @@ -1,8 +1,3 @@ -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Binding; - namespace DynamicData.Tests.Domain; public class PersonWithFriends(string name, int age, IEnumerable friends) : AbstractNotifyPropertyChanged, IKey diff --git a/src/DynamicData.Tests/Domain/PersonWithGender.cs b/src/DynamicData.Tests/Domain/PersonWithGender.cs index dc4ac6c09..f84542b9b 100644 --- a/src/DynamicData.Tests/Domain/PersonWithGender.cs +++ b/src/DynamicData.Tests/Domain/PersonWithGender.cs @@ -1,6 +1,5 @@ -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 7a11ea949..8ae486de9 100644 --- a/src/DynamicData.Tests/Domain/SelfObservingPerson.cs +++ b/src/DynamicData.Tests/Domain/SelfObservingPerson.cs @@ -1,7 +1,4 @@ -using System; -using System.Reactive.Linq; - -namespace DynamicData.Tests.Domain; +namespace DynamicData.Tests.Domain; public class SelfObservingPerson : IDisposable { diff --git a/src/DynamicData.Tests/EnumerableExFixtures.cs b/src/DynamicData.Tests/EnumerableExFixtures.cs index d25cc8325..9af170dda 100644 --- a/src/DynamicData.Tests/EnumerableExFixtures.cs +++ b/src/DynamicData.Tests/EnumerableExFixtures.cs @@ -1,12 +1,4 @@ -using System; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests; +namespace DynamicData.Tests; public class EnumerableExFixtures { diff --git a/src/DynamicData.Tests/EnumerableIListFixture.cs b/src/DynamicData.Tests/EnumerableIListFixture.cs index 2c18d4302..0d59202a5 100644 --- a/src/DynamicData.Tests/EnumerableIListFixture.cs +++ b/src/DynamicData.Tests/EnumerableIListFixture.cs @@ -1,13 +1,4 @@ -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; - -namespace DynamicData.Tests +namespace DynamicData.Tests { public class EnumerableIListFixture { diff --git a/src/DynamicData.Tests/Global.cs b/src/DynamicData.Tests/Global.cs new file mode 100644 index 000000000..20b30cbb6 --- /dev/null +++ b/src/DynamicData.Tests/Global.cs @@ -0,0 +1,49 @@ +global using System; +global using System.Collections; +global using System.Collections.Concurrent; +global using System.Collections.Generic; +global using System.Collections.ObjectModel; +global using System.Collections.Specialized; +global using System.ComponentModel; +global using System.Diagnostics; +global using System.Diagnostics.CodeAnalysis; +global using System.Globalization; +global using System.Linq; +global using System.Linq.Expressions; +global using System.Reactive; +global using System.Reactive.Concurrency; +global using System.Reactive.Disposables; +global using System.Reactive.Linq; +global using System.Reactive.Subjects; +global using System.Reactive.Threading.Tasks; +global using System.Reflection; +global using System.Runtime.CompilerServices; +global using System.Runtime.InteropServices; +global using System.Threading; +global using System.Threading.Tasks; + +global using Microsoft.Reactive.Testing; + +global using Bogus; + +global using FluentAssertions; + +global using Xunit; +global using Xunit.Abstractions; +global using Xunit.Sdk; + +global using PublicApiGenerator; + +global using VerifyXunit; + +global using DynamicData.Binding; +global using DynamicData.Cache.Internal; +global using DynamicData.Experimental; +global using DynamicData.Internal; +global using DynamicData.Kernel; +global using DynamicData.PLinq; + +global using DynamicData.Tests.Domain; +global using DynamicData.Tests.Utilities; + +global using Person = DynamicData.Tests.Domain.Person; 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/CacheParentSubscriptionFixture.cs b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs index 5f11b9fc5..eed371d5a 100644 --- a/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs +++ b/src/DynamicData.Tests/Internal/CacheParentSubscriptionFixture.cs @@ -2,26 +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.Reactive.Subjects; -using System.Threading; -using System.Threading.Tasks; - -using Bogus; - -using DynamicData.Internal; -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Internal; /// -/// Tests for +/// Tests for /// behavioral contracts using a minimal concrete subclass. /// public sealed class CacheParentSubscriptionFixture diff --git a/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs b/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs index 3062e331f..17bf5eafc 100644 --- a/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs +++ b/src/DynamicData.Tests/Internal/DeliveryQueueFixture.cs @@ -1,14 +1,3 @@ -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; public class DeliveryQueueFixture diff --git a/src/DynamicData.Tests/Internal/DeliveryQueueMergeFixture.cs b/src/DynamicData.Tests/Internal/DeliveryQueueMergeFixture.cs index fe67508a6..7826ea621 100644 --- a/src/DynamicData.Tests/Internal/DeliveryQueueMergeFixture.cs +++ b/src/DynamicData.Tests/Internal/DeliveryQueueMergeFixture.cs @@ -2,21 +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.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading; -using System.Threading.Tasks; - -using DynamicData.Internal; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Internal; /// @@ -229,4 +214,4 @@ public void NoOthers_FallsBackToFirstAlone() received.Should().Equal(7, 11); completed.Should().BeTrue(); } -} \ No newline at end of file +} diff --git a/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs b/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs index 2296564ef..32029cf40 100644 --- a/src/DynamicData.Tests/Internal/KeyedDisposableFixture.cs +++ b/src/DynamicData.Tests/Internal/KeyedDisposableFixture.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; -using System.Collections.Generic; - -using DynamicData.Internal; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Internal; public class KeyedDisposableFixture diff --git a/src/DynamicData.Tests/Internal/NotificationFixture.cs b/src/DynamicData.Tests/Internal/NotificationFixture.cs index d221b0044..5bc10eefd 100644 --- a/src/DynamicData.Tests/Internal/NotificationFixture.cs +++ b/src/DynamicData.Tests/Internal/NotificationFixture.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; -using System.Reactive; - -using DynamicData.Internal; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Internal; public class NotificationFixture diff --git a/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs b/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs index 2891a0d27..c4e2da7e5 100644 --- a/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs +++ b/src/DynamicData.Tests/Internal/SharedDeliveryQueueFixture.cs @@ -2,19 +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.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -using Bogus; - -using DynamicData.Internal; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Internal; public class SharedDeliveryQueueFixture @@ -537,4 +524,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/Internal/SwappableLockFixture.cs b/src/DynamicData.Tests/Internal/SwappableLockFixture.cs index 4b3bd980e..7f545d3c7 100644 --- a/src/DynamicData.Tests/Internal/SwappableLockFixture.cs +++ b/src/DynamicData.Tests/Internal/SwappableLockFixture.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.Threading; -using FluentAssertions; -using Xunit; - namespace DynamicData.Tests.Internal; public sealed class SwappableLockFixture @@ -84,7 +79,7 @@ public void SwapTo_WithoutCreate_Throws() try { swappable.SwapTo(gate); - throw new Xunit.Sdk.XunitException("Expected InvalidOperationException"); + throw new XunitException("Expected InvalidOperationException"); } catch (InvalidOperationException) { diff --git a/src/DynamicData.Tests/Internal/UnsynchronizedCombineLatestFixture.cs b/src/DynamicData.Tests/Internal/UnsynchronizedCombineLatestFixture.cs index 256937218..17387d5c4 100644 --- a/src/DynamicData.Tests/Internal/UnsynchronizedCombineLatestFixture.cs +++ b/src/DynamicData.Tests/Internal/UnsynchronizedCombineLatestFixture.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; -using System.Collections.Generic; -using System.Reactive.Subjects; - -using DynamicData.Internal; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Internal; /// diff --git a/src/DynamicData.Tests/Internal/UnsynchronizedMergeFixture.cs b/src/DynamicData.Tests/Internal/UnsynchronizedMergeFixture.cs index 85b95b8ea..5d4b862af 100644 --- a/src/DynamicData.Tests/Internal/UnsynchronizedMergeFixture.cs +++ b/src/DynamicData.Tests/Internal/UnsynchronizedMergeFixture.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; -using System.Collections.Generic; -using System.Reactive.Subjects; - -using DynamicData.Internal; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.Internal; /// @@ -172,4 +162,4 @@ public void NoOthers_FallsBackToFirstAlone() received.Should().Equal(7, 11); completed.Should().BeTrue(); } -} \ No newline at end of file +} diff --git a/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs b/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs index 1044f5cd2..dabc1aa61 100644 --- a/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs +++ b/src/DynamicData.Tests/Issues/EmptyToChangeSetIssue.cs @@ -1,10 +1,4 @@ -using System.Collections.ObjectModel; -using System.Reactive; -using DynamicData.Binding; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.Issues +namespace DynamicData.Tests.Issues { public class EmptyToChangeSetIssue { diff --git a/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs b/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs index d257b8abb..573f54f5d 100644 --- a/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs +++ b/src/DynamicData.Tests/Issues/OnItemRemovedIssue.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using DynamicData.Binding; -using Xunit; - -namespace DynamicData.Tests.Issues +namespace DynamicData.Tests.Issues { public class OnItemRemovedIssue { diff --git a/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs b/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs index 438e1bd5f..2683b0d61 100644 --- a/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs +++ b/src/DynamicData.Tests/Kernal/CacheUpdaterFixture.cs @@ -1,13 +1,4 @@ -using System.Linq; - -using DynamicData.Cache.Internal; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +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..16fe8848c 100644 --- a/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs +++ b/src/DynamicData.Tests/Kernal/DistinctUpdateFixture.cs @@ -1,13 +1,4 @@ -using System; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +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..f5c502d9c 100644 --- a/src/DynamicData.Tests/Kernal/KeyValueFixture.cs +++ b/src/DynamicData.Tests/Kernal/KeyValueFixture.cs @@ -1,12 +1,4 @@ -using System.Collections.Generic; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +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..3ac601fd1 100644 --- a/src/DynamicData.Tests/Kernal/OptionFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Globalization; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +namespace DynamicData.Tests.Kernal; public class OptionFixture { diff --git a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs index 06095bc20..9857bbf29 100644 --- a/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs +++ b/src/DynamicData.Tests/Kernal/OptionObservableFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using DynamicData.Kernel; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +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..bf4b9fc57 100644 --- a/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs +++ b/src/DynamicData.Tests/Kernal/SourceUpdaterFixture.cs @@ -1,12 +1,3 @@ -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..1781b0002 100644 --- a/src/DynamicData.Tests/Kernal/UpdateFixture.cs +++ b/src/DynamicData.Tests/Kernal/UpdateFixture.cs @@ -1,13 +1,4 @@ -using System; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.Kernal; +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..d23ab92b5 100644 --- a/src/DynamicData.Tests/List/AndFixture.cs +++ b/src/DynamicData.Tests/List/AndFixture.cs @@ -1,11 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.List; public class AndFixture : AndFixtureBase @@ -30,7 +22,7 @@ public abstract class AndFixtureBase : IDisposable private readonly ChangeSetAggregator _results; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] + [SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] protected AndFixtureBase() { _source1 = new SourceList(); diff --git a/src/DynamicData.Tests/List/AutoRefreshFixture.cs b/src/DynamicData.Tests/List/AutoRefreshFixture.cs index e6e88aa72..1ad7745be 100644 --- a/src/DynamicData.Tests/List/AutoRefreshFixture.cs +++ b/src/DynamicData.Tests/List/AutoRefreshFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Binding; -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class AutoRefreshFixture { diff --git a/src/DynamicData.Tests/List/BatchFixture.cs b/src/DynamicData.Tests/List/BatchFixture.cs index c93fe2d08..fa9ce3f1d 100644 --- a/src/DynamicData.Tests/List/BatchFixture.cs +++ b/src/DynamicData.Tests/List/BatchFixture.cs @@ -1,14 +1,3 @@ -using System; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -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 ebbb28484..7e9cca03c 100644 --- a/src/DynamicData.Tests/List/BatchIfFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfFixture.cs @@ -1,15 +1,3 @@ -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; public class BatchIfFixture : IDisposable diff --git a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs index f192a17ca..cccaa04c6 100644 --- a/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs +++ b/src/DynamicData.Tests/List/BatchIfWithTimeOutFixture.cs @@ -1,14 +1,3 @@ -using System; -using System.Reactive.Subjects; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -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 e02330f98..7e94ded74 100644 --- a/src/DynamicData.Tests/List/BufferFixture.cs +++ b/src/DynamicData.Tests/List/BufferFixture.cs @@ -1,14 +1,3 @@ -using System; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -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 cd32c1b23..7172be60f 100644 --- a/src/DynamicData.Tests/List/BufferInitialFixture.cs +++ b/src/DynamicData.Tests/List/BufferInitialFixture.cs @@ -1,15 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -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..38b5d57e0 100644 --- a/src/DynamicData.Tests/List/CastFixture.cs +++ b/src/DynamicData.Tests/List/CastFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -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 c8b65086c..1dc713df6 100644 --- a/src/DynamicData.Tests/List/ChangeAwareListFixture.cs +++ b/src/DynamicData.Tests/List/ChangeAwareListFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +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..25aa530ee 100644 --- a/src/DynamicData.Tests/List/ChangeSetFixture.cs +++ b/src/DynamicData.Tests/List/ChangeSetFixture.cs @@ -1,21 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Management; -using System.Reflection; -using System.Threading.Channels; - -using Argon; - -using Bogus; - -using FluentAssertions; - -using Xunit; -using Xunit.Abstractions; -using Xunit.Sdk; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class ChangeSetFixture { diff --git a/src/DynamicData.Tests/List/CloneChangesFixture.cs b/src/DynamicData.Tests/List/CloneChangesFixture.cs index b043cf78f..64579bee1 100644 --- a/src/DynamicData.Tests/List/CloneChangesFixture.cs +++ b/src/DynamicData.Tests/List/CloneChangesFixture.cs @@ -1,13 +1,3 @@ -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 @@ -124,7 +114,7 @@ public void MovedItemInObservableCollectionIsMoved() clone.CollectionChanged += (s, e) => { - if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Move) + if (e.Action == NotifyCollectionChangedAction.Move) { itemMoved = true; } diff --git a/src/DynamicData.Tests/List/CloneFixture.cs b/src/DynamicData.Tests/List/CloneFixture.cs index 4e050e305..0ce2c6782 100644 --- a/src/DynamicData.Tests/List/CloneFixture.cs +++ b/src/DynamicData.Tests/List/CloneFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +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 ae7ca0d0b..f69e9b688 100644 --- a/src/DynamicData.Tests/List/CreationFixtures.cs +++ b/src/DynamicData.Tests/List/CreationFixtures.cs @@ -1,12 +1,4 @@ -using System; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class ListCreationFixtures { @@ -25,7 +17,7 @@ public void Create() })); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] + [SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Accetable for test.")] private void SubscribeAndAssert(IObservable> observableChangeset, bool expectsError = false) where T : notnull { diff --git a/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs b/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs index 1f8f725b3..7b3c330c5 100644 --- a/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs +++ b/src/DynamicData.Tests/List/DeferUntilLoadedFixture.cs @@ -1,12 +1,3 @@ -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 2d06a1122..93fff54d4 100644 --- a/src/DynamicData.Tests/List/DisposeManyFixture.cs +++ b/src/DynamicData.Tests/List/DisposeManyFixture.cs @@ -1,13 +1,3 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -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..8c4130a4e 100644 --- a/src/DynamicData.Tests/List/DistinctValuesFixture.cs +++ b/src/DynamicData.Tests/List/DistinctValuesFixture.cs @@ -1,12 +1,3 @@ -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..3d690a6eb 100644 --- a/src/DynamicData.Tests/List/DynamicAndFixture.cs +++ b/src/DynamicData.Tests/List/DynamicAndFixture.cs @@ -1,10 +1,3 @@ -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..efeb8f94e 100644 --- a/src/DynamicData.Tests/List/DynamicExceptFixture.cs +++ b/src/DynamicData.Tests/List/DynamicExceptFixture.cs @@ -1,10 +1,3 @@ -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..4099e7b3b 100644 --- a/src/DynamicData.Tests/List/DynamicOrFixture.cs +++ b/src/DynamicData.Tests/List/DynamicOrFixture.cs @@ -1,10 +1,3 @@ -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..e407c6d6a 100644 --- a/src/DynamicData.Tests/List/DynamicXOrFixture.cs +++ b/src/DynamicData.Tests/List/DynamicXOrFixture.cs @@ -1,10 +1,3 @@ -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..f74bb361a 100644 --- a/src/DynamicData.Tests/List/EditDiffFixture.cs +++ b/src/DynamicData.Tests/List/EditDiffFixture.cs @@ -1,13 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +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..4b71aef6e 100644 --- a/src/DynamicData.Tests/List/ExceptFixture.cs +++ b/src/DynamicData.Tests/List/ExceptFixture.cs @@ -1,11 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.List; public class ExceptFixture : ExceptFixtureBase @@ -30,7 +22,7 @@ public abstract class ExceptFixtureBase : IDisposable private readonly ChangeSetAggregator _results; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] + [SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] protected ExceptFixtureBase() { Source1 = new SourceList(); diff --git a/src/DynamicData.Tests/List/ExpireAfterFixture.cs b/src/DynamicData.Tests/List/ExpireAfterFixture.cs index 9ad68eb16..6ae40b8fd 100644 --- a/src/DynamicData.Tests/List/ExpireAfterFixture.cs +++ b/src/DynamicData.Tests/List/ExpireAfterFixture.cs @@ -1,20 +1,3 @@ -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 Microsoft.Reactive.Testing; - -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 781165835..18f8f5a41 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithClearAndReplace.cs @@ -1,13 +1,3 @@ -using System; -using System.Linq; -using System.Reactive.Subjects; - -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 fb3b6e855..d1881fb5c 100644 --- a/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs +++ b/src/DynamicData.Tests/List/FilterControllerFixtureWithDiffSet.cs @@ -1,13 +1,3 @@ -using System; -using System.Linq; -using System.Reactive.Subjects; - -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 3282e1fe8..27fc06ab8 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Base.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Base.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +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 ae662b9dd..e44f32c95 100644 --- a/src/DynamicData.Tests/List/FilterFixture.Static.cs +++ b/src/DynamicData.Tests/List/FilterFixture.Static.cs @@ -1,19 +1,4 @@ -using System; -using System.Collections.ObjectModel; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Randomizer = Bogus.Randomizer; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using Person = DynamicData.Tests.Domain.Person; - -namespace DynamicData.Tests.List; +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 d3f28efd3..de41e5abe 100644 --- a/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs +++ b/src/DynamicData.Tests/List/FilterFixture.WithPredicateState.cs @@ -1,19 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading; -using System.Threading.Tasks; - -using Bogus; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; -using Xunit.Abstractions; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public partial class FilterFixture { diff --git a/src/DynamicData.Tests/List/FilterOnObservableFixture.cs b/src/DynamicData.Tests/List/FilterOnObservableFixture.cs index 8cb3e152b..1fb86b5f4 100644 --- a/src/DynamicData.Tests/List/FilterOnObservableFixture.cs +++ b/src/DynamicData.Tests/List/FilterOnObservableFixture.cs @@ -1,13 +1,3 @@ -using System; -using System.Linq; -using System.Reactive.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..87cc57f7a 100644 --- a/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs +++ b/src/DynamicData.Tests/List/FilterOnPropertyFixture.cs @@ -1,12 +1,3 @@ -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 9a71359c5..3932fc570 100644 --- a/src/DynamicData.Tests/List/FilterWithObservable.cs +++ b/src/DynamicData.Tests/List/FilterWithObservable.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - using DynamicData.Aggregation; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/ForEachChangeFixture.cs b/src/DynamicData.Tests/List/ForEachChangeFixture.cs index 589397d31..d5ea4961d 100644 --- a/src/DynamicData.Tests/List/ForEachChangeFixture.cs +++ b/src/DynamicData.Tests/List/ForEachChangeFixture.cs @@ -1,13 +1,3 @@ -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 2f1913c48..cd388449b 100644 --- a/src/DynamicData.Tests/List/FromAsyncFixture.cs +++ b/src/DynamicData.Tests/List/FromAsyncFixture.cs @@ -1,18 +1,4 @@ -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; +namespace DynamicData.Tests.List; public class FromAsyncFixture { diff --git a/src/DynamicData.Tests/List/GroupImmutableFixture.cs b/src/DynamicData.Tests/List/GroupImmutableFixture.cs index cbf674654..4416994c4 100644 --- a/src/DynamicData.Tests/List/GroupImmutableFixture.cs +++ b/src/DynamicData.Tests/List/GroupImmutableFixture.cs @@ -1,16 +1,4 @@ -using System; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +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..6597d1b57 100644 --- a/src/DynamicData.Tests/List/GroupOnFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnFixture.cs @@ -1,12 +1,3 @@ -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..985067599 100644 --- a/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnPropertyFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +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..09539a0b2 100644 --- a/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs +++ b/src/DynamicData.Tests/List/GroupOnPropertyWithImmutableStateFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Kernel; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +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 253a70070..7a8d8cecb 100644 --- a/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeChangeSetsFixture.cs @@ -1,20 +1,4 @@ -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; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public sealed class MergeChangeSetsFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs index bdac643d9..72490c700 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsCacheFixture.cs @@ -1,20 +1,4 @@ -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; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +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 ea8019ea4..790231703 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsFixture.cs @@ -1,8 +1,3 @@ -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 41cec34e1..8521d48ee 100644 --- a/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyChangeSetsListFixture.cs @@ -1,19 +1,4 @@ -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; -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public sealed class MergeManyChangeSetsListFixture : IDisposable { diff --git a/src/DynamicData.Tests/List/MergeManyFixture.cs b/src/DynamicData.Tests/List/MergeManyFixture.cs index 997e91f9f..05e120fef 100644 --- a/src/DynamicData.Tests/List/MergeManyFixture.cs +++ b/src/DynamicData.Tests/List/MergeManyFixture.cs @@ -1,11 +1,3 @@ -using System; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -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 3585426cb..c236ac45b 100644 --- a/src/DynamicData.Tests/List/OnItemAddedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemAddedFixture.cs @@ -1,12 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.List; public class OnItemAddedFixture diff --git a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs index c044d8e89..371085f4c 100644 --- a/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRefreshedFixture.cs @@ -1,12 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.List; public class OnItemRefreshedFixture diff --git a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs index 6b91fc11d..1dcf04ebf 100644 --- a/src/DynamicData.Tests/List/OnItemRemovedFixture.cs +++ b/src/DynamicData.Tests/List/OnItemRemovedFixture.cs @@ -1,13 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.List; public class OnItemRemovedFixture diff --git a/src/DynamicData.Tests/List/OrFixture.cs b/src/DynamicData.Tests/List/OrFixture.cs index c4c973aa2..099090964 100644 --- a/src/DynamicData.Tests/List/OrFixture.cs +++ b/src/DynamicData.Tests/List/OrFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class OrFixture : OrFixtureBase { @@ -75,7 +67,7 @@ public abstract class OrFixtureBase : IDisposable private readonly ChangeSetAggregator _results; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] + [SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] protected OrFixtureBase() { _source1 = new SourceList(); diff --git a/src/DynamicData.Tests/List/PageFixture.cs b/src/DynamicData.Tests/List/PageFixture.cs index 5091b06b7..4e4c2ae61 100644 --- a/src/DynamicData.Tests/List/PageFixture.cs +++ b/src/DynamicData.Tests/List/PageFixture.cs @@ -1,16 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -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..90d7321df 100644 --- a/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs +++ b/src/DynamicData.Tests/List/QueryWhenChangedFixture.cs @@ -1,11 +1,3 @@ -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..bd307247b 100644 --- a/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs +++ b/src/DynamicData.Tests/List/RecursiveTransformManyFixture.cs @@ -1,12 +1,3 @@ -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 c0d86e06d..2175d50a9 100644 --- a/src/DynamicData.Tests/List/RefCountFixture.cs +++ b/src/DynamicData.Tests/List/RefCountFixture.cs @@ -1,14 +1,3 @@ -using System; -using System.Linq; -using System.Reactive.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..fff714584 100644 --- a/src/DynamicData.Tests/List/RemoveManyFixture.cs +++ b/src/DynamicData.Tests/List/RemoveManyFixture.cs @@ -1,11 +1,3 @@ -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..dd3e87329 100644 --- a/src/DynamicData.Tests/List/ReverseFixture.cs +++ b/src/DynamicData.Tests/List/ReverseFixture.cs @@ -1,11 +1,4 @@ -using System; -using System.Linq; - -using FluentAssertions; - -using Xunit; - -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 6fd4fe0f7..687b732a0 100644 --- a/src/DynamicData.Tests/List/SelectFixture.cs +++ b/src/DynamicData.Tests/List/SelectFixture.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; - -using DynamicData.Alias; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; +using DynamicData.Alias; namespace DynamicData.Tests.List; diff --git a/src/DynamicData.Tests/List/SizeLimitFixture.cs b/src/DynamicData.Tests/List/SizeLimitFixture.cs index f07825d14..405915726 100644 --- a/src/DynamicData.Tests/List/SizeLimitFixture.cs +++ b/src/DynamicData.Tests/List/SizeLimitFixture.cs @@ -1,14 +1,3 @@ -using System; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Microsoft.Reactive.Testing; - -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 7f2a7dea3..f5c678b3c 100644 --- a/src/DynamicData.Tests/List/SortFixture.cs +++ b/src/DynamicData.Tests/List/SortFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SortChangedFixture { diff --git a/src/DynamicData.Tests/List/SortMutableFixture.cs b/src/DynamicData.Tests/List/SortMutableFixture.cs index 63eab9e03..f506b23d8 100644 --- a/src/DynamicData.Tests/List/SortMutableFixture.cs +++ b/src/DynamicData.Tests/List/SortMutableFixture.cs @@ -1,17 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Subjects; - -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..3e340ee18 100644 --- a/src/DynamicData.Tests/List/SortPrimitiveFixture.cs +++ b/src/DynamicData.Tests/List/SortPrimitiveFixture.cs @@ -1,13 +1,3 @@ -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 06905c5a4..a665c7469 100644 --- a/src/DynamicData.Tests/List/SourceListFixture.cs +++ b/src/DynamicData.Tests/List/SourceListFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Disposables; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public class SourceListFixture { 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 8f8995a2e..75278af0e 100644 --- a/src/DynamicData.Tests/List/SubscribeManyFixture.cs +++ b/src/DynamicData.Tests/List/SubscribeManyFixture.cs @@ -1,11 +1,3 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; - -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 5b490f84f..96650e46a 100644 --- a/src/DynamicData.Tests/List/SwitchFixture.cs +++ b/src/DynamicData.Tests/List/SwitchFixture.cs @@ -1,17 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; -using System.Threading; - -using DynamicData.Tests.Utilities; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +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 a46aa790f..a6e2c2edd 100644 --- a/src/DynamicData.Tests/List/ToCollectionFixture.cs +++ b/src/DynamicData.Tests/List/ToCollectionFixture.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Linq; -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.List; +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 0a60bc356..86b3ca340 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.IntegrationTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +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 887a230d4..7e78ca494 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Items.UnitTests.cs @@ -1,16 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using Microsoft.Reactive.Testing; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +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 505404290..9b6ca5766 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.IntegrationTests.cs @@ -1,15 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +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 55b1fdaae..b09245ac0 100644 --- a/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs +++ b/src/DynamicData.Tests/List/ToObservableChangeSetFixture.Sequences.UnitTests.cs @@ -1,17 +1,4 @@ -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; - -using DynamicData.Tests.Utilities; - -namespace DynamicData.Tests.List; +namespace DynamicData.Tests.List; public static partial class ToObservableChangeSetFixture { 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 7d3b1f1e3..7d00b76be 100755 --- a/src/DynamicData.Tests/List/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/List/TransformAsyncFixture.cs @@ -1,14 +1,3 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Threading.Tasks; - -using FluentAssertions; -using Xunit; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - namespace DynamicData.Tests.List; [Obsolete("Not obsolete - test commented out due to test run freezing on Appveyor")] diff --git a/src/DynamicData.Tests/List/TransformFixture.cs b/src/DynamicData.Tests/List/TransformFixture.cs index e3c966be0..d9714aefb 100644 --- a/src/DynamicData.Tests/List/TransformFixture.cs +++ b/src/DynamicData.Tests/List/TransformFixture.cs @@ -1,14 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; - -using DynamicData.Tests.Domain; -using DynamicData.Tests.Utilities; - -using FluentAssertions; -using Xunit; - -namespace DynamicData.Tests.List; +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 caf8bc6c7..6890ecaf3 100644 --- a/src/DynamicData.Tests/List/TransformManyFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyFixture.cs @@ -1,14 +1,3 @@ -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..652f2a6cf 100644 --- a/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyObservableCollectionFixture.cs @@ -1,14 +1,4 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; - -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +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..92e66c26e 100644 --- a/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyProjectionFixture.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; - -using DynamicData.Binding; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests.List; +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..564974156 100644 --- a/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs +++ b/src/DynamicData.Tests/List/TransformManyRefreshFixture.cs @@ -1,13 +1,3 @@ -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 66f681bff..cca213591 100644 --- a/src/DynamicData.Tests/List/VirtualisationFixture.cs +++ b/src/DynamicData.Tests/List/VirtualisationFixture.cs @@ -1,14 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Subjects; - -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..6e7b5069a 100644 --- a/src/DynamicData.Tests/List/XOrFixture.cs +++ b/src/DynamicData.Tests/List/XOrFixture.cs @@ -1,11 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -using Xunit; - namespace DynamicData.Tests.List; public class XOrFixture : XOrFixtureBase @@ -30,7 +22,7 @@ public abstract class XOrFixtureBase : IDisposable private readonly ChangeSetAggregator _results; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] + [SuppressMessage("Usage", "CA2214:Do not call overridable methods in constructors", Justification = "Accepted as part of a test.")] protected XOrFixtureBase() { _source1 = new SourceList(); diff --git a/src/DynamicData.Tests/ObservableCollectionExFixture.cs b/src/DynamicData.Tests/ObservableCollectionExFixture.cs index 0d93711a9..295a81157 100644 --- a/src/DynamicData.Tests/ObservableCollectionExFixture.cs +++ b/src/DynamicData.Tests/ObservableCollectionExFixture.cs @@ -1,13 +1,4 @@ - -using System.Collections.ObjectModel; -using DynamicData.Binding; -using DynamicData.Tests.Domain; - -using FluentAssertions; - -using Xunit; - -namespace DynamicData.Tests; +namespace DynamicData.Tests; public class ObservableCollectionExFixture { diff --git a/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs b/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs index bb4e7cb3f..a9148584b 100644 --- a/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs +++ b/src/DynamicData.Tests/Utilities/CacheChangeSetAssertions.cs @@ -1,9 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public static class CacheChangeSetAssertions { diff --git a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs index 7f0eba1b9..96870d64c 100644 --- a/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/CacheItemRecordingObserver.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Reactive.Concurrency; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public sealed class CacheItemRecordingObserver : RecordingObserverBase> 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/ComparerExtensions.cs b/src/DynamicData.Tests/Utilities/ComparerExtensions.cs index 76433346f..04005a330 100644 --- a/src/DynamicData.Tests/Utilities/ComparerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ComparerExtensions.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal sealed class NoOpComparer : IComparer { diff --git a/src/DynamicData.Tests/Utilities/FakeScheduler.cs b/src/DynamicData.Tests/Utilities/FakeScheduler.cs index fc2b19bbf..2ffd3cd62 100644 --- a/src/DynamicData.Tests/Utilities/FakeScheduler.cs +++ b/src/DynamicData.Tests/Utilities/FakeScheduler.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal sealed class FakeScheduler : IScheduler diff --git a/src/DynamicData.Tests/Utilities/FakerExtensions.cs b/src/DynamicData.Tests/Utilities/FakerExtensions.cs index 1388d3b80..50d225a04 100644 --- a/src/DynamicData.Tests/Utilities/FakerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/FakerExtensions.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Linq; -using System.Reactive.Concurrency; -using Bogus; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class FakerExtensions { 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..22f14d758 100644 --- a/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs +++ b/src/DynamicData.Tests/Utilities/ListChangeSetAssertions.cs @@ -1,9 +1,4 @@ -using System.Collections.Generic; -using System.Linq; - -using FluentAssertions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public static class ListChangeSetAssertions { diff --git a/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs b/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs index 09eaa8819..c9ad14179 100644 --- a/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/ListItemRecordingObserver.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Reactive.Concurrency; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public sealed class ListItemRecordingObserver : RecordingObserverBase> diff --git a/src/DynamicData.Tests/Utilities/ObservableEx.cs b/src/DynamicData.Tests/Utilities/ObservableEx.cs index df45f9f75..715c880b5 100644 --- a/src/DynamicData.Tests/Utilities/ObservableEx.cs +++ b/src/DynamicData.Tests/Utilities/ObservableEx.cs @@ -1,8 +1,4 @@ -using System; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; /// /// Extra Observable Tools for Testing diff --git a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs index acd336d0e..919c06d31 100644 --- a/src/DynamicData.Tests/Utilities/ObservableExtensions.cs +++ b/src/DynamicData.Tests/Utilities/ObservableExtensions.cs @@ -1,15 +1,4 @@ -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; - -using FluentAssertions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class ObservableExtensions { @@ -402,7 +391,7 @@ public static IObservable ValidateSynchronization(this IObservable sour // This allows the operator to be combined with other operators that might be testing for things that the safeguards normally prevent. => RawAnonymousObservable.Create(observer => { - var inFlightNotification = null as Notification; + var inFlightNotification = null as System.Reactive.Notification; var synchronizationGate = new object(); // Not using .Do() so we can track the *entire* in-flight period of a notification, including all synchronous downstream processing. @@ -411,7 +400,7 @@ public static IObservable ValidateSynchronization(this IObservable sour onError: error => ProcessIncomingNotification(Notification.CreateOnError(error)), onCompleted: () => ProcessIncomingNotification(Notification.CreateOnCompleted()))); - void ProcessIncomingNotification(Notification incomingNotification) + void ProcessIncomingNotification(System.Reactive.Notification incomingNotification) { try { diff --git a/src/DynamicData.Tests/Utilities/ObservableSpy.cs b/src/DynamicData.Tests/Utilities/ObservableSpy.cs index b4ae7bbc8..50a03b8b6 100644 --- a/src/DynamicData.Tests/Utilities/ObservableSpy.cs +++ b/src/DynamicData.Tests/Utilities/ObservableSpy.cs @@ -1,12 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.InteropServices; -using System.Threading; -using Xunit.Abstractions; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class ObservableSpy { @@ -15,7 +7,7 @@ internal static class ObservableSpy private static class NativeMethods { [DllImport("kernel32.dll", CharSet = CharSet.Unicode, EntryPoint = "OutputDebugStringW")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "SYSLIB1054:Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time", Justification = "Affects operation")] + [SuppressMessage("Interoperability", "SYSLIB1054:Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time", Justification = "Affects operation")] public static extern void OutputDebugString(string lpOutputString); } @@ -209,7 +201,7 @@ private static Action TestLogger(ITestOutputHelper testOutputHelper) => #endif #if DEBUG - private static void DebugLogger(string str) => System.Diagnostics.Debug.WriteLine(str); + private static void DebugLogger(string str) => Debug.WriteLine(str); #elif DEBUG_SPY_ALWAYS private static void DebugLogger(string str) => NativeMethods.OutputDebugString(str); #endif diff --git a/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs b/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs index eb9f4a490..fa315b2d8 100644 --- a/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs +++ b/src/DynamicData.Tests/Utilities/RandomizerExtensions.cs @@ -1,9 +1,4 @@ -using System; -using System.Diagnostics; -using System.Reactive.Concurrency; -using Bogus; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; internal static class RandomizerExtensions { 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/RecordingObserverBase.cs b/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs index 4c7ce3a0e..e725b8340 100644 --- a/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs +++ b/src/DynamicData.Tests/Utilities/RecordingObserverBase.cs @@ -1,19 +1,11 @@ -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; +namespace DynamicData.Tests.Utilities; // Using a custom implementing of IObserver<> to bypass normal RX safeguards, allowing invalid behaviors to be potentially tested for. public abstract class RecordingObserverBase : IObserver { private readonly TaskCompletionSource _whenFinalizedSource; - private readonly List>> _notifications; + private readonly List>> _notifications; private readonly IScheduler _scheduler; private Exception? _error; @@ -35,7 +27,7 @@ public bool HasCompleted public bool HasFinalized => _hasCompleted || (_error is not null); - public IReadOnlyList>> Notifications + public IReadOnlyList>> Notifications => _notifications; public Task WhenFinalized 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 afe5f47d5..7614ae5fc 100644 --- a/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs +++ b/src/DynamicData.Tests/Utilities/StressAddRemoveExtensions.cs @@ -1,9 +1,4 @@ -using System; -using System.Linq; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - -namespace DynamicData.Tests.Utilities; +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 bdd440a1c..01b78fe49 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceCache.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceCache.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Kernel; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public sealed class TestSourceCache : ISourceCache diff --git a/src/DynamicData.Tests/Utilities/TestSourceList.cs b/src/DynamicData.Tests/Utilities/TestSourceList.cs index 6f3a1e2c2..70a885a20 100644 --- a/src/DynamicData.Tests/Utilities/TestSourceList.cs +++ b/src/DynamicData.Tests/Utilities/TestSourceList.cs @@ -1,11 +1,4 @@ -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; +namespace DynamicData.Tests.Utilities; public sealed class TestSourceList : ISourceList diff --git a/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs b/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs index 4994e2b35..8a3395f1e 100644 --- a/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs +++ b/src/DynamicData.Tests/Utilities/UnsynchronizedNotificationException.cs @@ -1,7 +1,4 @@ -using System; -using System.Reactive; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public class UnsynchronizedNotificationException : Exception @@ -10,7 +7,7 @@ public UnsynchronizedNotificationException() : base("Unsynchronized notification received: Another notification is already being processed") { } - public required Notification IncomingNotification { get; init; } + public required System.Reactive.Notification IncomingNotification { get; init; } - public required Notification PriorNotification { get; init; } + public required System.Reactive.Notification PriorNotification { get; init; } } diff --git a/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs b/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs index 51c53964d..a82caab33 100644 --- a/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs +++ b/src/DynamicData.Tests/Utilities/ValueRecordingObserver.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using System.Reactive.Concurrency; - -namespace DynamicData.Tests.Utilities; +namespace DynamicData.Tests.Utilities; public sealed class ValueRecordingObserver : RecordingObserverBase 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/Aggregation/AggregationEx.cs b/src/DynamicData/Aggregation/AggregationEx.cs index 9e5faed42..25f5389ca 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 8f80f41c0..ae28a06ee 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..02489497b 100644 --- a/src/DynamicData/Aggregation/CountEx.cs +++ b/src/DynamicData/Aggregation/CountEx.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/MaxEx.cs b/src/DynamicData/Aggregation/MaxEx.cs index a8cf6821d..0d3f40295 100644 --- a/src/DynamicData/Aggregation/MaxEx.cs +++ b/src/DynamicData/Aggregation/MaxEx.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/StdDevEx.cs b/src/DynamicData/Aggregation/StdDevEx.cs index 7c08577e9..7cdcfda9f 100644 --- a/src/DynamicData/Aggregation/StdDevEx.cs +++ b/src/DynamicData/Aggregation/StdDevEx.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/Alias/ObservableCacheAlias.cs b/src/DynamicData/Alias/ObservableCacheAlias.cs index b89cb2626..e63f32836 100644 --- a/src/DynamicData/Alias/ObservableCacheAlias.cs +++ b/src/DynamicData/Alias/ObservableCacheAlias.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; - namespace DynamicData.Alias; /// diff --git a/src/DynamicData/Attributes.cs b/src/DynamicData/Attributes.cs deleted file mode 100644 index 45b01bca7..000000000 --- a/src/DynamicData/Attributes.cs +++ /dev/null @@ -1,7 +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.CompilerServices; - -[assembly: InternalsVisibleTo("DynamicData.Tests")] diff --git a/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs b/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs index e24b07843..3f6fa6f0f 100644 --- a/src/DynamicData/Binding/AbstractNotifyPropertyChanged.cs +++ b/src/DynamicData/Binding/AbstractNotifyPropertyChanged.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.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..2b9990bb2 100644 --- a/src/DynamicData/Binding/BindPaged.cs +++ b/src/DynamicData/Binding/BindPaged.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.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..907440143 100644 --- a/src/DynamicData/Binding/BindVirtualized.cs +++ b/src/DynamicData/Binding/BindVirtualized.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.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Binding; /* diff --git a/src/DynamicData/Binding/BindingListAdaptor.cs b/src/DynamicData/Binding/BindingListAdaptor.cs index f71571ae7..50a81b143 100644 --- a/src/DynamicData/Binding/BindingListAdaptor.cs +++ b/src/DynamicData/Binding/BindingListAdaptor.cs @@ -3,11 +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 256d08fbe..b6f7dd2cd 100644 --- a/src/DynamicData/Binding/BindingListEventsSuspender.cs +++ b/src/DynamicData/Binding/BindingListEventsSuspender.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.Reactive.Disposables; - 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 32991a88e..20f75def2 100644 --- a/src/DynamicData/Binding/BindingListEx.cs +++ b/src/DynamicData/Binding/BindingListEx.cs @@ -2,12 +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.Reactive; -using System.Reactive.Linq; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/ExpressionBuilder.cs b/src/DynamicData/Binding/ExpressionBuilder.cs index 3bf085163..dfb0d9240 100644 --- a/src/DynamicData/Binding/ExpressionBuilder.cs +++ b/src/DynamicData/Binding/ExpressionBuilder.cs @@ -2,12 +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.Reactive; -using System.Reactive.Linq; -using System.Reflection; - namespace DynamicData.Binding; internal static class ExpressionBuilder diff --git a/src/DynamicData/Binding/IObservableCollection.cs b/src/DynamicData/Binding/IObservableCollection.cs index 4358877b5..daebb703c 100644 --- a/src/DynamicData/Binding/IObservableCollection.cs +++ b/src/DynamicData/Binding/IObservableCollection.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.Specialized; -using System.ComponentModel; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/IObservableListEx.cs b/src/DynamicData/Binding/IObservableListEx.cs index fee1b2bec..2d5291744 100644 --- a/src/DynamicData/Binding/IObservableListEx.cs +++ b/src/DynamicData/Binding/IObservableListEx.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.ObjectModel; -using System.Reactive.Linq; - namespace DynamicData.Binding; /// @@ -138,7 +135,7 @@ private static ChangeSet RemoveKey(this IChangeSet(changeSetWithKey, list); + var enumerator = new RemoveKeyEnumerator(changeSetWithKey, list); return new ChangeSet(enumerator); } diff --git a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs b/src/DynamicData/Binding/NotifyPropertyChangedEx.cs index e42e048fd..6073de259 100644 --- a/src/DynamicData/Binding/NotifyPropertyChangedEx.cs +++ b/src/DynamicData/Binding/NotifyPropertyChangedEx.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.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..169d94846 100644 --- a/src/DynamicData/Binding/Observable.cs +++ b/src/DynamicData/Binding/Observable.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.Binding; internal static class Observable diff --git a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs b/src/DynamicData/Binding/ObservableCollectionAdaptor.cs index 8f709c35a..ed0ab67d6 100644 --- a/src/DynamicData/Binding/ObservableCollectionAdaptor.cs +++ b/src/DynamicData/Binding/ObservableCollectionAdaptor.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.Diagnostics.CodeAnalysis; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/ObservableCollectionEx.cs b/src/DynamicData/Binding/ObservableCollectionEx.cs index e6e53b6f5..d574197ac 100644 --- a/src/DynamicData/Binding/ObservableCollectionEx.cs +++ b/src/DynamicData/Binding/ObservableCollectionEx.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.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Reactive; -using System.Reactive.Linq; - namespace DynamicData.Binding; /// @@ -106,7 +101,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 9bb427b24..f53baf0d7 100644 --- a/src/DynamicData/Binding/ObservableCollectionExtended.cs +++ b/src/DynamicData/Binding/ObservableCollectionExtended.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.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 4fd8fc4a1..40404759b 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactory.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactory.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.Generic; -using System.ComponentModel; -using System.Linq.Expressions; -using System.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -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 9e7c78b8d..b5326dcd7 100644 --- a/src/DynamicData/Binding/ObservablePropertyFactoryCache.cs +++ b/src/DynamicData/Binding/ObservablePropertyFactoryCache.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.Collections.Concurrent; -using System.ComponentModel; -using System.Linq.Expressions; -using System.Reflection; - namespace DynamicData.Binding; internal sealed class ObservablePropertyFactoryCache diff --git a/src/DynamicData/Binding/ObservablePropertyPart.cs b/src/DynamicData/Binding/ObservablePropertyPart.cs index 9b4b1ab09..dd4a6cd94 100644 --- a/src/DynamicData/Binding/ObservablePropertyPart.cs +++ b/src/DynamicData/Binding/ObservablePropertyPart.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.Diagnostics; -using System.Linq.Expressions; -using System.Reactive; - namespace DynamicData.Binding; [DebuggerDisplay("ObservablePropertyPart<{" + nameof(expression) + "}>")] diff --git a/src/DynamicData/Binding/SortAndBind.cs b/src/DynamicData/Binding/SortAndBind.cs index 0bb5fe208..b5665483c 100644 --- a/src/DynamicData/Binding/SortAndBind.cs +++ b/src/DynamicData/Binding/SortAndBind.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.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - namespace DynamicData.Binding; /* diff --git a/src/DynamicData/Binding/SortAndBindOptions.cs b/src/DynamicData/Binding/SortAndBindOptions.cs index bf93e8afe..cc9e3eab4 100644 --- a/src/DynamicData/Binding/SortAndBindOptions.cs +++ b/src/DynamicData/Binding/SortAndBindOptions.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.Concurrency; - namespace DynamicData.Binding; /// diff --git a/src/DynamicData/Binding/SortedBindingListAdaptor.cs b/src/DynamicData/Binding/SortedBindingListAdaptor.cs index c833dab6b..956ccad52 100644 --- a/src/DynamicData/Binding/SortedBindingListAdaptor.cs +++ b/src/DynamicData/Binding/SortedBindingListAdaptor.cs @@ -3,8 +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/CacheChangeSetEx.cs b/src/DynamicData/Cache/CacheChangeSetEx.cs index 7caef62c7..42bf659cc 100644 --- a/src/DynamicData/Cache/CacheChangeSetEx.cs +++ b/src/DynamicData/Cache/CacheChangeSetEx.cs @@ -2,7 +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. -namespace DynamicData.Cache; +namespace DynamicData; internal static class CacheChangeSetEx { diff --git a/src/DynamicData/Cache/ChangeAwareCache.cs b/src/DynamicData/Cache/ChangeAwareCache.cs index fa5798566..8973e9a86 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; @@ -87,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) diff --git a/src/DynamicData/Cache/IPagedChangeSet.cs b/src/DynamicData/Cache/IPagedChangeSet.cs index 4fd88a798..272b3f4d5 100644 --- a/src/DynamicData/Cache/IPagedChangeSet.cs +++ b/src/DynamicData/Cache/IPagedChangeSet.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.Operators; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/IntermediateCache.cs b/src/DynamicData/Cache/IntermediateCache.cs index 6a2e03caa..5515bdf17 100644 --- a/src/DynamicData/Cache/IntermediateCache.cs +++ b/src/DynamicData/Cache/IntermediateCache.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.Diagnostics; -using DynamicData.Binding; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index 2ddc25cbb..683f6006b 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.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.Diagnostics; -using System.Reactive.Disposables; - namespace DynamicData.Cache.Internal; [DebuggerDisplay("AnonymousObservableCache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] @@ -12,7 +9,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; diff --git a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs b/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs index 97feda5a3..55126508a 100644 --- a/src/DynamicData/Cache/Internal/AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/Internal/AsyncDisposeMany.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; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; #if SUPPORTS_ASYNC_DISPOSABLE diff --git a/src/DynamicData/Cache/Internal/AutoRefresh.cs b/src/DynamicData/Cache/Internal/AutoRefresh.cs index f1f17d677..923ef23b6 100644 --- a/src/DynamicData/Cache/Internal/AutoRefresh.cs +++ b/src/DynamicData/Cache/Internal/AutoRefresh.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; - 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 2ae4d660d..dfc5c9619 100644 --- a/src/DynamicData/Cache/Internal/BatchIf.cs +++ b/src/DynamicData/Cache/Internal/BatchIf.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; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class BatchIf diff --git a/src/DynamicData/Cache/Internal/Cache.cs b/src/DynamicData/Cache/Internal/Cache.cs index 95f9cfeba..7ee84c369 100644 --- a/src/DynamicData/Cache/Internal/Cache.cs +++ b/src/DynamicData/Cache/Internal/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.Diagnostics; - namespace DynamicData.Cache.Internal; [DebuggerDisplay("Cache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")] diff --git a/src/DynamicData/Cache/Internal/Cast.cs b/src/DynamicData/Cache/Internal/Cast.cs index 02f62ebb8..8dda73478 100644 --- a/src/DynamicData/Cache/Internal/Cast.cs +++ b/src/DynamicData/Cache/Internal/Cast.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 Cast(IObservable> source, Func converter) diff --git a/src/DynamicData/Cache/Internal/ChangeSetCache.cs b/src/DynamicData/Cache/Internal/ChangeSetCache.cs index d63a93bea..1230a01f8 100644 --- a/src/DynamicData/Cache/Internal/ChangeSetCache.cs +++ b/src/DynamicData/Cache/Internal/ChangeSetCache.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; /// diff --git a/src/DynamicData/Cache/Internal/Combiner.cs b/src/DynamicData/Cache/Internal/Combiner.cs index 87eb9af11..ff7de18f5 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 bfcea5f34..dc9c9e45d 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..27c94fbf6 100644 --- a/src/DynamicData/Cache/Internal/DisposeMany.cs +++ b/src/DynamicData/Cache/Internal/DisposeMany.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.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..8435b6088 100644 --- a/src/DynamicData/Cache/Internal/DistinctCalculator.cs +++ b/src/DynamicData/Cache/Internal/DistinctCalculator.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 DistinctCalculator(IObservable> source, Func valueSelector) diff --git a/src/DynamicData/Cache/Internal/DynamicCombiner.cs b/src/DynamicData/Cache/Internal/DynamicCombiner.cs index 9e2907a78..4c0258c55 100644 --- a/src/DynamicData/Cache/Internal/DynamicCombiner.cs +++ b/src/DynamicData/Cache/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; - namespace DynamicData.Cache.Internal; internal sealed class DynamicCombiner diff --git a/src/DynamicData/Cache/Internal/DynamicGrouper.cs b/src/DynamicData/Cache/Internal/DynamicGrouper.cs index cb4880193..8af6d620b 100644 --- a/src/DynamicData/Cache/Internal/DynamicGrouper.cs +++ b/src/DynamicData/Cache/Internal/DynamicGrouper.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.Diagnostics; -using System.Reactive.Disposables; - namespace DynamicData.Cache.Internal; internal sealed class DynamicGrouper(Func? groupSelector = null) : IDisposable diff --git a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs index 17afafebd..050360d2e 100644 --- a/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.cs +++ b/src/DynamicData/Cache/Internal/EditDiffChangeSetOptional.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 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 f9271948c..89fd6dd3c 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForSource.cs @@ -2,12 +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.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 1f5724715..bd8c7a52a 100644 --- a/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs +++ b/src/DynamicData/Cache/Internal/ExpireAfter.ForStream.cs @@ -2,12 +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.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 1ca4a1731..d155f61e2 100644 --- a/src/DynamicData/Cache/Internal/Filter.Dynamic.cs +++ b/src/DynamicData/Cache/Internal/Filter.Dynamic.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.Linq; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal static partial class Filter diff --git a/src/DynamicData/Cache/Internal/Filter.Static.cs b/src/DynamicData/Cache/Internal/Filter.Static.cs index 58b8bfb91..357716163 100644 --- a/src/DynamicData/Cache/Internal/Filter.Static.cs +++ b/src/DynamicData/Cache/Internal/Filter.Static.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 static partial class Filter diff --git a/src/DynamicData/Cache/Internal/FilterImmutable.cs b/src/DynamicData/Cache/Internal/FilterImmutable.cs index 67f6ec02d..383a9f2d2 100644 --- a/src/DynamicData/Cache/Internal/FilterImmutable.cs +++ b/src/DynamicData/Cache/Internal/FilterImmutable.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.Cache.Internal; internal sealed class FilterImmutable diff --git a/src/DynamicData/Cache/Internal/FilterOnObservable.cs b/src/DynamicData/Cache/Internal/FilterOnObservable.cs index d444d9ac4..acea546c4 100644 --- a/src/DynamicData/Cache/Internal/FilterOnObservable.cs +++ b/src/DynamicData/Cache/Internal/FilterOnObservable.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.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 a8d851454..6154d441a 100644 --- a/src/DynamicData/Cache/Internal/FullJoin.cs +++ b/src/DynamicData/Cache/Internal/FullJoin.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 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 9cf8ca0e2..5b4318910 100644 --- a/src/DynamicData/Cache/Internal/GroupOn.cs +++ b/src/DynamicData/Cache/Internal/GroupOn.cs @@ -2,12 +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; - -using DynamicData.Internal; - 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 91efad22f..a0c449972 100644 --- a/src/DynamicData/Cache/Internal/GroupOnDynamic.cs +++ b/src/DynamicData/Cache/Internal/GroupOnDynamic.cs @@ -2,12 +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; - -using DynamicData.Internal; - 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 1f0923af7..e0ee44d00 100644 --- a/src/DynamicData/Cache/Internal/GroupOnImmutable.cs +++ b/src/DynamicData/Cache/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.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..d99929887 100644 --- a/src/DynamicData/Cache/Internal/GroupOnObservable.cs +++ b/src/DynamicData/Cache/Internal/GroupOnObservable.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.Linq; -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 8fa06893b..5da904756 100644 --- a/src/DynamicData/Cache/Internal/GroupOnProperty.cs +++ b/src/DynamicData/Cache/Internal/GroupOnProperty.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.ComponentModel; -using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class GroupOnProperty(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs index bc3755a44..fde66d748 100644 --- a/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/Internal/GroupOnPropertyWithImmutableState.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.ComponentModel; -using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.Cache.Internal; internal sealed class GroupOnPropertyWithImmutableState(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) 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/InnerJoin.cs b/src/DynamicData/Cache/Internal/InnerJoin.cs index 9b16ef51e..1009e94e9 100644 --- a/src/DynamicData/Cache/Internal/InnerJoin.cs +++ b/src/DynamicData/Cache/Internal/InnerJoin.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 InnerJoin(IObservable> left, IObservable> right, Func rightKeySelector, Func<(TLeftKey leftKey, TRightKey rightKey), TLeft, TRight, TDestination> resultSelector) 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/LeftJoin.cs b/src/DynamicData/Cache/Internal/LeftJoin.cs index 44ee18898..0f958fef9 100644 --- a/src/DynamicData/Cache/Internal/LeftJoin.cs +++ b/src/DynamicData/Cache/Internal/LeftJoin.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 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 b682ddc03..14dd12cda 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.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.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Cache.Internal; /// @@ -20,13 +15,13 @@ public sealed class LockFreeObservableCache : IObservableCache> _changes = new(); - [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 Subject> _changesPreview = new(); - [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 Subject _countChanged = new(); private readonly IDisposable _cleanUp; diff --git a/src/DynamicData/Cache/Internal/MergeChangeSets.cs b/src/DynamicData/Cache/Internal/MergeChangeSets.cs index ebf4b22f1..66dc74e4f 100644 --- a/src/DynamicData/Cache/Internal/MergeChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeChangeSets.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; - namespace DynamicData.Cache.Internal; /// diff --git a/src/DynamicData/Cache/Internal/MergeMany.cs b/src/DynamicData/Cache/Internal/MergeMany.cs index 490317e38..bf46c6d66 100644 --- a/src/DynamicData/Cache/Internal/MergeMany.cs +++ b/src/DynamicData/Cache/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.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 551cc8bbf..ad8794392 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSets.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.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..a8875e776 100644 --- a/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.cs +++ b/src/DynamicData/Cache/Internal/MergeManyCacheChangeSetsSourceCompare.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.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 d0b9032c2..34635a2fb 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..81fdfb188 100644 --- a/src/DynamicData/Cache/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/Cache/Internal/MergeManyListChangeSets.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.Linq; -using DynamicData.Internal; -using DynamicData.List.Internal; - namespace DynamicData.Cache.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..d8ac1b306 100644 --- a/src/DynamicData/Cache/Internal/OfType.cs +++ b/src/DynamicData/Cache/Internal/OfType.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.Linq; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class OfType(IObservable> source, bool suppressEmptyChangeSets) diff --git a/src/DynamicData/Cache/Internal/OnBeingRemoved.cs b/src/DynamicData/Cache/Internal/OnBeingRemoved.cs index 092306f3d..47e9738b5 100644 --- a/src/DynamicData/Cache/Internal/OnBeingRemoved.cs +++ b/src/DynamicData/Cache/Internal/OnBeingRemoved.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 OnBeingRemoved(IObservable> source, Action removeAction) diff --git a/src/DynamicData/Cache/Internal/Page.cs b/src/DynamicData/Cache/Internal/Page.cs index 2d91ac29d..6ec62f24f 100644 --- a/src/DynamicData/Cache/Internal/Page.cs +++ b/src/DynamicData/Cache/Internal/Page.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 Page(IObservable> source, IObservable pageRequests) diff --git a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs b/src/DynamicData/Cache/Internal/QueryWhenChanged.cs index 7e9764244..4d7a84e53 100644 --- a/src/DynamicData/Cache/Internal/QueryWhenChanged.cs +++ b/src/DynamicData/Cache/Internal/QueryWhenChanged.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 QueryWhenChanged(IObservable> source, Func>? itemChangedTrigger = null) diff --git a/src/DynamicData/Cache/Internal/RefCount.cs b/src/DynamicData/Cache/Internal/RefCount.cs index 8787853af..361a9dbb6 100644 --- a/src/DynamicData/Cache/Internal/RefCount.cs +++ b/src/DynamicData/Cache/Internal/RefCount.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 RefCount(IObservable> source) 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/RightJoin.cs b/src/DynamicData/Cache/Internal/RightJoin.cs index ef7b679e9..a6cbf3bfd 100644 --- a/src/DynamicData/Cache/Internal/RightJoin.cs +++ b/src/DynamicData/Cache/Internal/RightJoin.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 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 6afb9632f..38565ad19 100644 --- a/src/DynamicData/Cache/Internal/Sort.cs +++ b/src/DynamicData/Cache/Internal/Sort.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.Cache.Internal; internal sealed class Sort diff --git a/src/DynamicData/Cache/Internal/SortAndPage.cs b/src/DynamicData/Cache/Internal/SortAndPage.cs index 02ef996dc..4e355eb7c 100644 --- a/src/DynamicData/Cache/Internal/SortAndPage.cs +++ b/src/DynamicData/Cache/Internal/SortAndPage.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 DynamicData.Binding; - namespace DynamicData.Cache.Internal; internal sealed class SortAndPage diff --git a/src/DynamicData/Cache/Internal/SortAndVirtualize.cs b/src/DynamicData/Cache/Internal/SortAndVirtualize.cs index 0e6ae5508..5f6e1c62d 100644 --- a/src/DynamicData/Cache/Internal/SortAndVirtualize.cs +++ b/src/DynamicData/Cache/Internal/SortAndVirtualize.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 DynamicData.Binding; - namespace DynamicData.Cache.Internal; internal sealed class SortAndVirtualize 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/SortedKeyValueApplicator.cs b/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs index 4ab732ceb..1c7d79ed4 100644 --- a/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.cs +++ b/src/DynamicData/Cache/Internal/SortedKeyValueApplicator.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.Binding; - namespace DynamicData.Cache.Internal; /* diff --git a/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs b/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs index 863f2d6d6..23d33fb64 100644 --- a/src/DynamicData/Cache/Internal/SpecifiedGrouper.cs +++ b/src/DynamicData/Cache/Internal/SpecifiedGrouper.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 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 cf6c90ca3..778535a0a 100644 --- a/src/DynamicData/Cache/Internal/SubscribeMany.cs +++ b/src/DynamicData/Cache/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.Cache.Internal; internal sealed class SubscribeMany diff --git a/src/DynamicData/Cache/Internal/Switch.cs b/src/DynamicData/Cache/Internal/Switch.cs index 551a35730..b4bc0c9cf 100644 --- a/src/DynamicData/Cache/Internal/Switch.cs +++ b/src/DynamicData/Cache/Internal/Switch.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 Switch(IObservable>> sources) diff --git a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs index 230e84d45..282950538 100644 --- a/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/Internal/ToObservableChangeSet.cs @@ -2,12 +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.Cache.Internal; internal static class ToObservableChangeSet diff --git a/src/DynamicData/Cache/Internal/ToObservableOptional.cs b/src/DynamicData/Cache/Internal/ToObservableOptional.cs index 47efd420c..d2ac7fa55 100644 --- a/src/DynamicData/Cache/Internal/ToObservableOptional.cs +++ b/src/DynamicData/Cache/Internal/ToObservableOptional.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 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 040da65b2..25b7dfd60 100644 --- a/src/DynamicData/Cache/Internal/TransformAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformAsync.cs @@ -2,12 +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.Threading.Tasks; - -using DynamicData.Internal; - 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..25c46de93 100644 --- a/src/DynamicData/Cache/Internal/TransformImmutable.cs +++ b/src/DynamicData/Cache/Internal/TransformImmutable.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.Cache.Internal; internal sealed class TransformImmutable diff --git a/src/DynamicData/Cache/Internal/TransformMany.cs b/src/DynamicData/Cache/Internal/TransformMany.cs index 46c2c9a42..81f5ed02e 100644 --- a/src/DynamicData/Cache/Internal/TransformMany.cs +++ b/src/DynamicData/Cache/Internal/TransformMany.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; -using System.Collections.ObjectModel; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Binding; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class TransformMany(IObservable> source, Func> manySelector, Func keySelector, Func>>? childChanges = null) diff --git a/src/DynamicData/Cache/Internal/TransformManyAsync.cs b/src/DynamicData/Cache/Internal/TransformManyAsync.cs index b202cb307..09accc411 100644 --- a/src/DynamicData/Cache/Internal/TransformManyAsync.cs +++ b/src/DynamicData/Cache/Internal/TransformManyAsync.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.Linq; -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 b88e4f1c6..716ee93bc 100644 --- a/src/DynamicData/Cache/Internal/TransformOnObservable.cs +++ b/src/DynamicData/Cache/Internal/TransformOnObservable.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.Linq; -using DynamicData.Internal; - namespace DynamicData.Cache.Internal; internal sealed class TransformOnObservable(IObservable> source, Func> transform, bool transformOnRefresh = false) diff --git a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs index 4bce97ac4..3a79013f1 100644 --- a/src/DynamicData/Cache/Internal/TransformWithForcedTransform.cs +++ b/src/DynamicData/Cache/Internal/TransformWithForcedTransform.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 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 d94783e87..26d437c0c 100644 --- a/src/DynamicData/Cache/Internal/TreeBuilder.cs +++ b/src/DynamicData/Cache/Internal/TreeBuilder.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.Reactive; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Internal; - 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..29b9b0a67 100644 --- a/src/DynamicData/Cache/Internal/UniquenessEnforcer.cs +++ b/src/DynamicData/Cache/Internal/UniquenessEnforcer.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 UniquenessEnforcer(IObservable> source) diff --git a/src/DynamicData/Cache/Internal/Virtualise.cs b/src/DynamicData/Cache/Internal/Virtualise.cs index 8eb827a28..85cdc3a34 100644 --- a/src/DynamicData/Cache/Internal/Virtualise.cs +++ b/src/DynamicData/Cache/Internal/Virtualise.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 Virtualise(IObservable> source, IObservable virtualRequests) diff --git a/src/DynamicData/Cache/Node.cs b/src/DynamicData/Cache/Node.cs index 44918b4c1..4fec17514 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; @@ -16,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; diff --git a/src/DynamicData/Cache/ObservableCache.cs b/src/DynamicData/Cache/ObservableCache.cs index e73a035a3..3c193c107 100644 --- a/src/DynamicData/Cache/ObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCache.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.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.Binding; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -18,10 +10,10 @@ internal sealed class ObservableCache : IObservableCache> _changes = new(); - [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 Subject> _changesPreview = new(); private readonly IDisposable _cleanUp; @@ -34,10 +26,10 @@ internal sealed class ObservableCache : IObservableCache _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; - [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 Lazy> _isEditInProgress; private int _editLevel; // The level of recursion in editing. diff --git a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs index 8ae6e1643..607c2262f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Adapt.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.AdaptSelector.cs b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs index 07c984029..a04d82fa9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AdaptSelector.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 6993a191f..562078682 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AddOrUpdate.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 22aa4c861..faf6c98cb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.And.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.And.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.AsObservableCache.cs b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs index 55eab0c4c..6ff29e1ab 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsObservableCache.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.AsyncDisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs index 0a15843d5..5a1d4c851 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AsyncDisposeMany.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -74,7 +60,8 @@ public static IObservable> AsyncDisposeMany> disposalsCompletedAccessor) where TObject : notnull where TKey : notnull - => Cache.Internal.AsyncDisposeMany.Create( + => + Cache.Internal.AsyncDisposeMany.Create( source: source, disposalsCompletedAccessor: disposalsCompletedAccessor); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs index fbc3edac7..308096d30 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefresh.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.AutoRefreshOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs index 684f88152..ef9b8983c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.Batch.cs b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs index 5b8a7c7a0..ba12a99ff 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Batch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Batch.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 6fad6c183..727af58f1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BatchIf.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.Bind.cs b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs index 79eb57e8e..a1d1465fc 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Bind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Bind.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.BufferInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs index c8d709c85..fc6ba0387 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 81d492d88..c86b649f7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Cast.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Cast.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.ChangeKey.cs b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs index 58fd8aa54..46bc0fda9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ChangeKey.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 48b728854..2b1ee1239 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clear.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clear.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.Clone.cs b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs index 7dfcf3d6b..ea89fe659 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Clone.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Clone.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 0e8696250..1afdbc11a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Combine.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Combine.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.Convert.cs b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs index b6a37a345..e7181ed7e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Convert.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Convert.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 47d11d3ca..eeacf26e0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.CreateChangeSetTransformer.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.DeferUntilLoaded.cs b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs index c0725b0de..55f75558c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DeferUntilLoaded.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.DisposeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs index df1db9684..eb082eb5a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DisposeMany.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.DistinctValues.cs b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs index 05148c640..c3efb1827 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.DistinctValues.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.EditDiff.cs b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs index da9eed2f2..11d43cdc0 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EditDiff.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.EnsureUniqueKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs index 8606b0d93..b105c93a9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.EnsureUniqueKeys.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.Except.cs b/src/DynamicData/Cache/ObservableCacheEx.Except.cs index 0cb153b48..64a6975c8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Except.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Except.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.ExpireAfter.cs b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs index 168d8903e..f63c8c4bf 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ExpireAfter.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -53,7 +39,8 @@ public static IObservable> ExpireAfter( Func timeSelector) where TObject : notnull where TKey : notnull - => Cache.Internal.ExpireAfter.ForStream.Create( + => + Cache.Internal.ExpireAfter.ForStream.Create( source: source, timeSelector: timeSelector); @@ -67,7 +54,8 @@ public static IObservable> ExpireAfter( IScheduler scheduler) where TObject : notnull where TKey : notnull - => Cache.Internal.ExpireAfter.ForStream.Create( + => + Cache.Internal.ExpireAfter.ForStream.Create( source: source, timeSelector: timeSelector, scheduler: scheduler); @@ -86,7 +74,8 @@ public static IObservable> ExpireAfter( TimeSpan? pollingInterval) where TObject : notnull where TKey : notnull - => Cache.Internal.ExpireAfter.ForStream.Create( + => + Cache.Internal.ExpireAfter.ForStream.Create( source: source, timeSelector: timeSelector, pollingInterval: pollingInterval); @@ -103,7 +92,8 @@ public static IObservable> ExpireAfter( IScheduler scheduler) where TObject : notnull where TKey : notnull - => Cache.Internal.ExpireAfter.ForStream.Create( + => + Cache.Internal.ExpireAfter.ForStream.Create( source: source, timeSelector: timeSelector, pollingInterval: pollingInterval, @@ -133,7 +123,8 @@ public static IObservable>> ExpireAfter< IScheduler? scheduler = null) where TObject : notnull where TKey : notnull - => Cache.Internal.ExpireAfter.ForSource.Create( + => + Cache.Internal.ExpireAfter.ForSource.Create( source: source, timeSelector: timeSelector, pollingInterval: pollingInterval, diff --git a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs index 7b43d0173..3a17a12e8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Filter.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Filter.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Runtime.CompilerServices; -using DynamicData.Binding; -using DynamicData.Cache; -using DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -54,7 +40,8 @@ public static IObservable> Filter( bool suppressEmptyChangeSets = true) where TObject : notnull where TKey : notnull - => Cache.Internal.Filter.Static.Create( + => + Cache.Internal.Filter.Static.Create( source: source, filter: filter, suppressEmptyChangeSets: suppressEmptyChangeSets); @@ -110,7 +97,8 @@ public static IObservable> Filter Cache.Internal.Filter.Dynamic.Create( + => + Cache.Internal.Filter.Dynamic.Create( source: source, predicateState: predicateState, predicate: predicate, @@ -136,7 +124,8 @@ public static IObservable> Filter( where TObject : notnull where TKey : notnull - => Cache.Internal.Filter.Dynamic>.Create( + => + Cache.Internal.Filter.Dynamic>.Create( source: source, predicateState: predicateChanged, predicate: static (predicate, item) => predicate.Invoke(item), diff --git a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs index 4d9ff918a..7a1acfdd4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterImmutable.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.FilterOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs index 0b7cba486..2d4a2012f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FilterOnObservable.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.FinallySafe.cs b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs index 8202530ac..5de82bdde 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FinallySafe.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.Flatten.cs b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs index 27f751a52..55b08b73d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Flatten.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 212720b1f..cf2840625 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FlattenBufferResult.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 d1031451a..b486f79ed 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForEachChange.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 02103498f..6fca43439 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ForForced.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 a6cbe1d6d..0cf1e3b61 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoin.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.FullJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs index 5fdd48cbf..1f50f78c2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.FullJoinMany.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.Group.cs b/src/DynamicData/Cache/ObservableCacheEx.Group.cs index de997e83e..c7d51d4bd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Group.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Group.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.GroupOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs index 1aa9f3ec4..0bd7e2b7a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnObservable.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.GroupOnProperty.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs index 06b9148fb..ac6bf1898 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnProperty.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.GroupOnPropertyWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs index 299dcd825..f5bc58e08 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupOnPropertyWithImmutableState.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.GroupWithImmutableState.cs b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs index be73aeee4..a1591d791 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.GroupWithImmutableState.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.IgnoreSameReferenceUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs index f5ff65ace..e0e16a9bb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreSameReferenceUpdate.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 2b8f11a87..f16a71434 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IgnoreUpdateWhen.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 8f5f41f31..18b9e39ee 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.IncludeUpdateWhen.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 311bd3f27..2e622308b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoin.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.InnerJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs index e94ed1c92..4edc34fbe 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InnerJoinMany.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.InvokeEvaluate.cs b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs index f19fde951..daec7b5a2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.LeftJoin.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs index eb8db273d..cc7cfc8cb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoin.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.LeftJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs index 38f5bb44e..9d7d6b52c 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LeftJoinMany.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.LimitSizeTo.cs b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs index 0a2d4f902..eb7bbedbb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.LimitSizeTo.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.MergeChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs index 0ad190f8b..811ed1506 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeChangeSets.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.MergeMany.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs index b68d82ee9..ed5bc079b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeMany.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.MergeManyChangeSets.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs index 5abef697b..6980ff0c4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyChangeSets.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.MergeManyItems.cs b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs index f00e2a522..9685286b8 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MergeManyItems.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.MonitorStatus.cs b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs index 93abf0f92..2ed7aed71 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.MonitorStatus.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.NotEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs index 0aa975d17..ceee8a8cb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.NotEmpty.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 a821c0d3b..497117472 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OfType.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OfType.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.OnChangeAction.cs b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs index 00b222a68..15c7448cb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnChangeAction.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 85a2414cd..18dcbe53f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemAdded.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 f8acb562b..3221dbe3b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRefreshed.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 cf183b6a2..9e5b1e9bb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemRemoved.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.OnItemUpdated.cs b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs index e3728eedc..1db707506 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.OnItemUpdated.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 749bb2c67..50965d6ca 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Or.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Or.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.PopulateFrom.cs b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs index 3a3472989..fa06e49c2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateFrom.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 5025697c3..af41cf3aa 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.PopulateInto.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.QueryWhenChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs index 9142aeb4b..492e208af 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.QueryWhenChanged.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.RefCount.cs b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs index 9ffd8f263..d2bfe18a7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RefCount.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.Refresh.cs b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs index 64ff32064..78294cd96 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Refresh.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 f230d46d2..fd4410534 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Remove.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Remove.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 293cb67f5..d7a09354d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKey.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.RemoveKeys.cs b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs index 79cfe7949..ec0a46c3e 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RemoveKeys.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 79af47e7e..968371cf9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoin.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.RightJoinMany.cs b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs index e3b76a0ac..f14603e27 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.RightJoinMany.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.SkipInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs index c6c5966f7..8949376cd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SkipInitial.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 e9427c83a..40a8d3726 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Sort.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Sort.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.SortAndBind.cs b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs index 9f5e1444c..e7e6481ee 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.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.Diagnostics.CodeAnalysis; -using DynamicData.Binding; - namespace DynamicData; /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs b/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs index 2834f6084..00716f1db 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortBy.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.StartWithEmpty.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs index 8960f03aa..4574809a6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.StartWithItem.cs b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs index eded4a622..5a360c2ab 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithItem.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 9bf1b13ba..4c1c0379d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SubscribeMany.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.SuppressRefresh.cs b/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs index 452c4ea0d..29c14dba6 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SuppressRefresh.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 852c52cdf..4eb3c526f 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.ToCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs index 1871e4337..11e0b49d2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 eab09f58a..0e7a146c4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableChangeSet.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 476631326..295bb70fd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.ToSortedCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs index 81770d625..da89b27ef 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToSortedCollection.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.Transform.cs b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs index 2798408cc..e5c7142ae 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Transform.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Transform.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TransformAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs index 4fee5e5cd..8c924898b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformAsync.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TransformImmutable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs index df1dc7522..8b2833414 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformImmutable.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TransformMany.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs index 682f5592d..f9eebd476 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformMany.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TransformManyAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs index baa9785b4..7d61f8627 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManyAsync.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TransformManySafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs index e18e4c7ee..125fc21ba 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformManySafeAsync.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TransformOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs index cc960dbad..a342886b1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformOnObservable.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TransformSafe.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs index f57f3a987..99db14660 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafe.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TransformSafeAsync.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs index cee0308b0..a974d814d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformSafeAsync.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TransformToTree.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs index d7229910e..0b19c4bde 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformToTree.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TransformWithInlineUpdate.cs b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs index c990fb2ed..b44435d45 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TransformWithInlineUpdate.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TreatMovesAsRemoveAdd.cs b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs index 41b5fda47..6a50df617 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TreatMovesAsRemoveAdd.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 a49b33f24..3723e737b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueFor.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.TrueForAll.cs b/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs index e09acbedb..024d42371 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAll.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 674d89f58..4e9ff2a1d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.TrueForAny.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 933529ea0..fc465cfc2 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.VirtualiseAndPage.cs b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs index 99712be19..3a278091a 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.VirtualiseAndPage.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.Linq; -using DynamicData.Cache.Internal; - namespace DynamicData; /// diff --git a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs index 1f100206b..b760e9550 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Watch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Watch.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 1c846024d..7e4ad2f89 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WatchValue.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 9f08fe7cf..dc245ce5b 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenAnyPropertyChanged.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.WhenPropertyChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs index 7e2b7daf8..0d4fdc1e1 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenPropertyChanged.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.WhenValueChanged.cs b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs index 976cd9736..db508f48d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhenValueChanged.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.WhereReasonsAre.cs b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs index deb554af3..5af16d2b4 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAre.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 e73ac0377..e8b0ddffb 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.WhereReasonsAreNot.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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 87e37b9b7..df069d3e3 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Xor.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Xor.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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.cs b/src/DynamicData/Cache/ObservableCacheEx.cs index 76a0cb1f8..6fd6232c7 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.cs @@ -2,20 +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.Reactive; -using System.Reactive.Concurrency; -using System.Reactive.Disposables; -using System.Reactive.Linq; -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/PageContext.cs b/src/DynamicData/Cache/PageContext.cs index a36afc396..940a1ae7f 100644 --- a/src/DynamicData/Cache/PageContext.cs +++ b/src/DynamicData/Cache/PageContext.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.Operators; - namespace DynamicData; /// diff --git a/src/DynamicData/Cache/PageResponse.cs b/src/DynamicData/Cache/PageResponse.cs index 425eb440e..2b5c4f432 100644 --- a/src/DynamicData/Cache/PageResponse.cs +++ b/src/DynamicData/Cache/PageResponse.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.Operators; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/PagedChangeSet.cs b/src/DynamicData/Cache/PagedChangeSet.cs index f16135527..56d8da26e 100644 --- a/src/DynamicData/Cache/PagedChangeSet.cs +++ b/src/DynamicData/Cache/PagedChangeSet.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 DynamicData.Cache.Internal; -using DynamicData.Operators; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/SortAndPageOptions.cs b/src/DynamicData/Cache/SortAndPageOptions.cs index 1783eced2..8d84e3e43 100644 --- a/src/DynamicData/Cache/SortAndPageOptions.cs +++ b/src/DynamicData/Cache/SortAndPageOptions.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.Binding; - namespace DynamicData; /// diff --git a/src/DynamicData/Cache/SortAndVirtualizeOptions.cs b/src/DynamicData/Cache/SortAndVirtualizeOptions.cs index fa6843347..e231ffe8d 100644 --- a/src/DynamicData/Cache/SortAndVirtualizeOptions.cs +++ b/src/DynamicData/Cache/SortAndVirtualizeOptions.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.Binding; - namespace DynamicData; /// diff --git a/src/DynamicData/Cache/SortedChangeSet.cs b/src/DynamicData/Cache/SortedChangeSet.cs index fa9e37be0..81f16541f 100644 --- a/src/DynamicData/Cache/SortedChangeSet.cs +++ b/src/DynamicData/Cache/SortedChangeSet.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.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/SourceCache.cs b/src/DynamicData/Cache/SourceCache.cs index 5d281579c..ecbf87adc 100644 --- a/src/DynamicData/Cache/SourceCache.cs +++ b/src/DynamicData/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 System.Diagnostics; -using DynamicData.Binding; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs index dd2f6acbb..f6b9f5f5c 100644 --- a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/ChangeSetAggregator.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.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - namespace DynamicData.Tests; /// diff --git a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs index 745bf27ae..2ef2e907d 100644 --- a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.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.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - // ReSharper disable once CheckNamespace namespace DynamicData.Tests; diff --git a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs index 7711123f6..1a7309752 100644 --- a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.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.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - namespace DynamicData.Tests; /// diff --git a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs index 42ff87a74..bfa408460 100644 --- a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.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.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - // ReSharper disable once CheckNamespace namespace DynamicData.Tests; diff --git a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs index 70158e156..ee2c5416f 100644 --- a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.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.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - // ReSharper disable once CheckNamespace namespace DynamicData.Tests; diff --git a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs index b972709a5..8ad2aec21 100644 --- a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.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.Disposables; -using System.Reactive.Linq; - -using DynamicData.Diagnostics; - // ReSharper disable once CheckNamespace namespace DynamicData.Tests; diff --git a/src/DynamicData/Cache/VirtualChangeSet.cs b/src/DynamicData/Cache/VirtualChangeSet.cs index 3aae7f59f..e2009f834 100644 --- a/src/DynamicData/Cache/VirtualChangeSet.cs +++ b/src/DynamicData/Cache/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 DynamicData.Cache.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/Diagnostics/DiagnosticOperators.cs b/src/DynamicData/Diagnostics/DiagnosticOperators.cs index bdf17fadc..e5e8414a4 100644 --- a/src/DynamicData/Diagnostics/DiagnosticOperators.cs +++ b/src/DynamicData/Diagnostics/DiagnosticOperators.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.Diagnostics; /// diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index cf6bfc2ae..f2563d67a 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -4,7 +4,6 @@ true true true - enable @@ -27,11 +26,6 @@ - - - - - Dynamic Data diff --git a/src/DynamicData/DynamicDataOptions.cs b/src/DynamicData/DynamicDataOptions.cs index 4d0cececb..2d3ec4719 100644 --- a/src/DynamicData/DynamicDataOptions.cs +++ b/src/DynamicData/DynamicDataOptions.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.Binding; - namespace DynamicData; /// diff --git a/src/DynamicData/EnumerableEx.cs b/src/DynamicData/EnumerableEx.cs index 207ec85e9..9e21fb331 100644 --- a/src/DynamicData/EnumerableEx.cs +++ b/src/DynamicData/EnumerableEx.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; /// diff --git a/src/DynamicData/Experimental/ExperimentalEx.cs b/src/DynamicData/Experimental/ExperimentalEx.cs index c10391abe..919c8f8b0 100644 --- a/src/DynamicData/Experimental/ExperimentalEx.cs +++ b/src/DynamicData/Experimental/ExperimentalEx.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.Concurrency; - namespace DynamicData.Experimental; /// diff --git a/src/DynamicData/Experimental/ISubjectWithRefCount.cs b/src/DynamicData/Experimental/ISubjectWithRefCount.cs index 3bf4d4eda..4e72c8cc2 100644 --- a/src/DynamicData/Experimental/ISubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/ISubjectWithRefCount.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.Subjects; - namespace DynamicData.Experimental; /// diff --git a/src/DynamicData/Experimental/SubjectWithRefCount.cs b/src/DynamicData/Experimental/SubjectWithRefCount.cs index 0554eb718..e5b89d438 100644 --- a/src/DynamicData/Experimental/SubjectWithRefCount.cs +++ b/src/DynamicData/Experimental/SubjectWithRefCount.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.Subjects; - namespace DynamicData.Experimental; /// diff --git a/src/DynamicData/Experimental/Watcher.cs b/src/DynamicData/Experimental/Watcher.cs index d60417c79..48f6149dc 100644 --- a/src/DynamicData/Experimental/Watcher.cs +++ b/src/DynamicData/Experimental/Watcher.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.Experimental; internal sealed class Watcher : IWatcher @@ -17,10 +12,10 @@ internal sealed class Watcher : IWatcher private readonly Lock _locker = new(); - [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) diff --git a/src/DynamicData/Global.cs b/src/DynamicData/Global.cs new file mode 100644 index 000000000..03c5491e2 --- /dev/null +++ b/src/DynamicData/Global.cs @@ -0,0 +1,35 @@ +// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved. +// Roland Pheasant licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +global using System; +global using System.Collections; +global using System.Collections.Concurrent; +global using System.Collections.Generic; +global using System.Collections.ObjectModel; +global using System.Collections.Specialized; +global using System.ComponentModel; +global using System.Diagnostics; +global using System.Diagnostics.CodeAnalysis; +global using System.Linq; +global using System.Linq.Expressions; +global using System.Reactive; +global using System.Reactive.Concurrency; +global using System.Reactive.Disposables; +global using System.Reactive.Linq; +global using System.Reactive.Subjects; +global using System.Reflection; +global using System.Runtime.CompilerServices; +global using System.Threading; +global using System.Threading.Tasks; + +global using DynamicData.Binding; +global using DynamicData.Cache.Internal; +global using DynamicData.Diagnostics; +global using DynamicData.Internal; +global using DynamicData.Kernel; +global using DynamicData.List.Internal; +global using DynamicData.List.Linq; +global using DynamicData.Operators; + +[assembly: InternalsVisibleTo("DynamicData.Tests")] diff --git a/src/DynamicData/GlobalConfig.cs b/src/DynamicData/GlobalConfig.cs index 106e66aec..7cc74297a 100644 --- a/src/DynamicData/GlobalConfig.cs +++ b/src/DynamicData/GlobalConfig.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.Concurrency; - namespace DynamicData; internal static class GlobalConfig diff --git a/src/DynamicData/Internal/CacheParentSubscription.cs b/src/DynamicData/Internal/CacheParentSubscription.cs index e817c9fb3..0be870dda 100644 --- a/src/DynamicData/Internal/CacheParentSubscription.cs +++ b/src/DynamicData/Internal/CacheParentSubscription.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.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; - namespace DynamicData.Internal; /// diff --git a/src/DynamicData/Internal/DeliveryQueueMergeExtensions.cs b/src/DynamicData/Internal/DeliveryQueueMergeExtensions.cs index 43b3d94b3..f76c42711 100644 --- a/src/DynamicData/Internal/DeliveryQueueMergeExtensions.cs +++ b/src/DynamicData/Internal/DeliveryQueueMergeExtensions.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.Internal; // Same-type Rx merge that owns a DeliveryQueue. Serializes notifications from diff --git a/src/DynamicData/Internal/Notification.cs b/src/DynamicData/Internal/Notification.cs index 30bb0270c..5186987ec 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/ObservableEx.cs b/src/DynamicData/Internal/ObservableEx.cs index c998f3d5b..d337229fe 100644 --- a/src/DynamicData/Internal/ObservableEx.cs +++ b/src/DynamicData/Internal/ObservableEx.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.Internal; internal static class ObservableEx diff --git a/src/DynamicData/Internal/SharedDeliveryQueue.cs b/src/DynamicData/Internal/SharedDeliveryQueue.cs index 1974f6dec..efe9a83c2 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/Internal/SynchronizeSafeExtensions.cs b/src/DynamicData/Internal/SynchronizeSafeExtensions.cs index d662bb542..ffde54aca 100644 --- a/src/DynamicData/Internal/SynchronizeSafeExtensions.cs +++ b/src/DynamicData/Internal/SynchronizeSafeExtensions.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.Internal; // Drop-in replacements for Observable.Synchronize(lock) that release the lock before diff --git a/src/DynamicData/Kernel/EnumerableEx.cs b/src/DynamicData/Kernel/EnumerableEx.cs index 521acea3a..163a3fe69 100644 --- a/src/DynamicData/Kernel/EnumerableEx.cs +++ b/src/DynamicData/Kernel/EnumerableEx.cs @@ -106,7 +106,9 @@ internal static void ForEach(this IEnumerable source, Action ToHashSet(this IEnumerable source) => new(source); + #endif /// /// Returns an object with it's current index. 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/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 341d345b2..cfc793661 100644 --- a/src/DynamicData/Kernel/InternalEx.cs +++ b/src/DynamicData/Kernel/InternalEx.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; -using System.Reactive.Concurrency; -using System.Reactive.Linq; -using System.Reactive.Subjects; - namespace DynamicData.Kernel; /// diff --git a/src/DynamicData/Kernel/OptionObservableExtensions.cs b/src/DynamicData/Kernel/OptionObservableExtensions.cs index c79825797..5a05f59ea 100644 --- a/src/DynamicData/Kernel/OptionObservableExtensions.cs +++ b/src/DynamicData/Kernel/OptionObservableExtensions.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.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 dfd1e130f..502949957 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/ChangeAwareListWithRefCounts.cs b/src/DynamicData/List/ChangeAwareListWithRefCounts.cs index 234b07930..68a6bfa95 100644 --- a/src/DynamicData/List/ChangeAwareListWithRefCounts.cs +++ b/src/DynamicData/List/ChangeAwareListWithRefCounts.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.List.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ChangeSetEx.cs b/src/DynamicData/List/ChangeSetEx.cs index 3110bf823..20b7f0796 100644 --- a/src/DynamicData/List/ChangeSetEx.cs +++ b/src/DynamicData/List/ChangeSetEx.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 DynamicData.List.Internal; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/IPageChangeSet.cs b/src/DynamicData/List/IPageChangeSet.cs index 447612a76..3ff01e3a2 100644 --- a/src/DynamicData/List/IPageChangeSet.cs +++ b/src/DynamicData/List/IPageChangeSet.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.Operators; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/Internal/AnonymousObservableList.cs b/src/DynamicData/List/Internal/AnonymousObservableList.cs index 643b01d77..6ee1cbaf1 100644 --- a/src/DynamicData/List/Internal/AnonymousObservableList.cs +++ b/src/DynamicData/List/Internal/AnonymousObservableList.cs @@ -2,16 +2,13 @@ // Roland 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.List.Internal; [DebuggerDisplay("AnonymousObservableList<{typeof(T).Name}> ({Count} Items)")] 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/AutoRefresh.cs b/src/DynamicData/List/Internal/AutoRefresh.cs index fa25f1583..6e924745d 100644 --- a/src/DynamicData/List/Internal/AutoRefresh.cs +++ b/src/DynamicData/List/Internal/AutoRefresh.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; - 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 5456279e1..5beff3114 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..d0ffd153b 100644 --- a/src/DynamicData/List/Internal/ClonedListChangeSet.cs +++ b/src/DynamicData/List/Internal/ClonedListChangeSet.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 ClonedListChangeSet diff --git a/src/DynamicData/List/Internal/Combiner.cs b/src/DynamicData/List/Internal/Combiner.cs index 249c91cad..7c735e2a0 100644 --- a/src/DynamicData/List/Internal/Combiner.cs +++ b/src/DynamicData/List/Internal/Combiner.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.Disposables; -using System.Reactive.Linq; - -using DynamicData.Cache.Internal; - namespace DynamicData.List.Internal; internal sealed class Combiner(ICollection>> source, CombineOperator type) @@ -131,7 +126,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/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 1d75a909c..3b0d727a8 100644 --- a/src/DynamicData/List/Internal/DisposeMany.cs +++ b/src/DynamicData/List/Internal/DisposeMany.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 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 fd3a41645..45ba31e39 100644 --- a/src/DynamicData/List/Internal/DynamicCombiner.cs +++ b/src/DynamicData/List/Internal/DynamicCombiner.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.Disposables; -using System.Reactive.Linq; - -using DynamicData.Cache.Internal; - namespace DynamicData.List.Internal; internal sealed class DynamicCombiner(IObservableList>> source, CombineOperator type) @@ -141,7 +136,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. diff --git a/src/DynamicData/List/Internal/ExpireAfter.cs b/src/DynamicData/List/Internal/ExpireAfter.cs index 47445ea60..8d923d1df 100644 --- a/src/DynamicData/List/Internal/ExpireAfter.cs +++ b/src/DynamicData/List/Internal/ExpireAfter.cs @@ -2,12 +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; internal sealed class ExpireAfter diff --git a/src/DynamicData/List/Internal/Filter.Dynamic.cs b/src/DynamicData/List/Internal/Filter.Dynamic.cs index c94680aab..df181039d 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 0d435cde9..65ac816ae 100644 --- a/src/DynamicData/List/Internal/Filter.Static.cs +++ b/src/DynamicData/List/Internal/Filter.Static.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.WithPredicateState.cs b/src/DynamicData/List/Internal/Filter.WithPredicateState.cs index 0f448aaf6..61ae3a840 100644 --- a/src/DynamicData/List/Internal/Filter.WithPredicateState.cs +++ b/src/DynamicData/List/Internal/Filter.WithPredicateState.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.Linq; - -using DynamicData.Internal; - namespace DynamicData.List.Internal; internal static partial class Filter diff --git a/src/DynamicData/List/Internal/FilterOnObservable.cs b/src/DynamicData/List/Internal/FilterOnObservable.cs index 7a18fbc85..3f3a28709 100644 --- a/src/DynamicData/List/Internal/FilterOnObservable.cs +++ b/src/DynamicData/List/Internal/FilterOnObservable.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; - 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..148151e88 100644 --- a/src/DynamicData/List/Internal/FilterOnProperty.cs +++ b/src/DynamicData/List/Internal/FilterOnProperty.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.Linq.Expressions; -using System.Reactive.Concurrency; - namespace DynamicData.List.Internal; [Obsolete("Use AutoRefresh(), followed by Filter() instead")] 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 0afd2f250..32964cb3f 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 d389561f9..c7e7f210e 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..2d69ac478 100644 --- a/src/DynamicData/List/Internal/GroupOnProperty.cs +++ b/src/DynamicData/List/Internal/GroupOnProperty.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.ComponentModel; -using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class GroupOnProperty(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs index 99d8b1d75..5115dcdfd 100644 --- a/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/Internal/GroupOnPropertyWithImmutableState.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.ComponentModel; -using System.Linq.Expressions; -using System.Reactive.Concurrency; -using System.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class GroupOnPropertyWithImmutableState(IObservable> source, Expression> groupSelectorKey, TimeSpan? throttle = null, IScheduler? scheduler = null) diff --git a/src/DynamicData/List/Internal/LimitSizeTo.cs b/src/DynamicData/List/Internal/LimitSizeTo.cs index 53cb0442a..322b45a66 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; 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 6248ef7ea..f20dfd67b 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 1151bcb3c..4485c4685 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 92601637d..7f96a0969 100644 --- a/src/DynamicData/List/Internal/MergeManyCacheChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyCacheChangeSets.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.Disposables; -using System.Reactive.Linq; -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 7682cccf5..3672ab1a6 100644 --- a/src/DynamicData/List/Internal/MergeManyListChangeSets.cs +++ b/src/DynamicData/List/Internal/MergeManyListChangeSets.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 DynamicData.Internal; - namespace DynamicData.List.Internal; /// diff --git a/src/DynamicData/List/Internal/OnItemAdded.cs b/src/DynamicData/List/Internal/OnItemAdded.cs index c041b3575..deff69cc1 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 527237cdc..8df3b7702 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 6629d265f..0bcc8d97d 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 abdf04d4d..2a6db29e5 100644 --- a/src/DynamicData/List/Internal/Pager.cs +++ b/src/DynamicData/List/Internal/Pager.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.Reactive.Linq; - namespace DynamicData.List.Internal; internal sealed class Pager(IObservable> source, IObservable requests) 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 66279974e..8a6d40d82 100644 --- a/src/DynamicData/List/Internal/RefCount.cs +++ b/src/DynamicData/List/Internal/RefCount.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.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 730f42f07..d642af1e6 100644 --- a/src/DynamicData/List/Internal/Sort.cs +++ b/src/DynamicData/List/Internal/Sort.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.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 dcd20c283..87dc15d9c 100644 --- a/src/DynamicData/List/Internal/Switch.cs +++ b/src/DynamicData/List/Internal/Switch.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.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 3dcc3dc56..6d208cfee 100644 --- a/src/DynamicData/List/Internal/ToObservableChangeSet.cs +++ b/src/DynamicData/List/Internal/ToObservableChangeSet.cs @@ -2,12 +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; internal static class ToObservableChangeSet diff --git a/src/DynamicData/List/Internal/TransformAsync.cs b/src/DynamicData/List/Internal/TransformAsync.cs index ed4c54afc..cdf3bd049 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 83df7e1c0..bc3c31366 100644 --- a/src/DynamicData/List/Internal/TransformMany.cs +++ b/src/DynamicData/List/Internal/TransformMany.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; -using System.Collections.ObjectModel; -using System.Reactive.Disposables; -using System.Reactive.Linq; - -using DynamicData.Binding; - namespace DynamicData.List.Internal; internal sealed class TransformMany(IObservable> source, Func> manySelector, IEqualityComparer? equalityComparer = null, Func>>? childChanges = null) diff --git a/src/DynamicData/List/Internal/Transformer.cs b/src/DynamicData/List/Internal/Transformer.cs index 5256f02a8..762e28adc 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 static class Transformer diff --git a/src/DynamicData/List/Internal/Virtualiser.cs b/src/DynamicData/List/Internal/Virtualiser.cs index ced3b742b..f0a329c14 100644 --- a/src/DynamicData/List/Internal/Virtualiser.cs +++ b/src/DynamicData/List/Internal/Virtualiser.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 Virtualiser(IObservable> source, IObservable requests) 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..191fb008a 100644 --- a/src/DynamicData/List/Linq/UnifiedChangeEnumerator.cs +++ b/src/DynamicData/List/Linq/UnifiedChangeEnumerator.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 DynamicData.List.Internal; - namespace DynamicData.List.Linq; internal sealed class UnifiedChangeEnumerator(IChangeSet changeSet) : IEnumerable> 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/ListEx.cs b/src/DynamicData/List/ListEx.cs index a001792f0..435047a4a 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; diff --git a/src/DynamicData/List/ObservableListEx.Adapt.cs b/src/DynamicData/List/ObservableListEx.Adapt.cs index f1616cb84..1afe541d1 100644 --- a/src/DynamicData/List/ObservableListEx.Adapt.cs +++ b/src/DynamicData/List/ObservableListEx.Adapt.cs @@ -2,19 +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 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; -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 69936e9d1..c17ecf581 100644 --- a/src/DynamicData/List/ObservableListEx.AddKey.cs +++ b/src/DynamicData/List/ObservableListEx.AddKey.cs @@ -2,19 +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 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; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.And.cs b/src/DynamicData/List/ObservableListEx.And.cs index aa31e0ddb..4670cbe8c 100644 --- a/src/DynamicData/List/ObservableListEx.And.cs +++ b/src/DynamicData/List/ObservableListEx.And.cs @@ -2,19 +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 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; -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 b40781f11..e41976435 100644 --- a/src/DynamicData/List/ObservableListEx.AsObservableList.cs +++ b/src/DynamicData/List/ObservableListEx.AsObservableList.cs @@ -2,19 +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 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; -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 98244f523..89f9c169e 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefresh.cs @@ -2,19 +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 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; -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 c3b7d88b0..521f44176 100644 --- a/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.AutoRefreshOnObservable.cs @@ -2,19 +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 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; -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 423430dc5..0d04f631e 100644 --- a/src/DynamicData/List/ObservableListEx.Bind.cs +++ b/src/DynamicData/List/ObservableListEx.Bind.cs @@ -2,19 +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 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; -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 1794fbd0b..c817b2833 100644 --- a/src/DynamicData/List/ObservableListEx.BufferIf.cs +++ b/src/DynamicData/List/ObservableListEx.BufferIf.cs @@ -2,19 +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 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; -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 17ad6d43b..0620c8ce0 100644 --- a/src/DynamicData/List/ObservableListEx.BufferInitial.cs +++ b/src/DynamicData/List/ObservableListEx.BufferInitial.cs @@ -2,19 +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 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; -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 bdda8da92..b655e82bd 100644 --- a/src/DynamicData/List/ObservableListEx.Cast.cs +++ b/src/DynamicData/List/ObservableListEx.Cast.cs @@ -2,19 +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 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; -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 4695297da..8ddecac85 100644 --- a/src/DynamicData/List/ObservableListEx.CastToObject.cs +++ b/src/DynamicData/List/ObservableListEx.CastToObject.cs @@ -2,19 +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 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; -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 5d352e664..9f2d23dec 100644 --- a/src/DynamicData/List/ObservableListEx.Clone.cs +++ b/src/DynamicData/List/ObservableListEx.Clone.cs @@ -2,19 +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 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; -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 3c9f6e37d..deab769a4 100644 --- a/src/DynamicData/List/ObservableListEx.Combine.cs +++ b/src/DynamicData/List/ObservableListEx.Combine.cs @@ -2,19 +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 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; -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 1cec7f00a..59787f768 100644 --- a/src/DynamicData/List/ObservableListEx.Convert.cs +++ b/src/DynamicData/List/ObservableListEx.Convert.cs @@ -2,19 +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 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; -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 680eaa3d4..fcc07ba20 100644 --- a/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs +++ b/src/DynamicData/List/ObservableListEx.DeferUntilLoaded.cs @@ -2,19 +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 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; -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 12690c3f8..c5bc0e506 100644 --- a/src/DynamicData/List/ObservableListEx.DisposeMany.cs +++ b/src/DynamicData/List/ObservableListEx.DisposeMany.cs @@ -2,19 +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 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; -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 3ec80ce62..76a02dd71 100644 --- a/src/DynamicData/List/ObservableListEx.DistinctValues.cs +++ b/src/DynamicData/List/ObservableListEx.DistinctValues.cs @@ -2,19 +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 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; -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 dda249733..192113197 100644 --- a/src/DynamicData/List/ObservableListEx.Except.cs +++ b/src/DynamicData/List/ObservableListEx.Except.cs @@ -2,19 +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 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; -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 4df348372..8c101b564 100644 --- a/src/DynamicData/List/ObservableListEx.ExpireAfter.cs +++ b/src/DynamicData/List/ObservableListEx.ExpireAfter.cs @@ -2,19 +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 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; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -52,7 +39,8 @@ public static IObservable> ExpireAfter( TimeSpan? pollingInterval = null, IScheduler? scheduler = null) where T : notnull - => List.Internal.ExpireAfter.Create( + => + List.Internal.ExpireAfter.Create( source: source, timeSelector: timeSelector, pollingInterval: pollingInterval, diff --git a/src/DynamicData/List/ObservableListEx.Filter.cs b/src/DynamicData/List/ObservableListEx.Filter.cs index fefbf6b69..2fc99ac44 100644 --- a/src/DynamicData/List/ObservableListEx.Filter.cs +++ b/src/DynamicData/List/ObservableListEx.Filter.cs @@ -2,20 +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.Collections.ObjectModel; -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; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace + +using Filter = DynamicData.List.Internal.Filter; + namespace DynamicData; /// @@ -60,7 +50,8 @@ public static IObservable> Filter( this IObservable> source, Func predicate) where T : notnull - => List.Internal.Filter.Static.Create( + => + List.Internal.Filter.Static.Create( source: source, predicate: predicate, suppressEmptyChangesets: true); @@ -101,7 +92,7 @@ public static IObservable> Filter(this IObservable(source, predicate, filterPolicy).Run(); + return new Filter.Dynamic(source, predicate, filterPolicy).Run(); } /// @@ -141,7 +132,8 @@ public static IObservable> Filter( ListFilterPolicy filterPolicy = ListFilterPolicy.CalculateDiff, bool suppressEmptyChangeSets = true) where T : notnull - => List.Internal.Filter.WithPredicateState.Create( + => + List.Internal.Filter.WithPredicateState.Create( source: source, predicateState: predicateState, predicate: predicate, diff --git a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs index 3def7723f..a81cb17f2 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnObservable.cs @@ -2,19 +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 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; -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 5407a576c..f0721acfc 100644 --- a/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.FilterOnProperty.cs @@ -2,19 +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 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; -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 667a494ad..061cd411e 100644 --- a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs +++ b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs @@ -2,19 +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 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; -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 fcea5f87f..75d565fdb 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachChange.cs @@ -2,19 +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 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; -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 e908219b9..8818e3796 100644 --- a/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs +++ b/src/DynamicData/List/ObservableListEx.ForEachItemChange.cs @@ -2,19 +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 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; -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 301a8a12f..475195aa2 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOn.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOn.cs @@ -2,19 +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 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; -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 1ded39b63..d7abf68b8 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnProperty.cs @@ -2,19 +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 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; -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 92d456a85..3cdf783a8 100644 --- a/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupOnPropertyWithImmutableState.cs @@ -2,19 +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 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; -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 1aff4860d..913b230f5 100644 --- a/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs +++ b/src/DynamicData/List/ObservableListEx.GroupWithImmutableState.cs @@ -2,19 +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 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; -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 a726fc040..5006f6093 100644 --- a/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs +++ b/src/DynamicData/List/ObservableListEx.LimitSizeTo.cs @@ -2,19 +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 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; -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 ffd9dab13..64ff9ef06 100644 --- a/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeChangeSets.cs @@ -2,19 +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 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; -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 0b83871d3..2e2c42d99 100644 --- a/src/DynamicData/List/ObservableListEx.MergeMany.cs +++ b/src/DynamicData/List/ObservableListEx.MergeMany.cs @@ -2,19 +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 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; -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 3fff768e9..82e898b81 100644 --- a/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs +++ b/src/DynamicData/List/ObservableListEx.MergeManyChangeSets.cs @@ -2,19 +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 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; -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 e2d591daa..3299511e2 100644 --- a/src/DynamicData/List/ObservableListEx.NotEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.NotEmpty.cs @@ -2,19 +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 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; -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 f07beed67..09b7b6885 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs @@ -2,19 +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 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; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -52,7 +39,8 @@ public static IObservable> OnItemAdded( this IObservable> source, Action addAction) where T : notnull - => List.Internal.OnItemAdded.Create( + => + 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 53824aba0..d8f90c813 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs @@ -2,19 +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 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; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -39,7 +26,8 @@ public static IObservable> OnItemRefreshed( this IObservable> source, Action refreshAction) where T : notnull - => List.Internal.OnItemRefreshed.Create( + => + 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 7a63f9247..b914630c4 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs @@ -2,19 +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 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; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -59,7 +46,8 @@ public static IObservable> OnItemRemoved( Action removeAction, bool invokeOnUnsubscribe = true) where T : notnull - => List.Internal.OnItemRemoved.Create( + => + List.Internal.OnItemRemoved.Create( source: source, removeAction: removeAction, invokeOnUnsubscribe: invokeOnUnsubscribe); diff --git a/src/DynamicData/List/ObservableListEx.Or.cs b/src/DynamicData/List/ObservableListEx.Or.cs index e25648668..16c1ea6d2 100644 --- a/src/DynamicData/List/ObservableListEx.Or.cs +++ b/src/DynamicData/List/ObservableListEx.Or.cs @@ -2,19 +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 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; -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 2045d1783..9e9f06766 100644 --- a/src/DynamicData/List/ObservableListEx.Page.cs +++ b/src/DynamicData/List/ObservableListEx.Page.cs @@ -2,19 +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 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; -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 2278e8487..9b720ee6e 100644 --- a/src/DynamicData/List/ObservableListEx.PopulateInto.cs +++ b/src/DynamicData/List/ObservableListEx.PopulateInto.cs @@ -2,19 +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 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; -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 d6c3d1b24..0b4d629d0 100644 --- a/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs +++ b/src/DynamicData/List/ObservableListEx.QueryWhenChanged.cs @@ -2,19 +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 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; -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 88ed48761..bf5a76f79 100644 --- a/src/DynamicData/List/ObservableListEx.RefCount.cs +++ b/src/DynamicData/List/ObservableListEx.RefCount.cs @@ -2,19 +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 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; -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 d6ebbfb60..fe4f61943 100644 --- a/src/DynamicData/List/ObservableListEx.RemoveIndex.cs +++ b/src/DynamicData/List/ObservableListEx.RemoveIndex.cs @@ -2,19 +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 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; -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 291ca278d..5bd6a348c 100644 --- a/src/DynamicData/List/ObservableListEx.Reverse.cs +++ b/src/DynamicData/List/ObservableListEx.Reverse.cs @@ -2,19 +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 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; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; diff --git a/src/DynamicData/List/ObservableListEx.SkipInitial.cs b/src/DynamicData/List/ObservableListEx.SkipInitial.cs index 3fd0a3031..b18b426bf 100644 --- a/src/DynamicData/List/ObservableListEx.SkipInitial.cs +++ b/src/DynamicData/List/ObservableListEx.SkipInitial.cs @@ -2,19 +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 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; -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 3766273fa..45b641117 100644 --- a/src/DynamicData/List/ObservableListEx.Sort.cs +++ b/src/DynamicData/List/ObservableListEx.Sort.cs @@ -2,19 +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 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; -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 91c7100e0..973f33b06 100644 --- a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs @@ -2,19 +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 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; -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 39858fc77..76bf6092c 100644 --- a/src/DynamicData/List/ObservableListEx.SubscribeMany.cs +++ b/src/DynamicData/List/ObservableListEx.SubscribeMany.cs @@ -2,19 +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 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; -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 ac040d07f..825e716a6 100644 --- a/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs +++ b/src/DynamicData/List/ObservableListEx.SuppressRefresh.cs @@ -2,19 +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 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; -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 e9e9ea89b..e3f914e38 100644 --- a/src/DynamicData/List/ObservableListEx.Switch.cs +++ b/src/DynamicData/List/ObservableListEx.Switch.cs @@ -2,19 +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 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; -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 072451c92..3ae810c60 100644 --- a/src/DynamicData/List/ObservableListEx.ToCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToCollection.cs @@ -2,19 +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 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; -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 1c465dddc..0e796d81f 100644 --- a/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs +++ b/src/DynamicData/List/ObservableListEx.ToObservableChangeSet.cs @@ -2,19 +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 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; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -46,7 +33,8 @@ public static IObservable> ToObservableChangeSet( this IObservable source, IScheduler? scheduler = null) where T : notnull - => List.Internal.ToObservableChangeSet.Create( + => + List.Internal.ToObservableChangeSet.Create( source: source, expireAfter: null, limitSizeTo: -1, @@ -65,7 +53,8 @@ public static IObservable> ToObservableChangeSet( Func expireAfter, IScheduler? scheduler = null) where T : notnull - => List.Internal.ToObservableChangeSet.Create( + => + List.Internal.ToObservableChangeSet.Create( source: source, expireAfter: expireAfter, limitSizeTo: -1, @@ -84,7 +73,8 @@ public static IObservable> ToObservableChangeSet( int limitSizeTo, IScheduler? scheduler = null) where T : notnull - => List.Internal.ToObservableChangeSet.Create( + => + List.Internal.ToObservableChangeSet.Create( source: source, expireAfter: null, limitSizeTo: limitSizeTo, @@ -104,7 +94,8 @@ public static IObservable> ToObservableChangeSet( int limitSizeTo, IScheduler? scheduler = null) where T : notnull - => List.Internal.ToObservableChangeSet.Create( + => + List.Internal.ToObservableChangeSet.Create( source: source, expireAfter: expireAfter, limitSizeTo: limitSizeTo, @@ -121,7 +112,8 @@ public static IObservable> ToObservableChangeSet( this IObservable> source, IScheduler? scheduler = null) where T : notnull - => List.Internal.ToObservableChangeSet.Create( + => + List.Internal.ToObservableChangeSet.Create( source: source, expireAfter: null, limitSizeTo: -1, @@ -139,7 +131,8 @@ public static IObservable> ToObservableChangeSet( int limitSizeTo, IScheduler? scheduler = null) where T : notnull - => List.Internal.ToObservableChangeSet.Create( + => + List.Internal.ToObservableChangeSet.Create( source: source, expireAfter: null, limitSizeTo: limitSizeTo, @@ -157,7 +150,8 @@ public static IObservable> ToObservableChangeSet( Func expireAfter, IScheduler? scheduler = null) where T : notnull - => List.Internal.ToObservableChangeSet.Create( + => + List.Internal.ToObservableChangeSet.Create( source: source, expireAfter: expireAfter, limitSizeTo: -1, @@ -177,7 +171,8 @@ public static IObservable> ToObservableChangeSet( int limitSizeTo, IScheduler? scheduler = null) where T : notnull - => List.Internal.ToObservableChangeSet.Create( + => + List.Internal.ToObservableChangeSet.Create( source: source, expireAfter: expireAfter, limitSizeTo: limitSizeTo, diff --git a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs index 860079901..8af3dd536 100644 --- a/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs +++ b/src/DynamicData/List/ObservableListEx.ToSortedCollection.cs @@ -2,19 +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 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; -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 302f62bbf..0ec5f9364 100644 --- a/src/DynamicData/List/ObservableListEx.Top.cs +++ b/src/DynamicData/List/ObservableListEx.Top.cs @@ -2,19 +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 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; -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 8407322e4..6de367ccc 100644 --- a/src/DynamicData/List/ObservableListEx.Transform.cs +++ b/src/DynamicData/List/ObservableListEx.Transform.cs @@ -2,19 +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 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; -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 c50cf0bc0..b4cf7ceb3 100644 --- a/src/DynamicData/List/ObservableListEx.TransformAsync.cs +++ b/src/DynamicData/List/ObservableListEx.TransformAsync.cs @@ -2,19 +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 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; -using DynamicData.List.Linq; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -50,7 +37,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, @@ -68,7 +55,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, @@ -86,7 +73,7 @@ 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, @@ -104,7 +91,7 @@ public static IObservable> TransformAsync /// Async transform overload receiving the source item, previously transformed value, and 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, int, Task> transformFactory, @@ -122,7 +109,7 @@ public static IObservable> TransformAsync /// Async transform overload receiving the source item, previously transformed value, index, and CancellationToken attached to the underlying subscription. 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, CancellationToken, Task> transformFactory, diff --git a/src/DynamicData/List/ObservableListEx.TransformMany.cs b/src/DynamicData/List/ObservableListEx.TransformMany.cs index 28750767f..455008f3a 100644 --- a/src/DynamicData/List/ObservableListEx.TransformMany.cs +++ b/src/DynamicData/List/ObservableListEx.TransformMany.cs @@ -2,19 +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 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; -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 d790a8bd7..07a18cf26 100644 --- a/src/DynamicData/List/ObservableListEx.Virtualise.cs +++ b/src/DynamicData/List/ObservableListEx.Virtualise.cs @@ -2,19 +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 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; -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 9e3aedb93..2620f11c7 100644 --- a/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenAnyPropertyChanged.cs @@ -2,19 +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 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; -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 5682e7a5b..10b86ccc9 100644 --- a/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenPropertyChanged.cs @@ -2,19 +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 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; -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 e75630066..f900f5387 100644 --- a/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs +++ b/src/DynamicData/List/ObservableListEx.WhenValueChanged.cs @@ -2,19 +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 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; -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 87cfe93fe..691cb7fc6 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAre.cs @@ -2,19 +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 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; -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 5daefa9e8..8da597c5a 100644 --- a/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs +++ b/src/DynamicData/List/ObservableListEx.WhereReasonsAreNot.cs @@ -2,19 +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 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; -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 70d5d2c40..cf140d121 100644 --- a/src/DynamicData/List/ObservableListEx.Xor.cs +++ b/src/DynamicData/List/ObservableListEx.Xor.cs @@ -2,19 +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 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; -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 ffe07170a..7eb05ec7f 100644 --- a/src/DynamicData/List/ObservableListEx.cs +++ b/src/DynamicData/List/ObservableListEx.cs @@ -2,19 +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 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; -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..a87001995 100644 --- a/src/DynamicData/List/PageChangeSet.cs +++ b/src/DynamicData/List/PageChangeSet.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 DynamicData.Operators; - // ReSharper disable once CheckNamespace namespace DynamicData; 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 754ed7970..0c3b8fc19 100644 --- a/src/DynamicData/List/SourceList.cs +++ b/src/DynamicData/List/SourceList.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.Diagnostics; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Reactive.Subjects; - -using DynamicData.List.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; @@ -32,7 +25,7 @@ public sealed class SourceList : ISourceList private readonly ReaderWriter _readerWriter = new(); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposal is superfluous after completion, and causes a bunch of test failures")] + [SuppressMessage("Usage", "CA2213:Disposable fields should be disposed", Justification = "Disposal is superfluous after completion, and causes a bunch of test failures")] private readonly Lazy> _isEditInProgress; private int _editLevel; diff --git a/src/DynamicData/List/SourceListEditConvenienceEx.cs b/src/DynamicData/List/SourceListEditConvenienceEx.cs index 408eeee7e..d7f1c09ac 100644 --- a/src/DynamicData/List/SourceListEditConvenienceEx.cs +++ b/src/DynamicData/List/SourceListEditConvenienceEx.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.List.Internal; - // ReSharper disable once CheckNamespace namespace DynamicData; 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/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; diff --git a/src/DynamicData/ObservableChangeSet.cs b/src/DynamicData/ObservableChangeSet.cs index 7c2441e7b..1198b41e3 100644 --- a/src/DynamicData/ObservableChangeSet.cs +++ b/src/DynamicData/ObservableChangeSet.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; /// diff --git a/src/DynamicData/Platforms/net45/PFilter.cs b/src/DynamicData/Platforms/net45/PFilter.cs index f4aff797e..7abb97b52 100644 --- a/src/DynamicData/Platforms/net45/PFilter.cs +++ b/src/DynamicData/Platforms/net45/PFilter.cs @@ -3,10 +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; - // ReSharper disable once CheckNamespace namespace DynamicData.PLinq { diff --git a/src/DynamicData/Platforms/net45/PSubscribeMany.cs b/src/DynamicData/Platforms/net45/PSubscribeMany.cs index 4c9e4be35..6a4a7de5f 100644 --- a/src/DynamicData/Platforms/net45/PSubscribeMany.cs +++ b/src/DynamicData/Platforms/net45/PSubscribeMany.cs @@ -3,9 +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..91076324e 100644 --- a/src/DynamicData/Platforms/net45/PTransform.cs +++ b/src/DynamicData/Platforms/net45/PTransform.cs @@ -3,8 +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 { @@ -25,7 +23,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) From ce4e05f5810da6fa1944ac8153943da3fd4c9f71 Mon Sep 17 00:00:00 2001 From: Viktor Jannicke Date: Mon, 19 Oct 2026 22:01:13 +0200 Subject: [PATCH 07/10] Port upstream list Transform without-index regressions Translate the regression tests added by upstream #1171 to TUnit: Remove and RemoveRange changes without indexes remove the first occurrence of each item through Transform and TransformAsync. The fork's DD-018 implementation already passes them in both flavours. Co-Authored-By: Claude Opus 5.5 --- .../List/TransformAsyncFixture.cs | 56 +++++++++++++++++++ .../List/TransformFixture.cs | 56 +++++++++++++++++++ 2 files changed, 112 insertions(+) diff --git a/src/DynamicData.Tests/List/TransformAsyncFixture.cs b/src/DynamicData.Tests/List/TransformAsyncFixture.cs index 3c05d368d..92c655207 100755 --- a/src/DynamicData.Tests/List/TransformAsyncFixture.cs +++ b/src/DynamicData.Tests/List/TransformAsyncFixture.cs @@ -180,4 +180,60 @@ public async Task TransformAsyncCancelsTokenOnUnSubscribe() sub.Dispose(); await Assert.That(tcs.Task.IsCanceled).IsTrue(); } + + // Ported from upstream #1171; covers https://github.com/reactivemarbles/DynamicData/issues/1169 + [Test] + public async Task RemoveValueWithoutIndex() + { + var source = Enumerable.Empty>() + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.AddRange, + items: new[] { 1, 2, 3, 2, 1 }) + }) + .Append(new ChangeSet() + { + new Change(reason: ListChangeReason.Remove, current: 2) + }) + .ToObservable(); + + using var subscription = source + .TransformAsync(static item => Task.FromResult(item.ToString())) + .ValidateChangeSets() + .RecordListItems(out var results); + + await Assert.That(results.Error).IsNull(); + await Assert.That(results.RecordedChangeSets.Count).IsEqualTo(2).Because("2 source operations were performed"); + await Assert.That(results.RecordedItems).IsEquivalentTo(new[] { "1", "3", "2", "1" }, TUnit.Assertions.Enums.CollectionOrdering.Matching).Because("The first occurrence of the given item should have been removed"); + await Assert.That(results.HasCompleted).IsTrue().Because("the source, and all asynchronous operations, have completed"); + } + + // Ported from upstream #1171; covers https://github.com/reactivemarbles/DynamicData/issues/1169 + [Test] + public async Task RemoveRangeWithoutIndex() + { + var source = Enumerable.Empty>() + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.AddRange, + items: new[] { 1, 2, 3, 4, 5, 4, 3, 2, 1 }) + }) + .Append(new ChangeSet() + { + new Change(reason: ListChangeReason.RemoveRange, items: new[] { 1, 3, 5 }) + }) + .ToObservable(); + + using var subscription = source + .TransformAsync(static item => Task.FromResult(item.ToString())) + .ValidateChangeSets() + .RecordListItems(out var results); + + await Assert.That(results.Error).IsNull(); + await Assert.That(results.RecordedChangeSets.Count).IsEqualTo(2).Because("2 source operations were performed"); + await Assert.That(results.RecordedItems).IsEquivalentTo(new[] { "2", "4", "4", "3", "2", "1" }, TUnit.Assertions.Enums.CollectionOrdering.Matching).Because("The first occurrence of each odd-numbered item in the list should have been removed"); + await Assert.That(results.HasCompleted).IsTrue().Because("the source, and all asynchronous operations, have completed"); + } } diff --git a/src/DynamicData.Tests/List/TransformFixture.cs b/src/DynamicData.Tests/List/TransformFixture.cs index c60d1d3de..3e396f5ca 100644 --- a/src/DynamicData.Tests/List/TransformFixture.cs +++ b/src/DynamicData.Tests/List/TransformFixture.cs @@ -98,6 +98,62 @@ public async Task RemoveWithoutIndex() await Assert.That(results.Data.Count).IsEqualTo(0).Because("Should be nothing cached"); } + // Ported from upstream #1171; covers https://github.com/reactivemarbles/DynamicData/issues/1169 + [Test] + public async Task RemoveRangeWithoutIndex() + { + var source = Enumerable.Empty>() + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.AddRange, + items: new[] { 1, 2, 3, 4, 5, 4, 3, 2, 1 }) + }) + .Append(new ChangeSet() + { + new Change(reason: ListChangeReason.RemoveRange, items: new[] { 1, 3, 5 }) + }) + .ToObservable(); + + using var subscription = source + .Transform(static item => item.ToString()) + .ValidateChangeSets() + .RecordListItems(out var results); + + await Assert.That(results.Error).IsNull(); + await Assert.That(results.RecordedChangeSets.Count).IsEqualTo(2).Because("2 source operations were performed"); + await Assert.That(results.RecordedItems).IsEquivalentTo(new[] { "2", "4", "4", "3", "2", "1" }, TUnit.Assertions.Enums.CollectionOrdering.Matching).Because("The first occurrence of each odd-numbered item in the list should have been removed"); + await Assert.That(results.HasCompleted).IsTrue().Because("the source, and all asynchronous operations, have completed"); + } + + // Ported from upstream #1171; covers https://github.com/reactivemarbles/DynamicData/issues/1169 + [Test] + public async Task RemoveValueWithoutIndex() + { + var source = Enumerable.Empty>() + .Append(new ChangeSet() + { + new Change( + reason: ListChangeReason.AddRange, + items: new[] { 1, 2, 3, 2, 1 }) + }) + .Append(new ChangeSet() + { + new Change(reason: ListChangeReason.Remove, current: 2) + }) + .ToObservable(); + + using var subscription = source + .Transform(static item => item.ToString()) + .ValidateChangeSets() + .RecordListItems(out var results); + + await Assert.That(results.Error).IsNull(); + await Assert.That(results.RecordedChangeSets.Count).IsEqualTo(2).Because("2 source operations were performed"); + await Assert.That(results.RecordedItems).IsEquivalentTo(new[] { "1", "3", "2", "1" }, TUnit.Assertions.Enums.CollectionOrdering.Matching).Because("The first occurrence of the given item should have been removed"); + await Assert.That(results.HasCompleted).IsTrue().Because("the source, and all asynchronous operations, have completed"); + } + [Test] public async Task SameKeyChanges() { From b3a9ed01047fa8be0dec56af52090a5554101807 Mon Sep 17 00:00:00 2001 From: Viktor Jannicke Date: Mon, 19 Oct 2026 22:02:11 +0200 Subject: [PATCH 08/10] Use BCL argument guards throughout Finish the move to upstream's guard spelling begun in the #1201 merge: the remaining ArgumentExceptionHelper.ThrowIfNull calls become ArgumentNullException.ThrowIfNull. On .NET 10 the csproj already aliased ArgumentExceptionHelper and ArgumentOutOfRangeExceptionHelper to the BCL types, so behaviour is unchanged; the aliases and the net4x-only helper classes are removed. Co-Authored-By: Claude Opus 5.5 --- .../DynamicData.Reactive.csproj | 10 --- src/DynamicData.Tests/Kernal/EnumerableEx.cs | 12 +-- src/DynamicData/Aggregation/AggregationEx.cs | 8 +- src/DynamicData/Aggregation/AvgEx.cs | 32 +++---- src/DynamicData/Aggregation/CountEx.cs | 2 +- src/DynamicData/Aggregation/MaxEx.cs | 16 ++-- src/DynamicData/Aggregation/StdDevEx.cs | 64 +++++++------- .../Aggregation/SumEx.Immutable.cs | 12 +-- src/DynamicData/Aggregation/SumEx.cs | 18 ++-- src/DynamicData/Cache/ChangeAwareCache.cs | 2 +- .../Cache/Internal/AbstractFilter.cs | 2 +- .../Internal/AnonymousObservableCache.cs | 2 +- .../Cache/Internal/LockFreeObservableCache.cs | 2 +- .../Cache/Internal/MergeManyItems.cs | 4 +- ...servableCacheEx.AutoRefreshOnObservable.cs | 4 +- .../Cache/ObservableCacheEx.BufferInitial.cs | 2 +- .../ObservableCacheEx.IgnoreUpdateWhen.cs | 2 +- .../Cache/ObservableCacheEx.InvokeEvaluate.cs | 2 +- .../Cache/ObservableCacheEx.SortAndBind.cs | 4 +- .../Cache/ObservableCacheEx.StartWithEmpty.cs | 14 ++-- .../Cache/ObservableCacheEx.Switch.cs | 2 +- .../Cache/ObservableCacheEx.ToCollection.cs | 2 +- .../ObservableCacheEx.ToObservableOptional.cs | 2 +- .../Cache/ObservableCacheEx.UpdateIndex.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/DynamicData.csproj | 10 --- src/DynamicData/Kernel/InternalEx.cs | 8 +- .../Kernel/OptionObservableExtensions.cs | 2 +- .../List/Internal/AnonymousObservableList.cs | 2 +- .../List/Internal/FilterOnObservable.cs | 2 +- .../List/ObservableListEx.Batch.cs | 2 +- .../List/ObservableListEx.BufferInitial.cs | 2 +- .../List/ObservableListEx.CastToObject.cs | 2 +- .../ObservableListEx.FlattenBufferResult.cs | 2 +- .../List/ObservableListEx.OnItemAdded.cs | 2 +- .../List/ObservableListEx.OnItemRefreshed.cs | 2 +- .../List/ObservableListEx.OnItemRemoved.cs | 2 +- .../List/ObservableListEx.StartWithEmpty.cs | 2 +- .../List/Tests/ChangeSetAggregator.cs | 2 +- .../Polyfills/ArgumentExceptionHelper.cs | 34 -------- .../ArgumentOutOfRangeExceptionHelper.cs | 83 ------------------- 46 files changed, 129 insertions(+), 266 deletions(-) delete mode 100644 src/DynamicData/Polyfills/ArgumentExceptionHelper.cs delete mode 100644 src/DynamicData/Polyfills/ArgumentOutOfRangeExceptionHelper.cs diff --git a/src/DynamicData.Reactive/DynamicData.Reactive.csproj b/src/DynamicData.Reactive/DynamicData.Reactive.csproj index 6537a501a..cba874040 100644 --- a/src/DynamicData.Reactive/DynamicData.Reactive.csproj +++ b/src/DynamicData.Reactive/DynamicData.Reactive.csproj @@ -43,14 +43,4 @@ - - - - - - - - - - diff --git a/src/DynamicData.Tests/Kernal/EnumerableEx.cs b/src/DynamicData.Tests/Kernal/EnumerableEx.cs index 1c837bf55..2912838e7 100644 --- a/src/DynamicData.Tests/Kernal/EnumerableEx.cs +++ b/src/DynamicData.Tests/Kernal/EnumerableEx.cs @@ -4,8 +4,8 @@ public static class EnumerableEx { public static IEnumerable CurrentNextZip(this IEnumerable source, Func selector) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(selector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(selector); var enumerator = source.GetEnumerator(); if (enumerator.MoveNext()) @@ -25,8 +25,8 @@ public static IEnumerable CurrentNextZip(this IEnumerable PrevCurrentNextZip(this IEnumerable source, Func selector) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(selector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(selector); var enumerator = source.GetEnumerator(); if (enumerator.MoveNext()) @@ -48,8 +48,8 @@ public static IEnumerable PrevCurrentNextZip(this IEnumerab public static IEnumerable PrevCurrentZip(this IEnumerable source, Func selector) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(selector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(selector); var enumerator = source.GetEnumerator(); if (enumerator.MoveNext()) diff --git a/src/DynamicData/Aggregation/AggregationEx.cs b/src/DynamicData/Aggregation/AggregationEx.cs index 192b4f5e8..1ab4d3008 100644 --- a/src/DynamicData/Aggregation/AggregationEx.cs +++ b/src/DynamicData/Aggregation/AggregationEx.cs @@ -52,8 +52,8 @@ public static IObservable> ForAggregation( /// An observable which emits the value. public static IObservable InvalidateWhen(this IObservable source, IObservable invalidate) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(invalidate); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(invalidate); return invalidate.StartWith(Unit.Default).Select(_ => source).Switch().DistinctUntilChanged(); } @@ -68,8 +68,8 @@ public static IObservable InvalidateWhen(this IObservable source, IObse /// An observable which emits the value. public static IObservable InvalidateWhen(this IObservable source, IObservable invalidate) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(invalidate); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(invalidate); return invalidate.StartWith(default(TTrigger)).Select(_ => source).Switch().DistinctUntilChanged(); } diff --git a/src/DynamicData/Aggregation/AvgEx.cs b/src/DynamicData/Aggregation/AvgEx.cs index 07b14ca7d..a5ad8a4be 100644 --- a/src/DynamicData/Aggregation/AvgEx.cs +++ b/src/DynamicData/Aggregation/AvgEx.cs @@ -316,7 +316,7 @@ public static IObservable Avg(this IObservable> source, /// public static IObservable Avg(this IObservable> source, Func valueSelector, int emptyValue = 0) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.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); } @@ -342,7 +342,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) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.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); } @@ -370,7 +370,7 @@ public static IObservable Avg(this IObservable /// public static IObservable Avg(this IObservable> source, Func valueSelector, double emptyValue = 0) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.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); } @@ -398,7 +398,7 @@ public static IObservable Avg(this IObservable /// public static IObservable Avg(this IObservable> source, Func valueSelector, decimal emptyValue = 0) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.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); } @@ -456,11 +456,11 @@ public static IObservable Avg(this IObservable> /// 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, bool retainProjections = true) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); - ArgumentExceptionHelper.ThrowIfNull(addAction); - ArgumentExceptionHelper.ThrowIfNull(removeAction); - ArgumentExceptionHelper.ThrowIfNull(resultAction); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(addAction); + ArgumentNullException.ThrowIfNull(removeAction); + ArgumentNullException.ThrowIfNull(resultAction); return Observable.Defer(() => { @@ -560,8 +560,8 @@ private static IObservable> AvgProject> AvgProject> AvgProjectNullable> AvgProjectNullable AvgNullableSelector(Func valueSelector) where TValue : struct { - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(valueSelector); return item => valueSelector(item).GetValueOrDefault(); } diff --git a/src/DynamicData/Aggregation/CountEx.cs b/src/DynamicData/Aggregation/CountEx.cs index a3bbb35d4..88e56b954 100644 --- a/src/DynamicData/Aggregation/CountEx.cs +++ b/src/DynamicData/Aggregation/CountEx.cs @@ -42,7 +42,7 @@ public static IObservable Count(this IObservableAn observable which emits the count. public static IObservable Count(this IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.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 36b2a9f89..c99df38e2 100644 --- a/src/DynamicData/Aggregation/MaxEx.cs +++ b/src/DynamicData/Aggregation/MaxEx.cs @@ -49,8 +49,8 @@ public static IObservable Maximum(this IObservable { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Max, emptyValue); } @@ -72,8 +72,8 @@ public static IObservable Maximum(this IObserva where TKey : notnull where TResult : struct, IComparable { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Max, emptyValue); } @@ -91,8 +91,8 @@ public static IObservable Minimum(this IObservable { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Min, emptyValue); } @@ -114,8 +114,8 @@ public static IObservable Minimum(this IObserva where TKey : notnull where TResult : struct, IComparable { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.ToChangesAndCollection().Calculate(valueSelector, MaxOrMin.Min, emptyValue); } diff --git a/src/DynamicData/Aggregation/StdDevEx.cs b/src/DynamicData/Aggregation/StdDevEx.cs index 09e11558b..1df1d2d87 100644 --- a/src/DynamicData/Aggregation/StdDevEx.cs +++ b/src/DynamicData/Aggregation/StdDevEx.cs @@ -30,8 +30,8 @@ public static class StdDevEx public static IObservable StdDev(this IObservable> source, Func valueSelector, int fallbackValue) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.ForAggregation().StdDev(valueSelector, fallbackValue); } @@ -47,8 +47,8 @@ public static IObservable StdDev(this IObservable> sour public static IObservable StdDev(this IObservable> source, Func valueSelector, long fallbackValue) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.ForAggregation().StdDev(valueSelector, fallbackValue); } @@ -64,8 +64,8 @@ public static IObservable StdDev(this IObservable> sour public static IObservable StdDev(this IObservable> source, Func valueSelector, double fallbackValue) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.ForAggregation().StdDev(valueSelector, fallbackValue); } @@ -81,8 +81,8 @@ public static IObservable StdDev(this IObservable> sour public static IObservable StdDev(this IObservable> source, Func valueSelector, decimal fallbackValue) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.ForAggregation().StdDev(valueSelector, fallbackValue); } @@ -98,8 +98,8 @@ public static IObservable StdDev(this IObservable> sou public static IObservable StdDev(this IObservable> source, Func valueSelector, float fallbackValue = 0) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.ForAggregation().StdDev(valueSelector, fallbackValue); } @@ -117,8 +117,8 @@ public static IObservable StdDev(this IObservable StdDev(this IObservable StdDev(this IObservable StdDev(this IObservable StdDev(this IObservableAn observable which emits the standard deviation value. public static IObservable StdDev(this IObservable> source, Func valueSelector, int fallbackValue = 0) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.StdDevCalc(t => (decimal)valueSelector(t), (decimal)fallbackValue).Select(value => (double)value); } @@ -224,8 +224,8 @@ 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) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.StdDevCalc(t => (decimal)valueSelector(t), (decimal)fallbackValue).Select(value => (double)value); } @@ -239,8 +239,8 @@ 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) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.StdDevCalc(valueSelector, fallbackValue); } @@ -254,8 +254,8 @@ 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) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.StdDevCalc(valueSelector, fallbackValue); } @@ -269,8 +269,8 @@ 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) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.StdDevCalc(t => valueSelector(t), fallbackValue); } @@ -284,8 +284,8 @@ public static IObservable StdDev(this IObservableThe result of the operation. private static IObservable StdDevCalc(this IObservable> source, Func valueSelector, double fallbackValue) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Scan( default(StdDev), @@ -310,8 +310,8 @@ private static IObservable StdDevCalc(this IObservableThe result of the operation. private static IObservable StdDevCalc(this IObservable> source, Func valueSelector, decimal fallbackValue) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Scan( default(StdDev), diff --git a/src/DynamicData/Aggregation/SumEx.Immutable.cs b/src/DynamicData/Aggregation/SumEx.Immutable.cs index 76fecc898..991772dc7 100644 --- a/src/DynamicData/Aggregation/SumEx.Immutable.cs +++ b/src/DynamicData/Aggregation/SumEx.Immutable.cs @@ -248,8 +248,8 @@ private static IObservable SumCacheImmutable( where TObject : notnull where TKey : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Scan(seed, (sum, changes) => { @@ -286,7 +286,7 @@ private static IObservable SumCacheImmutableNullable valueSelector(item).GetValueOrDefault(), seed, add, subtract); } @@ -299,8 +299,8 @@ private static IObservable SumListImmutable( Func subtract) where TObject : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Scan(seed, (sum, changes) => { @@ -353,7 +353,7 @@ private static IObservable SumListImmutableNullable( where TObject : notnull where TValue : struct { - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(valueSelector); return SumListImmutable(source, item => valueSelector(item).GetValueOrDefault(), seed, add, subtract); } diff --git a/src/DynamicData/Aggregation/SumEx.cs b/src/DynamicData/Aggregation/SumEx.cs index 390f4ad3c..73aeade75 100644 --- a/src/DynamicData/Aggregation/SumEx.cs +++ b/src/DynamicData/Aggregation/SumEx.cs @@ -351,8 +351,8 @@ private static IObservable SumCacheStateful( where TObject : notnull where TKey : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return Observable.Defer(() => { @@ -413,7 +413,7 @@ private static IObservable SumCacheStatefulNullable valueSelector(item).GetValueOrDefault(), seed, add, subtract); } @@ -426,8 +426,8 @@ private static IObservable SumListStateful( Func subtract) where TObject : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return Observable.Defer(() => { @@ -619,7 +619,7 @@ private static IObservable SumListStatefulNullable( where TObject : notnull where TValue : struct { - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(valueSelector); return SumListStateful(source, item => valueSelector(item).GetValueOrDefault(), seed, add, subtract); } @@ -654,8 +654,8 @@ private static IObservable SumAggregate( Func add, Func subtract) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(valueSelector); return source.Scan(seed, (sum, changes) => { @@ -677,7 +677,7 @@ private static IObservable SumAggregateNullable( Func subtract) where TValue : struct { - ArgumentExceptionHelper.ThrowIfNull(valueSelector); + ArgumentNullException.ThrowIfNull(valueSelector); return SumAggregate(source, item => valueSelector(item).GetValueOrDefault(), seed, add, subtract); } diff --git a/src/DynamicData/Cache/ChangeAwareCache.cs b/src/DynamicData/Cache/ChangeAwareCache.cs index d511f81e0..e8eb749df 100644 --- a/src/DynamicData/Cache/ChangeAwareCache.cs +++ b/src/DynamicData/Cache/ChangeAwareCache.cs @@ -56,7 +56,7 @@ public ChangeAwareCache(int capacity) /// Data to populate the cache with. public ChangeAwareCache(Dictionary data) { - ArgumentExceptionHelper.ThrowIfNull(data); + ArgumentNullException.ThrowIfNull(data); _data = data; _changes = []; diff --git a/src/DynamicData/Cache/Internal/AbstractFilter.cs b/src/DynamicData/Cache/Internal/AbstractFilter.cs index dc397e4b7..74425bcae 100644 --- a/src/DynamicData/Cache/Internal/AbstractFilter.cs +++ b/src/DynamicData/Cache/Internal/AbstractFilter.cs @@ -30,7 +30,7 @@ internal abstract class AbstractFilter : IFilter /// The filter value. protected AbstractFilter(ChangeAwareCache cache, Func? filter) { - ArgumentExceptionHelper.ThrowIfNull(cache); + ArgumentNullException.ThrowIfNull(cache); _cache = cache; Filter = filter ?? (_ => true); diff --git a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs index c625ea4e6..073ec36a7 100644 --- a/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs +++ b/src/DynamicData/Cache/Internal/AnonymousObservableCache.cs @@ -50,7 +50,7 @@ public AnonymousObservableCache(IObservable> source) /// The cache value. public AnonymousObservableCache(IObservableCache cache) { - ArgumentExceptionHelper.ThrowIfNull(cache); + ArgumentNullException.ThrowIfNull(cache); _cache = cache; _cleanUp = Disposable.Empty; diff --git a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs index 1a7fda79a..01f71a6e0 100644 --- a/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs +++ b/src/DynamicData/Cache/Internal/LockFreeObservableCache.cs @@ -60,7 +60,7 @@ public sealed class LockFreeObservableCache : IObservableCacheThe source. public LockFreeObservableCache(IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); _updater = new CacheUpdater(_innerCache); diff --git a/src/DynamicData/Cache/Internal/MergeManyItems.cs b/src/DynamicData/Cache/Internal/MergeManyItems.cs index 91d0945b1..46f5b8f4a 100644 --- a/src/DynamicData/Cache/Internal/MergeManyItems.cs +++ b/src/DynamicData/Cache/Internal/MergeManyItems.cs @@ -36,8 +36,8 @@ internal sealed class MergeManyItems /// The observableSelector value. public MergeManyItems(IObservable> source, Func> observableSelector) { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(observableSelector); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(observableSelector); _source = source; _observableSelector = observableSelector; diff --git a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs index f8651a633..be65e7f52 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.AutoRefreshOnObservable.cs @@ -32,8 +32,8 @@ public static IObservable> AutoRefreshOnObservable reevaluator(t), changeSetBuffer, scheduler); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs index 7fe2994f3..b3f1b40cd 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.BufferInitial.cs @@ -41,7 +41,7 @@ public static IObservable> BufferInitial> IgnoreUpdateWhen diff --git a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs index ef5a16e4f..8605be650 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.InvokeEvaluate.cs @@ -37,7 +37,7 @@ public static IObservable> InvokeEvaluate changes.Where(u => u.Reason == ChangeReason.Refresh).ForEach(u => u.Current.Evaluate())); } } diff --git a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs index 9b80e5401..3b693c35d 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.SortAndBind.cs @@ -258,7 +258,7 @@ public static partial class ObservableCacheEx where TObject : notnull where TKey : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); return new SortAndBind(source, comparer, options, targetList).Run(); } @@ -386,7 +386,7 @@ public static partial class ObservableCacheEx where TObject : notnull where TKey : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.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 4ef637e8f..7aada9d00 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.StartWithEmpty.cs @@ -29,7 +29,7 @@ public static IObservable> StartWithEmpty.Empty); } @@ -46,7 +46,7 @@ public static IObservable> StartWithEmpty.Empty); } @@ -63,7 +63,7 @@ public static IObservable> StartWithEmpty.Empty); } @@ -80,7 +80,7 @@ public static IObservable> StartWithEmpty.Empty); } @@ -99,7 +99,7 @@ public static IObservable> StartWithEm where TKey : notnull where TGroupKey : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); return source.StartWith(GroupChangeSet.Empty); } @@ -118,7 +118,7 @@ public static IObservable> St where TKey : notnull where TGroupKey : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); return source.StartWith(ImmutableGroupChangeSet.Empty); } @@ -132,7 +132,7 @@ public static IObservable> St /// Overload for IReadOnlyCollection<T>. public static IObservable> StartWithEmpty(this IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); return source.StartWith(ReadOnlyCollectionLight.Empty); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs index 054f5948b..3475090ae 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.Switch.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.Switch.cs @@ -50,7 +50,7 @@ public static IObservable> Switch(this where TObject : notnull where TKey : notnull { - ArgumentExceptionHelper.ThrowIfNull(sources); + ArgumentNullException.ThrowIfNull(sources); return ObservableCacheEx.Switch((IObservable>>)sources); } diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs index adce60148..1fa4f4698 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToCollection.cs @@ -28,7 +28,7 @@ public static IObservable> ToCollection { diff --git a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs index b5822359a..5a7a03aa9 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.ToObservableOptional.cs @@ -70,7 +70,7 @@ public static partial class ObservableCacheEx where TObject : notnull where TKey : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); if (initialOptionalWhenMissing) { diff --git a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs index 24e147827..0470b4147 100644 --- a/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs +++ b/src/DynamicData/Cache/ObservableCacheEx.UpdateIndex.cs @@ -28,7 +28,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/Cache/Tests/ChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs index adfaf285e..a9594e47a 100644 --- a/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/ChangeSetAggregator.cs @@ -30,7 +30,7 @@ public sealed class ChangeSetAggregator : IDisposable /// The source. public ChangeSetAggregator(IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); var published = source.Publish(); @@ -116,7 +116,7 @@ public sealed class ChangeSetAggregator : IDisposable /// The source. public ChangeSetAggregator(IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs index 3ae3e4d98..b509689c8 100644 --- a/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/DistinctChangeSetAggregator.cs @@ -33,7 +33,7 @@ public class DistinctChangeSetAggregator : IDisposable /// The source. public DistinctChangeSetAggregator(IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs index 90568dd0b..13672a6bb 100644 --- a/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/GroupChangeSetAggregator.cs @@ -41,7 +41,7 @@ public class GroupChangeSetAggregator : IDisposable /// The source. public GroupChangeSetAggregator(IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs index aa71b3ab9..51d9c5717 100644 --- a/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/PagedChangeSetAggregator.cs @@ -35,7 +35,7 @@ public class PagedChangeSetAggregator : IDisposable /// The source. public PagedChangeSetAggregator(IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs index 9b0ecdaec..59bdbb8d6 100644 --- a/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/SortedChangeSetAggregator.cs @@ -35,7 +35,7 @@ public class SortedChangeSetAggregator : IDisposable /// The source. public SortedChangeSetAggregator(IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs index 1228dc6f4..a44a62eac 100644 --- a/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs +++ b/src/DynamicData/Cache/Tests/VirtualChangeSetAggregator.cs @@ -35,7 +35,7 @@ public class VirtualChangeSetAggregator : IDisposable /// The source. public VirtualChangeSetAggregator(IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/DynamicData.csproj b/src/DynamicData/DynamicData.csproj index 0365e8726..bbbcab483 100644 --- a/src/DynamicData/DynamicData.csproj +++ b/src/DynamicData/DynamicData.csproj @@ -54,14 +54,4 @@ Dynamic Data is a comprehensive caching and data manipulation solution which int - - - - - - - - - - diff --git a/src/DynamicData/Kernel/InternalEx.cs b/src/DynamicData/Kernel/InternalEx.cs index 03469c408..874fd347a 100644 --- a/src/DynamicData/Kernel/InternalEx.cs +++ b/src/DynamicData/Kernel/InternalEx.cs @@ -41,8 +41,8 @@ public static class InternalEx public static IObservable RetryWithBackOff(this IObservable source, Func backOffStrategy) where TException : Exception { - ArgumentExceptionHelper.ThrowIfNull(source); - ArgumentExceptionHelper.ThrowIfNull(backOffStrategy); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(backOffStrategy); IObservable Retry(int failureCount) => source.Catch( @@ -78,8 +78,8 @@ IObservable Retry(int failureCount) => /// A disposable that will stop the schedule. public static IDisposable ScheduleRecurringAction(this IScheduler scheduler, TimeSpan interval, Action action) { - ArgumentExceptionHelper.ThrowIfNull(scheduler); - ArgumentExceptionHelper.ThrowIfNull(action); + ArgumentNullException.ThrowIfNull(scheduler); + ArgumentNullException.ThrowIfNull(action); var disposable = new SerialDisposable(); diff --git a/src/DynamicData/Kernel/OptionObservableExtensions.cs b/src/DynamicData/Kernel/OptionObservableExtensions.cs index bcce9a5ce..ffcf2f304 100644 --- a/src/DynamicData/Kernel/OptionObservableExtensions.cs +++ b/src/DynamicData/Kernel/OptionObservableExtensions.cs @@ -151,7 +151,7 @@ public static class OptionObservableExtensions public static IObservable SelectValues(this IObservable> source) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); return source.Where(t => t.HasValue && t.Value is not null).Select(t => t.Value!); } diff --git a/src/DynamicData/List/Internal/AnonymousObservableList.cs b/src/DynamicData/List/Internal/AnonymousObservableList.cs index d024423c2..3f54aa472 100644 --- a/src/DynamicData/List/Internal/AnonymousObservableList.cs +++ b/src/DynamicData/List/Internal/AnonymousObservableList.cs @@ -47,7 +47,7 @@ public AnonymousObservableList(IObservable> source) /// The sourceList value. public AnonymousObservableList(ISourceList sourceList) { - ArgumentExceptionHelper.ThrowIfNull(sourceList); + ArgumentNullException.ThrowIfNull(sourceList); _sourceList = sourceList; _cleanUp = Disposable.Empty; } diff --git a/src/DynamicData/List/Internal/FilterOnObservable.cs b/src/DynamicData/List/Internal/FilterOnObservable.cs index fca2201c7..53e85db4c 100644 --- a/src/DynamicData/List/Internal/FilterOnObservable.cs +++ b/src/DynamicData/List/Internal/FilterOnObservable.cs @@ -71,7 +71,7 @@ private IObservable ObserveFilter(TObject item) { // Keep factory exceptions on the source path, as before. var filter = _filter(item); - ArgumentExceptionHelper.ThrowIfNull(filter); + ArgumentNullException.ThrowIfNull(filter); return Observable.Create(observer => { // Connect before observing so only the latest synchronous initialization value is committed. diff --git a/src/DynamicData/List/ObservableListEx.Batch.cs b/src/DynamicData/List/ObservableListEx.Batch.cs index af231f658..8dd442c50 100644 --- a/src/DynamicData/List/ObservableListEx.Batch.cs +++ b/src/DynamicData/List/ObservableListEx.Batch.cs @@ -32,7 +32,7 @@ public static partial class ObservableListEx public static IObservable> Batch(this IObservable> source, TimeSpan timeSpan, IScheduler? scheduler = null) where TObject : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); if (timeSpan < TimeSpan.Zero) { throw new ArgumentOutOfRangeException(nameof(timeSpan), timeSpan, "The batch window must not be negative."); diff --git a/src/DynamicData/List/ObservableListEx.BufferInitial.cs b/src/DynamicData/List/ObservableListEx.BufferInitial.cs index 19f2bf7d8..a391e1b06 100644 --- a/src/DynamicData/List/ObservableListEx.BufferInitial.cs +++ b/src/DynamicData/List/ObservableListEx.BufferInitial.cs @@ -36,7 +36,7 @@ public static partial class ObservableListEx public static IObservable> BufferInitial(this IObservable> source, TimeSpan initialBuffer, IScheduler? scheduler = null) where TObject : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); if (initialBuffer < TimeSpan.Zero) { throw new ArgumentOutOfRangeException(nameof(initialBuffer), initialBuffer, "The initial buffer duration must be non-negative."); diff --git a/src/DynamicData/List/ObservableListEx.CastToObject.cs b/src/DynamicData/List/ObservableListEx.CastToObject.cs index 810be4ec6..9e8347a82 100644 --- a/src/DynamicData/List/ObservableListEx.CastToObject.cs +++ b/src/DynamicData/List/ObservableListEx.CastToObject.cs @@ -25,7 +25,7 @@ public static partial class ObservableListEx public static IObservable> CastToObject(this IObservable> source) where T : class { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(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 eaaa0f842..0e90ef2f4 100644 --- a/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs +++ b/src/DynamicData/List/ObservableListEx.FlattenBufferResult.cs @@ -30,7 +30,7 @@ public static partial class ObservableListEx public static IObservable> FlattenBufferResult(this IObservable>> source) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(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 7c1f1f18e..6110177ef 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemAdded.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemAdded.cs @@ -45,7 +45,7 @@ public static IObservable> OnItemAdded( Action addAction) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.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 2fb75b1b6..a8ee90b5c 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRefreshed.cs @@ -32,7 +32,7 @@ public static IObservable> OnItemRefreshed( Action refreshAction) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.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 a2a2eb193..25beacbb4 100644 --- a/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs +++ b/src/DynamicData/List/ObservableListEx.OnItemRemoved.cs @@ -52,7 +52,7 @@ public static IObservable> OnItemRemoved( bool invokeOnUnsubscribe = true) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); return List.Internal.OnItemRemoved.Create( source: source, removeAction: removeAction, diff --git a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs index 3a4a9de48..ca9eadbd0 100644 --- a/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs +++ b/src/DynamicData/List/ObservableListEx.StartWithEmpty.cs @@ -27,7 +27,7 @@ public static partial class ObservableListEx public static IObservable> StartWithEmpty(this IObservable> source) where T : notnull { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); return source.StartWith(ChangeSet.Empty); } diff --git a/src/DynamicData/List/Tests/ChangeSetAggregator.cs b/src/DynamicData/List/Tests/ChangeSetAggregator.cs index 1fcd9efbf..54450741f 100644 --- a/src/DynamicData/List/Tests/ChangeSetAggregator.cs +++ b/src/DynamicData/List/Tests/ChangeSetAggregator.cs @@ -33,7 +33,7 @@ public class ChangeSetAggregator : IDisposable /// The source. public ChangeSetAggregator(IObservable> source) { - ArgumentExceptionHelper.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(source); var published = source.Publish(); diff --git a/src/DynamicData/Polyfills/ArgumentExceptionHelper.cs b/src/DynamicData/Polyfills/ArgumentExceptionHelper.cs deleted file mode 100644 index 0136871e1..000000000 --- a/src/DynamicData/Polyfills/ArgumentExceptionHelper.cs +++ /dev/null @@ -1,34 +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 REACTIVE_SHIM - -namespace DynamicData.Reactive; -#else - -namespace DynamicData; -#endif - -/// -/// 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 deleted file mode 100644 index a97f3823f..000000000 --- a/src/DynamicData/Polyfills/ArgumentOutOfRangeExceptionHelper.cs +++ /dev/null @@ -1,83 +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 REACTIVE_SHIM - -namespace DynamicData.Reactive; -#else - -namespace DynamicData; -#endif - -/// 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); - } -} From 978a5fe1ec5e2aaffc00051620fe1f002f51e11d Mon Sep 17 00:00:00 2001 From: Viktor Jannicke Date: Mon, 19 Oct 2026 22:02:55 +0200 Subject: [PATCH 09/10] Record the 2026-10 upstream sync in the fork register Update DD-001 (no Polyfill package), DD-002 (fork-owned src/ Directory.Packages.props), DD-003 (flavour-aware Global.cs) and DD-018 (upstream #1171 merged, narrower than the fork). Adapt the merged upstream usings guidance to the fork's project layout. Co-Authored-By: Claude Opus 5.5 --- .github/copilot-instructions.md | 4 ++-- docs/fork-differences.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index c5ec3abbf..3f7b1e7e5 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -91,7 +91,7 @@ src/ ## Usings and Namespaces -**Do not add `using` directives to source files.** Each project declares its namespaces once, as `global using` directives in its own `Global.cs` (`src/DynamicData/Global.cs`, `src/DynamicData.Tests/Global.cs`, `src/DynamicData.Benchmarks/Global.cs`). `ImplicitUsings` is disabled, so `Global.cs` is the complete list. If you need a namespace that is not in scope, add it there. +**Do not add `using` directives to library source files.** In this fork they declare their namespaces once in `src/DynamicData/Global.cs`, which both flavours compile: the DynamicData namespaces switch on `REACTIVE_SHIM`, and each library csproj adds its Rx stack (ReactiveUI.Primitives or System.Reactive) as `` items. `ImplicitUsings` stays enabled. The TUnit test and benchmark projects declare their namespaces as `` items in their csproj files. If you need a namespace that is not in scope, add it there. Two DynamicData namespaces are the exception and **must** stay file-level, because importing them globally silently rebinds existing calls: @@ -100,7 +100,7 @@ Two DynamicData namespaces are the exception and **must** stay file-level, becau | `DynamicData.Alias` | Supplies `Select`, `Where` and `SelectMany` for changeset streams. They are more specific than the Rx operators of the same name, so importing globally silently rebinds calls such as `.Where(_ => flag)` to `Filter`. | | `DynamicData.Aggregation` | Supplies `Count`, `Sum`, `Avg`, `Maximum` and `Minimum` for changeset streams. `Count()` is more specific than Rx's `Count()` and returns the same type, so importing globally silently turns a count of emitted changesets into a live item count. | -If a global namespace makes a name ambiguous, qualify the call site or add a global alias in `Global.cs`. Do not move the namespace back into the file. Already handled: `System.Reactive.Notification` is qualified wherever the tests mean the Rx type rather than `DynamicData.Internal.Notification`, and the tests' `Global.cs` aliases `Person` to the domain type so it wins over `Bogus.Person`. +If a global namespace makes a name ambiguous, qualify the call site or add a global alias in `Global.cs`. Do not move the namespace back into the file. ## Operator Architecture Pattern diff --git a/docs/fork-differences.md b/docs/fork-differences.md index 56e05a3d4..1c50b2bef 100644 --- a/docs/fork-differences.md +++ b/docs/fork-differences.md @@ -9,16 +9,16 @@ entry `retired`. Upstream status is as last reviewed; open gaps are tracked as | ID | What differs | Why | Upstream status | | --- | --- | --- | --- | -| DD-001 | .NET 10 only; SDK pinned in [global.json](../global.json). | Runic targets .NET 10; one API baseline per flavor. | Upstream multi-targets. | -| DD-002 | Default ReactiveUI.Primitives 9.0.0; `-p:ReactiveUIPrimitivesVersion=8.4.0` keeps ReactiveUI 25 source compatibility. Independent [package versions](../Directory.Packages.props). | Current Runic uses Primitives 9; 8.4 consumers still build. | Based on open PR [#1116](https://github.com/reactivemarbles/DynamicData/pull/1116). | -| DD-003 | Two flavors from shared sources: Primitives (`DynamicData`) and System.Reactive (`DynamicData.Reactive`, `REACTIVE_SHIM`). | Consumers of either Rx stack. | Based on open PR #1116. | +| DD-001 | .NET 10 only; SDK pinned in [global.json](../global.json). No Polyfill package: the BCL provides the APIs upstream polyfills. | Runic targets .NET 10; one API baseline per flavor. | Upstream multi-targets with the Polyfill package (#1201). | +| DD-002 | Default ReactiveUI.Primitives 9.0.0; `-p:ReactiveUIPrimitivesVersion=8.4.0` keeps ReactiveUI 25 source compatibility. Fork-owned central [package versions](../src/Directory.Packages.props) (Primitives via `ReactiveUIPrimitivesVersion`); the [root file](../Directory.Packages.props) keeps CPM off for `eng/` and stops an enclosing workspace's versions from applying. | Current Runic uses Primitives 9; 8.4 consumers still build. | Based on open PR [#1116](https://github.com/reactivemarbles/DynamicData/pull/1116). | +| DD-003 | Two flavors from shared sources: Primitives (`DynamicData`) and System.Reactive (`DynamicData.Reactive`, `REACTIVE_SHIM`). The library [Global.cs](../src/DynamicData/Global.cs) switches DynamicData namespaces on `REACTIVE_SHIM` and leaves Rx imports to each csproj; `ImplicitUsings` stays enabled. | Consumers of either Rx stack. | Based on open PR #1116. | | DD-004 | Tests use TUnit / Microsoft.Testing.Platform; upstream xUnit tests are translated. | One runner for both flavors. | Upstream uses xUnit. | | DD-005 | Packages `Runic.DynamicData` and `Runic.DynamicData.Reactive`, released as GitHub release assets; namespaces unchanged, original MIT license and authorship kept. | Avoid clashing with upstream package IDs. | Fork only. | | DD-006 | List and cache `ExpireAfter` guard callbacks racing subscription/source disposal. | Late timer callbacks after disposal. | Fork fix. | | DD-007 | `StdDev` uses incremental central moments; integral/decimal selectors use decimal accumulators. | Precision for large offsets ([#1196](https://github.com/reactivemarbles/DynamicData/issues/1196)). | Upstream fixed only the sample divisor (#1191). | | DD-016 | Queue-serialized operators use gate-free merge helpers that honour the intended Rx selector/empty-input/null-value contracts. | Cross-cache deadlocks ([#1073](https://github.com/reactivemarbles/DynamicData/issues/1073)). | #1097 merged; helper contract repairs are fork only. | | DD-017 | `RemoveKey` keeps per-subscription key positions. | Equal values lost identity ([#1182](https://github.com/reactivemarbles/DynamicData/issues/1182), #1119). | Open PR [#1192](https://github.com/reactivemarbles/DynamicData/pull/1192). | -| DD-018 | List `Transform`/`TransformAsync`, `EditDiff` and `TransformMany` remove one occurrence at a time (reference, then equality). | Dropped or duplicated rows (#1169, #1072). | Open PR [#1171](https://github.com/reactivemarbles/DynamicData/pull/1171) covers part. | +| DD-018 | List `Transform`/`TransformAsync`, `EditDiff` and `TransformMany` remove one occurrence at a time (reference, then equality). | Dropped or duplicated rows (#1169, #1072). | [#1171](https://github.com/reactivemarbles/DynamicData/pull/1171) merged for list `Transform`/`TransformAsync` only (first equal occurrence); its regressions pass against the fork implementation. | | DD-019 | Property observation subscribes to the runtime chain target, not only the declared type. | Missed notifications through interfaces (#1156). | Open issue. | | DD-020 | Cache `AsyncDisposeMany` disposes a replaced distinct reference even when values are equal. | Leaked owned objects. | Fork fix. | | DD-021 | `BufferInitial` uses one one-shot timer for both collection types. | Spinning with tiny timeouts (#1170). | Open issue. | From eaaf954b52ce32cf8762e07b02ec96ae13c2ee2a Mon Sep 17 00:00:00 2001 From: Viktor Jannicke Date: Mon, 19 Oct 2026 22:22:57 +0200 Subject: [PATCH 10/10] Keep SourceLink commit provenance under Central Package Management The CPM adoption turned Microsoft.SourceLink.GitHub into a GlobalPackageReference. NuGet restores those without buildTransitive assets (and ignores an IncludeAssets override), which drops the Microsoft.SourceLink.Common and Microsoft.Build.Tasks.Git targets. Packages then lost the repository commit in their nuspec, and the packaged acceptance gate rejected them. Reference SourceLink from Directory.Build.props with a central version instead, as before. Co-Authored-By: Claude Opus 5.5 --- src/Directory.Build.props | 4 ++++ src/Directory.Packages.props | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 4e9a219da..543da1f0d 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -65,6 +65,10 @@ + + + + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 59afba4b5..59dc731c2 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -9,6 +9,9 @@ + + @@ -32,9 +35,6 @@ - - -