private BoxCaseSolution LoadBoxCaseSolution(XmlElement eltSolution) { // pattern string patternName = eltSolution.Attributes["Pattern"].Value; // orientation HalfAxis.HAxis orthoAxis = HalfAxis.Parse(eltSolution.Attributes["OrthoAxis"].Value); // instantiate box case solution BoxCaseSolution sol = new BoxCaseSolution(null, orthoAxis, patternName); // limit reached if (eltSolution.HasAttribute("LimitReached")) { string sLimitReached = eltSolution.Attributes["LimitReached"].Value; sol.LimitReached = (BoxCaseSolution.Limit)(int.Parse(sLimitReached)); } // layers XmlElement eltLayers = eltSolution.ChildNodes[0] as XmlElement; foreach (XmlNode nodeLayer in eltLayers.ChildNodes) { BoxLayer boxLayer = LoadLayer(nodeLayer as XmlElement) as BoxLayer; sol.Add(boxLayer); } return sol; }