public static int Main(string[] args)
{
SBMLDocument d;
int errors;
if (args.Length != 2)
{
Console.Write(Environment.NewLine
+ " usage: addModelHistory <input-filename> <output-filename>" + Environment.NewLine
+ Environment.NewLine);
return 2;
}
d = libsbml.readSBML(args[0]);
errors = (int)d.getNumErrors();
if (errors > 0)
{
Console.Write("Read Error(s):" + Environment.NewLine);
d.printErrors();
Console.Write("Correct the above and re-run." + Environment.NewLine);
}
else
{
ModelHistory h = new ModelHistory();
ModelCreator c = new ModelCreator();
c.setFamilyName("Keating");
c.setGivenName("Sarah");
c.setEmail("*****@*****.**");
c.setOrganization("University of Hertfordshire");
long status = h.addCreator(c);
printStatus("Status for addCreator: ", status);
Date date = new Date("1999-11-13T06:54:32");
Date date2 = new Date("2007-11-30T06:54:00-02:00");
status = h.setCreatedDate(date);
printStatus("Set created date: ", status);
status = h.setModifiedDate(date2);
printStatus("Set modified date: ", status);
status = d.getModel().setModelHistory(h);
printStatus("Set model history: ", status);
libsbml.writeSBML(d, args[1]);
}
return errors;
}