S
Sebastian
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
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