Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/11/10 12:54:14 (15 years ago)
Author:
epitzer
Message:

add complete persistence API docs (#548)

Location:
trunk/sources/HeuristicLab.Persistence/3.3/Default
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/DataMemberAccessor.cs

    r1938 r3004  
    55namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
    66
     7  /// <summary>
     8  /// Encapsulation and abstraction for access a data member of an object
     9  /// regardless of it being a property or field. Addicionally a
     10  /// default value and an alternate name can be specified.
     11  /// </summary>
    712  public class DataMemberAccessor {
    813
     
    1217    public readonly object DefaultValue;
    1318
     19
     20    /// <summary>
     21    /// Create a DataMemberAccessor from a FieldInfo or PropertyInfo for the give object.
     22    /// </summary>
    1423    public DataMemberAccessor(MemberInfo memberInfo, string name, object defaultvalue, object obj) {
    1524      Name = name;
     
    3342    }
    3443
     44    /// <summary>
     45    /// Wrap existing getter and setter functions.
     46    /// </summary>
    3547    public DataMemberAccessor(string name, object defaultValue,
    3648        Func<object> getter, Action<object> setter) {
     
    4052      Set = setter;
    4153    }
    42 
     54   
     55    /// <summary>
     56    /// Create an empty accessor that just encapsulates an object
     57    /// without access.
     58    /// </summary>
    4359    public DataMemberAccessor(object o) {
    4460      Name = null;
     
    4864    }
    4965
     66    /// <summary>
     67    /// Create an empty accessor that just encapsulates an object
     68    /// without access.
     69    /// </summary>
    5070    public DataMemberAccessor(object o, string name) {
    5171      Name = name;
     
    5474      Set = null;
    5575    }
    56 
    5776
    5877    public override string ToString() {
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Bitmap2XmlSerializer.cs

    r2965 r3004  
    1111
    1212namespace HeuristicLab.Persistence.Default.Xml.Primitive {
    13   public class Bitmap2XmlSerializer :PrimitiveXmlSerializerBase<Bitmap>{
    14     private static Regex re = new Regex(@"<!\[CDATA\[((?:[^]]|\](?!\]>))*)\]\]>", RegexOptions.Singleline);
     13  public class Bitmap2XmlSerializer : PrimitiveXmlSerializerBase<Bitmap> {
    1514
    1615    public override XmlString Format(Bitmap o) {
    1716      MemoryStream stream = new MemoryStream();
    18       o.Save(stream,ImageFormat.Png);
     17      o.Save(stream, ImageFormat.Png);
    1918      byte[] array = stream.ToArray();
    2019      Byte1DArray2XmlSerializer serializer = new Byte1DArray2XmlSerializer();
     
    3231      Bitmap bitmap = new Bitmap(stream);
    3332      return bitmap;
    34   }
     33    }
    3534  }
    3635}
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs

    r2718 r3004  
    1111namespace HeuristicLab.Persistence.Default.Xml {
    1212
     13
     14  /// <summary>
     15  /// Main entry point of persistence to XML. Use the static methods to serialize
     16  /// to a file or to a stream.
     17  /// </summary>
    1318  public class XmlGenerator : GeneratorBase<string> {
    1419
     
    155160    }
    156161
     162    /// <summary>
     163    /// Serialize an object into a file.
     164    ///
     165    /// The XML configuration is obtained from the <code>ConfigurationService</code>.
     166    /// The file is actually a ZIP file.
     167    /// Compression level is set to 5 and needed assemblies are not included.
     168    /// </summary>   
    157169    public static void Serialize(object o, string filename) {
    158       Serialize(o, filename, ConfigurationService.Instance.GetDefaultConfig(new XmlFormat()), false, 5);
    159     }
    160 
     170      Serialize(o, filename, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, 5);
     171    }
     172
     173    /// <summary>
     174    /// Serialize an object into a file.
     175    ///
     176    /// The XML configuration is obtained from the <code>ConfigurationService</code>.
     177    /// Needed assemblies are not included.
     178    /// </summary>
     179    /// <param name="compression">ZIP file compression level</param>
    161180    public static void Serialize(object o, string filename, int compression) {
    162181      Serialize(o, filename, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, compression);
    163182    }
     183
    164184
    165185    public static void Serialize(object obj, string filename, Configuration config) {
Note: See TracChangeset for help on using the changeset viewer.