Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/07/09 12:43:26 (16 years ago)
Author:
epitzer
Message:

Include chain of declaring types for proper type information of nested types. (#575)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/Core/TypeStringBuilder.cs

    r1454 r1519  
    66  public static class TypeStringBuilder {
    77
    8     private static void BuildVersionInvariantName(Type type, StringBuilder sb) {   
    9       sb.Append(type.Namespace);
    10       sb.Append('.');
     8    private static void BuildDeclaringTypeChain(Type type, StringBuilder sb) {
     9      if ( type.DeclaringType != null ) {
     10        BuildDeclaringTypeChain(type.DeclaringType, sb);
     11        sb.Append(type.DeclaringType.Name).Append('+');
     12      }
     13    }
     14
     15    private static void BuildVersionInvariantName(Type type, StringBuilder sb) {
     16      sb.Append(type.Namespace).Append('.');
     17      BuildDeclaringTypeChain(type, sb);
    1118      sb.Append(type.Name);
    1219      if (type.IsGenericType) {
     
    1623          sb.Append("[");
    1724          BuildVersionInvariantName(args[i], sb);
    18           sb.Append("]");
    19           sb.Append(",");
     25          sb.Append("],");
    2026        }
    2127        if (args.Length > 0)
     
    2329        sb.Append("]");
    2430      }           
    25       sb.Append(", ");
    26       sb.Append(type.Assembly.GetName().Name);     
     31      sb.Append(", ").Append(type.Assembly.GetName().Name);
    2732    }
    2833
Note: See TracChangeset for help on using the changeset viewer.