public void Populate(Hashtable values, string tagFormat) { StringTheory phrase = new StringTheory(); foreach (string str in values.Keys) { phrase.Renew(tagFormat); phrase.Replace("*", str); this.Replace(phrase, values[str]); } }
public string getXml() { StringTheory theory = new StringTheory("<%islandName%>%body%</%islandName%>\n"); StringTheory val = new StringTheory(); StringTheory theory3 = new StringTheory(); foreach (string str in this.getFieldNames()) { val.Renew(" <%fieldName%>%fieldValue%</%fieldName%>\n"); val.Replace("%fieldName%", str.ToLower()); val.Replace("%fieldValue%", ((Field)this[str]).getValue()); theory3.Append(val); } theory.Replace("%islandName%", this.StreamName.ToLower()); theory.Replace("%body%", theory3); return theory.ToString(); }