Re: Overriding constructors
From: Cowboy (NoSpamMgbworld_at_comcast.netNoSpamM)
Date: 05/18/04
- Next message: Cowboy: "Re: Message Box in C#"
- Previous message: Owe Armandt: "DragDrop with FileDrop"
- In reply to: Samer: "Overriding constructors"
- Next in thread: Jon Skeet [C# MVP]: "Re: Overriding constructors"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 18 May 2004 13:29:30 -0500
You should be able to write a constructor for your class and explicitly call
the base implementation, effectively overriding it. You can also overload
the constructor, if you need params passed in when you create the object. I
have not tried with ServiceBase, in particular, but your new derived class
can have a default constructor as well as any number of parameterized
constructors.
I do not necessarily consider this to be overriding so much, so the
terminology is suspect.
-- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA ************************************************ Think Outside the Box! ************************************************ "Samer" <samabutaa@hotmail.com> wrote in message news:a2254096.0405181019.73d70a25@posting.google.com... > I'm writing a class that derives from ServiceBase and it says in the > documentation for the constructor of ServiceBase that if you override > the base class constructor, you should explicitly call it in the > constructor of your derived class. > > As far as I know a constructor cannot be overridden only overloaded, > is this a mistake or have I been mislead.
- Next message: Cowboy: "Re: Message Box in C#"
- Previous message: Owe Armandt: "DragDrop with FileDrop"
- In reply to: Samer: "Overriding constructors"
- Next in thread: Jon Skeet [C# MVP]: "Re: Overriding constructors"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|