C#: How to structure this method that is meant to be overridden
<p>So, I have the method below, which is part of an <code>abstract</code> class that is basically a 2d array of characters. I intend to have several subclasses with slightly different behavior, that know how to populate themselves in different ways.</p>

<p>The method in question is supposed to insert a string into the array. To avoid overflow errors, I need to check if there is room in the array. Checking whether this is enough room is simple enough, but that is where the problem begins.</p>

<p>If there isn't enough room, I want each subclass to define how it will handle that behavior. (E.g., some subclasses will just start over at the beginning, others will do nothing and stop inserting characters, others will erase the top line, move everything up, and write it on the new blank line on the bottom, others will just give up and crash the program, etc.)</p>

<p>See the comments in the below code. I think I want to <code>override</code> the implementation, but is there a way I can just override the else branch, or do I have to move the whole method into the subclass?</p>

<p>(<code>IsEnoughRoom</code> is a private method within the class.)</p>

<pre><code>internal void InsertString(string stringToInsert, int xStart, int yStart)
{
    char[] charsToInsert = stringToInsert.ToCharArray();
    int currentXPosition = xStart;
    int currentYPosition = yStart;

    // For each character in the array of charsToInsert,
    for (int i = 0; i &lt; charsToInsert.Length; i++)
    {
        // Check if there is enough room...
        if(isEnoughRoom(xStart, yStart, charsToInsert))
        {
            SetCharAt(currentXPosition, currentYPosition, charsToInsert[i]);

            if (currentXPosition &lt; xSize - 1)
            {
                currentXPosition++;
            }
            else
            {
                currentXPosition = 0;
                currentYPosition++;
            }
        }
        else
        {
            //TODO: What do we do if there isn't enough room?
        }
}
</code></pre>