Changeset 14927 for branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StorableHookAttribute.cs
- Timestamp:
- 05/04/17 17:19:35 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/StorableHookAttribute.cs
r14925 r14927 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.Linq; 24 using System.Reflection; 23 25 24 namespace HeuristicLab.Persistence .Default.CompositeSerializers.Storable{26 namespace HeuristicLab.Persistence { 25 27 26 28 … … 49 51 /// </summary> 50 52 [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)] 53 [StorableType("983bf558-1458-4129-b018-7e121ac3840e")] 51 54 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 } 52 61 53 62 private readonly HookType hookType; … … 64 73 /// at the <c>HookType</c> time. 65 74 /// </summary> 66 /// <param name="hookType"> Typeof the hook.</param>75 /// <param name="hookType">MemberSelection of the hook.</param> 67 76 public StorableHookAttribute(HookType hookType) { 68 77 this.hookType = hookType;
Note: See TracChangeset
for help on using the changeset viewer.