Esempio n. 1
0
    public void RunTest()
    {
      XmlSerializer x = new XmlSerializer(typeof(Configuration));

      string xmlFileName = @"..\HydroNumerics\MikeSheTools\TestData\IrrigationConfiguration.xml";
      Configuration Cf;
        using (FileStream fs =new System.IO.FileStream(xmlFileName, System.IO.FileMode.Open))
          Cf = (Configuration)x.Deserialize(fs);
     
      Controller C = new Controller(Cf);

      C.Run();

    }
Esempio n. 2
0
    public static void Main(string[] args)
    {

      XmlSerializer x = new XmlSerializer(typeof(Configuration));

      Configuration Cf;
      string xmlfile;
      string shefile;
      if (args.Length == 2)
      {
        if (Path.GetExtension(args[0]).ToLower() == ".xml")
        {
          xmlfile = args[0];
          shefile = args[1];
        }
        else
        {
          xmlfile = args[1];
          shefile = args[0];
        }

        using (FileStream fs = new FileStream(xmlfile, System.IO.FileMode.Open))
        {
          Cf = (Configuration)x.Deserialize(fs);
        }
        Cf.SheFile = shefile;
      }
      else
      {
        using (FileStream fs = new FileStream(args[0], System.IO.FileMode.Open))
          Cf = (Configuration)x.Deserialize(fs);
      }

      Console.WriteLine("XML-input file read");
      Controller C = new Controller(Cf);
      C.Run();
      Console.ReadLine();

    }