Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ dotnet_diagnostic.SA1113.severity = error
dotnet_diagnostic.SA1114.severity = none
dotnet_diagnostic.SA1115.severity = error
dotnet_diagnostic.SA1116.severity = none
dotnet_diagnostic.SA1117.severity = error
dotnet_diagnostic.SA1117.severity = none
dotnet_diagnostic.SA1118.severity = none
dotnet_diagnostic.SA1119.severity = error
dotnet_diagnostic.SA1120.severity = error
Expand All @@ -380,7 +380,7 @@ dotnet_diagnostic.SA1133.severity = error
dotnet_diagnostic.SA1134.severity = error
dotnet_diagnostic.SA1135.severity = error
dotnet_diagnostic.SA1136.severity = error
dotnet_diagnostic.SA1137.severity = error
dotnet_diagnostic.SA1137.severity = none
dotnet_diagnostic.SA1139.severity = error
dotnet_diagnostic.SA1200.severity = none
dotnet_diagnostic.SA1201.severity = none
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Aggregation/SumEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Aggregation;

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Alias/ObservableCacheAlias.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

using System.Reactive;

using DynamicData.Kernel;

namespace DynamicData.Alias;

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion src/DynamicData/Binding/ExpressionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.ComponentModel;
using System.Linq.Expressions;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reflection;

Expand Down
1 change: 0 additions & 1 deletion src/DynamicData/Binding/ObservableCollectionEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Collections.Specialized;
using System.Reactive;
using System.Reactive.Linq;
using DynamicData.Kernel;

namespace DynamicData.Binding;

Expand Down
2 changes: 1 addition & 1 deletion src/DynamicData/Binding/SortAndBind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public SortAndBind(IObservable<IChangeSet<TObject, TKey>> source,
comparerChanged = comparerChanged.ObserveOn(scheduler);
}

var locker = new object();
var locker = InternalEx.NewLock();
SortApplicator? sortApplicator = null;

// Create a new sort applicator each time.
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/CacheChangeSetEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Cache;

internal static class CacheChangeSetEx
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Change.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

// ReSharper disable once CheckNamespace
namespace DynamicData;

Expand Down
1 change: 0 additions & 1 deletion src/DynamicData/Cache/ChangeAwareCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for full license information.

using DynamicData.Cache;
using DynamicData.Kernel;

// ReSharper disable once CheckNamespace
namespace DynamicData;
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/IGrouping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

// ReSharper disable once CheckNamespace
namespace DynamicData;

Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/IObservableCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

// ReSharper disable once CheckNamespace
namespace DynamicData;

Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/IQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

// ReSharper disable once CheckNamespace
namespace DynamicData;

Expand Down
1 change: 0 additions & 1 deletion src/DynamicData/Cache/IntermediateCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System.Diagnostics;
using DynamicData.Binding;
using DynamicData.Kernel;

// ReSharper disable once CheckNamespace
namespace DynamicData;
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/AbstractFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Cache.Internal;

internal abstract class AbstractFilter<TObject, TKey> : IFilter<TObject, TKey>
Expand Down
1 change: 0 additions & 1 deletion src/DynamicData/Cache/Internal/AnonymousObservableCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System.Diagnostics;
using System.Reactive.Disposables;
using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/AnonymousQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Cache.Internal;

internal sealed class AnonymousQuery<TObject, TKey>(Cache<TObject, TKey> cache) : IQuery<TObject, TKey>
Expand Down
2 changes: 1 addition & 1 deletion src/DynamicData/Cache/Internal/AutoRefresh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public IObservable<IChangeSet<TObject, TKey>> Run() => Observable.Create<IChange
changes.Buffer(buffer.Value, _scheduler).Where(list => list.Count > 0).Select(items => new ChangeSet<TObject, TKey>(items));

// publish refreshes and underlying changes
var locker = new object();
var locker = InternalEx.NewLock();
var publisher = shared.Synchronize(locker).Merge(refreshChanges.Synchronize(locker)).SubscribeSafe(observer);

