Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleArray2XmlFormatters.cs @ 1542

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

Numerous small changes, coding conventions, renames, mini refactoring (#548)

File size: 984 bytes
Line 
1using System;
2using HeuristicLab.Persistence.Core;
3using System.Globalization;
4
5namespace HeuristicLab.Persistence.Default.Xml.Compact {
6
7  [EmptyStorableClass]
8  public class DoubleArray2XmlFormatter : NumberArray2XmlFormatterBase {
9
10    public override Type Type {
11      get {
12        return typeof(double[]);
13      }
14    }
15
16    protected override string FormatValue(object o) {
17      return ((double)o).ToString("r", CultureInfo.InvariantCulture);
18    }
19
20    protected override object ParseValue(string o) {
21      return double.Parse(o);
22    }
23  }
24
25  [EmptyStorableClass]
26  public class Double2DArray2XmlFormatter : DoubleArray2XmlFormatter {
27    public override Type Type {
28      get {
29        return typeof(double[,]);
30      }
31    }
32  }
33
34  [EmptyStorableClass]
35  public class Double3DArray2XmlFormatter : DoubleArray2XmlFormatter {
36    public override Type Type {
37      get {
38        return typeof(double[, ,]);
39      }
40    }
41  }
42 
43}
Note: See TracBrowser for help on using the repository browser.