private void AddDecorator(ActionChain<PatternTestInstanceState> chain)
 {
     chain.Around(delegate(PatternTestInstanceState childState, Action<PatternTestInstanceState> inner)
     {
         TestShell.RunGuarded(delegate
         {
             using (ReadLockCookie.Create())
             {
                 inner(childState);
             }
         });
     });
 }
 private void WrapDefaultAction(ActionChain<PatternTestInstanceState> chain, Action<PatternTestInstanceState> decoratorAction)
 {
     chain.Around((testInstanceState, decoratedAction) =>
     {
         try
         {
             testInstanceState.Data.SetValue(defaultActionKey, decoratedAction);
             decoratorAction(testInstanceState);
         }
         finally
         {
             testInstanceState.Data.RemoveValue(defaultActionKey);
         }
     });
 }