public static IEnumerable <SerialElement> DeserializeByJson(string Json) { SerializeJSON serializeJSON = JsonConvert.DeserializeObject <SerializeJSON>(Json); return(serializeJSON.Materials.Values.ToList <SerialElement>() .Concat(serializeJSON.ElementTypes.Values.ToList <SerialElement>()) .Concat(serializeJSON.HostObjTypes.Values.ToList <SerialElement>()) .Concat(serializeJSON.Views.Values.ToList <SerialElement>()) .Concat(serializeJSON.Elements)); }
public static string SerializeToJson(List <SerialElement> serialList) { SerializeJSON serializeJSON = new SerializeJSON(); foreach (SerialElement se in serialList) { serializeJSON._sortSerialElement(se); } return(Newtonsoft.Json.JsonConvert.SerializeObject(serializeJSON, Formatting.Indented)); }