Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            var desktop = new ConsoleDesktop ();

            var leandow = new Leandow ("Terminal", 50, 20, 4, 2);
            //TODO: Try this code instead and handle the problem: var leandow = new Leandow ("Terminal", 50, 20, 30, 30);

            desktop.Add (leandow);

            // Or: new ConsoleDesktop ().Show (new Leandow("Terminal", 40, 20));
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            var desktop = new ConsoleDesktop();

            var leandow = new Leandow("Terminal", 50, 20, 4, 2);

            //TODO: Try this code instead and handle the problem: var leandow = new Leandow ("Terminal", 50, 20, 30, 30);

            desktop.Add(leandow);

            // Or: new ConsoleDesktop ().Show (new Leandow("Terminal", 40, 20));
        }
Exemplo n.º 3
0
        public void Add(Leandow leandow)
        {
            Console.BackgroundColor = ConsoleColor.Gray;
            Console.SetCursorPosition (leandow.Offset.Left, leandow.Offset.Top);
            Console.Write (leandow.Title);
            for (int j = 0; j < leandow.Size.Width - leandow.Title.Length; j++)
                Console.Write (" ");
            Console.WriteLine ();
            Console.BackgroundColor = ConsoleColor.White;

            for (int i = 0; i < leandow.Size.Height - 1; i++) {
                 Console.SetCursorPosition (leandow.Offset.Left, leandow.Offset.Top + i + 1);
                for (int j = 0; j < leandow.Size.Width; j++)
                    Console.Write (" ");
                Console.WriteLine ();
            }

            Console.ReadKey (true);
        }
Exemplo n.º 4
0
        public void Add(Leandow leandow)
        {
            Console.BackgroundColor = ConsoleColor.Gray;
            Console.SetCursorPosition(leandow.Offset.Left, leandow.Offset.Top);
            Console.Write(leandow.Title);
            for (int j = 0; j < leandow.Size.Width - leandow.Title.Length; j++)
            {
                Console.Write(" ");
            }
            Console.WriteLine();
            Console.BackgroundColor = ConsoleColor.White;

            for (int i = 0; i < leandow.Size.Height - 1; i++)
            {
                Console.SetCursorPosition(leandow.Offset.Left, leandow.Offset.Top + i + 1);
                for (int j = 0; j < leandow.Size.Width; j++)
                {
                    Console.Write(" ");
                }
                Console.WriteLine();
            }

            Console.ReadKey(true);
        }