Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance: Move DynamicDataOptions #864

Merged
merged 5 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@ namespace DynamicData.Binding
public bool UseReplaceForUpdates { get; set; }
public static DynamicData.Binding.BindingOptions NeverFireReset(bool useReplaceForUpdates = true) { }
}
public static class DynamicDataOptions
{
public static DynamicData.Binding.BindingOptions Binding { get; set; }
}
public interface IEvaluateAware
{
void Evaluate();
Expand Down Expand Up @@ -701,6 +697,10 @@ namespace DynamicData
public static bool operator !=(in DynamicData.Change<TObject, TKey> left, in DynamicData.Change<TObject, TKey> right) { }
public static bool operator ==(in DynamicData.Change<TObject, TKey> left, in DynamicData.Change<TObject, TKey> right) { }
}
public static class DynamicDataOptions
{
public static DynamicData.Binding.BindingOptions Binding { get; set; }
}
public static class EnumerableEx
{
public static System.IObservable<DynamicData.IChangeSet<TObject>> AsObservableChangeSet<TObject>(this System.Collections.Generic.IEnumerable<TObject> source, bool completable = false)
Expand Down
12 changes: 0 additions & 12 deletions src/DynamicData/Binding/BindingOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,3 @@ public record struct BindingOptions(int ResetThreshold, bool UseReplaceForUpdate
/// <returns> The binding options.</returns>
public static BindingOptions NeverFireReset(bool useReplaceForUpdates = DefaultResetOnFirstTimeLoad) => new(int.MaxValue, useReplaceForUpdates, false);
}

/// <summary>
/// System wide default values for binding operators.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Related Files.")]
public static class DynamicDataOptions
{
/// <summary>
/// Gets or sets the default values for all binding operations.
/// </summary>
public static BindingOptions Binding { get; set; } = new(BindingOptions.DefaultResetThreshold);
}
1 change: 1 addition & 0 deletions src/DynamicData/Cache/ObservableCacheEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Runtime.CompilerServices;
using DynamicData;
using DynamicData.Binding;
using DynamicData.Cache;
using DynamicData.Cache.Internal;
Expand Down
18 changes: 18 additions & 0 deletions src/DynamicData/DynamicDataOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) 2011-2023 Roland Pheasant. All rights 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 DynamicData.Binding;

namespace DynamicData;

/// <summary>
/// System wide options container.
/// </summary>
public static class DynamicDataOptions
{
/// <summary>
/// Gets or sets the default values for all binding operations.
/// </summary>
public static BindingOptions Binding { get; set; } = new(BindingOptions.DefaultResetThreshold);
}
2 changes: 1 addition & 1 deletion src/DynamicData/List/ObservableListEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;

using DynamicData;
using DynamicData.Binding;
using DynamicData.Cache.Internal;
using DynamicData.Kernel;
Expand Down