There are several kinds of inner (nested) classes in Java:
- Static inner classes
- Non-static inner classes
- Function-local inner classes
- Anonymous inner classes
These classes differ in what members they can access in their outer class.
C# has only one kind of class, corresponding to the #1 from Java's list. What your code has is the #2, a non-static inner class. Instances of these classes have an implicit reference to their outer class, explaining the way they can access the members of their outer class. In exchange for having this implicit reference, non-static inner classes can be instantiated only in the context of an object of the outer class.
To model non-static inner classes in C# one would add a constructor that takes an instance of the outer class, and replace all direct references to members of the outer class with references qualified by the variable referencing the outer class that you set in the constructor.