title: How use IInterceptor in Castle.DynamicProxy?
body: <p>I wrote an example like this</p>
  
  <p><strong>Simple Calculator class :</strong></p>
  
  <pre><code>public class Calculator
  {
      public int Add(int a, int b)
      {
          return a + b;
      }
  }
  </code></pre>
  
  <p><strong>implemented "IInterceptor" that provided by DynamicProxy</strong></p>
  
  <pre><code> [Serializable]
  public abstract class Interceptor : IInterceptor
  {
      public void Intercept(IInvocation invocation)
      {
          ExecuteBefore(invocation);
          invocation.Proceed();
          ExecuteAfter(invocation);
  
      }
      protected abstract void ExecuteAfter(IInvocation invocation);
      protected abstract void ExecuteBefore(IInvocation invocation);
  }
  </code></pre>
  
  <p><strong>Created an Interceptor class and inherited from "Interceptor" class</strong></p>
  
  <pre><code>    public class CalculatorInterceptor : Interceptor
  {
      protected override void ExecuteBefore(Castle.DynamicProxy.IInvocation invocation)
      {
          Console.WriteLine("Start");
      }
  
      protected override void ExecuteAfter(Castle.DynamicProxy.IInvocation invocation)
      {
          Console.WriteLine("End");
      }
  }
  </code></pre>
  
  <p>but when I used it NOT working !!!</p>
  
  <pre><code>static void Main(string[] args)
      {
          ProxyGenerator generator = new ProxyGenerator();
          Calculator c = generator.CreateClassProxy&lt;Calculator&gt;(new CalculatorInterceptor());
          var r = c.Add(11, 22);
          Console.WriteLine(r);
          Console.ReadKey();
      }
  </code></pre>
  
  <p>I excepted to see something like this :</p>
  
  <pre><code>START
  33
  END
  </code></pre>
  
  <p>but only show</p>
  
  <pre><code>33
  </code></pre>
  
  <p>How I can correct it ?!</p>