- Timestamp:
- 04/23/09 14:22:29 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/TypeDecomposer.cs
r1623 r1625 28 28 29 29 public object CreateInstance(Type type, IEnumerable<Tag> metaInfo) { 30 foreach (var typeName in metaInfo) { 31 return Type.GetType((string)typeName.Value); 30 IEnumerator<Tag> it = metaInfo.GetEnumerator(); 31 try { 32 it.MoveNext(); 33 } catch (InvalidOperationException e) { 34 throw new PersistenceException("Insufficient meta information to instantiate Type object", e); 32 35 } 33 return null; 36 try { 37 return Type.GetType((string)it.Current.Value, true); 38 } catch (InvalidCastException e) { 39 throw new PersistenceException("Invalid meta information during reconstruction of Type object", e); 40 } catch (TypeLoadException e) { 41 throw new PersistenceException(String.Format( 42 "Cannot load Type {0}, make sure all required assemblies are available.", 43 (string)it.Current.Value), e); 44 } 34 45 } 35 46 36 47 public void Populate(object instance, IEnumerable<Tag> objects, Type type) { 48 // Type ojects are populated during instance creation. 37 49 } 38 50 }
Note: See TracChangeset
for help on using the changeset viewer.