Last change
on this file since 1454 was
1454,
checked in by epitzer, 16 years ago
|
merge persistence exploration branch into trunk as HL plugin. (#506)
|
File size:
547 bytes
|
Line | |
---|
1 | using System;
|
---|
2 | using HeuristicLab.Persistence.Core;
|
---|
3 | using HeuristicLab.Persistence.Interfaces;
|
---|
4 |
|
---|
5 | namespace HeuristicLab.Persistence.Default.Xml.Primitive {
|
---|
6 |
|
---|
7 | [EmptyStorableClass]
|
---|
8 | public class Boolean2XmlFormatter : IFormatter {
|
---|
9 |
|
---|
10 | public Type Type { get { return typeof(bool); } }
|
---|
11 | public IFormat Format { get { return XmlFormat.Instance; } }
|
---|
12 |
|
---|
13 | public object DoFormat(object o) {
|
---|
14 | return ((bool)o).ToString();
|
---|
15 | }
|
---|
16 |
|
---|
17 | public object Parse(object o) {
|
---|
18 | return bool.Parse((string)o);
|
---|
19 | }
|
---|
20 |
|
---|
21 | }
|
---|
22 |
|
---|
23 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.