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)); }
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)); }
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); }
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); }