mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-10 18:24:53 +00:00
Merge remote-tracking branch 'origin/MetLife_v5.2' into MetLife_v5.3
# Conflicts: # ICD.Common.Utils/Json/JsonItemWrapper.cs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using ICD.Common.Utils.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -77,7 +78,20 @@ namespace ICD.Common.Utils.Json
|
||||
type = Type.GetType(typeString);
|
||||
}
|
||||
|
||||
if (type == null)
|
||||
{
|
||||
typeString = AddSimplSharpSuffix(typeString);
|
||||
type = Type.GetType(typeString);
|
||||
}
|
||||
|
||||
return JsonConvert.DeserializeObject(itemString, type);
|
||||
}
|
||||
|
||||
private static string AddSimplSharpSuffix(string typeString)
|
||||
{
|
||||
return Regex.Replace(typeString,
|
||||
"(?'prefix'[^,]+, )(?'assembly'[^,]*)(?'suffix', .*)",
|
||||
"${prefix}${assembly}_SimplSharp${suffix}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user