예제 #1
0
 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")
                             ));
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
            }
        }