Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/13/09 10:58:33 (15 years ago)
Author:
epitzer
Message:

support composite value types (#506)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New Persistence Exploration/Persistence/Persistence/XmlFormatter.cs

    r1338 r1339  
    11using System.Collections.Generic;
    22using System;
    3 using System.Xml;
    43using System.Text;
    54namespace Persistence {
     
    5352    private string FormatBegin(ISerializationToken token) {     
    5453      BeginToken beginToken = (BeginToken)token;
     54      var attributes = new Dictionary<string, string> {
     55        {"name", beginToken.Accessor.Name},
     56        {"type", beginToken.Accessor.Get().GetType().AssemblyQualifiedName } };
     57      if ( beginToken.Id != null )
     58        attributes.Add("id", beginToken.Id.ToString());                                           
    5559      string result = Prefix +
    56                       FormatNode("COMPOSITE",
    57                                  new Dictionary<string, string>
    58                                    {
    59                                      {"name", beginToken.Accessor.Name},
    60                                      {"type", beginToken.Accessor.Get().GetType().AssemblyQualifiedName},
    61                                      {"id", beginToken.Id.ToString()}
    62                                    }, NodeType.Start) + "\n";
     60                      FormatNode("COMPOSITE", attributes, NodeType.Start) + "\n";
    6361      depth += 1;
    6462      return result;
Note: See TracChangeset for help on using the changeset viewer.