refactor: add creature extensions

This commit is contained in:
k0t9i
2023-01-31 19:14:45 +04:00
parent 5388dea95f
commit 24e6c4a180
5 changed files with 31 additions and 5 deletions

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Domain.Common
{
public static class ObservableCollectionExtensions
{
public static void RemoveAll<T>(this ObservableCollection<T> collection,
Func<T, bool> condition)
{
for (int i = collection.Count - 1; i >= 0; i--)
{
if (condition(collection[i]))
{
collection.RemoveAt(i);
}
}
}
}
}