internal partial class Class1
{
private class Class2 : ISomething, ISomethingElse
{
private class Class3 : ISomething
{
}
}
}
I want Class3 itself to host another private Class4, but that would make Class3 too big so I want to make Class3 partial. I know how to do that to a non-nested class. How would you make a nested class partial in a separate file?
This article states that it’s possible to make nested classes
partialeven if their parent class is not partial. But then you can’t separate them in several files, so I think you need to makeClass2partialtoo and split just like you would with first-level classes, keeping thepartial classhierarchy.I really hope that this question is just because of curiosity.
EDIT: Just tried this – works ok.
file1.cs
file2.cs