make some projects compatible with netframework4.8 again
This commit is contained in:
@@ -16,15 +16,16 @@ public static class RadListDataItemCollectionExtensions
|
||||
|
||||
public static IEnumerable<RadListDataItem> AddEnumValues<T>(this RadListDataItemCollection @this, bool clearCollection, Func<T, bool>? filter, Func<T, string?>? format) where T : struct, Enum
|
||||
{
|
||||
var values = Enum.GetValues<T>();
|
||||
var values = Enum.GetValues(typeof(T));
|
||||
var items = new List<RadListDataItem>();
|
||||
|
||||
format ??= v => Enum.GetName(v);
|
||||
if (format == null)
|
||||
format = v => Enum.GetName(typeof(T), v);
|
||||
|
||||
if (clearCollection)
|
||||
@this.Clear();
|
||||
|
||||
foreach (var value in values)
|
||||
foreach (T value in values)
|
||||
{
|
||||
if (filter is null || filter(value))
|
||||
items.Add(new(format(value), value));
|
||||
|
||||
Reference in New Issue
Block a user