I may be wrong (and I'm sure that everyone here will jump all over me
if I am), but in C# declaring a class within another class does _not_
make the inner class an inheritable part of the outer class.
In other words, in your example, abc.cde and ijk.cde are two completely
different classes that have nothing to do with each other. ijk.cde is
_not_ a "subclass" of abc.cde, unless you declare it like this:
class ijk : abc
{
class cde : abc.cde
{
}
}
and then it follows the normal rules of inheritance.
The only advantage to nesting classes in C# is to reduce scope (for
example declaring them "private") or to reduce name clutter in the
namespace (for example for a very specific class that can be used only
in one circumstance).
In particular, I believe that if you do this
class abc
{
class cde
{
}
public virtual cde CdeProperty
{
...
}
}
then in ijk, in order to override CdeProperty, you would have to say
this:
class ijk : abc
{
class cde : abc.cde
{
}
public override abc.cde CdeProperty
{
...
}
}
because if you were to say "public override cde CdeProperty" then you
would technically be declaring the property with a different return
type, ijk.cde, and you would require a "new" keyword, not "override".
I'm sure that others here will correct me if I have that all wrong.