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/Decomposers/StorableDecomposer.cs

    r1542 r1553  
    1717        EmptyStorableClassAttribute.IsEmpyStorable(type);
    1818
    19     }   
     19    }
     20
     21    public IEnumerable<Tag> CreateMetaInfo(object o) {
     22      return new Tag[] { };
     23    }
    2024
    2125    public IEnumerable<Tag> Decompose(object obj) {
     
    2529    }
    2630
    27     public object CreateInstance(Type type) {
     31    public object CreateInstance(Type type, IEnumerable<Tag> metaInfo) {
    2832      return Activator.CreateInstance(type, true);
    2933    }
    3034
    31     public object Populate(object instance, IEnumerable<Tag> objects, Type type) {           
     35    public void Populate(object instance, IEnumerable<Tag> objects, Type type) {           
    3236      var memberDict = new Dictionary<string, Tag>();     
    3337      IEnumerator<Tag> iter = objects.GetEnumerator();     
     
    3741      foreach (var mapping in StorableAttribute.GetAutostorableAccessors(instance)) {
    3842        if (memberDict.ContainsKey(mapping.Key)) {
    39           memberDict[mapping.Key].SafeSet(mapping.Value.Set);
     43          mapping.Value.Set(memberDict[mapping.Key].Value);         
    4044        } else if (mapping.Value.DefaultValue != null) {
    4145          mapping.Value.Set(mapping.Value.DefaultValue);
    4246        }
    4347      }
    44       return instance;
    4548    }
    46 
    4749  }
    4850}
Note: See TracChangeset for help on using the changeset viewer.