public static D FileToObject <D>(string file, int proj = 0x00ff) where D : IData, new() { try { byte[] bytes = File.ReadAllBytes(file); JObj jo = (JObj) new JsonParse(bytes, bytes.Length).Parse(); if (jo != null) { return(jo.ToObject <D>(proj)); } } catch (Exception ex) { Debug.WriteLine(ex.Message); } return(default(D)); }
public static D StringToObject <D>(string v, int proj = 0x00ff) where D : IData, new() { JObj jo = (JObj) new JsonParse(v).Parse(); return(jo.ToObject <D>(proj)); }