Changeset 1363 for branches/New Persistence Exploration/Persistence/Test
- Timestamp:
- 03/19/09 14:19:58 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New Persistence Exploration/Persistence/Test/NewSerializationTest.cs
r1362 r1363 154 154 r.dict.Add("two", 2); 155 155 r.dict.Add("three", 3); 156 Serializer s = new Serializer(r, ConfigurationService.Instance.GetDefaultConfig(XmlFormat.Instance)); 157 XmlGenerator xmlGenerator = new XmlGenerator(); 158 StreamWriter writer = new StreamWriter("test.xml"); 159 foreach (ISerializationToken token in s) { 160 string line = xmlGenerator.Format(token); 161 writer.Write(line); 162 Console.Out.Write(line); 163 } 164 writer.Close(); 165 writer = new StreamWriter("test-types.xml"); 166 foreach (string line in xmlGenerator.Format(s.TypeCache)) { 167 writer.WriteLine(line); 168 Console.Out.WriteLine(line); 169 } 170 writer.Close(); 171 172 XmlParser parser = new XmlParser(new StreamReader("test.xml")); 173 DeSerializer deSerializer = new DeSerializer( 174 XmlParser.ParseTypeCache(new StreamReader("test-types.xml"))); 175 object o = deSerializer.DeSerialize(parser); 156 XmlGenerator.Serialize(r, "test"); 157 object o = XmlParser.DeSerialize("test"); 176 158 Console.Out.WriteLine(Util.AutoFormat(o, true)); 177 159 }
Note: See TracChangeset
for help on using the changeset viewer.