Last change
on this file since 1835 was
1823,
checked in by epitzer, 16 years ago
|
Namespace refactoring: rename formatters & decomposers -> primitive and composite serializers. (#603)
|
File size:
771 bytes
|
Line | |
---|
1 | using System.Collections;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System;
|
---|
4 | using HeuristicLab.Persistence.Core;
|
---|
5 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.Persistence.Default.Xml.Compact {
|
---|
8 |
|
---|
9 | [EmptyStorableClass]
|
---|
10 | public class IntList2XmlSerializer : NumberEnumeration2XmlSerializerBase<List<int>> {
|
---|
11 |
|
---|
12 | protected override void Add(IEnumerable enumeration, object o) {
|
---|
13 | ((List<int>)enumeration).Add((int)o);
|
---|
14 | }
|
---|
15 |
|
---|
16 | protected override IEnumerable Instantiate() {
|
---|
17 | return new List<int>();
|
---|
18 | }
|
---|
19 |
|
---|
20 | protected override string FormatValue(object o) {
|
---|
21 | return o.ToString();
|
---|
22 | }
|
---|
23 |
|
---|
24 | protected override object ParseValue(string o) {
|
---|
25 | return int.Parse(o);
|
---|
26 | }
|
---|
27 | }
|
---|
28 |
|
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.