Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/25/09 17:16:32 (15 years ago)
Author:
epitzer
Message:

Implement persistence of storables as decomposer. (#506)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New Persistence Exploration/Persistence/Persistence/Default/Decomposers/TypeDecomposer.cs

    r1408 r1419  
    33using HeuristicLab.Persistence.Core;
    44using HeuristicLab.Persistence.Interfaces;
     5using System.Collections.Generic;
    56
    67namespace HeuristicLab.Persistence.Default.Decomposers {
     
    1314    }
    1415
    15     public IEnumerable DeCompose(object obj) {
     16    public IEnumerable<Tag> DeCompose(object obj) {
    1617      Type t = (Type) obj;
    17       yield return t.AssemblyQualifiedName;
     18      yield return new Tag("AssemblyQualifiedName", t.AssemblyQualifiedName);
    1819    }
    1920
    20     public object Compose(IEnumerable objects, Type type) {
    21       foreach ( string typeName in objects ) {
    22         return Type.GetType(typeName);
     21    public object CreateInstance(Type type) {
     22      return null;
     23    }
     24
     25    public object Populate(object instance, IEnumerable<Tag> objects, Type type) {
     26      foreach ( var typeName in objects ) {
     27        return Type.GetType((string)typeName.Value);
    2328      }
    2429      return null;
Note: See TracChangeset for help on using the changeset viewer.