public void TestInnerWithOuterInstance() { Outer outer = new Outer(); Outer.Inner inner = new Outer.Inner(outer); }
/// <summary>Initializes a new instance of the <see cref="Inner"/> class.</summary> /// <param name="outer">The outer.</param> public Inner(Outer outer) { Console.WriteLine("Class Inner"); Console.WriteLine("Can access non-static fields by using Instance object"); Console.WriteLine("a " + outer.a); Console.WriteLine("b " + outer.b); Console.WriteLine("c " + outer.c); Console.WriteLine("d " + outer.d); Console.WriteLine("e " + e); StaticMethod(); Console.WriteLine("Can access non-static fields by using Instance object"); outer.InstanceMethod(); }