Re: Call root base method from doubly derived class?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



DrBonzo,

No, there isn't. B would have to expose a method which would expose the
base method of A, without doing anything else.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"DrBonzo" <DrBonzo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:735B045B-52E9-43C5-86AA-0482CB9D2E98@xxxxxxxxxxxxxxxx
> Given
>
> public class A {
> virtual void foo() { ... }
> }
>
> public class B : A {
> public override void foo() { ... }
> public Bthingy() { ... base.foo() ...}
> }
>
> public class C : B {
> public override void foo() { . . . }
> public Cthingy() { ... base.foo() ... }
> }
>
>
> Bthingy's 'base.foo()' calls class A's foo.
> Cthingy's 'base.foo()' calls class B's foo.
>
> Is there a way for Cthingy to call the class A foo?
>


.



Relevant Pages

  • Re: a case for multiple inheritance
    ... FYI The 'new' modifier will define a method as hiding a derived one, ... private new void Foo ... If you want to expose two read-only lists from your ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: OO question on overriding virtual methods
    ... > I'm actually developing architectural frameworks for application ... > developing and I think virtual methods, ... > 2) Method can be overriten if needed but if it is, base method should ... > public class B:A ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Wrapper class
    ... situations you should probably have a look at the proxy/decorator patterns ... public class FooProxy: Foo{ ... public override void Bar() { ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Newbie question - Disadvantages of java
    ... >> as I am about to switch to java, can somebody tell me the biggest ... public class Foo { ... public Foo getFoo() { ... I.e. primitive types, references and array references? ...
    (comp.lang.java.programmer)
  • Re: XmlSerializer: Inheritance and Read-Only Properties
    ... > public class Bar: Foo ... > public string Message ...
    (microsoft.public.dotnet.xml)