1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-25 17:59:24 +01:00

made json converter collection code a bit cleaner

This commit is contained in:
Ellpeck 2020-02-27 19:43:36 +01:00
parent d0370e583e
commit 2744f7d806

View file

@ -6,8 +6,8 @@ using Newtonsoft.Json;
namespace MLEM.Data.Json {
public class JsonConverters {
public static readonly JsonConverter[] Converters = Assembly.GetExecutingAssembly().GetExportedTypes()
.Where(t => t.Namespace == typeof(JsonConverters).Namespace && t.IsSubclassOf(typeof(JsonConverter)))
public static readonly JsonConverter[] Converters = typeof(JsonConverters).Assembly.GetExportedTypes()
.Where(t => t.IsSubclassOf(typeof(JsonConverter)))
.Select(t => t.GetConstructor(Type.EmptyTypes).Invoke(null)).Cast<JsonConverter>().ToArray();
public static JsonSerializer AddAll(JsonSerializer serializer) {