public void Print1() { AssemblyOneClass1 A1 = new AssemblyOneClass1(); // We can not access internal member (id) of different assembly. // Console.WriteLine(A1.id); Console.WriteLine("Internal member of the different asembly is not accessable here."); }
public void Test() { AssemblyOneClass1 A1 = new AssemblyOneClass1(); A1.Print(); // This is not possible, because AssemblyOneClass2 is internal. //AssemblyOneClass2 A2 = new AssemblyOneClass2(); }
public void SampleMethod() { AssemblyOneClass1 A1 = new AssemblyOneClass1(); //A1.ID=102; //protected internal base.ID2 = 103; AssemblyTwoClass1 A2 = new AssemblyTwoClass1(); A2.ID2 = 104; }
public void Print2() { AssemblyOneClass1 A1 = new AssemblyOneClass1(); // We can not access protected internal member (Name) by instance of AssemblyOneClass1 class. //Console.WriteLine(A1.Name); // But by Console.WriteLine("Protected internal member of different assembly is accessable in different assembly but in derived class using base keyword : " + base.Name); // OR Console.WriteLine(); AssemblyTwoClass2 A2 = new AssemblyTwoClass2(); Console.WriteLine("Protected internal member of different assembly is accessable in different assembly but in derived class usign instance of child class only : " + A2.Name); }