Paulustrious wrote:
Is it possible to force a cast to an inherited class?
Is there any way to allow the son to follow in his father's
footsteps...
Do you need the object cast as a different object? Or can you simply use
properties?
// Using VS2005.
class Person
{
private string m_Name = String.Empty;
public string Name
{
get { return m_Name; }
set { m_Name = value; }
}
}
class PersonCollection : List<Person> {}
class FamilyMember : Person
{
private Person m_Father = new Person();
public Person Father
{
get { return m_Father; }
set { m_Father = value; }
}
private PersonCollection m_Sons = new PersonCollection();
public PersonCollection Sons
{
get { return m_Sons; }
set { m_Sons = value; }
}
}
--
John T
http://sage1solutions.com/TknoFlyer
Reduce spam. Use Sender Policy Framework:
http://spf.pobox.com
____________________