title: Dictionary with delegate as value
body: <p>I have following class</p>
  
  <pre><code>public class CVisitor : IVisitor
      {
          public int Visit(Heartbeat element)
          {
              Trace.WriteLine("Heartbeat"); 
              return 1;
          }
          public int Visit(Information element)
          {
              Trace.WriteLine("Information"); 
               return 1;
          }
  
      }
  </code></pre>
  
  <p>I want to have a Dictionary with mappings, that every argument type will be mapped to it's implementation function:Heartbeat will be mapped to <code>public int Visit(Heartbeat element)</code></p>
  
  <p>I thought to do something like following:</p>
  
  <pre><code>    _messageMapper = new Dictionary&lt;Type, "what should be here ?" &gt;();
      _messageMapper.Add(typeof(Heartbeat), "and how I put it here?" );
  </code></pre>
  
  <p>what should I put instead "what should be here ?" and "and how I put it here?"</p>
  
  <p>Thanks </p>