Lets imagine:
// assembly 01
abstract class Foo
{
abstract void Bar();
}
class AdvancedFoo : Foo
{
override void Bar() { base.Foo(); ... }
}
sealed class SuperiorFoo : AdvancedFoo
{
override sealed void Bar() { base.Foo(); }
}
And then I want to reference that assembly 01 from my 02 asm and replace the intermediate base class (and only it) so the instances of a SuperiorFoo
were acting like they are inhereting from assembly 02's AdvancedFoo
.
// assembly 02
class AdvancedFoo : Foo
{
override void Bar() { base.Foo(); ... }
}
Is there any way to do that by not rewriting the SuperiorFoo
class declaration if the 02 assembly?
var supFoo = new SuperiorFoo();
supFoo.Bar(); // This one should call assembly 02's Bar();