return new CompositeDisposable(publisher, shared.Connect());
Expand Down
2 changes: 1 addition & 1 deletion src/DynamicData/Cache/Internal/BatchIf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public IObservable<ChangeSet<TObject, TKey>> Run() => Observable.Create<ChangeSe
observer =>
{
var batchedChanges = new List<IChangeSet<TObject, TKey>>();
var locker = new object();
var locker = InternalEx.NewLock();
var paused = initialPauseState;
var timeoutDisposer = new SerialDisposable();
var intervalTimerDisposer = new SerialDisposable();
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/Cache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

using System.Diagnostics;

using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

[DebuggerDisplay("Cache<{typeof(TObject).Name}, {typeof(TKey).Name}> ({Count} Items)")]
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/CacheUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Cache.Internal;

internal sealed class CacheUpdater<TObject, TKey> : ISourceUpdater<TObject, TKey>
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/Cast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

using System.Reactive.Linq;

using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

internal sealed class Cast<TSource, TKey, TDestination>(IObservable<IChangeSet<TSource, TKey>> source, Func<TSource, TDestination> converter)
Expand Down
3 changes: 0 additions & 3 deletions src/DynamicData/Cache/Internal/ChangeSetMergeTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Kernel;

namespace DynamicData.Cache.Internal;

internal sealed class ChangeSetMergeTracker<TObject, TKey>(Func<IEnumerable<ChangeSetCache<TObject, TKey>>> selectCaches, IComparer<TObject>? comparer, IEqualityComparer<TObject>? equalityComparer)
Expand Down
6 changes: 4 additions & 2 deletions src/DynamicData/Cache/Internal/Combiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

using System.Reactive.Disposables;

using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

/// <summary>
Expand All @@ -17,7 +15,11 @@ internal sealed class Combiner<TObject, TKey>(CombineOperator type, Action<IChan
{
private readonly ChangeAwareCache<TObject, TKey> _combinedCache = new();

#if NET9_0_OR_GREATER
private readonly Lock _locker = new();
#else
private readonly object _locker = new();
#endif

private readonly IList<Cache<TObject, TKey>> _sourceCaches = new List<Cache<TObject, TKey>>();

Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/DeferUntilLoaded.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

using System.Reactive.Linq;

using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

internal sealed class DeferUntilLoaded<TObject, TKey>
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/DistinctCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

using System.Reactive.Linq;

using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

internal sealed class DistinctCalculator<TObject, TKey, TValue>(IObservable<IChangeSet<TObject, TKey>> source, Func<TObject, TValue> valueSelector)
Expand Down
4 changes: 1 addition & 3 deletions src/DynamicData/Cache/Internal/DynamicCombiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;

using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

internal sealed class DynamicCombiner<TObject, TKey>(IObservableList<IObservable<IChangeSet<TObject, TKey>>> source, CombineOperator type)
Expand All @@ -18,7 +16,7 @@ internal sealed class DynamicCombiner<TObject, TKey>(IObservableList<IObservable
public IObservable<IChangeSet<TObject, TKey>> Run() => Observable.Create<IChangeSet<TObject, TKey>>(
observer =>
{
var locker = new object();
var locker = InternalEx.NewLock();

// this is the resulting cache which produces all notifications
var resultCache = new ChangeAwareCache<TObject, TKey>();
Expand Down
2 changes: 1 addition & 1 deletion src/DynamicData/Cache/Internal/DynamicFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public IObservable<IChangeSet<TObject, TKey>> Run() => Observable.Create<IChange
var filteredData = new ChangeAwareCache<TObject, TKey>();
Func<TObject, bool> predicate = _ => false;

var locker = new object();
var locker = InternalEx.NewLock();

var refresher = LatestPredicateObservable().Synchronize(locker).Select(
p =>
Expand Down
1 change: 0 additions & 1 deletion src/DynamicData/Cache/Internal/DynamicGrouper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System.Diagnostics;
using System.Reactive.Disposables;
using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/EditDiff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Cache.Internal;

internal sealed class EditDiff<TObject, TKey>(ISourceCache<TObject, TKey> source, Func<TObject, TObject, bool> areEqual)
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/EditDiffChangeSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 EditDiffChangeSet<TObject, TKey>(IObservable<IEnumerable<TObject>> source, Func<TObject, TKey> keySelector, IEqualityComparer<TObject>? equalityComparer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for full license information.

using System.Reactive.Linq;
using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

Expand Down
5 changes: 0 additions & 5 deletions src/DynamicData/Cache/Internal/Filter.WithPredicateState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
// Roland Pheasant licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using System;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Transactions;

using DynamicData.Internal;

namespace DynamicData.Cache.Internal;
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/FilteredIndexCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Cache.Internal;

internal static class FilteredIndexCalculator<TObject, TKey>
Expand Down
4 changes: 1 addition & 3 deletions src/DynamicData/Cache/Internal/FullJoin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;

using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

internal sealed class FullJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>> left, IObservable<IChangeSet<TRight, TRightKey>> right, Func<TRight, TLeftKey> rightKeySelector, Func<TLeftKey, Optional<TLeft>, Optional<TRight>, TDestination> resultSelector)
Expand All @@ -27,7 +25,7 @@ internal sealed class FullJoin<TLeft, TLeftKey, TRight, TRightKey, TDestination>
public IObservable<IChangeSet<TDestination, TLeftKey>> Run() => Observable.Create<IChangeSet<TDestination, TLeftKey>>(
observer =>
{
var locker = new object();
var locker = InternalEx.NewLock();

// create local backing stores
var leftCache = _left.Synchronize(locker).AsObservableCache(false);
Expand Down
2 changes: 0 additions & 2 deletions src/DynamicData/Cache/Internal/FullJoinMany.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.Cache.Internal;

internal sealed class FullJoinMany<TLeft, TLeftKey, TRight, TRightKey, TDestination>(IObservable<IChangeSet<TLeft, TLeftKey>> left, IObservable<IChangeSet<TRight, TRightKey>> right, Func<TRight, TLeftKey> rightKeySelector, Func<TLeftKey, Optional<TLeft>, IGrouping<TRight, TRightKey, TLeftKey>, TDestination> resultSelector)
Expand Down
4 changes: 1 addition & 3 deletions src/DynamicData/Cache/Internal/GroupOn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;

using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

internal sealed class GroupOn<TObject, TKey, TGroupKey>(IObservable<IChangeSet<TObject, TKey>> source, Func<TObject, TGroupKey> groupSelectorKey, IObservable<Unit>? regrouper)
Expand All @@ -24,7 +22,7 @@ internal sealed class GroupOn<TObject, TKey, TGroupKey>(IObservable<IChangeSet<T
public IObservable<IGroupChangeSet<TObject, TKey, TGroupKey>> Run() => Observable.Create<IGroupChangeSet<TObject, TKey, TGroupKey>>(
observer =>
{
var locker = new object();
var locker = InternalEx.NewLock();
var grouper = new Grouper(_groupSelectorKey);

var groups = _source.Finally(observer.OnCompleted).Synchronize(locker).Select(grouper.Update).Where(changes => changes.Count != 0);
Expand Down
1 change: 0 additions & 1 deletion src/DynamicData/Cache/Internal/GroupOnDynamic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;
using DynamicData.Internal;
using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

Expand Down
4 changes: 1 addition & 3 deletions src/DynamicData/Cache/Internal/GroupOnImmutable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using System.Reactive;
using System.Reactive.Linq;

using DynamicData.Kernel;

namespace DynamicData.Cache.Internal;

internal sealed class GroupOnImmutable<TObject, TKey, TGroupKey>(IObservable<IChangeSet<TObject, TKey>> source, Func<TObject, TGroupKey> groupSelectorKey, IObservable<Unit>? regrouper)
Expand All @@ -23,7 +21,7 @@ internal sealed class GroupOnImmutable<TObject, TKey, TGroupKey>(IObservable<ICh
public IObservable<IImmutableGroupChangeSet<TObject, TKey, TGroupKey>> Run() => Observable.Create<IImmutableGroupChangeSet<TObject, TKey, TGroupKey>>(
observer =>
{
var locker = new object();
var locker = InternalEx.NewLock();
var grouper = new Grouper(_groupSelectorKey);

var groups = _source.Synchronize(locker).Select(grouper.Update).Where(changes => changes.Count != 0);
Expand Down
Loading