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