Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/17/11 17:16:33 (13 years ago)
Author:
epitzer
Message:

check hooks by method name only (#1530)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceSpeedUp/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAnalyzer.cs

    r6224 r6228  
    139139      if (methodInfo.ReturnType != typeof(void) || methodInfo.GetParameters().Length > 0)
    140140        return;
    141       var attribute = (StorableHookAttribute)methodInfo.GetCustomAttributes(typeof(StorableHookAttribute), false).SingleOrDefault();
    142       if (attribute != null)
    143         typeDescriptor.Hooks.Add(new HookDescriptor(typeDescriptor, methodInfo, attribute.HookType));
     141      switch (methodInfo.Name) {
     142        case "AfterDeserialization":
     143          typeDescriptor.Hooks.Add(new HookDescriptor(typeDescriptor, methodInfo, HookType.AfterDeserialization));
     144          break;
     145        case "BeforeSerialization":
     146          typeDescriptor.Hooks.Add(new HookDescriptor(typeDescriptor, methodInfo, HookType.BeforeSerialization));
     147          break;
     148        default: break;
     149      }
    144150    }
    145151  }
Note: See TracChangeset for help on using the changeset viewer.