using System.Collections.Generic; using System.Linq; using System.Text; namespace IFramework.Serialization { public class ArrayFormatter : StringFormatter { public override void ConvertToString(T[] t, StringBuilder builder) { ListFormatter c = StringConvert.GetFormatter(typeof(List)) as ListFormatter; c.ConvertToString(t.ToList(),builder); } public override bool TryConvert(string self, out T[] result) { ListFormatter c = StringConvert.GetFormatter(typeof(List)) as ListFormatter; List list; if (!c.TryConvert(self, out list)) { result = MakeDefault(); return false; } else { result = list.ToArray(); return true; } } } }