[Mono-list] Keyword this or base expected(CS1018)

Rob Brown-Bayliss rbb@orcon.net.nz
Sun, 22 Aug 2004 16:56:55 +1200


OK, so how do I pass args to the base class?  

I thought:

MyClass my_class = new MyClass(gxml, database);

would pass gxml and database to the base class of MyClass?

> This is wrong.
> 
> While calling the contructor, the gxml and database are undefined. If
> you be appropriate to call as:
> 
> public MyClass(): base(null, null)
> {
> ...
> }
> 
> or better still:
> 
> public MyClass(): base( (Glade.XML) null, (Database) null )
> {
> ...
> }
> 
> Use the latter option if there are more than one overloaded
> consturctor in the base class that can make up for BaseClass(null,
> null).
> 
> NB: I have assumed that Glade.XML is not enum.
> 
> 
> 
> Cheers,
> Gaurav Vaish
> http://gallery.mastergaurav.net
> -----------------------------------
> 
> 
> On Sun, 22 Aug 2004 16:19:03 +1200, Rob Brown-Bayliss <rbb@orcon.net.nz> wrote:
> > 
> > Why does this:
> > 
> > public MyClass() : base (Glade.XML gxml, Database database)
> > 
> > give me this error?
> > 
> > Keyword this or base expected(CS1018)

--
Rob Brown-Bayliss

________________________________________________________________________