Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/04/17 17:19:35 (7 years ago)
Author:
gkronber
Message:

#2520: changed all usages of StorableClass to use StorableType with an auto-generated GUID (did not add StorableType to other type definitions yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StorableHookAttribute.cs

    r14925 r14927  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2121
    2222using System;
     23using System.Linq;
     24using System.Reflection;
    2325
    24 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
     26namespace HeuristicLab.Persistence {
    2527
    2628
     
    4951  /// </summary>
    5052  [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
     53  [StorableType("983bf558-1458-4129-b018-7e121ac3840e")]
    5154  public sealed class StorableHookAttribute : Attribute {
     55    public static bool IsStorableHook(MethodInfo methodInfo) {
     56      return Attribute.IsDefined(methodInfo, typeof(StorableHookAttribute), false);
     57    }
     58    public static StorableHookAttribute[] GetStorableHookAttributes(MethodInfo methodInfo) {
     59      return Attribute.GetCustomAttributes(methodInfo, false).OfType<StorableHookAttribute>().ToArray();
     60    }
    5261
    5362    private readonly HookType hookType;
     
    6473    /// at the <c>HookType</c> time.
    6574    /// </summary>
    66     /// <param name="hookType">Type of the hook.</param>
     75    /// <param name="hookType">MemberSelection of the hook.</param>
    6776    public StorableHookAttribute(HookType hookType) {
    6877      this.hookType = hookType;
Note: See TracChangeset for help on using the changeset viewer.