internal static SpriteFrameSave FromXElement(System.Xml.Linq.XElement element) { SpriteFrameSave sfs = new SpriteFrameSave(); foreach (var subElement in element.Elements()) { switch (subElement.Name.LocalName) { case "BorderSides": sfs.BorderSides = SceneSave.AsInt(subElement); break; case "ParentSprite": sfs.ParentSprite = SpriteSave.FromXElement(subElement); break; case "SpriteBorderWidth": sfs.SpriteBorderWidth = SceneSave.AsFloat(subElement); break; case "TextureBorderWidth": sfs.TextureBorderWidth = SceneSave.AsFloat(subElement); break; default: throw new NotImplementedException(); //break; } } return(sfs); }