Re: base, derived objects

Peter Osucha <[email protected]> Thu, 3 May 2007 11:41:02 -0400
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <[email protected]>
Chris,

That's what I'm doing now.  I was wondering if there was some sort of
shorthand (shorterhand?) that would allow me to just set the base
object.  It's easy enough to just create another constructor that takes
a 'Base' as its argument...

Peter

-----Original Message-----
From: Discussion relating to the specifics of the C# and Managed C++
languages [mailto:[email protected]] On Behalf Of Chris
Anderson
Sent: Thursday, May 03, 2007 11:28 AM
To: [email protected]
Subject: Re: [DOTNET-CX] base, derived objects

public Derived (<derived param list>) : base(pass appropriate params to
base) {}
 
eg
 
public Base (int param1, string param2) {...}
 
public Derived (int p1, string p2, int p3) : base(p1,p2)
{
   // do something additional with p3
}
 
 

________________________________

From: Discussion relating to the specifics of the C# and Managed C++
languages on behalf of Peter Osucha
Sent: Thu 03/05/2007 16:00
To: [email protected]
Subject: [DOTNET-CX] base, derived objects



I have an derived class 'Derived' and a base class 'Base' from which it
derives.  I have a constructor for 'Derived' which contains arguments
for virtually all the properties in 'Base'.  I could create a
constructor for 'Derived' which takes an object of type 'Base'.
However, I am wondering if there is any 'shorthand' for doing this
already built into the system. 



Is there?



Peter

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com