/// <summary>
    /// Reads and parses the configuration element
    /// </summary>
    /// <param name="Configuration"></param>
    public override void ReadConfiguration(XElement Configuration)
    {
      base.ReadConfiguration(Configuration);
      if (Update)
      {
        var Unsatelement = Configuration.Element("UnsatFiles");
        if (Unsatelement != null)
        {
          foreach (var parfile in Unsatelement.Elements("UnsatFile"))
          {
            UZAgeDefinition uzd = new UZAgeDefinition();
            uzd.FileName = new SafeFile() { FileName = parfile.SafeParseString("DFS2FileName") };
            uzd.FileName.ColumnNames.Add(parfile.SafeParseString("ItemName"));
            uzd.MinHorizontalTravelDistance =parfile.SafeParseDouble("MinHorizontalTravelDistance") ?? 0;
            uzd.MinTravelTime = parfile.SafeParseDouble("MinTravelTime") ?? 0;

            UnsatAgeFiles.Add(uzd);
          }
        }

        
        var daisyelement =Configuration.Element("DaisyFiles");

        var startyear = daisyelement.SafeParseInt("RecycleStartYear");
        int startmonth = daisyelement.SafeParseInt("RecycleStartMonth") ??1;

        if (startyear.HasValue)
          RecycleStart = new DateTime(startyear.Value, startmonth, 1);

        var endyear = daisyelement.SafeParseInt("RecycleEndYear");
        int endmonth = daisyelement.SafeParseInt("RecycleEndMonth") ?? 1;
        if (endyear.HasValue)
          RecycleEnd = new DateTime(endyear.Value, endmonth, 1);
        RecycleScale = daisyelement.SafeParseDouble("RecycleScaleFactor") ?? 1;

        foreach (var parfile in daisyelement.Elements("DaisyFile"))
        {
          DaisyFiles.Add(new SafeFile() { FileName = parfile.SafeParseString("FileName") });
        }

        var pFiles =Configuration.Element("ParticleFiles");
        UseUnsatFilter = pFiles.SafeParseBool("RemoveUnsatParticles") ?? false;
        DrainToBoundaryOption = pFiles.SafeParseBool("DrainToBoundaryCorrection") ?? false;


        foreach (var parfile in pFiles.Elements("ParticleFile"))
        {
          ParticleFiles.Add(new SafeFile() { FileName = parfile.SafeParseString("ShapeFileName") });
        }

        SoilCodes = new SafeFile() { FileName = Configuration.Element("SoilCodes").SafeParseString("ShapeFileName") };
      }
    }
        /// <summary>
        /// Reads and parses the configuration element
        /// </summary>
        /// <param name="Configuration"></param>
        public override void ReadConfiguration(XElement Configuration)
        {
            base.ReadConfiguration(Configuration);
            if (Update)
            {
                var Unsatelement = Configuration.Element("UnsatFiles");
                if (Unsatelement != null)
                {
                    foreach (var parfile in Unsatelement.Elements("UnsatFile"))
                    {
                        UZAgeDefinition uzd = new UZAgeDefinition();
                        uzd.FileName = new SafeFile()
                        {
                            FileName = parfile.SafeParseString("DFS2FileName")
                        };
                        uzd.FileName.ColumnNames.Add(parfile.SafeParseString("ItemName"));
                        uzd.MinHorizontalTravelDistance = parfile.SafeParseDouble("MinHorizontalTravelDistance") ?? 0;
                        uzd.MinTravelTime = parfile.SafeParseDouble("MinTravelTime") ?? 0;

                        UnsatAgeFiles.Add(uzd);
                    }
                }


                var daisyelement = Configuration.Element("DaisyFiles");

                var startyear  = daisyelement.SafeParseInt("RecycleStartYear");
                int startmonth = daisyelement.SafeParseInt("RecycleStartMonth") ?? 1;

                if (startyear.HasValue)
                {
                    RecycleStart = new DateTime(startyear.Value, startmonth, 1);
                }

                var endyear  = daisyelement.SafeParseInt("RecycleEndYear");
                int endmonth = daisyelement.SafeParseInt("RecycleEndMonth") ?? 1;
                if (endyear.HasValue)
                {
                    RecycleEnd = new DateTime(endyear.Value, endmonth, 1);
                }
                RecycleScale = daisyelement.SafeParseDouble("RecycleScaleFactor") ?? 1;

                foreach (var parfile in daisyelement.Elements("DaisyFile"))
                {
                    DaisyFiles.Add(new SafeFile()
                    {
                        FileName = parfile.SafeParseString("FileName")
                    });
                }

                var pFiles = Configuration.Element("ParticleFiles");
                UseUnsatFilter        = pFiles.SafeParseBool("RemoveUnsatParticles") ?? false;
                DrainToBoundaryOption = pFiles.SafeParseBool("DrainToBoundaryCorrection") ?? false;


                foreach (var parfile in pFiles.Elements("ParticleFile"))
                {
                    ParticleFiles.Add(new SafeFile()
                    {
                        FileName = parfile.SafeParseString("ShapeFileName")
                    });
                }

                SoilCodes = new SafeFile()
                {
                    FileName = Configuration.Element("SoilCodes").SafeParseString("ShapeFileName")
                };
            }
        }