Changeset 1554
- Timestamp:
- 04/14/09 14:15:22 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 12 added
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence.Test/NewSerializationTest.cs
r1553 r1554 237 237 XmlGenerator.Serialize(sdt, "test5.zip"); 238 238 object o = XmlParser.DeSerialize("test5.zip"); 239 Console.WriteLine(ViewOnlyGenerator.Serialize(sdt));240 Console.WriteLine(ViewOnlyGenerator.Serialize(o));239 //Console.WriteLine(ViewOnlyGenerator.Serialize(sdt)); 240 //Console.WriteLine(ViewOnlyGenerator.Serialize(o)); 241 241 } 242 242 … … 273 273 Console.WriteLine(ViewOnlyGenerator.Serialize(o)); 274 274 } 275 276 class Float { 277 [Storable] 278 float f = 12.3f; 279 } 280 281 public static void Test9() { 282 XmlGenerator.Serialize(12.3f, "test9.zip"); 283 object o = XmlParser.DeSerialize("test9.zip"); 284 Console.WriteLine(ViewOnlyGenerator.Serialize(12.3f)); 285 Console.WriteLine(ViewOnlyGenerator.Serialize(o)); 286 } 275 287 276 288 277 289 public static void Main() { 278 290 BasicConfigurator.Configure(); 291 ConfigurationService.Instance.Reset(); 279 292 Test1(); 280 293 Test2(); 281 294 Test3(); 282 295 Test4(); 283 //Test5();296 Test5(); 284 297 Test6(); 285 298 Test7(); 286 299 Test8(); 300 Test9(); 287 301 //SpeedTest(); 288 302 //SpeedTest2(); -
trunk/sources/HeuristicLab.Persistence/3.3/Core/ConfigurationService.cs
r1542 r1554 107 107 } 108 108 Formatters[formatter.Format].Add(formatter); 109 Logger.Debug("discovered formatter " + t.VersionInvariantName()); 109 110 } catch (MissingMethodException e) { 110 111 Logger.Warn("Could not instantiate " + t.VersionInvariantName(), e); 111 } 112 } catch (ArgumentException e) { 113 Logger.Warn("Could not instantiate " + t.VersionInvariantName(), e); 114 } 112 115 } 113 116 if (t.GetInterface(typeof (IDecomposer).FullName) != null) { 114 117 try { 115 118 Decomposers.Add((IDecomposer) Activator.CreateInstance(t, true)); 119 Logger.Debug("discovered decomposer " + t.VersionInvariantName()); 116 120 } catch (MissingMethodException e) { 117 Logger.Warn("Could not instantiate " + t.VersionInvariantName(), e); 121 Logger.Warn("Could not instantiate " + t.VersionInvariantName(), e); 122 } catch (ArgumentException e) { 123 Logger.Warn("Could not instantiate " + t.VersionInvariantName(), e); 118 124 } 119 125 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/ViewOnly/ViewOnlyFormat.cs
r1553 r1554 45 45 public class Type2ViewFormatter : ValueType2ViewFormatter { 46 46 public override Type Type { get { return typeof(Type); } } 47 } 48 49 public class Float2ViewFormatter : ValueType2ViewFormatter { 50 public override Type Type { get { return typeof(float); } } 47 51 } 48 52 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Double2XmlFormatter.cs
r1454 r1554 1 1 using System; 2 using System.Globalization;3 2 using HeuristicLab.Persistence.Core; 4 3 using HeuristicLab.Persistence.Interfaces; 4 using System.Reflection; 5 using System.Globalization; 5 6 6 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 [EmptyStorableClass] 9 public class Double2XmlFormatter : IFormatter { 10 11 public Type Type { get { return typeof(double); } } 12 public IFormat Format { get { return XmlFormat.Instance; } } 13 14 public object DoFormat(object o) { 15 return ((double)o).ToString("r", CultureInfo.InvariantCulture); 16 } 17 18 public object Parse(object o) { 19 return double.Parse((string)o, CultureInfo.InvariantCulture); 20 } 21 22 } 10 public class Double2XmlFormatter : DecimalNumber2XmlFormatterBase<double> { } 23 11 24 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Int2XmlFormatter.cs
r1454 r1554 2 2 using HeuristicLab.Persistence.Core; 3 3 using HeuristicLab.Persistence.Interfaces; 4 using System.Reflection; 5 using System.Globalization; 4 6 5 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 6 8 7 9 [EmptyStorableClass] 8 public class Int2XmlFormatter : IFormatter { 9 10 public Type Type { get { return typeof(int); } } 11 public IFormat Format { get { return XmlFormat.Instance; } } 12 13 public object DoFormat(object o) { 14 return ((int)o).ToString(); 15 } 16 17 public object Parse(object o) { 18 return int.Parse((string)o); 19 } 20 21 } 10 public class Int2XmlFormatter : SimpleNumber2XmlFormatterBase<int> { } 22 11 23 12 } -
trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj
r1553 r1554 112 112 <Compile Include="Core\DataMemberAccessor.cs" /> 113 113 <Compile Include="Default\Xml\Compact\IntList2XmlFormatter.cs" /> 114 <Compile Include="Default\Xml\Primitive\Double2XmlFormatterBase.cs" /> 115 <Compile Include="Default\Xml\Primitive\Decimal2XmlFormatterBase.cs" /> 116 <Compile Include="Default\Xml\Primitive\Float2XmlFormatterBase.cs" /> 117 <Compile Include="Default\Xml\Primitive\UInt2XmlFormatter.cs" /> 118 <Compile Include="Default\Xml\Primitive\Long2XmlFormatter.cs" /> 119 <Compile Include="Default\Xml\Primitive\ULong2XmlFormatter.cs" /> 120 <Compile Include="Default\Xml\Primitive\Int2XmlFormatter.cs" /> 121 <Compile Include="Default\Xml\Primitive\SByte2XmlFormatter.cs" /> 122 <Compile Include="Default\Xml\Primitive\Byte2XmlFormatter.cs" /> 123 <Compile Include="Default\Xml\Primitive\Short2XmlFormatter.cs" /> 124 <Compile Include="Default\Xml\Primitive\UShort2XmlFormatter.cs" /> 125 <Compile Include="Default\Xml\Primitive\Bool2XmlFormatter.cs" /> 126 <Compile Include="Default\Xml\Primitive\DecimalNumber2XmlFormatterBase.cs" /> 114 127 <Compile Include="Default\Xml\Primitive\String2XmlFormatter.cs" /> 115 <Compile Include="Default\Xml\Primitive\Int2XmlFormatter.cs" /> 116 <Compile Include="Default\Xml\Primitive\Double2XmlFormatter.cs" /> 117 <Compile Include="Default\Xml\Primitive\Boolean2XmlFormatter.cs" /> 128 <Compile Include="Default\Xml\Primitive\SimpleNumber2XmlFormatterBase.cs" /> 118 129 <Compile Include="Default\Xml\Primitive\DateTime2XmlFormatter.cs" /> 119 130 <Compile Include="Default\Xml\XmlFormat.cs" />
Note: See TracChangeset
for help on using the changeset viewer.