Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2737


Ignore:
Timestamp:
02/02/10 16:24:12 (15 years ago)
Author:
epitzer
Message:

incorporate persistence fixes from test branch (#548)

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence.GUI/3.3/HeuristicLabPersistenceGUIPlugin.cs

    r2656 r2737  
    77  [PluginFile("HeuristicLab.Persistence.GUI-3.3.dll", PluginFileType.Assembly)]
    88  [PluginDependency("HeuristicLab.Persistence-3.3")]
    9   public class HeuristicLabPersistencePlugin : PluginBase { }
     9  public class HeuristicLabPersistenceGUIPlugin : PluginBase { }
    1010
    1111
    1212  [Application("Persistence Configuration")]
    13   public class HeuristicLabPersistenceApplication : ApplicationBase {
     13  public class HeuristicLabPersistenceGUIApplication : ApplicationBase {
    1414    public override void Run() {
    1515      Application.EnableVisualStyles();
  • trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/TypeNameParser.cs

    r1795 r2737  
    3131      Version := '\d+\.\d+\.\d+\.\d+)'
    3232
    33       IDENTIFIER = [a-zA-Z][a-ZA-Z0-9]*
     33      IDENTIFIER = [_a-zA-Z][_a-ZA-Z0-9]*
    3434    */
    3535
     
    3838      private static Dictionary<string, string> tokens =
    3939        new Dictionary<string, string> {
     40          {"-", "DASH"},
    4041          {"&", "AMPERSAND"},
    4142          {".", "DOT"},
    42           {"-", "DASH"},
    4343          {"+", "PLUS"},
    4444          {",", "COMMA"},
     
    5050          {"`", "BACKTICK"} };
    5151      private static Regex NumberRegex = new Regex("^\\d+$");
    52       private static Regex TokenRegex = new Regex("[-&.+,\\[\\]* =`]|\\d+|[a-zA-Z][a-zA-Z0-9]*");
     52      private static Regex TokenRegex = new Regex("[-&.+,\\[\\]* =`]|\\d+|[_a-zA-Z][_a-zA-Z0-9]*");
    5353      public string Name { get; private set; }
    5454      public string Value { get; private set; }
  • trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs

    r2106 r2737  
    5353    private List<TypeMapping> externalTypeCache;
    5454    private List<string> requiredFiles;
    55     private void BuildTypeCache() {     
     55    private void BuildTypeCache() {
    5656      externalTypeCache = new List<TypeMapping>();
    5757      Dictionary<Assembly, bool> assemblies = new Dictionary<Assembly, bool>();
     
    8484
    8585    public Serializer(object obj, Configuration configuration, string rootName, bool isTestRun) {
    86    
    8786      this.obj = obj;
    8887      this.rootName = rootName;
     
    174173      yield return new BeginToken(name, typeId, id);
    175174      bool first = true;
    176       foreach (var tag in metaInfo) {
    177         IEnumerator<ISerializationToken> metaIt = Serialize(new DataMemberAccessor(tag.Value, tag.Name));
    178         while (metaIt.MoveNext()) {
    179           if (first) {
    180             yield return new MetaInfoBeginToken();
    181             first = false;
     175      if (metaInfo != null) {
     176        foreach (var tag in metaInfo) {
     177          IEnumerator<ISerializationToken> metaIt = Serialize(new DataMemberAccessor(tag.Value, tag.Name));
     178          while (metaIt.MoveNext()) {
     179            if (first) {
     180              yield return new MetaInfoBeginToken();
     181              first = false;
     182            }
     183            yield return metaIt.Current;
    182184          }
    183           yield return metaIt.Current;
    184185        }
    185186      }
     
    187188        yield return new MetaInfoEndToken();
    188189      }
    189       foreach (var tag in tags) {
    190         IEnumerator<ISerializationToken> it = Serialize(new DataMemberAccessor(tag.Value, tag.Name));
    191         while (it.MoveNext())
    192           yield return it.Current;
     190      if (tags != null) {
     191        foreach (var tag in tags) {
     192          IEnumerator<ISerializationToken> it = Serialize(new DataMemberAccessor(tag.Value, tag.Name));
     193          while (it.MoveNext())
     194            yield return it.Current;
     195        }
    193196      }
    194197      yield return new EndToken(name, typeId, id);
Note: See TracChangeset for help on using the changeset viewer.