Index: trunk/tools/FxCop/HeuristicLab.FxCop/EnforceAfterDeserializationHookName.cs
===================================================================
--- trunk/tools/FxCop/HeuristicLab.FxCop/EnforceAfterDeserializationHookName.cs	(revision 7340)
+++ 	(revision )
@@ -1,43 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System.Linq;
-using Microsoft.FxCop.Sdk;
-
-namespace HeuristicLab.FxCop {
-  internal sealed class EnforceAfterDeserializationHookName : HeuristicLabFxCopRuleBase {
-    public EnforceAfterDeserializationHookName()
-      : base("EnforceAfterDeserializationHookName") { }
-
-    public override ProblemCollection Check(Member member) {
-      Method method = member as Method;
-      if (method == null) return null;
-
-      if (method.Attributes.Any(x => x.Type.FullName == "HeuristicLab.Persistence.Default.CompositeSerializers.Storable.StorableHookAttribute")
-        && method.Name.Name != "AfterDeserialization") {
-        var resolution = GetResolution(method.FullName);
-        Problems.Add(new Problem(resolution));
-      }
-
-      return Problems;
-    }
-  }
-}
Index: trunk/tools/FxCop/HeuristicLab.FxCop/EnforceOneStorableHookPerClass.cs
===================================================================
--- trunk/tools/FxCop/HeuristicLab.FxCop/EnforceOneStorableHookPerClass.cs	(revision 7350)
+++ trunk/tools/FxCop/HeuristicLab.FxCop/EnforceOneStorableHookPerClass.cs	(revision 7350)
@@ -0,0 +1,55 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Linq;
+using Microsoft.FxCop.Sdk;
+
+namespace HeuristicLab.FxCop {
+  internal sealed class EnforceOneStorableHookPerClass : HeuristicLabFxCopRuleBase {
+    public EnforceOneStorableHookPerClass()
+      : base("EnforceOneStorableHookPerClass") { }
+
+    public override ProblemCollection Check(TypeNode type) {
+      var storableHooks = type.Members.Where(x => x.Attributes.Any(y => y.Type.FullName == "HeuristicLab.Persistence.Default.CompositeSerializers.Storable.StorableHookAttribute")).ToArray();
+      if (storableHooks.Length < 2) return null;
+      else {
+        int afterDeserialization = 0;
+        int beforeSerialization = 0;
+        foreach (var hook in storableHooks) {
+          var attribute = hook.Attributes.FirstOrDefault(x => x.Type.FullName == "HeuristicLab.Persistence.Default.CompositeSerializers.Storable.StorableHookAttribute");
+          if (attribute != null && attribute.Expressions.Count > 0) {
+            var literal = (Literal)attribute.Expressions[0];
+            if (literal != null && literal.Value is int) {
+              int hookType = (int)literal.Value;
+              if (hookType == 1) afterDeserialization++;
+              else if (hookType == 0) beforeSerialization++;
+            }
+          }
+        }
+        if (afterDeserialization > 1)
+          Problems.Add(new Problem(GetResolution(type.Name.Name, afterDeserialization, "AfterDeserialization")));
+        if (beforeSerialization > 1)
+          Problems.Add(new Problem(GetResolution(type.Name.Name, beforeSerialization, "BeforeSerialization")));
+      }
+      return Problems;
+    }
+  }
+}
Index: trunk/tools/FxCop/HeuristicLab.FxCop/EnforceStorableHookNames.cs
===================================================================
--- trunk/tools/FxCop/HeuristicLab.FxCop/EnforceStorableHookNames.cs	(revision 7350)
+++ trunk/tools/FxCop/HeuristicLab.FxCop/EnforceStorableHookNames.cs	(revision 7350)
@@ -0,0 +1,49 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Linq;
+using Microsoft.FxCop.Sdk;
+
+namespace HeuristicLab.FxCop {
+  internal sealed class EnforceStorableHookNames : HeuristicLabFxCopRuleBase {
+    public EnforceStorableHookNames()
+      : base("EnforceStorableHookNames") { }
+
+    public override ProblemCollection Check(Member member) {
+      Method method = member as Method;
+      if (method == null) return null;
+
+      var attribute = method.Attributes.FirstOrDefault(x => x.Type.FullName == "HeuristicLab.Persistence.Default.CompositeSerializers.Storable.StorableHookAttribute");
+      if (attribute != null && attribute.Expressions.Count > 0) {
+        var literal = (Literal)attribute.Expressions[0];
+        if (literal != null && literal.Value is int) {
+          int hookType = (int)literal.Value;
+          if (hookType == 1 && method.Name.Name != "AfterDeserialization") {
+            Problems.Add(new Problem(GetResolution(method.FullName, "AfterDeserialization")));
+          } else if (hookType == 0 && method.Name.Name != "BeforeSerialization") {
+            Problems.Add(new Problem(GetResolution(method.FullName, "BeforeSerialization")));
+          }
+        }
+      }
+      return Problems;
+    }
+  }
+}
Index: trunk/tools/FxCop/HeuristicLab.FxCop/HeuristicLab.FxCop.csproj
===================================================================
--- trunk/tools/FxCop/HeuristicLab.FxCop/HeuristicLab.FxCop.csproj	(revision 7340)
+++ trunk/tools/FxCop/HeuristicLab.FxCop/HeuristicLab.FxCop.csproj	(revision 7350)
@@ -47,5 +47,6 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="EnforceAfterDeserializationHookName.cs" />
+    <Compile Include="EnforceOneStorableHookPerClass.cs" />
+    <Compile Include="EnforceStorableHookNames.cs" />
     <Compile Include="HeuristicLabFxCopRuleBase.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
