Mercurial > repos > IBBoard.WarFoundry.API
comparison api/Savers/Xml/WarFoundryXmlGameSystemSaver.cs @ 322:3e9b0603afad
Re #338: WarFoundry.API - Save System Data
* Alter visibility in GameSystem saver to allow for re-use of code
* Add encoding to XML
* Make use of GameSystem saver within FileSaver
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 09 Mar 2011 20:32:08 +0000 |
parents | 40a2df1f629a |
children | e0580a009e75 |
comparison
equal
deleted
inserted
replaced
321:2ba88d5fb881 | 322:3e9b0603afad |
---|---|
48 } | 48 } |
49 | 49 |
50 return success; | 50 return success; |
51 } | 51 } |
52 | 52 |
53 private string CreateXmlString(WarFoundryObject toSave) | 53 public string CreateXmlString(WarFoundryObject toSave) |
54 { | 54 { |
55 string xmlString = ""; | 55 string xmlString = ""; |
56 | 56 |
57 if (toSave is GameSystem) | 57 if (toSave is GameSystem) |
58 { | 58 { |
63 } | 63 } |
64 | 64 |
65 private string CreateGameSystemXmlString(GameSystem toSave) | 65 private string CreateGameSystemXmlString(GameSystem toSave) |
66 { | 66 { |
67 XmlDocument doc = new XmlDocument(); | 67 XmlDocument doc = new XmlDocument(); |
68 XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", null, null); | 68 XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "UTF-8", null); |
69 doc.AppendChild(declaration); | 69 doc.AppendChild(declaration); |
70 XmlSchema schema = new XmlSchema(); | 70 XmlSchema schema = new XmlSchema(); |
71 schema.Namespaces.Add("", "http://ibboard.co.uk/warfoundry/system"); | 71 schema.Namespaces.Add("", "http://ibboard.co.uk/warfoundry/system"); |
72 schema.Namespaces.Add("cats", "http://ibboard.co.uk/warfoundry/cats"); | 72 schema.Namespaces.Add("cats", "http://ibboard.co.uk/warfoundry/cats"); |
73 doc.Schemas.Add(schema); | 73 doc.Schemas.Add(schema); |