T
Tony
Hello!
Assume I have this classes shown below.
Now to my question List below is inherited from CollectionBase and is a
property and return an IList according to the documentation.
I can't figure out if I do "Type myType1 = List.GetType();" in the add
method and check myType1 it shows name of Animals
I thought it should show IList because List is of Type IList.
But when I do Type myType2= InnerList.GetType();
then myType2 is an ArrayList which is correct.
class Animals : CollectionBase
{
public void Add(Animal newAnimal)
{
List.Add(newAnimal)
Type myType1= List.GetType();
Type myType2= InnerList.GetType();
}
}
class Animal
{
something here
}
//Tony
Assume I have this classes shown below.
Now to my question List below is inherited from CollectionBase and is a
property and return an IList according to the documentation.
I can't figure out if I do "Type myType1 = List.GetType();" in the add
method and check myType1 it shows name of Animals
I thought it should show IList because List is of Type IList.
But when I do Type myType2= InnerList.GetType();
then myType2 is an ArrayList which is correct.
class Animals : CollectionBase
{
public void Add(Animal newAnimal)
{
List.Add(newAnimal)
Type myType1= List.GetType();
Type myType2= InnerList.GetType();
}
}
class Animal
{
something here
}
//Tony