Ejemplo n.º 1
0
        public static NamedDataStream ToNamedDataStream(
            this XElement Elem, XNamespace Namespace)
        {
            NamedDataStream model = null;

            if (Elem != null)
            {
                model                 = new NamedDataStream();
                model.Name            = Elem.Element(Namespace + "Name").StringOrDefault("");
                model.DataStreamLines =
                    Elem.ToEnumerableOfString(Namespace, "DataStreamLines", "Item").ToList();
            }
            return(model);
        }
Ejemplo n.º 2
0
 public static XElement ToXElement(this NamedDataStream Model, XName Name)
 {
     if (Model == null)
     {
         return(new XElement(Name, null));
     }
     else
     {
         XElement xe = new XElement(Name,
                                    new XElement("Name", Model.Name),
                                    Model.DataStreamLines.RemoveEmptyOrBlankItems( ).ToXElement("DataStreamLines", "Item")
                                    );
         return(xe);
     }
 }