C
Ching-Lung
Hi,
C#, like Java, doesn't allow multiple inheritance of an
object, but it does allow multiple inheritance from
several interfaces.
How's the syntax if I want to inherit an object from a
base object and also from several interfaces?
class Base{ /* bla bla bla */ }
interface IOne{ /* bla bla bla */ }
interface ITwo{ /* bla bla bla */ }
interface IThree{ /* bla bla bla */ }
class Derived : Base, IOne, ITwo, IThree{ /* bla bla bla
*/ } <- ???
I understand that I can convert Base to an interface, but
what if I have a windows form application that derives
from System.Windows.Forms.Form class and also needs to
derive from WebBrowser control (say DWebBrowserEvents and
DWebBrowserEvents2 interfaces)?
Please advice, thanks!
-CL
C#, like Java, doesn't allow multiple inheritance of an
object, but it does allow multiple inheritance from
several interfaces.
How's the syntax if I want to inherit an object from a
base object and also from several interfaces?
class Base{ /* bla bla bla */ }
interface IOne{ /* bla bla bla */ }
interface ITwo{ /* bla bla bla */ }
interface IThree{ /* bla bla bla */ }
class Derived : Base, IOne, ITwo, IThree{ /* bla bla bla
*/ } <- ???
I understand that I can convert Base to an interface, but
what if I have a windows form application that derives
from System.Windows.Forms.Form class and also needs to
derive from WebBrowser control (say DWebBrowserEvents and
DWebBrowserEvents2 interfaces)?
Please advice, thanks!
-CL