예제 #1
0
 /// <summary>
 /// Writes the content of <see cref="DynamicToml"/> to the specified stream.
 /// </summary>
 /// <param name="toml">A <see cref="Toml"/> instance to write with.</param>
 /// <param name="stream">The stream to write this <see cref="DynamicToml"/> to.</param>
 public void WriteTo(Toml toml, Stream stream)
 {
     this.WriteTo(toml, new StreamWriter(stream));
 }
예제 #2
0
#pragma warning restore 1591

        /// <summary>
        /// Writes the content of <see cref="DynamicToml"/> to the specified <see cref="TextWriter"/>.
        /// </summary>
        /// <param name="toml">A <see cref="Toml"/> instance to write with.</param>
        /// <param name="writer">The <see cref="TextWriter"/> to write this <see cref="DynamicToml"/> to.</param>
        public void WriteTo(Toml toml, TextWriter writer)
        {
            toml.SerializeXElement(writer, this.element);
        }
예제 #3
0
 /// <summary>
 /// Creates a new <see cref="DynamicToml"/> instance by using the specified stream.
 /// </summary>
 /// <param name="parser">A <see cref="Toml"/> instance to parse with.</param>
 /// <param name="stream">The stream that contains the TOML data.</param>
 /// <returns>An <see cref="DynamicToml"/> object used to read the data that is contained in the stream.</returns>
 public static dynamic Parse(Toml parser, Stream stream)
 {
     return(Parse(parser, new StreamReader(stream)));
 }
예제 #4
0
 /// <summary>
 /// Load an <see cref="DynamicToml"/> from a string that contains XML.
 /// </summary>
 /// <param name="parser">A <see cref="Toml"/> instance to parse with.</param>
 /// <param name="toml">A string that contains TOML.</param>
 /// <returns>A <see cref="DynamicToml"/> populated from the string that contains TOML.</returns>
 public static dynamic Parse(Toml parser, IEnumerable <char> toml)
 {
     return(new DynamicToml(parser.DeserializeXElement(toml)));
 }
예제 #5
0
 /// <summary>
 /// Loads a <see cref="DynamicToml"/> from a <see cref="TextReader"/>.
 /// </summary>
 /// <param name="parser">A <see cref="Toml"/> instance to parse with.</param>
 /// <param name="reader">A <see cref="TextReader" /> that will be read for the TOML content.</param>
 /// <returns>A <see cref="DynamicToml"/> that contains the TOML that was read from the specified <see cref="TextReader"/>.</returns>
 public static dynamic Parse(Toml parser, TextReader reader)
 {
     return(new DynamicToml(parser.DeserializeXElement(reader)));
 }