public static bool DoWrite <T>(IWriter writer, List <T> val, string name, WritCallback <T> call) { if (!writer.ArrayBegin(val.Count, name)) { return(false); } for (int i = 0; i < val.Count; ++i) { call(writer, val[i], null); } return(writer.ArrayEnd()); }
public static bool DoWrite <T, L>(IWriter writer, FixedArray <T, L> val, string name, WritCallback <T> call) where T : new() where L : IArrayLength, new() { for (int i = 0; i < val.Length; ++i) { //string valName = string.Format("{0}_{1}", string.IsNullOrEmpty(name) ? "" : name, i); call(writer, val[i], null); } return(true); }