Exemple #1
0
 public static D[] FileToArray <D>(string file, int proj = 0x00ff) where D : IData, new()
 {
     try
     {
         byte[] bytes = File.ReadAllBytes(file);
         JArr   ja    = (JArr) new JsonParse(bytes, bytes.Length).Parse();
         if (ja != null)
         {
             return(ja.ToArray <D>(proj));
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
     return(null);
 }
Exemple #2
0
        public static D[] StringToArray <D>(string v, int proj = 0x00ff) where D : IData, new()
        {
            JArr ja = (JArr) new JsonParse(v).Parse();

            return(ja.ToArray <D>(proj));
        }