mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
Merge branch 'MetLife_v5.3' of https://cs-gogs.icdpf.net/Common/Utils into MetLife_v5.3
This commit is contained in:
commit
c2b980a691
1 changed files with 14 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using ICD.Common.Utils.Extensions;
|
using ICD.Common.Utils.Extensions;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
@ -77,7 +78,20 @@ namespace ICD.Common.Utils.Json
|
||||||
type = Type.GetType(typeString);
|
type = Type.GetType(typeString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type == null)
|
||||||
|
{
|
||||||
|
typeString = AddSimplSharpSuffix(typeString);
|
||||||
|
type = Type.GetType(typeString);
|
||||||
|
}
|
||||||
|
|
||||||
return JsonConvert.DeserializeObject(itemString, type);
|
return JsonConvert.DeserializeObject(itemString, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string AddSimplSharpSuffix(string typeString)
|
||||||
|
{
|
||||||
|
return Regex.Replace(typeString,
|
||||||
|
"(?'prefix'[^,]+, )(?'assembly'[^,]*)(?'suffix', .*)",
|
||||||
|
"${prefix}${assembly}_SimplSharp${suffix}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue