예제 #1
0
		/// <summary>
		/// Helper for xml writing.
		/// </summary>
		/// <param name="a_stream"></param>
		/// <param name="a_write_func"></param>
		public static void WriteXml(Stream a_stream, Action<XmlWriter> a_write_func)
		{
			XmlWriterSettings settings = new XmlWriterSettings();
			settings.Indent = true;

			using (XmlWriter writer = new NoNamespacesXmlWriter(XmlWriter.Create(a_stream, settings)))
			{
				writer.WriteStartDocument();
				a_write_func(writer);
				writer.WriteEndDocument();
			}
		}
예제 #2
0
        /// <summary>
        /// Helper for xml writing.
        /// </summary>
        /// <param name="aStream"></param>
        /// <param name="aWriteFunc"></param>
        public static void WriteXml(Stream aStream, Action <XmlWriter> aWriteFunc)
        {
            var settings = new XmlWriterSettings {
                Indent = true
            };

            using (XmlWriter writer = new NoNamespacesXmlWriter(XmlWriter.Create(aStream, settings)))
            {
                writer.WriteStartDocument();
                aWriteFunc(writer);
                writer.WriteEndDocument();
            }
        }