Exemplo n.º 1
0
        public static string To <T>(T obj)
        {
            Type type   = typeof(T);
            var  output = new StringBuilder();

            output.Append("<?xml version=\"1.0\"?>\n");

            XMLTypeHandler handler = XMLHelpers.GetTypeHandler(type);

            if (handler == null)
            {
                return(null);
            }
            handler.Serialize(obj, output);
            return(output.ToString());
        }
Exemplo n.º 2
0
 public XMLFieldHandler(XMLReflectionHandler field, XMLTypeHandler typeHandler)
 {
     ReflectionInfo = field;
     TypeHandler    = typeHandler;
     Name           = ReflectionInfo?.Name ?? XMLHelpers.GetTypeName(TypeHandler.Type);
 }