public static XElement ToXElement(this ScreenDefnList Model, XName Name) { if (Model == null) { return(new XElement(Name)); } else { return(new XElement(Name, from c in Model select c.ToXElement("ScreenDefn") )); } }
public static ScreenDefnList RecallFromXmlFile(string ScreenDefnPath) { ScreenDefnList defnList = null; if (File.Exists(ScreenDefnPath) == true) { try { var text = System.IO.File.ReadAllText(ScreenDefnPath); defnList = ScreenDefnList.ReadXml(text); } catch (Exception excp) { Debug.Print(excp.ToString()); throw excp; } } return(defnList); }
public static ScreenDefnList ToScreenDefnList( this XElement Elem, XNamespace Namespace) { if (Elem == null) { return(new ScreenDefnList()); } else { var sl = from c in Elem.Elements(Namespace + "ScreenDefn") select c.ToScreenDefn(Namespace); var defnList = new ScreenDefnList(); foreach (var sf in sl) { defnList.Add(sf); } return(defnList); } }