Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/20/09 17:36:22 (16 years ago)
Author:
epitzer
Message:

namespace refactoring (#548)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs

    r1570 r1612  
    1010using HeuristicLab.Persistence.Core.Tokens;
    1111
    12 namespace HeuristicLab.Persistence.Default.Xml {
    13 
    14   struct XmlStrings {
    15     public const string PRIMITIVE = "PRIMITVE";
    16     public const string COMPOSITE = "COMPOSITE";
    17     public const string REFERENCE = "REFERENCE";
    18     public const string NULL = "NULL";
    19     public const string TYPECACHE = "TYPECACHE";
    20     public const string TYPE = "TYPE";
    21     public const string METAINFO = "METAINFO";
    22   }
     12namespace HeuristicLab.Persistence.Default.Xml { 
    2313
    2414  public class XmlGenerator : GeneratorBase<string> {
     
    116106    protected override string Format(BeginToken beginToken) {
    117107      return CreateNodeStart(
    118         XmlStrings.COMPOSITE,
     108        XmlStringConstants.COMPOSITE,
    119109        new Dictionary<string, object> {
    120110          {"name", beginToken.Name},
     
    124114
    125115    protected override string Format(EndToken endToken) {
    126       return CreateNodeEnd(XmlStrings.COMPOSITE);
     116      return CreateNodeEnd(XmlStringConstants.COMPOSITE);
    127117    }
    128118
    129119    protected override string Format(PrimitiveToken dataToken) {
    130       return CreateNode(XmlStrings.PRIMITIVE,
     120      return CreateNode(XmlStringConstants.PRIMITIVE,
    131121        new Dictionary<string, object> {
    132122            {"typeId", dataToken.TypeId},
     
    137127
    138128    protected override string Format(ReferenceToken refToken) {
    139       return CreateNode(XmlStrings.REFERENCE,
     129      return CreateNode(XmlStringConstants.REFERENCE,
    140130        new Dictionary<string, object> {
    141131          {"ref", refToken.Id},
     
    144134
    145135    protected override string Format(NullReferenceToken nullRefToken) {
    146       return CreateNode(XmlStrings.NULL,
     136      return CreateNode(XmlStringConstants.NULL,
    147137        new Dictionary<string, object>{
    148138          {"name", nullRefToken.Name}});
     
    150140
    151141    protected override string Format(MetaInfoBeginToken metaInfoBeginToken) {
    152       return CreateNodeStart(XmlStrings.METAINFO);
     142      return CreateNodeStart(XmlStringConstants.METAINFO);
    153143    }
    154144
    155145    protected override string Format(MetaInfoEndToken metaInfoEndToken) {
    156       return CreateNodeEnd(XmlStrings.METAINFO);
     146      return CreateNodeEnd(XmlStringConstants.METAINFO);
    157147    }
    158148
    159149    public IEnumerable<string> Format(List<TypeMapping> typeCache) {
    160       yield return CreateNodeStart(XmlStrings.TYPECACHE);
     150      yield return CreateNodeStart(XmlStringConstants.TYPECACHE);
    161151      foreach (var mapping in typeCache)
    162152        yield return CreateNode(
    163           XmlStrings.TYPE,
     153          XmlStringConstants.TYPE,
    164154          mapping.GetDict());
    165       yield return CreateNodeEnd(XmlStrings.TYPECACHE);
     155      yield return CreateNodeEnd(XmlStringConstants.TYPECACHE);
    166156    }
    167157
Note: See TracChangeset for help on using the changeset viewer.