[RESOLVED] Problem in casting interface

I Have a problem in casting the Interface. I Have a class that I inherit from some Collection class like this

class IAList:ICollectionSomething
{
...
}

class AList:IAList
{
...
}

class IBList:IAList
{
...
}

class BList:AList,IBList
{
...
}


and I use this class in this way:

class InterfaceA:ISomething
{
IAList Load(string s);
}

class A:InterfaceA
{
public IAList Load(string s)
{
...
}
}

class InterfaceB:InterfaceA
{
new IBList Load(string s);
}

class B:A,InterfaceB
{
public new IBList Load(string s)
{
return base.Load(s) as IBList
}
}


The problem is here:

public new IBList Load(string s)
{
return base.Load(s) as IBList
}


You can see here I have a load function that return IAList in my base class and I want to cast it to IBList, but it always return null.
I don`t know what is wrong with this. Can you help me to solve this problem?
[1179 byte] By [saktya] at [2007-11-20 11:45:19]
# 1 Re: [RESOLVED] Problem in casting interface
You can see here I have a load function that return IAList in my base class and I want to cast it to IBList, but it always return null.It is supposed to result in null if IAList.Load returns something that is not a IBList.

A IBList is a IAList, but IAList isn't necessarily a IBList.

- petter
wildfrog at 2007-11-9 11:36:59 >
# 2 Re: [RESOLVED] Problem in casting interface
Yeah you right... My problem is solved

The problem is in my factory class :p

Thanks
saktya at 2007-11-9 11:38:00 >