title: C# method pointer like in C++
body: <p>In C++ I was able to create my method pointer without knowing on which instance it will be called, but in C# I can't do it - I need the instance on the delegate creation.</p>
  
  <p>This is what I'm looking for :</p>
  
  <p>Here is the code from <a href="https://msdn.microsoft.com/fr-fr/library/system.action(v=vs.110).aspx" rel="nofollow">MSDN</a></p>
  
  <pre><code>using System;
  using System.Windows.Forms;
  
  public class Name
  {
     private string instanceName;
  
     public Name(string name)
     {
        this.instanceName = name;
     }
  
     public void DisplayToConsole()
     {
        Console.WriteLine(this.instanceName);
     }
  
     public void DisplayToWindow()
     {
        MessageBox.Show(this.instanceName);
     }
  }
  
  public class testTestDelegate
  {
     public static void Main()
     {
        Name testName = new Name("Koani");
        Action showMethod = testName.DisplayToWindow;
        showMethod();
     }
  }
  </code></pre>
  
  <p>But I want to do that : </p>
  
  <pre><code>public class testTestDelegate
  {
      public static void Main()
      {
          Name testName = new Name("Koani");
          Action showMethod = Name.DisplayToWindow;
          testName.showMethod();
      }
  }
  </code></pre>