T
Tony Johansson
Hello!
Sorry for opening up this task again.
I want to fully understand this List that is return from CollectionBase.
According to you is List in CollectionBase implemented something like the
below which you sent me previously. So the referenced type for List that
will be
returned at execution time must be CollectionBase. The compile type for List
is IList
But when I looked at it by using method Test in Int16Collection(see below) I
get that the referenced type at execution type is Int16Collection.
So the referenced type from CollectionBase for List is not the same as the
referenced type for List when I use GetType in method Test.
Can you explain whay the types are not the same?
< protected IList List
public class Int16Collection : CollectionBase
{
public void Test()
{
Console.Writeln(List.GetType()); //It writes out Int16Collection
}
}
//Tony
Sorry for opening up this task again.
I want to fully understand this List that is return from CollectionBase.
According to you is List in CollectionBase implemented something like the
below which you sent me previously. So the referenced type for List that
will be
returned at execution time must be CollectionBase. The compile type for List
is IList
But when I looked at it by using method Test in Int16Collection(see below) I
get that the referenced type at execution type is Int16Collection.
So the referenced type from CollectionBase for List is not the same as the
referenced type for List when I use GetType in method Test.
Can you explain whay the types are not the same?
< protected IList List
{
get
{
return this;
}
}
public class Int16Collection : CollectionBase
{
public void Test()
{
Console.Writeln(List.GetType()); //It writes out Int16Collection
}
}
//Tony