Calling virtual method from base : <p>I am trying to make a library for MigraDoc, based on <a href="http://www.pdfsharp.net/wiki/Invoice-sample.ashx" rel="nofollow noreferrer">this example</a>, which supports different types of documents. My idea was to make a base class, with a virtual method for <code>CreatePage()</code> (the method responsible for the page layout). However, the concept was that <code>CreatePage()</code> should be called from a method called <code>CreateDocument()</code> which is called by the user. Alas, it will be possible to override <code>CreatePage()</code>, but it is not meant to be called directly. It will look something like this:</p>

<pre><code>public class DocumentWriter
{
    private Document document;

    public virtual void CreateDocument(IDocumentArgs args)
    {
       document = new Document();

       DefineStyles();
       CreatePage();
       FillContent(args);
    }

    public virtual void CreatePage()
    {
        // Create page layout here
    }

    // Remaining code skipped for readability...
}
</code></pre>

<p>But if create inherited class, which overrides <code>CreatePage()</code>, then which method will be called from <code>CreateDocument()</code>?</p>

<ul>
<li>The original virtual (non-overridden) method</li>
<li>The method which overrides <code>CreatePage()</code></li>
</ul>
