Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Persistence/Default/Xml/Primitive/Boolean2XmlFormatter.cs @ 1454

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

merge persistence exploration branch into trunk as HL plugin. (#506)

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