Changeset 3036 for trunk/sources/HeuristicLab.Persistence
- Timestamp:
- 03/15/10 14:45:46 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3
- Files:
-
- 71 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/TypeLoader.cs ¶
r3004 r3036 20 20 "Cannot load type \"{0}\", falling back to partial name", typeNameString)); 21 21 try { 22 TypeName typeName = TypeNameParser.Parse(typeNameString); 23 Assembly a = Assembly.LoadWithPartialName(typeName.AssemblyName); 22 TypeName typeName = TypeNameParser.Parse(typeNameString); 23 #pragma warning disable 0618 24 Assembly a = Assembly.LoadWithPartialName(typeName.AssemblyName); 25 // the suggested Assembly.Load() method fails to load assemblies outside the GAC 26 #pragma warning restore 0618 24 27 type = a.GetType(typeName.ToString(false, false), true); 25 28 } catch (Exception) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs ¶
r3017 r3036 36 36 [Storable] 37 37 public List<TypeName> GenericArgs { get; internal set; } 38 39 /// <summary> 40 /// Gets a value indicating whether this instance is generic. 41 /// </summary> 42 /// <value> 43 /// <c>true</c> if this instance is generic; otherwise, <c>false</c>. 44 /// </value> 38 45 public bool IsGeneric { get { return GenericArgs.Count > 0; } } 39 46 … … 87 94 /// Returns a <see cref="System.String"/> that represents this instance. 88 95 /// </summary> 89 /// <param name="full">if set to <c>true</c> includes full informat oin96 /// <param name="full">if set to <c>true</c> includes full information 90 97 /// about generic parameters and assembly properties.</param> 91 98 /// <returns> … … 100 107 /// Returns a <see cref="System.String"/> that represents this instance. 101 108 /// </summary> 109 /// <param name="full">if set to <c>true</c> includes full information 110 /// about generic parameters and assembly properties.</param> 102 111 /// <param name="includeAssembly">if set to <c>true</c> include assembly properties and generic parameters.</param> 103 112 /// <returns> -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Core/FormatBase.cs ¶
r3017 r3036 6 6 /// <summary> 7 7 /// Common base class for defining a new serialization format. 8 /// </summary> 8 /// </summary> 9 /// <typeparam name="SerialDataFormat">The type of the serial data format.</typeparam> 9 10 [StorableClass] 10 11 public abstract class FormatBase<SerialDataFormat> : IFormat<SerialDataFormat> where SerialDataFormat : ISerialData { … … 23 24 /// <summary> 24 25 /// Compares formats by name. 25 /// </summary> 26 /// </summary> 27 /// <param name="f">The format.</param> 28 /// <returns>wheter this object and f are equal by name.</returns> 26 29 public bool Equals(FormatBase<SerialDataFormat> f) { 27 30 if (f == null) … … 33 36 /// Compares foramts by name. 34 37 /// </summary> 38 /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param> 39 /// <returns> 40 /// <c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>. 41 /// </returns> 42 /// <exception cref="T:System.NullReferenceException"> 43 /// The <paramref name="obj"/> parameter is null. 44 /// </exception> 35 45 public override bool Equals(object obj) { 36 46 FormatBase<SerialDataFormat> f = obj as FormatBase<SerialDataFormat>; … … 38 48 } 39 49 50 /// <summary> 51 /// Returns a hash code for this instance. 52 /// </summary> 53 /// <returns> 54 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 55 /// </returns> 40 56 public override int GetHashCode() { 41 57 return Name.GetHashCode(); -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Core/PrimitiveSerializerBase.cs ¶
r3017 r3036 26 26 /// Parses the specified serialized data back into an object. 27 27 /// </summary> 28 /// <param name="t">The serial data.</param> 29 /// <returns>A newly created object representing the serialized data.</returns> 28 /// <param name="data">The serial data.</param> 29 /// <returns> 30 /// A newly created object representing the serialized data. 31 /// </returns> 30 32 public abstract Source Parse(SerialData data); 31 33 … … 54 56 /// Parses the specified serialized data back into an object. 55 57 /// </summary> 56 /// <param name=" t">The serial data.</param>58 /// <param name="data">The serial data.</param> 57 59 /// <returns>A newly created object representing the serialized data.</returns> 58 object IPrimitiveSerializer.Parse(ISerialData o) {59 return Parse((SerialData) o);60 object IPrimitiveSerializer.Parse(ISerialData data) { 61 return Parse((SerialData)data); 60 62 } 61 63 -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ArraySerializer.cs ¶
r3017 r3036 9 9 10 10 [StorableClass] 11 publicclass ArraySerializer : ICompositeSerializer {11 internal sealed class ArraySerializer : ICompositeSerializer { 12 12 13 13 public int Priority { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/CompactNumberArray2StringSerializer.cs ¶
r3017 r3036 11 11 12 12 [StorableClass] 13 publicclass CompactNumberArray2StringSerializer : ICompositeSerializer {13 internal sealed class CompactNumberArray2StringSerializer : ICompositeSerializer { 14 14 15 15 public int Priority { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/DictionarySerializer.cs ¶
r3017 r3036 10 10 11 11 [StorableClass] 12 publicclass DictionarySerializer : ICompositeSerializer {12 internal sealed class DictionarySerializer : ICompositeSerializer { 13 13 14 14 public int Priority { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumSerializer.cs ¶
r3017 r3036 8 8 9 9 [StorableClass] 10 publicclass EnumSerializer : ICompositeSerializer {10 internal sealed class EnumSerializer : ICompositeSerializer { 11 11 12 12 public int Priority { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs ¶
r3017 r3036 11 11 12 12 [StorableClass] 13 publicclass EnumerableSerializer : ICompositeSerializer {13 internal sealed class EnumerableSerializer : ICompositeSerializer { 14 14 15 15 public int Priority { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/KeyValuePairSerializer.cs ¶
r3017 r3036 10 10 11 11 [StorableClass] 12 publicclass KeyValuePairSerializer : ICompositeSerializer {12 internal sealed class KeyValuePairSerializer : ICompositeSerializer { 13 13 14 14 public int Priority { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Number2StringSerializer.cs ¶
r3017 r3036 12 12 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 13 13 14 /// <summary> 15 /// Serializes a primitive number type using the ToString() method and an 16 /// approriate precision and parses back the generated string using 17 /// the number type's Parse() method. 18 /// 19 /// This serializer has Priorty below zero and is disabled by default 20 /// but can be useful in generating custom serializers. 21 /// </summary> 14 22 [StorableClass] 15 public class Number2StringSerializer : ICompositeSerializer {23 public sealed class Number2StringSerializer : ICompositeSerializer { 16 24 17 25 private static readonly List<Type> numberTypes = … … 42 50 } 43 51 52 /// <summary> 53 /// Determines for every type whether the composite serializer is applicable. 54 /// </summary> 55 /// <param name="type">The type.</param> 56 /// <returns> 57 /// <c>true</c> if this instance can serialize the specified type; otherwise, <c>false</c>. 58 /// </returns> 44 59 public bool CanSerialize(Type type) { 45 60 return numberParsers.ContainsKey(type); 46 61 } 47 62 63 /// <summary> 64 /// Give a reason if possibly why the given type cannot be serialized by this 65 /// ICompositeSerializer. 66 /// </summary> 67 /// <param name="type">The type.</param> 68 /// <returns> 69 /// A string justifying why type cannot be serialized. 70 /// </returns> 48 71 public string JustifyRejection(Type type) { 49 72 return string.Format("not a number type (one of {0})", … … 51 74 } 52 75 76 /// <summary> 77 /// Formats the specified obj. 78 /// </summary> 79 /// <param name="obj">The obj.</param> 80 /// <returns></returns> 53 81 public string Format(object obj) { 54 82 if (obj.GetType() == typeof(float)) … … 61 89 } 62 90 91 /// <summary> 92 /// Parses the specified string value. 93 /// </summary> 94 /// <param name="stringValue">The string value.</param> 95 /// <param name="type">The type.</param> 96 /// <returns></returns> 63 97 public object Parse(string stringValue, Type type) { 64 98 try { … … 75 109 76 110 111 112 /// <summary> 113 /// Defines the Priorty of this composite serializer. Higher number means 114 /// higher prioriy. Negative numbers are fallback serializers that are 115 /// disabled by default. 116 /// All default generic composite serializers have priority 100. Specializations 117 /// have priority 200 so they will be tried first. Priorities are 118 /// only considered for default configurations. 119 /// </summary> 120 /// <value></value> 77 121 public int Priority { 78 122 get { return -100; } 79 123 } 80 124 125 /// <summary> 126 /// Generate MetaInfo necessary for instance creation. (e.g. dimensions 127 /// necessary for array creation. 128 /// </summary> 129 /// <param name="obj">An object.</param> 130 /// <returns>An enumerable of <see cref="Tag"/>s.</returns> 81 131 public IEnumerable<Tag> CreateMetaInfo(object obj) { 82 132 yield return new Tag(Format(obj)); 83 133 } 84 134 135 /// <summary> 136 /// Decompose an object into <see cref="Tag"/>s, the tag name can be null, 137 /// the order in which elements are generated is guaranteed to be 138 /// the same as they will be supplied to the Populate method. 139 /// </summary> 140 /// <param name="obj">An object.</param> 141 /// <returns>An enumerable of <see cref="Tag"/>s.</returns> 85 142 public IEnumerable<Tag> Decompose(object obj) { 86 143 // numbers are composed just of meta info … … 88 145 } 89 146 147 /// <summary> 148 /// Create an instance of the object using the provided meta information. 149 /// </summary> 150 /// <param name="type">A type.</param> 151 /// <param name="metaInfo">The meta information.</param> 152 /// <returns>A fresh instance of the provided type.</returns> 90 153 public object CreateInstance(Type type, IEnumerable<Tag> metaInfo) { 91 154 var it = metaInfo.GetEnumerator(); … … 102 165 } 103 166 167 /// <summary> 168 /// Fills an object with values from the previously generated <see cref="Tag"/>s 169 /// in Decompose. The order in which the values are supplied is 170 /// the same as they where generated. <see cref="Tag"/> names might be null. 171 /// </summary> 172 /// <param name="instance">An empty object instance.</param> 173 /// <param name="tags">The tags.</param> 174 /// <param name="type">The type.</param> 104 175 public void Populate(object instance, IEnumerable<Tag> tags, Type type) { 105 176 // numbers are composed just of meta info, no need to populate -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/NumberEnumerable2StringSerializer.cs ¶
r3017 r3036 12 12 13 13 [StorableClass] 14 publicclass NumberEnumerable2StringSerializer : ICompositeSerializer {14 internal sealed class NumberEnumerable2StringSerializer : ICompositeSerializer { 15 15 16 16 public int Priority { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StackSerializer.cs ¶
r3017 r3036 11 11 12 12 [StorableClass] 13 publicclass StackSerializer : ICompositeSerializer {13 internal sealed class StackSerializer : ICompositeSerializer { 14 14 15 15 public int Priority { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableHookAttribute.cs ¶
r3031 r3036 11 11 /// Indicates the time at which the hook should be invoked. 12 12 /// </summary> 13 public enum HookType { BeforeSerialization, AfterDeserialization }; 13 public enum HookType { 14 15 /// <summary> 16 /// States that this hook should be called before the storable 17 /// serializer starts decomposing the object. 18 /// </summary> 19 BeforeSerialization, 20 21 /// <summary> 22 /// States that this hook should be called after the storable 23 /// serializer hast complete re-assembled the object. 24 /// </summary> 25 AfterDeserialization }; 14 26 15 27 -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs ¶
r3031 r3036 18 18 /// </summary> 19 19 [StorableClass] 20 public class StorableSerializer : ICompositeSerializer {20 public sealed class StorableSerializer : ICompositeSerializer { 21 21 22 22 #region ICompositeSerializer implementation 23 23 24 /// <summary> 25 /// Priority 200, one of the first default composite serializers to try. 26 /// </summary> 27 /// <value></value> 24 28 public int Priority { 25 29 get { return 200; } 26 30 } 27 31 32 /// <summary> 33 /// Determines for every type whether the composite serializer is applicable. 34 /// </summary> 35 /// <param name="type">The type.</param> 36 /// <returns> 37 /// <c>true</c> if this instance can serialize the specified type; otherwise, <c>false</c>. 38 /// </returns> 28 39 public bool CanSerialize(Type type) { 29 40 if (!ReflectionTools.HasDefaultConstructor(type) && … … 33 44 } 34 45 46 /// <summary> 47 /// Give a reason if possibly why the given type cannot be serialized by this 48 /// ICompositeSerializer. 49 /// </summary> 50 /// <param name="type">The type.</param> 51 /// <returns> 52 /// A string justifying why type cannot be serialized. 53 /// </returns> 35 54 public string JustifyRejection(Type type) { 36 55 if (!ReflectionTools.HasDefaultConstructor(type) && … … 42 61 } 43 62 63 /// <summary> 64 /// Creates the meta info. 65 /// </summary> 66 /// <param name="o">The object.</param> 67 /// <returns>A list of storable components.</returns> 44 68 public IEnumerable<Tag> CreateMetaInfo(object o) { 45 69 InvokeHook(HookType.BeforeSerialization, o); … … 47 71 } 48 72 73 /// <summary> 74 /// Decompose an object into <see cref="Tag"/>s, the tag name can be null, 75 /// the order in which elements are generated is guaranteed to be 76 /// the same as they will be supplied to the Populate method. 77 /// </summary> 78 /// <param name="obj">An object.</param> 79 /// <returns>An enumerable of <see cref="Tag"/>s.</returns> 49 80 public IEnumerable<Tag> Decompose(object obj) { 50 81 foreach (var accessor in GetStorableAccessors(obj)) { … … 55 86 private static readonly object[] defaultArgs = new object[] { true }; 56 87 88 /// <summary> 89 /// Create an instance of the object using the provided meta information. 90 /// </summary> 91 /// <param name="type">A type.</param> 92 /// <param name="metaInfo">The meta information.</param> 93 /// <returns>A fresh instance of the provided type.</returns> 57 94 public object CreateInstance(Type type, IEnumerable<Tag> metaInfo) { 58 95 try { … … 66 103 } 67 104 105 /// <summary> 106 /// Populates the specified instance. 107 /// </summary> 108 /// <param name="instance">The instance.</param> 109 /// <param name="objects">The objects.</param> 110 /// <param name="type">The type.</param> 68 111 public void Populate(object instance, IEnumerable<Tag> objects, Type type) { 69 112 var memberDict = new Dictionary<string, Tag>(); -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StructSerializer.cs ¶
r3017 r3036 11 11 12 12 [StorableClass] 13 publicclass StructSerializer : ICompositeSerializer {13 internal sealed class StructSerializer : ICompositeSerializer { 14 14 15 15 public int Priority { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs ¶
r3017 r3036 9 9 10 10 [StorableClass] 11 publicclass TypeSerializer : ICompositeSerializer {11 internal sealed class TypeSerializer : ICompositeSerializer { 12 12 13 13 public int Priority { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringFormat.cs ¶
r3017 r3036 10 10 namespace HeuristicLab.Persistence.Default.DebugString { 11 11 12 /// <summary> 13 /// Simple write-only format for debugging purposes. 14 /// </summary> 12 15 [StorableClass] 13 16 public class DebugStringFormat : FormatBase<DebugString> { 17 /// <summary> 18 /// Gets the format's name. 19 /// </summary> 20 /// <value>The format's name.</value> 14 21 public override string Name { get { return "DebugString"; } } 15 22 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringGenerator.cs ¶
r3005 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString { 10 10 11 /// <summary> 12 /// Generate a string that recursively describes an object graph. 13 /// </summary> 11 14 public class DebugStringGenerator : GeneratorBase<string> { 12 15 … … 14 17 private readonly bool showRefs; 15 18 19 /// <summary> 20 /// Initializes a new instance of the <see cref="DebugStringGenerator"/> class. 21 /// </summary> 16 22 public DebugStringGenerator() : this(true) { } 17 23 24 /// <summary> 25 /// Initializes a new instance of the <see cref="DebugStringGenerator"/> class. 26 /// </summary> 27 /// <param name="showRefs">if set to <c>true</c> show references.</param> 18 28 public DebugStringGenerator(bool showRefs) { 19 29 isSepReq = false; … … 21 31 } 22 32 33 /// <summary> 34 /// Formats the specified begin token. 35 /// </summary> 36 /// <param name="beginToken">The begin token.</param> 37 /// <returns>The token in serialized form.</returns> 23 38 protected override string Format(BeginToken beginToken) { 24 39 StringBuilder sb = new StringBuilder(); … … 38 53 } 39 54 55 /// <summary> 56 /// Formats the specified end token. 57 /// </summary> 58 /// <param name="endToken">The end token.</param> 59 /// <returns>The token in serialized form.</returns> 40 60 protected override string Format(EndToken endToken) { 41 61 isSepReq = true; … … 43 63 } 44 64 65 /// <summary> 66 /// Formats the specified primitive token. 67 /// </summary> 68 /// <param name="primitiveToken">The primitive token.</param> 69 /// <returns>The token in serialized form.</returns> 45 70 protected override string Format(PrimitiveToken primitiveToken) { 46 71 StringBuilder sb = new StringBuilder(); … … 61 86 } 62 87 88 /// <summary> 89 /// Formats the specified reference token. 90 /// </summary> 91 /// <param name="referenceToken">The reference token.</param> 92 /// <returns>The token in serialized form.</returns> 63 93 protected override string Format(ReferenceToken referenceToken) { 64 94 StringBuilder sb = new StringBuilder(); … … 76 106 } 77 107 108 /// <summary> 109 /// Formats the specified null reference token. 110 /// </summary> 111 /// <param name="nullReferenceToken">The null reference token.</param> 112 /// <returns>The token in serialized form.</returns> 78 113 protected override string Format(NullReferenceToken nullReferenceToken) { 79 114 StringBuilder sb = new StringBuilder(); … … 89 124 } 90 125 126 /// <summary> 127 /// Formats the specified meta info begin token. 128 /// </summary> 129 /// <param name="metaInfoBeginToken">The meta info begin token.</param> 130 /// <returns>The token in serialized form.</returns> 91 131 protected override string Format(MetaInfoBeginToken metaInfoBeginToken) { 92 132 return "["; 93 133 } 94 134 135 /// <summary> 136 /// Formats the specified meta info end token. 137 /// </summary> 138 /// <param name="metaInfoEndToken">The meta info end token.</param> 139 /// <returns>The token in serialized form.</returns> 95 140 protected override string Format(MetaInfoEndToken metaInfoEndToken) { 96 141 return "]"; 97 142 } 98 143 144 /// <summary> 145 /// Formats the specified type token. 146 /// </summary> 147 /// <param name="typeToken">The type token.</param> 148 /// <returns>The token in serialized form.</returns> 99 149 protected override string Format(TypeToken typeToken) { 100 150 return string.Empty; 101 151 } 102 152 153 /// <summary> 154 /// Serializes the specified object. 155 /// </summary> 156 /// <param name="o">The object.</param> 157 /// <returns>A string representation of the complete object graph</returns> 103 158 public static string Serialize(object o) { 104 159 return Serialize(o, ConfigurationService.Instance.GetDefaultConfig(new DebugStringFormat())); 105 160 } 106 161 162 /// <summary> 163 /// Serializes the specified object. 164 /// </summary> 165 /// <param name="o">The object.</param> 166 /// <param name="configuration">The persistence configuration.</param> 167 /// <returns>A string representation of the complete object graph.</returns> 107 168 public static string Serialize(object o, Configuration configuration) { 108 169 Serializer s = new Serializer(o, configuration); -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Bool2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass Bool2DebugStringSerializer : DebugStringSerializerBase<bool> { }11 internal sealed class Bool2DebugStringSerializer : DebugStringSerializerBase<bool> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Byte2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass Byte2DebugStringSerializer : DebugStringSerializerBase<byte> { }11 internal sealed class Byte2DebugStringSerializer : DebugStringSerializerBase<byte> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Char2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass Char2DebugStringSerializer : DebugStringSerializerBase<char> { }11 internal sealed class Char2DebugStringSerializer : DebugStringSerializerBase<char> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/DateTime2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass DateTime2DebugStringSerializer : DebugStringSerializerBase<DateTime> { }11 internal sealed class DateTime2DebugStringSerializer : DebugStringSerializerBase<DateTime> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Double2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass Double2DebugStringSerializer : DebugStringSerializerBase<double> { }11 internal sealed class Double2DebugStringSerializer : DebugStringSerializerBase<double> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Float2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass Float2DebugStringSerializer : DebugStringSerializerBase<float> { }11 internal sealed class Float2DebugStringSerializer : DebugStringSerializerBase<float> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Int2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass Int2DebugStringSerializer : DebugStringSerializerBase<int> { }11 internal sealed class Int2DebugStringSerializer : DebugStringSerializerBase<int> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Long2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass Long2DebugStringSerializer : DebugStringSerializerBase<long> { }11 internal sealed class Long2DebugStringSerializer : DebugStringSerializerBase<long> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/SByte2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass SByte2DebugStringSerializer : DebugStringSerializerBase<sbyte> { }11 internal sealed class SByte2DebugStringSerializer : DebugStringSerializerBase<sbyte> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Short2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass Short2DebugStringSerializer : DebugStringSerializerBase<short> { }11 internal sealed class Short2DebugStringSerializer : DebugStringSerializerBase<short> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/String2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass String2DebugStringSerializer : DebugStringSerializerBase<string> { }11 internal sealed class String2DebugStringSerializer : DebugStringSerializerBase<string> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Type2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass Type2DebugStringSerializer : DebugStringSerializerBase<Type> { }11 internal sealed class Type2DebugStringSerializer : DebugStringSerializerBase<Type> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/UInt2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass UInt2DebugStringSerializer : DebugStringSerializerBase<uint> { }11 internal sealed class UInt2DebugStringSerializer : DebugStringSerializerBase<uint> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/ULong2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass ULong2DebugStringSerializer : DebugStringSerializerBase<ulong> { }11 internal sealed class ULong2DebugStringSerializer : DebugStringSerializerBase<ulong> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/UShort2DebugStringSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicclass UShort2DebugStringSerializer : DebugStringSerializerBase<ushort> { }11 internal sealed class UShort2DebugStringSerializer : DebugStringSerializerBase<ushort> { } 12 12 13 13 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/ValueType2DebugStringSerializerBase.cs ¶
r1823 r3036 9 9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 publicabstract class DebugStringSerializerBase<T> : PrimitiveSerializerBase<T, DebugString> {11 internal abstract class DebugStringSerializerBase<T> : PrimitiveSerializerBase<T, DebugString> { 12 12 public override DebugString Format(T o) { return new DebugString(o.ToString()); } 13 13 public override T Parse(DebugString s) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/ByteArray2XmlSerializer.cs ¶
r2940 r3036 5 5 6 6 namespace HeuristicLab.Persistence.Default.Xml.Compact { 7 publicclass ByteArray2XmlSerializer<T> : NumberArray2XmlSerializerBase<T> where T : class {7 internal class ByteArray2XmlSerializer<T> : NumberArray2XmlSerializerBase<T> where T : class { 8 8 protected override string FormatValue(object o) { 9 9 return o.ToString(); … … 15 15 } 16 16 17 publicclass Byte1DArray2XmlSerializer : ByteArray2XmlSerializer<byte[]> { }17 internal sealed class Byte1DArray2XmlSerializer : ByteArray2XmlSerializer<byte[]> { } 18 18 19 publicclass Bytet2DArray2XmlSerializer : ByteArray2XmlSerializer<byte[,]> { }19 internal sealed class Bytet2DArray2XmlSerializer : ByteArray2XmlSerializer<byte[,]> { } 20 20 21 publicclass Byte3DArray2XmlSerializer : ByteArray2XmlSerializer<byte[, ,]> { }21 internal sealed class Byte3DArray2XmlSerializer : ByteArray2XmlSerializer<byte[, ,]> { } 22 22 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/CompactXmlSerializerBase.cs ¶
r1823 r3036 5 5 namespace HeuristicLab.Persistence.Default.Xml.Compact { 6 6 7 publicabstract class CompactXmlSerializerBase<T> : XmlSerializerBase<T> { }7 internal abstract class CompactXmlSerializerBase<T> : XmlSerializerBase<T> { } 8 8 9 9 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleArray2XmlSerializer.cs ¶
r1958 r3036 5 5 namespace HeuristicLab.Persistence.Default.Xml.Compact { 6 6 7 publicabstract class DoubleArray2XmlSerializerBase<T> : NumberArray2XmlSerializerBase<T> where T : class {7 internal abstract class DoubleArray2XmlSerializerBase<T> : NumberArray2XmlSerializerBase<T> where T : class { 8 8 9 9 protected override string FormatValue(object o) { … … 16 16 } 17 17 18 publicclass Double1DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[]> { }18 internal sealed class Double1DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[]> { } 19 19 20 publicclass Double2DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[,]> { }20 internal sealed class Double2DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[,]> { } 21 21 22 publicclass Double3DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[, ,]> { }22 internal sealed class Double3DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[, ,]> { } 23 23 24 24 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleList2XmlSerializer.cs ¶
r1958 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Compact { 8 8 9 publicclass DoubleList2XmlSerializer : NumberEnumeration2XmlSerializerBase<List<double>> {9 internal sealed class DoubleList2XmlSerializer : NumberEnumeration2XmlSerializerBase<List<double>> { 10 10 11 11 protected override void Add(IEnumerable enumeration, object o) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntArray2XmlSerializer.cs ¶
r1853 r3036 4 4 namespace HeuristicLab.Persistence.Default.Xml.Compact { 5 5 6 publicabstract class IntArray2XmlSerializerBase<T> : NumberArray2XmlSerializerBase<T> where T : class {6 internal abstract class IntArray2XmlSerializerBase<T> : NumberArray2XmlSerializerBase<T> where T : class { 7 7 8 8 protected override string FormatValue(object o) { … … 15 15 } 16 16 17 publicclass Int1DArray2XmlSerializer : IntArray2XmlSerializerBase<int[]> { }17 internal class Int1DArray2XmlSerializer : IntArray2XmlSerializerBase<int[]> { } 18 18 19 publicclass Int2DArray2XmlSerializer : IntArray2XmlSerializerBase<int[,]> { }19 internal class Int2DArray2XmlSerializer : IntArray2XmlSerializerBase<int[,]> { } 20 20 21 publicclass Int3DArray2XmlSerializer : IntArray2XmlSerializerBase<int[, ,]> { }21 internal class Int3DArray2XmlSerializer : IntArray2XmlSerializerBase<int[, ,]> { } 22 22 23 23 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntList2XmlSerializer.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Compact { 8 8 9 publicclass IntList2XmlSerializer : NumberEnumeration2XmlSerializerBase<List<int>> {9 internal sealed class IntList2XmlSerializer : NumberEnumeration2XmlSerializerBase<List<int>> { 10 10 11 11 protected override void Add(IEnumerable enumeration, object o) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberArray2XmlSerializerBase.cs ¶
r3017 r3036 9 9 10 10 [StorableClass] 11 publicabstract class NumberArray2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : class {11 internal abstract class NumberArray2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : class { 12 12 13 13 protected virtual string Separator { get { return ";"; } } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberEnumeration2XmlSerializerBase.cs ¶
r3017 r3036 9 9 10 10 [StorableClass] 11 publicabstract class NumberEnumeration2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : IEnumerable {11 internal abstract class NumberEnumeration2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : IEnumerable { 12 12 13 13 protected virtual string Separator { get { return ";"; } } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Bool2XmlSerializer.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass Bool2XmlSerializer : SimpleNumber2XmlSerializerBase<bool> { }9 internal sealed class Bool2XmlSerializer : SimpleNumber2XmlSerializerBase<bool> { } 10 10 11 11 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Byte2XmlSerializer.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass Byte2XmlSerializer : SimpleNumber2XmlSerializerBase<byte> { }9 internal sealed class Byte2XmlSerializer : SimpleNumber2XmlSerializerBase<byte> { } 10 10 11 11 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Char2XmlFormatter.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass Char2XmlSerializer : PrimitiveSerializerBase<char, XmlString> {9 internal sealed class Char2XmlSerializer : PrimitiveSerializerBase<char, XmlString> { 10 10 11 11 public override XmlString Format(char c) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DateTime2XmlSerializer.cs ¶
r1853 r3036 5 5 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 6 6 7 publicclass DateTime2XmlSerializer : PrimitiveXmlSerializerBase<DateTime> {7 internal sealed class DateTime2XmlSerializer : PrimitiveXmlSerializerBase<DateTime> { 8 8 9 9 public override XmlString Format(DateTime dt) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Decimal2XmlSerializer.cs ¶
r1958 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass Decimal2XmlSerializer : PrimitiveXmlSerializerBase<decimal> {9 internal sealed class Decimal2XmlSerializer : PrimitiveXmlSerializerBase<decimal> { 10 10 11 11 public static decimal ParseG30(string s) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Double2XmlSerializer.cs ¶
r1958 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass Double2XmlSerializer : PrimitiveXmlSerializerBase<double> {9 internal sealed class Double2XmlSerializer : PrimitiveXmlSerializerBase<double> { 10 10 11 11 public static double ParseG17(string s) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Float2XmlSerializer.cs ¶
r1958 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass Float2XmlSerializer : PrimitiveXmlSerializerBase<float> {9 internal sealed class Float2XmlSerializer : PrimitiveXmlSerializerBase<float> { 10 10 11 11 public static float ParseG8(string s) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Guid2XmlSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 10 10 11 publicclass Guid2XmlSerializer : PrimitiveXmlSerializerBase<Guid> {11 internal sealed class Guid2XmlSerializer : PrimitiveXmlSerializerBase<Guid> { 12 12 13 13 public override XmlString Format(Guid o) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Int2XmlSerializer.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass Int2XmlSerializer : SimpleNumber2XmlSerializerBase<int> { }9 internal sealed class Int2XmlSerializer : SimpleNumber2XmlSerializerBase<int> { } 10 10 11 11 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Long2XmlSerializer.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass Long2XmlSerializer : SimpleNumber2XmlSerializerBase<long> { }9 internal sealed class Long2XmlSerializer : SimpleNumber2XmlSerializerBase<long> { } 10 10 11 11 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/PrimitiveXmlSerializerBase.cs ¶
r1823 r3036 5 5 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 6 6 7 /// <summary> 8 /// Common base class for primitive XML serializers. 9 /// </summary> 10 /// <typeparam name="T">The source type being serialized to XMl.</typeparam> 7 11 public abstract class PrimitiveXmlSerializerBase<T> : XmlSerializerBase<T> { } 8 12 -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SByte2XmlSerializer.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass SByte2XmlSerializer : SimpleNumber2XmlSerializerBase<sbyte> { }9 internal sealed class SByte2XmlSerializer : SimpleNumber2XmlSerializerBase<sbyte> { } 10 10 11 11 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Short2XmlSerializer.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass Short2XmlSerializer : SimpleNumber2XmlSerializerBase<short> { }9 internal sealed class Short2XmlSerializer : SimpleNumber2XmlSerializerBase<short> { } 10 10 11 11 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SimpleNumber2XmlSerializerBase.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicabstract class SimpleNumber2XmlSerializerBase<T> : PrimitiveXmlSerializerBase<T> {9 internal abstract class SimpleNumber2XmlSerializerBase<T> : PrimitiveXmlSerializerBase<T> { 10 10 11 11 private static MethodInfo ParseMethod = typeof(T) -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/String2XmlSerializer.cs ¶
r2940 r3036 9 9 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 10 10 11 public class String2XmlSerializer : PrimitiveXmlSerializerBase<string> { 11 /// <summary> 12 /// Serializes a string to XML by embedding into a CDATA block. 13 /// </summary> 14 public sealed class String2XmlSerializer : PrimitiveXmlSerializerBase<string> { 12 15 16 /// <summary> 17 /// Formats the specified string. 18 /// </summary> 19 /// <param name="s">The string.</param> 20 /// <returns>An XmlString that embeds the string s in a CDATA section.</returns> 13 21 public override XmlString Format(string s) { 14 22 StringBuilder sb = new StringBuilder(); … … 21 29 private static Regex re = new Regex(@"<!CDATA\[((?:[]]|(?!\]>))*)\]\]>", RegexOptions.Singleline); 22 30 31 /// <summary> 32 /// Parses the specified XmlString into a string. 33 /// </summary> 34 /// <param name="x">The XMLString.</param> 35 /// <returns>The plain string contained in the XML CDATA section.</returns> 23 36 public override string Parse(XmlString x) { 24 37 StringBuilder sb = new StringBuilder(); -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Bitmap2XmlSerializer.cs ¶
r3004 r3036 11 11 12 12 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 13 publicclass Bitmap2XmlSerializer : PrimitiveXmlSerializerBase<Bitmap> {13 internal sealed class Bitmap2XmlSerializer : PrimitiveXmlSerializerBase<Bitmap> { 14 14 15 15 public override XmlString Format(Bitmap o) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/TimeSpan2XmlSerializer.cs ¶
r1853 r3036 9 9 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 10 10 11 publicclass TimeSpan2XmlSerializer : PrimitiveXmlSerializerBase<TimeSpan> {11 internal sealed class TimeSpan2XmlSerializer : PrimitiveXmlSerializerBase<TimeSpan> { 12 12 13 13 public override XmlString Format(TimeSpan o) { -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/UInt2XmlSerializer.cs ¶
r1853 r3036 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 publicclass UInt2XmlSerializer : SimpleNumber2XmlSerializerBase<uint> { }10 internal sealed class UInt2XmlSerializer : SimpleNumber2XmlSerializerBase<uint> { } 11 11 12 12 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/ULong2XmlSerializer.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass ULong2XmlSerializer : SimpleNumber2XmlSerializerBase<ulong> { }9 internal sealed class ULong2XmlSerializer : SimpleNumber2XmlSerializerBase<ulong> { } 10 10 11 11 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/UShort2XmlSerializer.cs ¶
r1853 r3036 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 publicclass UShort2XmlSerializer : SimpleNumber2XmlSerializerBase<ushort> { }9 internal sealed class UShort2XmlSerializer : SimpleNumber2XmlSerializerBase<ushort> { } 10 10 11 11 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlFormat.cs ¶
r3017 r3036 11 11 [StorableClass] 12 12 public class XmlFormat : FormatBase<XmlString> { 13 /// <summary> 14 /// Gets the format's name. 15 /// </summary> 16 /// <value>The format's name.</value> 13 17 public override string Name { get { return "XML"; } } 14 18 } -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs ¶
r3028 r3036 112 112 } 113 113 114 /// <summary> 115 /// Formats the specified begin token. 116 /// </summary> 117 /// <param name="beginToken">The begin token.</param> 118 /// <returns>The token in serialized form.</returns> 114 119 protected override string Format(BeginToken beginToken) { 115 120 var dict = new Dictionary<string, object> { … … 134 139 } 135 140 141 /// <summary> 142 /// Formats the specified end token. 143 /// </summary> 144 /// <param name="endToken">The end token.</param> 145 /// <returns>The token in serialized form.</returns> 136 146 protected override string Format(EndToken endToken) { 137 147 return CreateNodeEnd(XmlStringConstants.COMPOSITE); 138 148 } 139 149 150 /// <summary> 151 /// Formats the specified data token. 152 /// </summary> 153 /// <param name="dataToken">The data token.</param> 154 /// <returns>The token in serialized form.</returns> 140 155 protected override string Format(PrimitiveToken dataToken) { 141 156 var dict = new Dictionary<string, object> { … … 148 163 } 149 164 165 /// <summary> 166 /// Formats the specified ref token. 167 /// </summary> 168 /// <param name="refToken">The ref token.</param> 169 /// <returns>The token in serialized form.</returns> 150 170 protected override string Format(ReferenceToken refToken) { 151 171 return CreateNode(XmlStringConstants.REFERENCE, … … 155 175 } 156 176 177 /// <summary> 178 /// Formats the specified null ref token. 179 /// </summary> 180 /// <param name="nullRefToken">The null ref token.</param> 181 /// <returns>The token in serialized form.</returns> 157 182 protected override string Format(NullReferenceToken nullRefToken) { 158 183 return CreateNode(XmlStringConstants.NULL, … … 161 186 } 162 187 188 /// <summary> 189 /// Formats the specified meta info begin token. 190 /// </summary> 191 /// <param name="metaInfoBeginToken">The meta info begin token.</param> 192 /// <returns>The token in serialized form.</returns> 163 193 protected override string Format(MetaInfoBeginToken metaInfoBeginToken) { 164 194 return CreateNodeStart(XmlStringConstants.METAINFO); 165 195 } 166 196 197 /// <summary> 198 /// Formats the specified meta info end token. 199 /// </summary> 200 /// <param name="metaInfoEndToken">The meta info end token.</param> 201 /// <returns>The token in serialized form.</returns> 167 202 protected override string Format(MetaInfoEndToken metaInfoEndToken) { 168 203 return CreateNodeEnd(XmlStringConstants.METAINFO); … … 170 205 171 206 private TypeToken lastTypeToken; 207 /// <summary> 208 /// Formats the specified token. 209 /// </summary> 210 /// <param name="token">The token.</param> 211 /// <returns>The token in serialized form.</returns> 172 212 protected override string Format(TypeToken token) { 173 213 lastTypeToken = token; … … 205 245 /// <summary> 206 246 /// Serialize an object into a file. 207 ///208 247 /// The XML configuration is obtained from the <c>ConfigurationService</c>. 209 248 /// The file is actually a ZIP file. 210 249 /// Compression level is set to 5 and needed assemblies are not included. 211 /// </summary> 250 /// </summary> 251 /// <param name="o">The object.</param> 252 /// <param name="filename">The filename.</param> 212 253 public static void Serialize(object o, string filename) { 213 254 Serialize(o, filename, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, 5); -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlSerializerBase.cs ¶
r1823 r3036 4 4 5 5 namespace HeuristicLab.Persistence.Default.Xml { 6 6 7 /// <summary> 8 /// Common base class for all primitive XML Serializers. 9 /// </summary> 10 /// <typeparam name="T">The source type being serialized to XML.</typeparam> 7 11 public abstract class XmlSerializerBase<T> : PrimitiveSerializerBase<T, XmlString> { } 8 12 -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlString.cs ¶
r3017 r3036 6 6 namespace HeuristicLab.Persistence.Default.Xml { 7 7 8 /// <summary> 9 /// XML friendly encapsulation of string data. 10 /// </summary> 8 11 [StorableClass] 9 12 public class XmlString : ISerialData { 10 13 14 /// <summary> 15 /// Gets the XML string data. Essentially marks the string as 16 /// XML compatible string. 17 /// </summary> 18 /// <value>The XML string data.</value> 11 19 [Storable] 12 20 public string Data { get; private set; } … … 14 22 private XmlString() { } 15 23 24 /// <summary> 25 /// Initializes a new instance of the <see cref="XmlString"/> class. 26 /// </summary> 27 /// <param name="data">The xml data.</param> 16 28 public XmlString(string data) { 17 29 Data = data; 18 30 } 19 31 32 /// <summary> 33 /// Returns a <see cref="System.String"/> that represents this instance. 34 /// </summary> 35 /// <returns> 36 /// A <see cref="System.String"/> that represents this instance. 37 /// </returns> 20 38 public override string ToString() { 21 39 StringBuilder sb = new StringBuilder(); -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlStringConstants.cs ¶
r2718 r3036 11 11 namespace HeuristicLab.Persistence.Default.Xml { 12 12 13 struct XmlStringConstants {13 internal struct XmlStringConstants { 14 14 public const string PRIMITIVE = "PRIMITIVE"; 15 15 public const string COMPOSITE = "COMPOSITE"; -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj ¶
r3031 r3036 35 35 <WarningLevel>4</WarningLevel> 36 36 <DocumentationFile>bin\Release\HeuristicLab.Persistence-3.3.XML</DocumentationFile> 37 <TreatWarningsAsErrors>true</TreatWarningsAsErrors> 37 38 </PropertyGroup> 38 39 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/ICompositeSerializer.cs ¶
r3016 r3036 42 42 /// <summary> 43 43 /// Generate MetaInfo necessary for instance creation. (e.g. dimensions 44 /// necessary for array creation (see <see cref="ArraySerializer"/>).44 /// necessary for array creation. 45 45 /// </summary> 46 46 /// <param name="obj">An object.</param> -
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/IFormat.cs ¶
r3016 r3036 25 25 /// Marker interface for new serialization output format. Instead of implementing this 26 26 /// interface, derive from FormatBase. 27 /// </summary> 27 /// </summary> 28 /// <typeparam name="SerialDataFormat">The type of the serial data format.</typeparam> 28 29 public interface IFormat<SerialDataFormat> : IFormat where SerialDataFormat : ISerialData { 29 30 }
Note: See TracChangeset
for help on using the changeset viewer.