Beispiel #1
0
        private static XmlNode CreateBlockStatementNode(BlockStatement e, XmlDocument xmlDoc, Nullable <System.Windows.Point> point = null)
        {
            XmlNode exNode = CreateNode(xmlDoc, "BlockStatement", "type", GetTypeName(e.GetType()));

            if (point != null)
            {
                exNode.Attributes.Append(CreateAttribute(xmlDoc, "x", point.Value.X + ""));
                exNode.Attributes.Append(CreateAttribute(xmlDoc, "y", point.Value.Y + ""));
            }
            //xmlDoc.CreateElement("BlockStatement");
            XmlNode bNode = xmlDoc.CreateElement("Body");

            exNode.AppendChild(bNode);

            foreach (Statement s in e.Body)
            {
                bNode.AppendChild(CreateStatementNode(s, xmlDoc));
            }
            return(exNode);
        }