Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/04/17 17:19:35 (7 years ago)
Author:
gkronber
Message:

#2520: changed all usages of StorableClass to use StorableType with an auto-generated GUID (did not add StorableType to other type definitions yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs

    r14185 r14927  
    2424using System.Linq;
    2525using System.Text;
    26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HeuristicLab.Persistence;
    2727
    2828namespace HeuristicLab.Persistence.Auxiliary {
     
    3333  /// attributes.
    3434  /// </summary>
    35   [StorableClass]
     35  [StorableType("a83d8580-07c2-4805-a31f-23b702689e0c")]
    3636  public class TypeName {
    3737
     
    5757    public List<int> GenericArgCounts { get; private set; }
    5858
    59       /// <summary>
     59    /// <summary>
    6060    /// Gets or sets the generic args.
    6161    /// </summary>
     
    110110    /// <param name="nameSpace">The namespace.</param>
    111111    /// <param name="className">Name of the class.</param>
    112     internal TypeName(string nameSpace, string className, List<int> genericArgCounts=null) {
     112    internal TypeName(string nameSpace, string className, List<int> genericArgCounts = null) {
    113113      Namespace = nameSpace;
    114114      ClassName = className;
     
    187187    private IEnumerable<string> GetNestedClassesInCode(HashSet<string> omitNamespaces, bool includeAllNamespaces) {
    188188      var i = 0;
    189       foreach (var pair in ClassName.Split('+').Zip(GenericArgCounts, (n, c) => new {n, c})) {
     189      foreach (var pair in ClassName.Split('+').Zip(GenericArgCounts, (n, c) => new { n, c })) {
    190190        if (pair.c == 0) {
    191191          yield return pair.n;
    192         }
    193         else {
     192        } else {
    194193          yield return string.Format("{0}<{1}>",
    195194            pair.n,
     
    208207            (omitNamespaces == null && includeNamespaces) ||
    209208             omitNamespaces != null && !omitNamespaces.Contains(Namespace))
    210           sb.Append(Namespace).Append('.');
     209        sb.Append(Namespace).Append('.');
    211210      if (GenericArgCounts != null) {
    212211        sb.Append(string.Join(".", GetNestedClassesInCode(omitNamespaces, includeNamespaces)));
     
    273272        }
    274273        return false;
    275       }
    276       catch (KeyNotFoundException) {
     274      } catch (KeyNotFoundException) {
    277275        throw new Exception("Could not extract version information from type string");
    278276      }
     
    311309        }
    312310        return true;
    313       }
    314       catch (KeyNotFoundException) {
     311      } catch (KeyNotFoundException) {
    315312        throw new Exception("Could not extract version infomration from type string");
    316313      }
Note: See TracChangeset for help on using the changeset viewer.