Changeset 1567
- Timestamp:
- 04/16/09 13:20:55 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3
- Files:
-
- 15 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Core/DeSerializer.cs
r1566 r1567 4 4 using HeuristicLab.Persistence.Core.Tokens; 5 5 6 namespace HeuristicLab.Persistence.Core { 6 namespace HeuristicLab.Persistence.Core { 7 7 8 public class ParentReference { }8 public class Deserializer { 9 9 10 class Midwife {10 class Midwife { 11 11 12 public int? Id { get; private set; }13 public bool MetaMode { get; set; }14 public object Obj { get; private set; }12 public int? Id { get; private set; } 13 public bool MetaMode { get; set; } 14 public object Obj { get; private set; } 15 15 16 private List<Tag> metaInfo;17 private List<Tag> customValues;18 private Type type;19 private IDecomposer decomposer;16 private List<Tag> metaInfo; 17 private List<Tag> customValues; 18 private Type type; 19 private IDecomposer decomposer; 20 20 21 public Midwife(object value) {22 this.Obj = value;23 }21 public Midwife(object value) { 22 this.Obj = value; 23 } 24 24 25 public Midwife(Type type, IDecomposer decomposer, int? id) {26 this.type = type;27 this.decomposer = decomposer;28 this.Id = id;29 MetaMode = false;30 metaInfo = new List<Tag>();31 customValues = new List<Tag>();32 }25 public Midwife(Type type, IDecomposer decomposer, int? id) { 26 this.type = type; 27 this.decomposer = decomposer; 28 this.Id = id; 29 MetaMode = false; 30 metaInfo = new List<Tag>(); 31 customValues = new List<Tag>(); 32 } 33 33 34 public void CreateInstance() {35 if (Obj != null)36 throw new ApplicationException("object already instantiated");37 Obj = decomposer.CreateInstance(type, metaInfo);38 }34 public void CreateInstance() { 35 if (Obj != null) 36 throw new ApplicationException("object already instantiated"); 37 Obj = decomposer.CreateInstance(type, metaInfo); 38 } 39 39 40 public void AddValue(string name, object value) { 41 if (MetaMode) { 42 metaInfo.Add(new Tag(name, value)); 43 } else { 44 customValues.Add(new Tag(name, value)); 40 public void AddValue(string name, object value) { 41 if (MetaMode) { 42 metaInfo.Add(new Tag(name, value)); 43 } else { 44 customValues.Add(new Tag(name, value)); 45 } 46 } 47 48 public void Populate() { 49 decomposer.Populate(Obj, customValues, type); 45 50 } 46 51 } 47 48 public void Populate() {49 decomposer.Populate(Obj, customValues, type);50 }51 }52 53 public class Deserializer {54 52 55 53 private readonly Dictionary<int, object> id2obj; -
trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj
r1564 r1567 101 101 <Compile Include="Core\TypeStringBuilder.cs" /> 102 102 <Compile Include="Core\GeneratorBase.cs" /> 103 <Compile Include="Default\DebugString\DebugString.cs" /> 104 <Compile Include="Default\DebugString\DebugStringFormat.cs" /> 105 <Compile Include="Default\DebugString\ValueType2DebugStringFormatterBase.cs" /> 106 <Compile Include="Default\DebugString\String2DebugStringFormatter.cs" /> 107 <Compile Include="Default\DebugString\Bool2DebugStringFormatter.cs" /> 108 <Compile Include="Default\DebugString\Int2DebugStringFormatter.cs" /> 109 <Compile Include="Default\DebugString\Doubld2DebugStringFormatter.cs" /> 110 <Compile Include="Default\DebugString\DateTime2DebugStringFormatter.cs" /> 111 <Compile Include="Default\DebugString\Type2DebugStringFormatter.cs" /> 112 <Compile Include="Default\DebugString\Float2DebugStringFormatter.cs" /> 113 <Compile Include="Default\DebugString\DebugStringGenerator.cs" /> 103 114 <Compile Include="Default\Decomposers\ArrayDecomposer.cs" /> 115 <Compile Include="Default\Decomposers\Number2StringConverter.cs" /> 116 <Compile Include="Default\Decomposers\CompactNumberArray2StringDecomposer.cs" /> 104 117 <Compile Include="Default\Decomposers\EnumerableDecomposer.cs" /> 105 118 <Compile Include="Default\Decomposers\EnumDecomposer.cs" /> … … 108 121 <Compile Include="Default\Decomposers\StorableDecomposer.cs" /> 109 122 <Compile Include="Default\Decomposers\TypeDecomposer.cs" /> 110 <Compile Include="Default\Decomposers\X2StringDecomposer.cs" /> 111 <Compile Include="Default\ViewOnly\ViewOnlyFormat.cs"> 112 <SubType>Code</SubType> 113 </Compile> 123 <Compile Include="Default\Decomposers\NumberEnumerable2StringDecomposer.cs" /> 114 124 <Compile Include="Default\Xml\Compact\IntArray2XmlFormatters.cs" /> 115 125 <Compile Include="Default\Xml\Compact\DoubleArray2XmlFormatters.cs" />
Note: See TracChangeset
for help on using the changeset viewer.