Skip to content

Commit

Permalink
Remove obsolete code (#918)
Browse files Browse the repository at this point in the history
* Remove obsolete code

* Update API file
  • Loading branch information
RolandPheasant committed Jul 11, 2024
1 parent 01d1119 commit 7f2b220
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -736,12 +736,6 @@ namespace DynamicData
void AddOrUpdate(TObject item, TKey key);
void Clear();
void Clone(DynamicData.IChangeSet<TObject, TKey> changes);
[System.Obsolete("Use Refresh: Same thing but better semantics")]
void Evaluate();
[System.Obsolete("Use Refresh: Same thing but better semantics")]
void Evaluate(System.Collections.Generic.IEnumerable<TKey> keys);
[System.Obsolete("Use Refresh: Same thing but better semantics")]
void Evaluate(TKey key);
TKey GetKey(TObject item);
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TObject>> GetKeyValues(System.Collections.Generic.IEnumerable<TObject> items);
void Refresh();
Expand Down Expand Up @@ -951,10 +945,6 @@ namespace DynamicData
void AddOrUpdate(TObject item);
void AddOrUpdate(System.Collections.Generic.IEnumerable<TObject> items, System.Collections.Generic.IEqualityComparer<TObject> comparer);
void AddOrUpdate(TObject item, System.Collections.Generic.IEqualityComparer<TObject> comparer);
[System.Obsolete("Use Refresh: Same thing but better semantics")]
void Evaluate(System.Collections.Generic.IEnumerable<TObject> items);
[System.Obsolete("Use Refresh: Same thing but better semantics")]
void Evaluate(TObject item);
void Load(System.Collections.Generic.IEnumerable<TObject> items);
void Refresh(System.Collections.Generic.IEnumerable<TObject> items);
void Refresh(TObject item);
Expand Down Expand Up @@ -1295,18 +1285,6 @@ namespace DynamicData
public static System.IObservable<DynamicData.IChangeSet<TObject, TKey>> EnsureUniqueKeys<TObject, TKey>(this System.IObservable<DynamicData.IChangeSet<TObject, TKey>> source)
where TObject : notnull
where TKey : notnull { }
[System.Obsolete("Use Refresh: Same thing but better semantics")]
public static void Evaluate<TObject, TKey>(this DynamicData.ISourceCache<TObject, TKey> source)
where TObject : notnull
where TKey : notnull { }
[System.Obsolete("Use Refresh: Same thing but better semantics")]
public static void Evaluate<TObject, TKey>(this DynamicData.ISourceCache<TObject, TKey> source, System.Collections.Generic.IEnumerable<TObject> items)
where TObject : notnull
where TKey : notnull { }
[System.Obsolete("Use Refresh: Same thing but better semantics")]
public static void Evaluate<TObject, TKey>(this DynamicData.ISourceCache<TObject, TKey> source, TObject item)
where TObject : notnull
where TKey : notnull { }
public static System.IObservable<DynamicData.IChangeSet<TObject, TKey>> Except<TObject, TKey>(this DynamicData.IObservableList<DynamicData.IObservableCache<TObject, TKey>> sources)
where TObject : notnull
where TKey : notnull { }
Expand Down
20 changes: 0 additions & 20 deletions src/DynamicData/Cache/ICacheUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,6 @@ public interface ICacheUpdater<TObject, TKey> : IQuery<TObject, TKey>
/// <param name="changes">The changes to clone.</param>
void Clone(IChangeSet<TObject, TKey> changes);

/// <summary>
/// Sends a signal for operators to recalculate it's state.
/// </summary>
[Obsolete(Constants.EvaluateIsDead)]
void Evaluate();

/// <summary>
/// Refreshes the items matching the specified keys.
/// </summary>
/// <param name="keys">The keys.</param>
[Obsolete(Constants.EvaluateIsDead)]
void Evaluate(IEnumerable<TKey> keys);

/// <summary>
/// Refreshes the item matching the specified key.
/// </summary>
/// <param name="key">The key to evaluate.</param>
[Obsolete(Constants.EvaluateIsDead)]
void Evaluate(TKey key);

/// <summary>
/// Gets the key associated with the object.
/// </summary>
Expand Down
14 changes: 0 additions & 14 deletions src/DynamicData/Cache/ISourceUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,6 @@ public interface ISourceUpdater<TObject, TKey> : ICacheUpdater<TObject, TKey>
/// <param name="comparer">The comparer.</param>
void AddOrUpdate(TObject item, IEqualityComparer<TObject> comparer);

/// <summary>
/// Refreshes the specified items.
/// </summary>
/// <param name="items">The items.</param>
[Obsolete(Constants.EvaluateIsDead)]
void Evaluate(IEnumerable<TObject> items);

/// <summary>
/// Refreshes the specified item.
/// </summary>
/// <param name="item">The item.</param>
[Obsolete(Constants.EvaluateIsDead)]
void Evaluate(TObject item);

/// <summary>
/// Clears existing values and loads the specified items.
/// </summary>
Expand Down
15 changes: 0 additions & 15 deletions src/DynamicData/Cache/Internal/CacheUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,6 @@ public void AddOrUpdate(IEnumerable<KeyValuePair<TKey, TObject>> itemsPairs)

public void Clone(IChangeSet<TObject, TKey> changes) => _cache.Clone(changes);

[Obsolete(Constants.EvaluateIsDead)]
public void Evaluate(IEnumerable<TKey> keys) => Refresh(keys);

[Obsolete(Constants.EvaluateIsDead)]
public void Evaluate(IEnumerable<TObject> items) => Refresh(items);

[Obsolete(Constants.EvaluateIsDead)]
public void Evaluate(TObject item) => Refresh(item);

[Obsolete(Constants.EvaluateIsDead)]
public void Evaluate() => Refresh();

[Obsolete(Constants.EvaluateIsDead)]
public void Evaluate(TKey key) => Refresh(key);

public TKey GetKey(TObject item)
{
if (_keySelector is null)
Expand Down
53 changes: 0 additions & 53 deletions src/DynamicData/Cache/ObservableCacheEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,59 +1205,6 @@ public static IObservable<IChangeSet<TObject, TKey>> EnsureUniqueKeys<TObject, T
return new UniquenessEnforcer<TObject, TKey>(source).Run();
}

/// <summary>
/// Signal observers to re-evaluate the specified item.
/// </summary>
/// <typeparam name="TObject">The type of the object.</typeparam>
/// <typeparam name="TKey">The type of the key.</typeparam>
/// <param name="source">The source.</param>
/// <param name="item">The item.</param>
/// <exception cref="ArgumentNullException">source.</exception>
[Obsolete(Constants.EvaluateIsDead)]
public static void Evaluate<TObject, TKey>(this ISourceCache<TObject, TKey> source, TObject item)
where TObject : notnull
where TKey : notnull
{
source.ThrowArgumentNullExceptionIfNull(nameof(source));

source.Edit(updater => updater.Refresh(item));
}

/// <summary>
/// Signal observers to re-evaluate the specified items.
/// </summary>
/// <typeparam name="TObject">The type of the object.</typeparam>
/// <typeparam name="TKey">The type of the key.</typeparam>
/// <param name="source">The source.</param>
/// <param name="items">The items.</param>
/// <exception cref="ArgumentNullException">source.</exception>
[Obsolete(Constants.EvaluateIsDead)]
public static void Evaluate<TObject, TKey>(this ISourceCache<TObject, TKey> source, IEnumerable<TObject> items)
where TObject : notnull
where TKey : notnull
{
source.ThrowArgumentNullExceptionIfNull(nameof(source));

source.Edit(updater => updater.Refresh(items));
}

/// <summary>
/// Signal observers to re-evaluate the all items.
/// </summary>
/// <typeparam name="TObject">The type of the object.</typeparam>
/// <typeparam name="TKey">The type of the key.</typeparam>
/// <param name="source">The source.</param>
/// <exception cref="ArgumentNullException">source.</exception>
[Obsolete(Constants.EvaluateIsDead)]
public static void Evaluate<TObject, TKey>(this ISourceCache<TObject, TKey> source)
where TObject : notnull
where TKey : notnull
{
source.ThrowArgumentNullExceptionIfNull(nameof(source));

source.Edit(updater => updater.Refresh());
}

/// <summary>
/// Dynamically apply a logical Except operator between the collections
/// Items from the first collection in the outer list are included unless contained in any of the other lists.
Expand Down
1 change: 0 additions & 1 deletion src/DynamicData/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace DynamicData;

internal static class Constants
{
public const string EvaluateIsDead = "Use Refresh: Same thing but better semantics";
public const string VirtualizeIsObsolete = "Use SortAndVirtualize as it's more efficient";
public const string PageIsObsolete = "Use SortAndPage as it's more efficient";
public const string TopIsObsolete = "Use Overload with comparer as it's more efficient";
Expand Down

0 comments on commit 7f2b220

Please sign in to comment.