Free cookie consent management tool by TermsFeed Policy Generator

source: branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Compact/IntList2XmlFormatter.cs @ 1361

Last change on this file since 1361 was 1361, checked in by epitzer, 15 years ago

Split all classes into their own file (#506)

File size: 717 bytes
Line 
1using System.Collections;
2using System.Collections.Generic;
3using System;
4
5namespace HeuristicLab.Persistence.Default.Xml.Compact {
6 
7  public class IntList2XmlFormatter : NumberEnumeration2XmlFormatter {
8
9    public override Type Type {
10      get {
11        return typeof(List<int>);
12      }
13    }
14
15    protected override void Add(IEnumerable enumeration, object o) {
16      ((List<int>)enumeration).Add((int)o);
17    }
18
19    protected override object Instantiate() {
20      return new List<int>();
21    }
22
23    protected override string formatValue(object o) {
24      return o.ToString();
25    }
26
27    protected override object parseValue(string o) {
28      return int.Parse(o);
29    }
30  }
31
32}
Note: See TracBrowser for help on using the repository browser.