Ejemplo n.º 1
0
    static void Main(string[] args)
    {
        ManagerClass.BaseClass dc  = new DerivedClass();
        ManagerClass.BaseClass adc = new AnotherDerivedClass();

        // Is accessible from outside ManagerClass
        dc.IsRunning = true;

        // Is not accessible from outside ManagerClass
        // dc.DoStuff();

        ManagerClass.TestManager();

        // Wait for input.
        Console.ReadKey(true);
    }
Ejemplo n.º 2
0
 public void CanAccessProtectedFieldInDerivedClassInDifferentNamespace()
 {
     var anotherDerivedClass = new AnotherDerivedClass();
     Assert.AreEqual("Parent's string", anotherDerivedClass.DoWork());
 }
Ejemplo n.º 3
0
    public void Print()
    {
        BaseClass anotherAsBase = new AnotherDerivedClass();

        Console.WriteLine(anotherAsBase.number);
    }
Ejemplo n.º 4
0
    public void Print()
    {
        BaseClass anotherAsBase = new AnotherDerivedClass();

        anotherAsBase.number = 0;
    }