public static void ClearAllButtons() { if (MyCanvas.ClearAllButtons()) { Console.WriteLine("All buttons is deleted!!!"); } else { Console.WriteLine("Deletion was not done because No buttons have been created!!!"); } }
public static void DeleteLastButtons() { if (MyCanvas.DeleteLastButtons()) { Console.WriteLine("Button is deleted!!!"); } else { Console.WriteLine("Deletion was not done ,because no buttons have been created!!!"); } }
public static void MoveButton(int buttonNumber, int x, int y) { if (MyCanvas.MoveButton(buttonNumber, x, y)) { Console.WriteLine("Button is moved successfully!!!"); } else { Console.WriteLine("Error!!!Button isn`t moved!!!"); } }
public static void CreateNewButton(int x1, int y1, int x2, int y2) { if (MyCanvas.CreateNewButton(x1, y1, x2, y2)) { Console.WriteLine("Button is create successfully!!!"); } else { Console.WriteLine("Error!!! There is no free space !!!"); } }
public static void IsPointInsideAButton(int x, int y) { _flag = MyCanvas.IsPointInsideAButton(x, y); if (_flag) { Console.WriteLine("The point is inside a button!!!"); } else { Console.WriteLine("The point isn`t inside a button!!!"); } }
internal static void CheckIfAnyButtonIsOverlapping() { _flag = MyCanvas.CheckIfAnyButtonIsOverlapping(); if (_flag) { Console.WriteLine("Button is over lapping!!!"); } else { Console.WriteLine("Button isn`t over lapping!!!"); } }
static void Main(string[] args) { int[] coordinats = new int[12] { 4, 770, 16, 720, 4, 560, 16, 471, 450, 18, 520, 5 }; for (int i = 0; i < 12; i++) { MyCanvas.CreateNewButton(coordinats[i++], coordinats[i++], coordinats[i++], coordinats[i]); } Client.CheckIfAnyButtonIsOverlapping(); Console.ReadKey(); Client.CreateNewButton(7, 751, 44, 701); Console.ReadKey(); Client.MoveButton(4, 23, 115); Console.ReadKey(); Client.ButtonСharacteristics(); Console.ReadKey(); Client.GetMaxNumberOfButtons(); Console.ReadKey(); Client.IsPointInsideAButton(499, 11); Console.ReadKey(); Client.DeleteLastButtons(); Console.ReadKey(); Client.ClearAllButtons(); Console.ReadKey(); /*for (int i = 0; i<3; i++) * { * Console.WriteLine("Enter coordinats of top left by 'ENTER':"); * int x1 = Convert.ToInt32(Console.ReadLine()); * int y1 = Convert.ToInt32(Console.ReadLine()); * * Console.WriteLine("Enter coordinats of buttom right by 'ENTER':"); * int x2 = Convert.ToInt32(Console.ReadLine()); * int y2 = Convert.ToInt32(Console.ReadLine()); * * Client clnt = new Client(x1, y1, x2, y2); * }*/ }
public static void GetMaxNumberOfButtons() { Console.WriteLine($"Number of buttons is {MyCanvas.GetMaxNumberOfButtons()}"); }
public static void ButtonСharacteristics() { MyCanvas.Print(); }