void FillFunction(GlowFunctionBase 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);

                var argumentsXml = contentsXml.Element("arguments");
                if (argumentsXml != null)
                {
                    glow.Arguments = ConvertTupleDescription(GlowTags.FunctionContents.Arguments, argumentsXml);
                }

                var resultXml = contentsXml.Element("result");
                if (resultXml != null)
                {
                    glow.Result = ConvertTupleDescription(GlowTags.FunctionContents.Result, resultXml);
                }
            }

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

            if (childrenXml != null)
            {
                FillElementCollection(glow.EnsureChildren(), childrenXml);
            }
        }
        void ConvertFunction(GlowFunctionBase 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));

                var arguments = glow.TypedArguments;
                if (arguments != null)
                {
                    writer.WriteStartElement("arguments");
                    ConvertTupleDescription(arguments, writer);
                    writer.WriteEndElement();
                }

                var result = glow.TypedResult;
                if (result != null)
                {
                    writer.WriteStartElement("result");
                    ConvertTupleDescription(result, writer);
                    writer.WriteEndElement();
                }

                writer.WriteEndElement();
            }

            var children = glow.Children;

            if (children != null)
            {
                writer.WriteStartElement("children");
                children.Accept(this, writer);
                writer.WriteEndElement();
            }
        }
 protected override void OnFunction(GlowFunctionBase glow, int[] path)
 {
 }
Example #4
0
        void FillFunction(GlowFunctionBase 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);

            var argumentsXml = contentsXml.Element("arguments");
            if(argumentsXml != null)
               glow.Arguments = ConvertTupleDescription(GlowTags.FunctionContents.Arguments, argumentsXml);

            var resultXml = contentsXml.Element("result");
            if(resultXml != null)
               glow.Result = ConvertTupleDescription(GlowTags.FunctionContents.Result, resultXml);
             }

             var childrenXml = xml.Element("children");
             if(childrenXml != null)
            FillElementCollection(glow.EnsureChildren(), childrenXml);
        }