Overriding interface members



Hi,

I'm confronted with a problem that seems not to be solvable. In
general: How can I override an interface member of my base class and
call the overridden method from my derived class?

This is my class:
class RemoteXmlDataSource : System.Web.UI.WebControls.XmlDataSource

And I want to override
DataSourceView System.Web.UI.IDataSource.GetView(string viewName)
but I want to make a call to the overridden method right after my
stuff.

Declaring the member with override, I get the message
The modifier 'override' is not valid for this item

When trying to access the "overridden" member with
(IDataSource)base).GetView(viewName), I get the message
Use of keyword 'base' is not valid in this context

Ok I understand, my interface member completely replaces the member
from the base class. Is there any way to do this even though?
I tried something like
((IDataSource)(XmlDataSource)this).GetView(viewName)
but that just calls my new member :)

That makes deriving much harder than just overriding a virtual method
and calling base.X()... But I hope I just did not fully understand ;)

Kind regards, Sebastian

.



Relevant Pages

  • C# example
    ... When a member is overridden, the new member is called in place of the member ... if an instance of an inherited class is cast to its base class ... I created 2 classes and would like to call the "method" to depict the para ... public override string method() ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: diff between virtual and abstract?
    ... meaningful body in the base class, as it can't be defined), then it should ... if you just want to give the subclass the ... *ability* to override a method then it should be virtual. ... abstract member forces the entire class to be abstract, ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: VS 2005 Classname Drop down
    ... In VB.NET 2005, to override a method/property in an inherited class, open ... member in the list. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.general)
  • Re: denying inheritance
    ... "Gary Labowitz" writes: ... and still override the member ... >> Not having a virtual destructor really should keep sane people ...
    (alt.comp.lang.learn.c-cpp)
  • Re: .equals(o) and Set membership
    ... in which i have override the Object.equals ... > objects) and if another member of the class contains the same two objects ... > if i'm correct in reading the docs about how Set classes work, ... > method, which at runtime should bind to my overridden method, no? ...
    (comp.lang.java)