internal static DisplayRegionGridSave FromXElement(System.Xml.Linq.XElement element) { DisplayRegionGridSave drgs = new DisplayRegionGridSave(); foreach (var subElement in element.Elements()) { switch (subElement.Name.LocalName) { case "ReferenceGrid": drgs.ReferenceGrid = ToFloatRectangleArrayArray(subElement); break; case "FirstPaintedX": drgs.FirstPaintedX = SceneSave.AsFloatList(subElement); break; case "FirstPaintedY": drgs.FirstPaintedY = SceneSave.AsFloat(subElement); break; default: throw new NotImplementedException(subElement.Name.LocalName); //break; } } return(drgs); }