Changeset 1703 for trunk/sources/HeuristicLab.Persistence/3.3/Default
- Timestamp:
- 04/29/09 15:30:23 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3/Default
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/ArrayDecomposer.cs
r1625 r1703 54 54 } 55 55 56 public object CreateInstance(Type t, IEnumerable<Tag> metaInfo) { 56 public object CreateInstance(Type t, IEnumerable<Tag> metaInfo) { 57 57 try { 58 58 IEnumerator<Tag> e = metaInfo.GetEnumerator(); … … 74 74 } catch (InvalidCastException x) { 75 75 throw new PersistenceException("Invalid format of array metainfo.", x); 76 } 76 } 77 77 } 78 78 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/CompactNumberArray2StringDecomposer.cs
r1644 r1703 63 63 try { 64 64 var tagIter = metaInfo.GetEnumerator(); 65 tagIter.MoveNext(); 65 tagIter.MoveNext(); 66 66 var valueIter = ((string)tagIter.Current.Value) 67 67 .Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries) … … 101 101 } catch (InvalidCastException e) { 102 102 throw new PersistenceException("Invalid element data during compact array deserialization", e); 103 } 103 } 104 104 } 105 105 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/KeyValuePairDecomposer.cs
r1625 r1703 31 31 Tag key, value; 32 32 try { 33 key = new Tag("key", t.GetProperty("Key").GetValue(o, null)); 33 key = new Tag("key", t.GetProperty("Key").GetValue(o, null)); 34 34 } catch (Exception e) { 35 35 throw new PersistenceException("Exception caught during KeyValuePair decomposition", e); -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/Number2StringConverter.cs
r1644 r1703 2 2 using HeuristicLab.Persistence.Interfaces; 3 3 using HeuristicLab.Persistence.Core; 4 using HeuristicLab.Persistence.Auxiliary; 4 5 using System.Collections.Generic; 5 6 using System.Reflection; … … 53 54 54 55 public object Parse(string stringValue, Type type) { 55 try { 56 try { 56 57 return numberParsers[type] 57 58 .Invoke(null, … … 62 63 } catch (OverflowException e) { 63 64 throw new PersistenceException("Overflow during number parsing.", e); 64 } 65 } 65 66 } 66 67 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/StackDecomposer.cs
r1683 r1703 18 18 19 19 20 public bool CanDecompose(Type type) { 20 public bool CanDecompose(Type type) { 21 21 return type == typeof(Stack) || 22 22 type.IsGenericType && … … 43 43 } 44 44 45 public void Populate(object instance, IEnumerable<Tag> tags, Type type) { 45 public void Populate(object instance, IEnumerable<Tag> tags, Type type) { 46 46 MethodInfo addMethod = type.GetMethod("Push"); 47 47 try { 48 48 foreach (var tag in tags) 49 addMethod.Invoke(instance, new[] { tag.Value }); 49 addMethod.Invoke(instance, new[] { tag.Value }); 50 50 } catch (Exception e) { 51 51 throw new PersistenceException("Exception caught while trying to populate enumerable.", e); -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/TypeDecomposer.cs
r1625 r1703 1 1 using System; 2 2 using HeuristicLab.Persistence.Core; 3 using HeuristicLab.Persistence.Auxiliary; 3 4 using HeuristicLab.Persistence.Interfaces; 4 5 using System.Collections.Generic; -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs
r1625 r1703 62 62 inner.Read(); 63 63 string xml = inner.ReadInnerXml(); 64 inner.Close(); 64 inner.Close(); 65 65 yield return new PrimitiveToken(name, typeId, id, new XmlString(xml)); 66 66 }
Note: See TracChangeset
for help on using the changeset viewer.