Ejemplo n.º 1
0
        public void ParentClassExplicitInterface()
        {
            NewAndOverrideClasses.IHelloWorld parentClass = new NewAndOverrideClasses.ParentClass();

            System.Diagnostics.Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);
            System.Diagnostics.Debug.WriteLine(parentClass.SayHelloWorld());
        }
Ejemplo n.º 2
0
        public void ParentClassCallingHelperMethod()
        {
            var parentClass = new NewAndOverrideClasses.ParentClass();

            System.Diagnostics.Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);
            System.Diagnostics.Debug.WriteLine(parentClass.CallMethodToSayHelloWorld());
        }
Ejemplo n.º 3
0
        public void DeclareAndChangeVariableType()
        {
            NewAndOverrideClasses.ChildClassNew childClass    = new NewAndOverrideClasses.ChildClassNew();
            NewAndOverrideClasses.ParentClass   newChildClass = childClass;

            System.Diagnostics.Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);
            System.Diagnostics.Debug.WriteLine("");

            System.Diagnostics.Debug.WriteLine("Child variable");
            System.Diagnostics.Debug.WriteLine(childClass.SayHelloWorld());
            System.Diagnostics.Debug.WriteLine("");

            System.Diagnostics.Debug.WriteLine("Parent variable");
            System.Diagnostics.Debug.WriteLine(newChildClass.SayHelloWorld());
        }
        public void ParentClassSayingHelloWorld()
        {
            var parentClass = new NewAndOverrideClasses.ParentClass();

            System.Diagnostics.Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);
            System.Diagnostics.Debug.WriteLine(parentClass.SayHelloWorld());
        }
        public void ParentClassExplicitInterface()
        {
            NewAndOverrideClasses.IHelloWorld parentClass = new NewAndOverrideClasses.ParentClass();

            System.Diagnostics.Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);
            System.Diagnostics.Debug.WriteLine(parentClass.SayHelloWorld());
        }