Index: trunk/tools/FxCop/HeuristicLab.FxCop/RuleMetadata.xml
===================================================================
--- trunk/tools/FxCop/HeuristicLab.FxCop/RuleMetadata.xml	(revision 7340)
+++ trunk/tools/FxCop/HeuristicLab.FxCop/RuleMetadata.xml	(revision 7350)
@@ -1,13 +1,23 @@
 ﻿<?xml version="1.0" encoding="utf-8" ?>
 <Rules FriendlyName="HeuristicLab 3.3 FxCop Rules">
-  <Rule TypeName="EnforceAfterDeserializationHookName" Category="HeuristicLab.Persistence" CheckId="HL0001">
-    <Name>Enforce AfterDeserialization as method name</Name>
-    <Description>Enforce the name AfterDeserialization for methods marked with the respective hook.</Description>
-    <Resolution>Method {0} is marked to act as an AfterDeserializationHook. It needs to be called AfterDeserialization.</Resolution>
+  <Rule TypeName="EnforceStorableHookNames" Category="HeuristicLab.Persistence" CheckId="HL0001">
+    <Name>Enforce StorableHook Names</Name>
+    <Description>The method that is marked to be a storable hook should always be called similar to the respective hook type.</Description>
+    <Resolution>Method {0} is attributed as a StorableHook. It needs to be called {1}.</Resolution>
     <MessageLevel Certainty="100">Error</MessageLevel>
-    <FixCategories>Breaking</FixCategories>
-    <Url />
-    <Owner />
-    <Email />
+    <FixCategories>NonBreaking</FixCategories>
+    <Url></Url>
+    <Owner></Owner>
+    <Email></Email>
+  </Rule>
+  <Rule TypeName="EnforceOneStorableHookPerClass" Category="HeuristicLab.Persistence" CheckId="HL0002">
+    <Name>Enforce One StorableHook Per Class</Name>
+    <Description>Each class shall have only one storable hook of each type.</Description>
+    <Resolution>Class {0} declares {1} storable hooks of type {2}. Merge these into one hook.</Resolution>
+    <MessageLevel Certainty="100">Error</MessageLevel>
+    <FixCategories>NonBreaking</FixCategories>
+    <Url></Url>
+    <Owner></Owner>
+    <Email></Email>
   </Rule>
 </Rules>
