public string ToXmlString(IProblemInstance problem)
        {
            var serializer = typeof(XmlStringSerializer <>).MakeGenericType(problem.GetType());
            var method     = serializer.GetMethod("ToXmlString");
            var ser        = Activator.CreateInstance(serializer);

            return((string)method.Invoke(ser, new object[] { problem }));
        }
Beispiel #2
0
 public byte[] ToByteArray(IProblemInstance problem)
 {
     return(Encoding.UTF8.GetBytes(_serializer.ToXmlString(problem)));
 }