Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntList2XmlFormatter.cs @ 1623

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

Namespace refactoring, visibility check (#548)

File size: 760 bytes
Line 
1using System.Collections;
2using System.Collections.Generic;
3using System;
4using HeuristicLab.Persistence.Core;
5using HeuristicLab.Persistence.Default.Decomposers.Storable;
6
7namespace HeuristicLab.Persistence.Default.Xml.Compact {
8
9  [EmptyStorableClass]
10  public class IntList2XmlFormatter : NumberEnumeration2XmlFormatterBase<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.