Mercurial > repos > snowblizz-super-API-ideas
diff api/Factories/Xml/WarFoundryXmlSaver.cs @ 82:3ea0ab04352b
* Fix line terminators
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 27 Jun 2009 18:59:49 +0000 |
parents | 306558904c2a |
children | 2f3cafb69799 |
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlSaver.cs Wed May 27 19:43:09 2009 +0000 +++ b/api/Factories/Xml/WarFoundryXmlSaver.cs Sat Jun 27 18:59:49 2009 +0000 @@ -29,7 +29,7 @@ return saver; } - public bool SaveAs(WarFoundryObject toSave, string saveAsPath) + public bool SaveAs(WarFoundryObject toSave, string saveAsPath) { if (CanSaveType(toSave)) { @@ -37,12 +37,12 @@ bool success = false; try - { - fs = new FileStream(saveAsPath, FileMode.Create, FileAccess.Write); - byte[] bytes = StringManipulation.StringToBytes(CreateXmlString(toSave)); - fs.Write(bytes, 0, bytes.Length); + { + fs = new FileStream(saveAsPath, FileMode.Create, FileAccess.Write); + byte[] bytes = StringManipulation.StringToBytes(CreateXmlString(toSave)); + fs.Write(bytes, 0, bytes.Length); fs.Flush(); - savePaths.Add(toSave, saveAsPath); + savePaths.Add(toSave, saveAsPath); success = true; } finally @@ -58,7 +58,7 @@ else { throw new ArgumentException("Cannot directly save objects of type "+toSave.GetType()); - } + } } public bool Save(WarFoundryObject toSave)