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 | |
---|
1 | using System;
|
---|
2 | using HeuristicLab.Persistence.Core;
|
---|
3 | using System.Globalization;
|
---|
4 |
|
---|
5 | namespace 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.