static void Main(string[] args)
        {
            Console.WriteLine("***** C# CarLibrary Client App *****");
            SportsCar viper = new SportsCar("Viper", 40, 240);

            viper.TurboBoost();

            MiniVan mv = new MiniVan();

            mv.TurboBoost();

            Console.WriteLine("Done. Press any key to terminate");
            Console.ReadLine();

            var internalClassInstance = new MyInternalClass();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Press 1 to view Using Private method(Line 87 to 99)");
            Console.WriteLine("Press 2 to run Using Protected and Private method(Line 38 to 66)");
            Console.WriteLine("Press 3 to run Using Internal method(Line 74 to 82)");
            Console.WriteLine("Press 4 to run Using Properties method(Line 108 to 121)");
            Console.WriteLine("Go check out my Using Inheritance and Interfaces method(Line 125 to 146) in code");

            switch (Console.ReadLine())
            {
            case "1": {
                Accessibility a = new Accessibility();
                a.MyProperty = "Private value changed";
                Console.WriteLine(a.MyProperty);
                break;
            }

            case "2": {
                Derived d = new Derived();
                d.MyDerivedMethod();
                break;
            }

            case "3": {
                MyInternalClass i = new MyInternalClass();
                i.MyMethod();
                break;
            }

            case "4": {
                Person p = new Person();
                p.FirstName = "John";
                Console.WriteLine("Propery value changed to {0}!", p.FirstName);
                break;
            }

            default: {
                Console.WriteLine("Entered value does not associate with any of the provided options!");
                break;
            }
            }
        }
Esempio n. 3
0
    public void DoSomething()
    {
        var myInternalClass = new MyInternalClass();

        myInternalClass.DoSomething();
    }
Esempio n. 4
0
    protected void MyProtectedMethod()
    {
        MyInternalClass mic = new MyInternalClass();

        mic.ThrowsException();
    }
Esempio n. 5
0
 static void Main(string[] args)
 {
     var internalClass = new MyInternalClass();
 }
Esempio n. 6
0
 protected void MyProtectedMethod()
 {
     MyInternalClass mic = new MyInternalClass();
     mic.ThrowsException();
 }
Esempio n. 7
0
        public void TestMethod1()
        {
            MyInternalClass myclass = new MyInternalClass();

            myclass.MyMethod();
        }
Esempio n. 8
0
 public MyInternalStruct(MyInternalClass c)
 {
     C = c;
 }
Esempio n. 9
0
 public MyInternalStruct(MyInternalClass c)
 {
     C = c;
 }
Esempio n. 10
0
        public static void Start()
        {
            var internalClass = new MyInternalClass();

            internalClass.MyMethod();
        }