Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableHookAttribute.cs @ 3199

Last change on this file since 3199 was 3036, checked in by epitzer, 15 years ago

make most serializers internal and complete API documentation (#548)

File size: 1.5 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Reflection;
6
7namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
8
9
10  /// <summary>
11  /// Indicates the time at which the hook should be invoked.
12  /// </summary>
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 };
26
27
28  /// <summary>
29  /// Mark methods that should be called at certain times during
30  /// serialization/deserialization by the <c>StorableSerializer</c>.
31  /// </summary>
32  [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
33  public sealed class StorableHookAttribute : Attribute {   
34
35    private readonly HookType hookType;
36    /// <summary>
37    /// Gets the type of the hook.
38    /// </summary>
39    /// <value>The type of the hook.</value>
40    public HookType HookType {
41      get { return hookType; }
42    }
43
44    /// <summary>
45    /// Mark method as <c>StorableSerializer</c> hook to be run
46    /// at the <c>HookType</c> time.
47    /// </summary>
48    /// <param name="hookType">Type of the hook.</param>
49    public StorableHookAttribute(HookType hookType) {
50      this.hookType = hookType;
51    }   
52  }
53}
Note: See TracBrowser for help on using the repository browser.