title: c# Calling an method from an object
body: <p>So I roughly got this:</p>
  
  <pre><code>public partial class Form1 : Form
  {
      GameEngine engine;
      public Form1()
      {
          engine = new GameEngine();
      }
  
      public void repaint()
      {
  
      }
  }
  
  class GameEngine
  {
      public void update()
      {
  
      }
  }
  </code></pre>
  
  <p>Now i wanna add something to the update() method, which makes it call the repaint() method, inside of that instance of the Form1 class, in which the respective object of the GameEngine class was created.</p>
  
  <p>In java i could've done it like this</p>
  
  <pre><code>        engine = new GameEngine()
          {
              public void repaintCaller()
              {
                  repaint();
              }
          };
  </code></pre>
  
  <p>and call repaintCaller() in the update() method, but that doesn't work in c#, now what is the equilvalent way to do this in c#?</p>