Changeset 1703
- Timestamp:
- 04/29/09 15:30:23 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 added
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence.GUI/3.3/PersistenceConfigurationForm.cs
r1660 r1703 4 4 using System.Linq; 5 5 using System.Windows.Forms; 6 using HeuristicLab.Persistence.Auxiliary; 6 7 using HeuristicLab.Persistence.Core; 7 8 using HeuristicLab.Persistence.Default.Xml; -
trunk/sources/HeuristicLab.Persistence/3.3/Core/ConfigurationService.cs
r1660 r1703 9 9 using HeuristicLab.Tracing; 10 10 using HeuristicLab.Persistence.Core.Tokens; 11 using HeuristicLab.Persistence.Auxiliary; 11 12 12 13 namespace HeuristicLab.Persistence.Core { … … 50 51 Logger.Warn("Could not load settings.", e); 51 52 } 52 } 53 } 53 54 } 54 55 -
trunk/sources/HeuristicLab.Persistence/3.3/Core/DeSerializer.cs
r1682 r1703 3 3 using HeuristicLab.Persistence.Interfaces; 4 4 using HeuristicLab.Persistence.Core.Tokens; 5 using HeuristicLab.Persistence.Auxiliary; 5 6 using HeuristicLab.Tracing; 6 7 using System.Reflection; … … 76 77 Logger.Error(String.Format( 77 78 "Cannot load type \"{0}\", falling back to loading with partial name", typeMapping.TypeName)); 78 string[] typeNameParts = typeMapping.TypeName.Split(new[] { ','});79 string[] typeNameParts = typeMapping.TypeName.Split(new[] { ',' }); 79 80 Assembly a = Assembly.LoadWithPartialName(typeNameParts[typeNameParts.Length - 1].Trim()); 80 81 Array.Resize(ref typeNameParts, typeNameParts.Length - 1); … … 90 91 "The serialization type cache could not be loaded.\r\n" + 91 92 "This usualy happens when you are missing an Assembly/Plugin.", e); 92 } 93 } 93 94 } 94 95 -
trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs
r1702 r1703 3 3 using System; 4 4 using System.Linq; 5 using HeuristicLab.Persistence.Auxiliary; 5 6 using HeuristicLab.Persistence.Interfaces; 6 7 using HeuristicLab.Persistence.Core.Tokens; … … 9 10 using System.Runtime.InteropServices; 10 11 11 namespace HeuristicLab.Persistence.Core { 12 namespace HeuristicLab.Persistence.Core { 12 13 13 14 public class Serializer : IEnumerable<ISerializationToken> { … … 59 60 this.rootName = rootName; 60 61 this.configuration = configuration; 61 obj2id = new Dictionary<object, int>(new ReferenceEqualityComparer()) { { new object(), 0 } };62 obj2id = new Dictionary<object, int>(new ReferenceEqualityComparer()) { { new object(), 0 } }; 62 63 typeCache = new Dictionary<Type, int>(); 63 64 } … … 82 83 int typeId = typeCache[type]; 83 84 int? id = null; 84 if ( !type.IsValueType) {85 if (!type.IsValueType) { 85 86 id = obj2id.Count; 86 87 obj2id.Add(value, (int)id); -
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 } -
trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj
r1683 r1703 101 101 <Compile Include="Core\FormatBase.cs" /> 102 102 <Compile Include="Core\FormatterBase.cs" /> 103 <Compile Include=" Core\TypeExtensions.cs" />103 <Compile Include="Auxiliary\TypeExtensions.cs" /> 104 104 <Compile Include="Core\TypeMapping.cs" /> 105 <Compile Include=" Core\TypeStringBuilder.cs" />105 <Compile Include="Auxiliary\TypeStringBuilder.cs" /> 106 106 <Compile Include="Core\GeneratorBase.cs" /> 107 107 <Compile Include="Default\DebugString\DebugString.cs" />
Note: See TracChangeset
for help on using the changeset viewer.