Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/14/09 13:23:08 (15 years ago)
Author:
epitzer
Message:

Replace final fixes for broken parent references with separation of instance creation with meta information. (#548)

File:
1 edited

Legend:

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

    r1542 r1553  
    1919    public const string TYPECACHE = "TYPECACHE";
    2020    public const string TYPE = "TYPE";
     21    public const string METAINFO = "METAINFO";
    2122  }
    2223
     
    3435      if (type == typeof(NullReferenceToken))
    3536        return Format((NullReferenceToken)token);
     37      if (type == typeof(MetaInfoBeginToken))
     38        return Format((MetaInfoBeginToken)token);
     39      if (type == typeof(MetaInfoEndToken))
     40        return Format((MetaInfoEndToken)token);
    3641      throw new ApplicationException("Invalid token of type " + type.FullName);
    3742    }
     
    4146    protected abstract T Format(ReferenceToken referenceToken);
    4247    protected abstract T Format(NullReferenceToken nullReferenceToken);
     48    protected abstract T Format(MetaInfoBeginToken metaInfoBeginToken);
     49    protected abstract T Format(MetaInfoEndToken metaInfoEndToken);
    4350  }
    4451
     
    126133    }
    127134
     135    protected override string Format(MetaInfoBeginToken metaInfoBeginToken) {
     136      string result = Prefix + "<" + XmlStrings.METAINFO + ">";
     137      depth += 1;
     138      return result;
     139    }
     140
     141    protected override string Format(MetaInfoEndToken metaInfoEndToken) {
     142      depth -= 1;
     143      return Prefix + "</" + XmlStrings.METAINFO + ">";
     144    }
     145
    128146    public IEnumerable<string> Format(List<TypeMapping> typeCache) {
    129147      yield return "<" + XmlStrings.TYPECACHE + ">";
Note: See TracChangeset for help on using the changeset viewer.