Changeset 1542
- Timestamp:
- 04/08/09 17:05:17 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 13 added
- 4 deleted
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence.GUI/3.3/PersistenceConfigurationForm.cs
r1530 r1542 366 366 367 367 [EmptyStorableClass] 368 public class EmptyFormat : Format {368 public class EmptyFormat : FormatBase { 369 369 public override string Name { get { return "Empty"; } } 370 370 public static EmptyFormat Instance = new EmptyFormat(); -
trunk/sources/HeuristicLab.Persistence.Test/HeuristicLab.Persistence.Test.csproj
r1534 r1542 9 9 <OutputType>Exe</OutputType> 10 10 <AppDesignerFolder>Properties</AppDesignerFolder> 11 <RootNamespace> Test</RootNamespace>12 <AssemblyName> Test</AssemblyName>11 <RootNamespace>HeuristicLab.Persistence.Test</RootNamespace> 12 <AssemblyName>HeuristicLab.Persistence.Test</AssemblyName> 13 13 <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> 14 14 <FileAlignment>512</FileAlignment> -
trunk/sources/HeuristicLab.Persistence.Test/NewSerializationTest.cs
r1519 r1542 185 185 r.myEnum = TestEnum.va1; 186 186 XmlGenerator.Serialize(r, "test.zip"); 187 object o = XmlParser.DeSerialize("test.zip"); 188 Console.Out.WriteLine(Util.AutoFormat(o, true)); 187 object o = XmlParser.DeSerialize("test.zip"); 189 188 Console.WriteLine(ViewOnlyGenerator.Serialize(r)); 190 189 Console.WriteLine(ViewOnlyGenerator.Serialize(o)); … … 199 198 c.kvpList = new KeyValuePair<List<C>, C>(new List<C> { c }, c); 200 199 XmlGenerator.Serialize(cs, "test3.zip"); 201 object o = XmlParser.DeSerialize("test3.zip"); 202 Console.Out.WriteLine(Util.AutoFormat(o, true)); 200 object o = XmlParser.DeSerialize("test3.zip"); 203 201 Console.WriteLine(ViewOnlyGenerator.Serialize(cs)); 204 202 Console.WriteLine(ViewOnlyGenerator.Serialize(o)); … … 220 218 arrayListArray[2].Add(a); 221 219 XmlGenerator.Serialize(arrayListArray, "test4.zip"); 222 object o = XmlParser.DeSerialize("test4.zip"); 223 Console.Out.WriteLine(Util.AutoFormat(o, true)); 220 object o = XmlParser.DeSerialize("test4.zip"); 224 221 Console.WriteLine(ViewOnlyGenerator.Serialize(arrayListArray)); 225 222 Console.WriteLine(ViewOnlyGenerator.Serialize(o)); … … 230 227 XmlGenerator.Serialize(m, "test2.zip"); 231 228 object o = XmlParser.DeSerialize("test2.zip"); 232 Console.Out.WriteLine(Util.AutoFormat(o, true)); 229 Console.WriteLine(ViewOnlyGenerator.Serialize(m)); 230 Console.WriteLine(ViewOnlyGenerator.Serialize(o)); 233 231 } 234 232 -
trunk/sources/HeuristicLab.Persistence/3.3/Core/Configuration.cs
r1454 r1542 13 13 private readonly Dictionary<Type, IDecomposer> decomposerCache; 14 14 [Storable] 15 public readonly IFormat Format;15 public IFormat Format { get; set; } 16 16 17 17 private Configuration() { -
trunk/sources/HeuristicLab.Persistence/3.3/Core/ConfigurationService.cs
r1539 r1542 7 7 using HeuristicLab.Persistence.Interfaces; 8 8 using HeuristicLab.Tracing; 9 using HeuristicLab.Persistence.Interfaces.Tokens; 9 10 10 11 namespace HeuristicLab.Persistence.Core { … … 14 15 private static ConfigurationService instance; 15 16 private readonly Dictionary<IFormat, Configuration> customConfigurations; 16 public readonly Dictionary<IFormat, List<IFormatter>> Formatters;17 public readonly List<IDecomposer> Decomposers;17 public Dictionary<IFormat, List<IFormatter>> Formatters { get; private set; } 18 public List<IDecomposer> Decomposers { get; private set; } 18 19 19 20 public static ConfigurationService Instance { … … 25 26 } 26 27 27 p ublicConfigurationService() {28 private ConfigurationService() { 28 29 Formatters = new Dictionary<IFormat, List<IFormatter>>(); 29 30 Decomposers = new List<IDecomposer>(); … … 35 36 public void LoadSettings() { 36 37 try { 37 if (String.IsNullOrEmpty(Properties.Settings.Default. customConfigurations) ||38 String.IsNullOrEmpty(Properties.Settings.Default. customConfigurationsTypeCache))38 if (String.IsNullOrEmpty(Properties.Settings.Default.CustomConfigurations) || 39 String.IsNullOrEmpty(Properties.Settings.Default.CustomConfigurationsTypeCache)) 39 40 return; 40 De Serializer deSerializer = new DeSerializer(41 Deserializer deSerializer = new Deserializer( 41 42 XmlParser.ParseTypeCache( 42 43 new StringReader( 43 Properties.Settings.Default. customConfigurationsTypeCache)));44 Properties.Settings.Default.CustomConfigurationsTypeCache))); 44 45 XmlParser parser = new XmlParser( 45 46 new StringReader( 46 Properties.Settings.Default. customConfigurations));47 Properties.Settings.Default.CustomConfigurations)); 47 48 var newCustomConfigurations = (Dictionary<IFormat, Configuration>) 48 deSerializer.De Serialize(parser);49 deSerializer.Deserialize(parser); 49 50 foreach (var config in newCustomConfigurations) { 50 51 customConfigurations[config.Key] = config.Value; … … 68 69 foreach (string s in generator.Format(serializer.TypeCache)) 69 70 configurationTypeCacheString.Append(s); 70 Properties.Settings.Default. customConfigurations =71 Properties.Settings.Default.CustomConfigurations = 71 72 configurationString.ToString(); 72 Properties.Settings.Default. customConfigurationsTypeCache =73 Properties.Settings.Default.CustomConfigurationsTypeCache = 73 74 configurationTypeCacheString.ToString(); 74 75 Properties.Settings.Default.Save(); -
trunk/sources/HeuristicLab.Persistence/3.3/Core/DataMemberAccessor.cs
r1454 r1542 16 16 public DataMemberAccessor( 17 17 MemberInfo memberInfo, 18 StorableAttribute autoStorableAttribute,18 StorableAttribute storableAttribute, 19 19 object obj) { 20 20 if (memberInfo.MemberType == MemberTypes.Field) { … … 34 34 "The Storable attribute can only be applied to fields and properties."); 35 35 } 36 Name = autoStorableAttribute.Name ?? memberInfo.Name;37 DefaultValue = autoStorableAttribute.DefaultValue;36 Name = storableAttribute.Name ?? memberInfo.Name; 37 DefaultValue = storableAttribute.DefaultValue; 38 38 } 39 39 -
trunk/sources/HeuristicLab.Persistence/3.3/Core/DeSerializer.cs
r1494 r1542 2 2 using System; 3 3 using HeuristicLab.Persistence.Interfaces; 4 using HeuristicLab.Persistence.Interfaces.Tokens; 4 5 5 6 namespace HeuristicLab.Persistence.Core { 6 7 7 public structParentReference {}8 public class ParentReference {} 8 9 9 10 class CompositeObject { … … 18 19 19 20 public void AddValue(string name, object value, List<Thunk> finalFixes) { 20 Tag t = new Tag(name, value) { finalFixes = finalFixes};21 Tag t = new Tag(name, value) {globalFinalFixes = finalFixes}; 21 22 customValues.Add(t); 22 23 } … … 30 31 public delegate void Thunk(); 31 32 32 public class De Serializer {33 public class Deserializer { 33 34 34 35 private readonly Dictionary<int, object> id2obj; … … 38 39 private List<Thunk> finalFixes; 39 40 40 public De Serializer(41 public Deserializer( 41 42 IEnumerable<TypeMapping> typeCache) { 42 43 id2obj = new Dictionary<int, object>(); 43 44 parentStack = new Stack<CompositeObject>(); 44 45 typeIds = new Dictionary<int, Type>(); 45 serializerMapping = createSerializers(typeCache);46 serializerMapping = CreateSerializers(typeCache); 46 47 } 47 48 48 private Dictionary<Type, object> createSerializers(IEnumerable<TypeMapping> typeCache) {49 private Dictionary<Type, object> CreateSerializers(IEnumerable<TypeMapping> typeCache) { 49 50 var map = new Dictionary<Type, object>(); 50 51 foreach (var typeMapping in typeCache) { … … 59 60 } 60 61 61 public object De Serialize(IEnumerable<ISerializationToken> tokens) {62 public object Deserialize(IEnumerable<ISerializationToken> tokens) { 62 63 finalFixes = new List<Thunk>(); 63 64 foreach (ISerializationToken token in tokens) { -
trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs
r1454 r1542 3 3 using System; 4 4 using HeuristicLab.Persistence.Interfaces; 5 using HeuristicLab.Persistence.Interfaces.Tokens; 5 6 6 7 namespace HeuristicLab.Persistence.Core { … … 49 50 50 51 public IEnumerator<ISerializationToken> GetEnumerator() { 51 DataMemberAccessor rootAccessor = new DataMemberAccessor( 52 rootName, null, () => obj, null); 53 IEnumerator<ISerializationToken> iterator = Serialize(rootAccessor); 54 while (iterator.MoveNext()) 55 yield return iterator.Current; 52 return Serialize(new DataMemberAccessor(rootName, null, () => obj, null)); 56 53 } 57 54 … … 75 72 IDecomposer decomposer = configuration.GetDecomposer(value.GetType()); 76 73 if (decomposer != null) 77 return CompositeEnumerator(accessor.Name, decomposer.De Compose(value), id, typeId);74 return CompositeEnumerator(accessor.Name, decomposer.Decompose(value), id, typeId); 78 75 throw new ApplicationException( 79 76 String.Format( … … 92 89 private IEnumerator<ISerializationToken> PrimitiveEnumerator(string name, 93 90 int typeId, object serializedValue, int? id) { 94 yield return new PrimitiveToken(name, typeId, serializedValue, id);91 yield return new PrimitiveToken(name, typeId, id, serializedValue); 95 92 } 96 93 -
trunk/sources/HeuristicLab.Persistence/3.3/Core/Tag.cs
r1454 r1542 4 4 5 5 public class Tag { 6 public List<Thunk> finalFixes;6 internal List<Thunk> globalFinalFixes; // reference to final fixes of Deserializer 7 7 public string Name { get; private set; } 8 public object Value ;8 public object Value { get; set; } 9 9 10 10 public Tag(string name, object value) { … … 17 17 } 18 18 public void SafeSet(Setter setter) { 19 if ( Value != null && Value.GetType() == typeof(ParentReference))20 finalFixes.Add(() => setter(Value));19 if ( Value as ParentReference != null) 20 globalFinalFixes.Add(() => setter(Value)); 21 21 else 22 22 setter(Value); -
trunk/sources/HeuristicLab.Persistence/3.3/Core/TypeMapping.cs
r1454 r1542 3 3 namespace HeuristicLab.Persistence.Core { 4 4 5 public structTypeMapping {5 public class TypeMapping { 6 6 public readonly int Id; 7 7 public readonly string TypeName; -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/ArrayDecomposer.cs
r1539 r1542 16 16 } 17 17 18 public IEnumerable<Tag> De Compose(object array) {18 public IEnumerable<Tag> Decompose(object array) { 19 19 Array a = (Array)array; 20 20 yield return new Tag("rank", a.Rank); -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/DictionaryDecomposer.cs
r1539 r1542 23 23 key = v; 24 24 keyIsSet = true; 25 check();25 Check(); 26 26 } 27 27 … … 29 29 value = v; 30 30 valueIsSet = true; 31 check();31 Check(); 32 32 } 33 33 34 private void check() {34 private void Check() { 35 35 if ( keyIsSet && valueIsSet ) 36 36 dict.Add(key, value); … … 50 50 } 51 51 52 public IEnumerable<Tag> De Compose(object o) {52 public IEnumerable<Tag> Decompose(object o) { 53 53 IDictionary dict = (IDictionary)o; 54 54 foreach ( DictionaryEntry entry in dict) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/EnumDecomposer.cs
r1539 r1542 13 13 14 14 public bool CanDecompose(Type type) { 15 return type.IsEnum || type == typeof 15 return type.IsEnum || type == typeof(Enum); 16 16 } 17 17 18 public IEnumerable<Tag> De Compose(object obj) {18 public IEnumerable<Tag> Decompose(object obj) { 19 19 yield return new Tag(Enum.GetName(obj.GetType(), obj)); 20 20 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/EnumerableDecomposer.cs
r1539 r1542 68 68 } 69 69 70 public IEnumerable<Tag> De Compose(object obj) {70 public IEnumerable<Tag> Decompose(object obj) { 71 71 foreach (object o in (IEnumerable)obj) { 72 72 yield return new Tag(null, o); -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/KeyValuePairDecomposer.cs
r1539 r1542 21 21 } 22 22 23 public IEnumerable<Tag> De Compose(object o) {23 public IEnumerable<Tag> Decompose(object o) { 24 24 Type t = o.GetType(); 25 25 yield return new Tag("key", t.GetProperty("Key").GetValue(o, null)); -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/StorableDecomposer.cs
r1539 r1542 19 19 } 20 20 21 public IEnumerable<Tag> De Compose(object obj) {21 public IEnumerable<Tag> Decompose(object obj) { 22 22 foreach (var mapping in StorableAttribute.GetAutostorableAccessors(obj)) { 23 23 yield return new Tag(mapping.Key, mapping.Value.Get()); -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/TypeDecomposer.cs
r1539 r1542 17 17 } 18 18 19 public IEnumerable<Tag> De Compose(object obj) {19 public IEnumerable<Tag> Decompose(object obj) { 20 20 Type t = (Type) obj; 21 21 yield return new Tag("VersionInvariantName", t.VersionInvariantName()); -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/X2StringDecomposer.cs
r1539 r1542 9 9 namespace HeuristicLab.Persistence.Default.Decomposers { 10 10 11 public class Number2StringDecomposer : IDecomposer { 12 13 public int Priority { 14 get { return 100; } 15 } 16 11 public class Number2StringConverter { 17 12 18 13 private static readonly List<Type> numberTypes = … … 34 29 private static readonly Dictionary<Type, MethodInfo> numberParsers; 35 30 36 static Number2String Decomposer() {31 static Number2StringConverter() { 37 32 numberParsers = new Dictionary<Type, MethodInfo>(); 38 33 foreach ( var type in numberTypes ) { … … 56 51 return obj.ToString(); 57 52 } 58 59 public IEnumerable<Tag> DeCompose(object obj) { 60 yield return new Tag(Format(obj)); 61 } 62 63 public object CreateInstance(Type type) { 64 return null; 65 } 66 53 67 54 public object Parse(string stringValue, Type type) { 68 55 return numberParsers[type] … … 72 59 } 73 60 74 public object Populate(object instance, IEnumerable<Tag> tags, Type type) {75 foreach (Tag tag in tags)76 return Parse((string)tag.Value, type);77 throw new ApplicationException("not enough tags to re-compose number.");78 }79 80 61 } 81 62 … … 91 72 } 92 73 93 public IEnumerable<Tag> De Compose(object obj) {74 public IEnumerable<Tag> Decompose(object obj) { 94 75 yield return new Tag(((DateTime)obj).Ticks); 95 76 } … … 114 95 } 115 96 116 private static readonly Number2String Decomposer numberDecomposer =117 new Number2String Decomposer();97 private static readonly Number2StringConverter numberConverter = 98 new Number2StringConverter(); 118 99 119 100 public bool CanDecompose(Type type) { 120 101 return 121 102 (type.IsArray || type == typeof (Array)) && 122 number Decomposer.CanDecompose(type.GetElementType());123 } 124 125 public IEnumerable<Tag> De Compose(object obj) {103 numberConverter.CanDecompose(type.GetElementType()); 104 } 105 106 public IEnumerable<Tag> Decompose(object obj) { 126 107 Array a = (Array) obj; 127 108 int[] lengths = new int[a.Rank]; … … 139 120 int[] positions = (int[])lowerBounds.Clone(); 140 121 while (positions[a.Rank - 1] < lengths[a.Rank - 1] + lowerBounds[a.Rank - 1]) { 141 sb.Append(number Decomposer.Format(a.GetValue(positions))).Append(';');122 sb.Append(numberConverter.Format(a.GetValue(positions))).Append(';'); 142 123 positions[0] += 1; 143 124 for (int i = 0; i < a.Rank - 1; i++) { … … 180 161 while (valueIter.MoveNext()) { 181 162 a.SetValue( 182 number Decomposer.Parse((string)valueIter.Current, elementType),163 numberConverter.Parse((string)valueIter.Current, elementType), 183 164 positions); 184 165 positions[0] += 1; … … 202 183 } 203 184 204 private static readonly Number2String Decomposer numberDecomposer =205 new Number2String Decomposer();185 private static readonly Number2StringConverter numberConverter = 186 new Number2StringConverter(); 206 187 207 188 private static readonly Dictionary<Type, Type> interfaceCache = new Dictionary<Type, Type>(); … … 213 194 if (iface.IsGenericType && 214 195 iface.GetGenericTypeDefinition() == typeof(IEnumerable<>) && 215 number Decomposer.CanDecompose(iface.GetGenericArguments()[0])) {196 numberConverter.CanDecompose(iface.GetGenericArguments()[0])) { 216 197 interfaceCache.Add(type, iface); 217 198 return iface; … … 243 224 } 244 225 245 public IEnumerable<Tag> De Compose(object obj) {226 public IEnumerable<Tag> Decompose(object obj) { 246 227 Type type = obj.GetType(); 247 228 Type enumerable = GetGenericEnumerableInterface(type); … … 259 240 while ( (bool)moveNextMethod.Invoke(genericEnumerator, empty) ) 260 241 sb.Append( 261 number Decomposer.Format(242 numberConverter.Format( 262 243 currentProperty.GetValue(genericEnumerator, null))).Append(';'); 263 244 yield return new Tag("compact enumerable", sb.ToString()); … … 277 258 .Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries); 278 259 foreach (var value in stringValues) { 279 addMethod.Invoke(instance, new[] {number Decomposer.Parse(value, elementType)});260 addMethod.Invoke(instance, new[] {numberConverter.Parse(value, elementType)}); 280 261 } 281 262 return instance; -
trunk/sources/HeuristicLab.Persistence/3.3/Default/ViewOnly/ViewOnlyFormat.cs
r1476 r1542 5 5 using HeuristicLab.Persistence.Default.Xml; 6 6 using HeuristicLab.Persistence.Core; 7 using HeuristicLab.Persistence.Interfaces.Tokens; 7 8 8 9 namespace HeuristicLab.Persistence.Default.ViewOnly { 9 10 10 public class ViewOnlyFormat : Format {11 public class ViewOnlyFormat : FormatBase { 11 12 public override string Name { get { return "ViewOnly"; } } 12 13 public static ViewOnlyFormat Instance = new ViewOnlyFormat(); -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleArray2XmlFormatters.cs
r1454 r1542 6 6 7 7 [EmptyStorableClass] 8 public class DoubleArray2XmlFormatter : NumberArray2XmlFormatter {8 public class DoubleArray2XmlFormatter : NumberArray2XmlFormatterBase { 9 9 10 10 public override Type Type { … … 14 14 } 15 15 16 protected override string formatValue(object o) {16 protected override string FormatValue(object o) { 17 17 return ((double)o).ToString("r", CultureInfo.InvariantCulture); 18 18 } 19 19 20 protected override object parseValue(string o) {20 protected override object ParseValue(string o) { 21 21 return double.Parse(o); 22 22 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleList2XmlFormatter.cs
r1454 r1542 8 8 9 9 [EmptyStorableClass] 10 public class DoubleList2XmlFormatter : NumberEnumeration2XmlFormatter {10 public class DoubleList2XmlFormatter : NumberEnumeration2XmlFormatterBase { 11 11 12 12 public override Type Type { … … 24 24 } 25 25 26 protected override string formatValue(object o) {26 protected override string FormatValue(object o) { 27 27 return ((double)o).ToString("r", CultureInfo.InvariantCulture); 28 28 } 29 29 30 protected override object parseValue(string o) {30 protected override object ParseValue(string o) { 31 31 return double.Parse(o); 32 32 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntArray2XmlFormatters.cs
r1454 r1542 5 5 6 6 [EmptyStorableClass] 7 public class IntArray2XmlFormatter : NumberArray2XmlFormatter {7 public class IntArray2XmlFormatter : NumberArray2XmlFormatterBase { 8 8 9 9 public override Type Type { … … 13 13 } 14 14 15 protected override string formatValue(object o) {15 protected override string FormatValue(object o) { 16 16 return o.ToString(); 17 17 } 18 18 19 protected override object parseValue(string o) {19 protected override object ParseValue(string o) { 20 20 return int.Parse(o); 21 21 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntList2XmlFormatter.cs
r1454 r1542 7 7 8 8 [EmptyStorableClass] 9 public class IntList2XmlFormatter : NumberEnumeration2XmlFormatter {9 public class IntList2XmlFormatter : NumberEnumeration2XmlFormatterBase { 10 10 11 11 public override Type Type { … … 23 23 } 24 24 25 protected override string formatValue(object o) {25 protected override string FormatValue(object o) { 26 26 return o.ToString(); 27 27 } 28 28 29 protected override object parseValue(string o) {29 protected override object ParseValue(string o) { 30 30 return int.Parse(o); 31 31 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/String2XmlFormatter.cs
r1476 r1542 3 3 using HeuristicLab.Persistence.Core; 4 4 using HeuristicLab.Persistence.Interfaces; 5 using System.Xml; 5 6 6 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlFormat.cs
r1454 r1542 5 5 6 6 [EmptyStorableClass] 7 public class XmlFormat : Format {7 public class XmlFormat : FormatBase { 8 8 public override string Name { get { return "XML"; } } 9 9 public static readonly XmlFormat Instance = new XmlFormat(); 10 private XmlFormat() { } 10 11 } 11 12 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs
r1476 r1542 8 8 using HeuristicLab.Tracing; 9 9 using log4net; 10 using HeuristicLab.Persistence.Interfaces.Tokens; 10 11 11 12 namespace HeuristicLab.Persistence.Default.Xml { … … 16 17 public const string REFERENCE = "REFERENCE"; 17 18 public const string NULL = "NULL"; 18 public const string TYPECACHE = "TYP CACHE";19 public const string TYPECACHE = "TYPECACHE"; 19 20 public const string TYPE = "TYPE"; 20 21 } … … 136 137 } 137 138 138 public static void Serialize(object o, string basename) {139 Serialize(o, basename, ConfigurationService.Instance.GetDefaultConfig(XmlFormat.Instance));139 public static void Serialize(object o, string filename) { 140 Serialize(o, filename, ConfigurationService.Instance.GetDefaultConfig(XmlFormat.Instance)); 140 141 } 141 142 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs
r1466 r1542 7 7 using HeuristicLab.Persistence.Interfaces; 8 8 using ICSharpCode.SharpZipLib.Zip; 9 using HeuristicLab.Persistence.Interfaces.Tokens; 9 10 10 11 namespace HeuristicLab.Persistence.Default.Xml { … … 59 60 reader.GetAttribute("name"), 60 61 int.Parse(reader.GetAttribute("typeId")), 61 reader.ReadString(),62 id);62 id, 63 reader.ReadString()); 63 64 } 64 65 … … 108 109 public static object DeSerialize(string filename) { 109 110 ZipFile zipFile = new ZipFile(filename); 110 De Serializer deSerializer = new DeSerializer(111 Deserializer deSerializer = new Deserializer( 111 112 ParseTypeCache( 112 113 new StreamReader( … … 114 115 XmlParser parser = new XmlParser( 115 116 new StreamReader(zipFile.GetInputStream(zipFile.GetEntry("data.xml")))); 116 return deSerializer.De Serialize(parser);117 return deSerializer.Deserialize(parser); 117 118 } 118 119 } -
trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj
r1538 r1542 108 108 <Compile Include="Default\Xml\Compact\DoubleArray2XmlFormatters.cs" /> 109 109 <Compile Include="Default\Xml\Compact\DoubleList2XmlFormatter.cs" /> 110 <Compile Include="Default\Xml\Compact\NumberEnumeration2XmlFormatter .cs" />111 <Compile Include="Default\Xml\Compact\NumberArray2XmlFormatter s.cs" />110 <Compile Include="Default\Xml\Compact\NumberEnumeration2XmlFormatterBase.cs" /> 111 <Compile Include="Default\Xml\Compact\NumberArray2XmlFormatterBase.cs" /> 112 112 <Compile Include="Core\DataMemberAccessor.cs" /> 113 113 <Compile Include="Default\Xml\Compact\IntList2XmlFormatter.cs" /> … … 121 121 <Compile Include="Core\DeSerializer.cs" /> 122 122 <Compile Include="Core\Tag.cs" /> 123 <Compile Include="Interfaces\IFormat.cs" /> 124 <Compile Include="Interfaces\FormatBase.cs" /> 123 125 <Compile Include="Interfaces\IDecomposer.cs" /> 124 126 <Compile Include="Interfaces\IFormatter.cs" /> 125 127 <Compile Include="Core\ConfigurationService.cs" /> 128 <Compile Include="Interfaces\Tokens\ISerializationToken.cs" /> 129 <Compile Include="Interfaces\Tokens\SerializationTokenBase.cs" /> 130 <Compile Include="Interfaces\Tokens\CompositeTokenBase.cs" /> 131 <Compile Include="Interfaces\Tokens\BeginToken.cs" /> 132 <Compile Include="Interfaces\Tokens\EndToken.cs" /> 133 <Compile Include="Interfaces\Tokens\PrimitiveToken.cs" /> 134 <Compile Include="Interfaces\Tokens\ReferenceToken.cs" /> 135 <Compile Include="Interfaces\Tokens\NulLReferenceToken.cs" /> 126 136 <Compile Include="Properties\AssemblyInfo.cs" /> 127 137 <Compile Include="Core\Serializer.cs" /> 128 <Compile Include="Interfaces\Tokens.cs" />129 138 <Compile Include="Properties\Settings.Designer.cs"> 130 139 <AutoGen>True</AutoGen> … … 132 141 <DependentUpon>Settings.settings</DependentUpon> 133 142 </Compile> 134 <Compile Include="Util.cs" />135 143 <Compile Include="Core\StorableAttribute.cs" /> 136 144 <Compile Include="Default\Xml\XmlGenerator.cs" /> -
trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/IDecomposer.cs
r1539 r1542 26 26 /// the same as they are supplied in the Compose method. 27 27 /// </summary> 28 IEnumerable<Tag> De Compose(object obj);28 IEnumerable<Tag> Decompose(object obj); 29 29 30 30 /// <summary> -
trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/IFormatter.cs
r1454 r1542 2 2 3 3 namespace HeuristicLab.Persistence.Interfaces { 4 5 public interface IFormat {6 string Name { get; }7 }8 9 public abstract class Format : IFormat {10 public abstract string Name { get; }11 public override bool Equals(object obj) {12 return Name == ((Format) obj).Name;13 }14 public override int GetHashCode() {15 return Name.GetHashCode();16 }17 }18 4 19 5 public interface IFormatter { -
trunk/sources/HeuristicLab.Persistence/3.3/Properties/Settings.Designer.cs
r1454 r1542 2 2 // <auto-generated> 3 3 // This code was generated by a tool. 4 // Runtime Version:2.0.50727.30 534 // Runtime Version:2.0.50727.3074 5 5 // 6 6 // Changes to this file may cause incorrect behavior and will be lost if … … 27 27 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 28 [global::System.Configuration.DefaultSettingValueAttribute("")] 29 public string customConfigurations {29 public string CustomConfigurations { 30 30 get { 31 return ((string)(this[" customConfigurations"]));31 return ((string)(this["CustomConfigurations"])); 32 32 } 33 33 set { 34 this[" customConfigurations"] = value;34 this["CustomConfigurations"] = value; 35 35 } 36 36 } … … 39 39 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 40 [global::System.Configuration.DefaultSettingValueAttribute("")] 41 public string customConfigurationsTypeCache {41 public string CustomConfigurationsTypeCache { 42 42 get { 43 return ((string)(this[" customConfigurationsTypeCache"]));43 return ((string)(this["CustomConfigurationsTypeCache"])); 44 44 } 45 45 set { 46 this[" customConfigurationsTypeCache"] = value;46 this["CustomConfigurationsTypeCache"] = value; 47 47 } 48 48 } -
trunk/sources/HeuristicLab.Persistence/3.3/Properties/Settings.settings
r1454 r1542 3 3 <Profiles /> 4 4 <Settings> 5 <Setting Name=" customConfigurations" Type="System.String" Scope="User">5 <Setting Name="CustomConfigurations" Type="System.String" Scope="User"> 6 6 <Value Profile="(Default)" /> 7 7 </Setting> 8 <Setting Name=" customConfigurationsTypeCache" Type="System.String" Scope="User">8 <Setting Name="CustomConfigurationsTypeCache" Type="System.String" Scope="User"> 9 9 <Value Profile="(Default)" /> 10 10 </Setting> -
trunk/sources/HeuristicLab.Persistence/3.3/app.config
r1530 r1542 8 8 <userSettings> 9 9 <HeuristicLab.Persistence.Properties.Settings> 10 <setting name=" customConfigurations" serializeAs="String">10 <setting name="CustomConfigurations" serializeAs="String"> 11 11 <value /> 12 12 </setting> 13 <setting name=" customConfigurationsTypeCache" serializeAs="String">13 <setting name="CustomConfigurationsTypeCache" serializeAs="String"> 14 14 <value /> 15 15 </setting>
Note: See TracChangeset
for help on using the changeset viewer.