using CommonSerializeDefine; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace CommonSerializing { public class Serializer : SerializerBase, ISerializer { public IEnumerable> Serialize(Type targetType, object obj) { throw new NotImplementedException(); } public string SerializeData(Type targetType, object data) { ITypeSerializer serializer = EnsureSerializer(targetType); return serializer.Serialize(data, targetType, this); } private IEnumerable GetFields(Type targetType) { foreach (var item in targetType.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) { yield return item; } } //private IEnumerable> FlattenFields(object obj, List stack) //{ // Type type = obj.GetType(); // foreach (var item in GetFields(type)) // { // Type fieldType = item.FieldType; // ITypeSerializer typeSerializer = TryGetSerializer(fieldType); // if (typeSerializer != null) // { // } // else // { // } // } //} } }