private void Write(ref string data, int tab) { if (!string.IsNullOrEmpty(this.name)) { for (int i = 0; i < tab; i++) { data += "\t"; } data += DataNode.Escape(this.name); if (this.value != null) { data = data + " = " + this.GetValueString(); } data += "\n"; for (int j = 0; j < this.children.Count; j++) { this.children[j].Write(ref data, tab + 1); } } }
private void Write(StreamWriter writer, int tab) { if (!string.IsNullOrEmpty(this.name)) { for (int i = 0; i < tab; i++) { writer.Write("\t"); } writer.Write(DataNode.Escape(this.name)); if (this.value != null) { writer.Write(" = "); writer.Write(this.GetValueString()); } writer.Write("\n"); for (int j = 0; j < this.children.Count; j++) { this.children[j].Write(writer, tab + 1); } } }