Line | |
---|
1 | using System;
|
---|
2 | using HeuristicLab.Persistence.Interfaces;
|
---|
3 |
|
---|
4 | namespace HeuristicLab.Persistence.Default.Xml.Primitive {
|
---|
5 |
|
---|
6 | public class Boolean2XmlFormatter : IFormatter {
|
---|
7 |
|
---|
8 | public Type Type { get { return typeof(bool); } }
|
---|
9 | public IFormat Format { get { return XmlFormat.Instance; } }
|
---|
10 |
|
---|
11 | public object DoFormat(object o) {
|
---|
12 | return ((bool)o).ToString();
|
---|
13 | }
|
---|
14 |
|
---|
15 | public object Parse(object o) {
|
---|
16 | return bool.Parse((string)o);
|
---|
17 | }
|
---|
18 |
|
---|
19 | }
|
---|
20 |
|
---|
21 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.