Changeset 1447 for branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs
- Timestamp:
- 03/27/09 13:45:33 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New Persistence Exploration/Persistence/Persistence/Core/DeSerializer.cs
r1437 r1447 18 18 19 19 public void AddValue(string name, object value, List<Thunk> finalFixes) { 20 Tag t = new Tag(name, value); 21 t.finalFixes = finalFixes; 20 Tag t = new Tag(name, value) {finalFixes = finalFixes}; 22 21 customValues.Add(t); 23 22 } … … 48 47 49 48 private Dictionary<Type, object> createSerializers(IEnumerable<TypeMapping> typeCache) { 50 var serializerMapping= new Dictionary<Type, object>();49 var map = new Dictionary<Type, object>(); 51 50 foreach (var typeMapping in typeCache) { 52 51 Type type = Type.GetType(typeMapping.TypeName); … … 54 53 if (typeMapping.Serializer != null) { 55 54 Type serializerType = Type.GetType(typeMapping.Serializer); 56 serializerMapping.Add(type, Activator.CreateInstance(serializerType, true));55 map.Add(type, Activator.CreateInstance(serializerType, true)); 57 56 } 58 57 } 59 return serializerMapping;58 return map; 60 59 } 61 60 … … 93 92 "No suitable method for deserialization of type \"{0}\" found.", 94 93 type.VersionInvariantName())); 95 object instance = decomposer.CreateInstance(type);96 if (instance == null)97 instance =new ParentReference();94 object instance = 95 decomposer.CreateInstance(type) ?? 96 new ParentReference(); 98 97 parentStack.Push(new CompositeObject(instance)); 99 98 if ( token.Id != null ) … … 110 109 "No suitable method for deserialization of type \"{0}\" found.", 111 110 type.VersionInvariantName())); 112 CompositeObject customComposite = (CompositeObject)parentStack.Pop();111 CompositeObject customComposite = parentStack.Pop(); 113 112 object deserializedObject = 114 113 decomposer.Populate(customComposite.Obj, customComposite.customValues, type);
Note: See TracChangeset
for help on using the changeset viewer.