public XElement HeapResolve(object resolveObject) { if (resolveObject == null) { return(XMLUtility.CreateNullNode()); } return(HeapResolve(resolveObject, TypeManager.ConventionOf(resolveObject.GetType()))); }
internal XElement ResolveInternal(object resolveObject, string convention) { if (resolveObject == null) { return(XMLUtility.CreateNullNode()); } var serialized = XMLUtility.CreateNode(convention); ResolveToInternal(resolveObject, convention, serialized); return(serialized); }
internal XElement Resolve(object resolveObject) { if (resolveObject == null) { return(XMLUtility.CreateNullNode()); } var convention = TypeManager.ConventionOf(resolveObject.GetType()); var serialized = XMLUtility.CreateNode(convention); ResolveToInternal(resolveObject, convention, serialized); return(serialized); }
/// <summary> /// Сериализирует объект, наиболее подходящим для него способом. /// Допускается значение null. /// </summary> /// <param name="resolveObject"></param> /// <returns></returns> public XElement AutoResolve(object resolveObject) { if (resolveObject == null) { return(XMLUtility.CreateNullNode()); } var type = resolveObject.GetType(); //Запоминаем тип //TODO REMOVE THIS var conventionType = TypeManager.ConventionOf(type); //Получаем условное обозночение типа //Для начала пытаемся понять с чем мы вообще работаем //TODO WORKING WITH TYPE MANAGER! if (SerializationUtility.Targeting.IsSaveReferenceInternal(type)) { return(HeapResolve(resolveObject, conventionType)); } return(ResolveInternal(resolveObject, conventionType)); }