void FillNode(GlowNodeBase glow, XElement xml)
        {
            var contentsXml = xml.Element("contents");

            if (contentsXml != null)
            {
                contentsXml.Element("identifier").Do(value => glow.Identifier   = value);
                contentsXml.Element("description").Do(value => glow.Description = value);
                contentsXml.Element("isRoot").Do(value => glow.IsRoot           = XmlConvert.ToBoolean(value));
                contentsXml.Element("isOnline").Do(value => glow.IsOnline       = XmlConvert.ToBoolean(value));
            }

            var childrenXml = xml.Element("children");

            if (childrenXml != null)
            {
                FillElementCollection(glow.EnsureChildren(), childrenXml);
            }
        }
        void ConvertNode(GlowNodeBase glow, XmlWriter writer)
        {
            if (glow.HasContents)
            {
                writer.WriteStartElement("contents");
                glow.Identifier.Do(value => writer.WriteElementString("identifier", value));
                glow.Description.Do(value => writer.WriteElementString("description", value));
                glow.IsRoot.Do(value => writer.WriteElementString("isRoot", XmlConvert.ToString(value)));
                glow.IsOnline.Do(value => writer.WriteElementString("isOnline", XmlConvert.ToString(value)));
                writer.WriteEndElement();
            }

            var children = glow.Children;

            if (children != null)
            {
                writer.WriteStartElement("children");
                children.Accept(this, writer);
                writer.WriteEndElement();
            }
        }
 protected override void OnNode(GlowNodeBase glow, int[] path)
 {
 }
Exemplo n.º 4
0
        void FillNode(GlowNodeBase glow, XElement xml)
        {
            var contentsXml = xml.Element("contents");

             if(contentsXml != null)
             {
            contentsXml.Element("identifier").Do(value => glow.Identifier = value);
            contentsXml.Element("description").Do(value => glow.Description = value);
            contentsXml.Element("isRoot").Do(value => glow.IsRoot = XmlConvert.ToBoolean(value));
            contentsXml.Element("isOnline").Do(value => glow.IsOnline = XmlConvert.ToBoolean(value));
             }

             var childrenXml = xml.Element("children");

             if(childrenXml != null)
            FillElementCollection(glow.EnsureChildren(), childrenXml);
        }