mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 06:28:35 +01:00
made json converter collection code a bit cleaner
This commit is contained in:
parent
d0370e583e
commit
2744f7d806
1 changed files with 2 additions and 2 deletions
|
@ -6,8 +6,8 @@ using Newtonsoft.Json;
|
||||||
namespace MLEM.Data.Json {
|
namespace MLEM.Data.Json {
|
||||||
public class JsonConverters {
|
public class JsonConverters {
|
||||||
|
|
||||||
public static readonly JsonConverter[] Converters = Assembly.GetExecutingAssembly().GetExportedTypes()
|
public static readonly JsonConverter[] Converters = typeof(JsonConverters).Assembly.GetExportedTypes()
|
||||||
.Where(t => t.Namespace == typeof(JsonConverters).Namespace && t.IsSubclassOf(typeof(JsonConverter)))
|
.Where(t => t.IsSubclassOf(typeof(JsonConverter)))
|
||||||
.Select(t => t.GetConstructor(Type.EmptyTypes).Invoke(null)).Cast<JsonConverter>().ToArray();
|
.Select(t => t.GetConstructor(Type.EmptyTypes).Invoke(null)).Cast<JsonConverter>().ToArray();
|
||||||
|
|
||||||
public static JsonSerializer AddAll(JsonSerializer serializer) {
|
public static JsonSerializer AddAll(JsonSerializer serializer) {
|
||||||
|
|
Loading…
Reference in a new issue