Free cookie consent management tool by TermsFeed Policy Generator

source: branches/New Persistence Exploration/Persistence/Persistence/Default/Xml/Primitive/Boolean2XmlFormatter.cs @ 1361

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

Split all classes into their own file (#506)

File size: 487 bytes
Line 
1using System;
2using HeuristicLab.Persistence.Interfaces;
3
4namespace 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.