示例#1
0
        static void Main(string[] args)
        {
            string val;

            val = System.Console.ReadLine();

            if (val == "1")
            {
                IDoThings myStuff = new DoHickey();
                myStuff.DoNothing();
                myStuff.DoSomething(5);
                myStuff.DoSomethingElse("Hello");
                System.Console.WriteLine("");
            }
            else if (val == "2")
            {
                IDoThings myDuff = new DoDickey();
                myDuff.DoNothing();
                myDuff.DoSomething(5);
                myDuff.DoSomethingElse("Hello");
                System.Console.WriteLine("");
            }
            else
            {
                System.Console.WriteLine("F**k off!");
                System.Console.WriteLine("");
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to the program. Press 1 for DoHickey and 2 for DoDickey");
            var input = Console.ReadLine();

            if (input == "1")
            {
                IDoStuff myStuff = new DoHickey();

                myStuff.DoNothing();
                myStuff.DoSomething(2);
                myStuff.DoSomethingElse("Hej Hickey");
            }
            else if (input == "2")
            {
                IDoStuff myStuff = new DoDickey();

                myStuff.DoNothing();
                myStuff.DoSomething(3);
                myStuff.DoSomethingElse("Hej Dickey");
            }
            else
            {
                Console.WriteLine("You must choose 1 or 2!");
            }

            Console.ReadLine();
        }
示例#3
0
        static void Main(string[] args)
        {
            string val;
            val = System.Console.ReadLine();

            if (val == "1")
            {
                IDoThings myStuff = new DoHickey();
                myStuff.DoNothing();
                myStuff.DoSomething(5);
                myStuff.DoSomethingElse("Hello");
                System.Console.WriteLine("");
            }
            else if (val == "2")
            {
                IDoThings myDuff = new DoDickey();
                myDuff.DoNothing();
                myDuff.DoSomething(5);
                myDuff.DoSomethingElse("Hello");
                System.Console.WriteLine("");
            }
            else
            {
                System.Console.WriteLine("F**k off!");
                System.Console.WriteLine("");
            }
        }
示例#4
0
        static void Main(string[] args)
        {
            IDoThings myStuff = new DoHickey();

            myStuff.DoNothing();
            myStuff.DoSomething(4);
            myStuff.DoSomethingElse("hej hej");
        }
示例#5
0
        static void Main(string[] args)
        {
            IDoThings doHickey = new DoHickey();

            doHickey.DoNothing();
            doHickey.DoSomething(7);
            doHickey.DoSomethingElse("John Doe");

            IDoThings doDickey = new DoDickey();

            doDickey.DoNothing();
            doDickey.DoSomething(7);
            doDickey.DoSomethingElse("John Doe");
        }