/// <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(); } }
/// <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(); } }