Beispiel #1
0
        public void DoShaping()
        {
            shapes c = new shapes();

            while (true)
            {
                Console.WriteLine("Select Shape: (R)ectangle, (C)ircle, (S)quare, (T)riangle:");
                var key = Console.ReadKey();


                switch (key.Key)
                {
                case ConsoleKey.R:
                    c.Rectangle();
                    break;

                case ConsoleKey.C:
                    c.Circle();
                    break;

                case ConsoleKey.S:
                    c.Square();
                    break;

                case ConsoleKey.T:
                    c.Triangle();
                    break;
                }
            }
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            shapes s = new shapes();

            s.DoShaping();



            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }