Basically what I want to do is
class Parent{
public class Nested {
private Nested(){
//do something
}
/* ??? */ Nested CreateNested(){
return new Nested ();
}
}
public Nested Foo(){
Nested n = (???).CreateNested ();
// do something about n
return n;
}
}
so that the users of the Parent
class can see the Nested
class, but are unable to create it (they can however get it from Parent
). I know that for normal methods you can do it with explicit interface implementation, but it doesn't seem to work with constructors.