void WriteSubNode(JsonTextWriterThing writer, Node node)
        {
            writer.WritePropertyName(node.Name);
            writer.WriteStartObject();
            foreach (KeyValuePair <String, Object> pair in node.Values)
            {
                writer.WriteProperty(pair);
            }

            foreach (Node subNode in node.Children)
            {
                WriteSubNode(writer, subNode);
            }

            writer.WriteEndObject();
        }
        public void UpdateJson()
        {
            StringBuilder sb = new StringBuilder();
            StringWriter  sw = new StringWriter(sb);

            using (JsonTextWriterThing writer = new JsonTextWriterThing(sw)) {
                writer.Formatting  = Formatting.Indented;
                writer.IndentChar  = ' ';
                writer.Indentation = 2;

                writer.WriteStartObject();
                foreach (Node node in nodeManager.Nodes)
                {
                    WriteSubNode(writer, node);
                }
                writer.WriteEndObject();
            }

            Code = sb.ToString();
        }