Changeset 4068 for trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberArray2XmlSerializerBase.cs
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberArray2XmlSerializerBase.cs
r3945 r4068 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections; 24 using System.Collections.Generic; 23 25 using System.Text; 24 using HeuristicLab.Persistence.Interfaces; 25 using System; 26 using HeuristicLab.Persistence.Auxiliary; 26 27 using HeuristicLab.Persistence.Core; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Persistence.Auxiliary;29 using HeuristicLab.Tracing;30 using System.Collections.Generic;31 29 32 30 namespace HeuristicLab.Persistence.Default.Xml.Compact { … … 51 49 lengths[i] = a.GetLength(i); 52 50 nElements *= lengths[i]; 53 } 51 } 54 52 sb.EnsureCapacity(sb.Length + nElements * 3); 55 53 for (int i = 0; i < a.Rank; i++) { … … 71 69 } 72 70 } 73 } 71 } 74 72 return new XmlString(sb.ToString()); 75 73 } … … 92 90 Array a = Array.CreateInstance(this.SourceType.GetElementType(), lengths, lowerBounds); 93 91 int[] positions = (int[])lowerBounds.Clone(); 94 while (values.MoveNext()) { 92 while (values.MoveNext()) { 95 93 a.SetValue(ParseValue(values.Current), positions); 96 94 positions[0] += 1; … … 107 105 throw new PersistenceException("Insufficient number of elements while trying to fill number array."); 108 106 return (T)(object)a; 109 } catch (InvalidOperationException e) { 107 } 108 catch (InvalidOperationException e) { 110 109 throw new PersistenceException("Insufficient information to rebuild number array.", e); 111 } catch (InvalidCastException e) { 110 } 111 catch (InvalidCastException e) { 112 112 throw new PersistenceException("Invalid element data or meta data to reconstruct number array.", e); 113 } catch (OverflowException e) { 113 } 114 catch (OverflowException e) { 114 115 throw new PersistenceException("Overflow during element parsing while trying to reconstruct number array.", e); 115 116 }
Note: See TracChangeset
for help on using the changeset viewer.