The solution I would use in that situation is make another layer of abstract classes that the classes that need the special Foo2
derive from instead.
abstract class A : X
{
public virtual void Foo()
{
//Foo logic
}
}
abstract class B : A
{
protected virtual void Foo2()
{
//Foo2
}
override void Foo()
{
Foo2();
base.Foo();
}
}
public A1 : B
{
}
public A2 : A
{
}
public A3 : B
{
}