示例#1
0
 /// <summary>
 /// Serializes the <see cref="XElement"/> to a TOML string.
 /// </summary>
 /// <param name="toml">The <see cref="XElement"/> to convert to TOML.</param>
 /// <returns>A TOML string.</returns>
 public string SerializeXElement(XElement toml)
 {
     return(XUtils.GetStreamString(w => this.SerializeXElement(w, toml)));
 }
示例#2
0
 /// <summary>
 /// Serializes the specified object to a TOML string.
 /// </summary>
 /// <param name="obj">The object to serialize.</param>
 /// <param name="factory">
 /// The function to make a <see cref="DataContractJsonSerializer"/>.
 /// if null, it will make a <see cref="DataContractJsonSerializer"/> with default settings.
 /// </param>
 /// <returns>A TOML string.</returns>
 public string SerializeObject(object obj, Func <DataContractJsonSerializer> factory = null)
 {
     return(XUtils.GetStreamString(w => this.SerializeObject(w, obj, factory)));
 }
示例#3
0
 /// <summary>
 /// Returns the TOML for this element.
 /// </summary>
 /// <returns>A <see cref="string"/> containing the TOML.</returns>
 public override string ToString()
 {
     return(XUtils.GetStreamString(w => this.WriteTo(Toml.V04, w)));
 }