title: Returning in a base class's method returns in child class call?
body: <p>I'm creating a C# framework in which (nearly) all of my classes will be based off of a single, abstract base class. This base class contains some privately-set properties, one of which being the boolean <strong>Garbage</strong>.</p>
  
  <p>In XNA's draw loop, I don't want any child classes to execute the code in their respective Draw() methods if the base class's <strong>Garbage</strong> property is set to true. I tried doing this with the following implementation:</p>
  
  <p>Abstract base class:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public virtual void Draw(GameTime GameTime, SpriteBatch SpriteBatch)
  {
      if (Garbage) return;
  }
  </code></pre>
  
  <p>Inherited class:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public void Draw(GameTime GameTime, SpriteBatch SpriteBatch, Color OverlayColor, float Scale)
  {
      base.Draw(GameTime, SpriteBatch);
  
      //Other code here...
  }    
  </code></pre>
  
  <p>Because the base class's Draw method is being called before the actual code in my child class, it hits that <strong>return</strong> statement, which I would want to follow through into my child class's Draw() call. However, this isn't happening.</p>
  
  <p>Is there any way to achieve the effect I want, without adding that "if (Garbage) return;" restriction to the top of every inherited class's Draw() method?</p>