private void HighlighAction(int _action) { switch (_action) { case 1: //go to calibration scene B_1.Select(); currentSelection = 1; break; case 2: // instantiate scoreboard B_2.Select(); currentSelection = 2; break; case 3: // go to tutorial scene B_3.Select(); currentSelection = 3; break; case 4: //quit B_4.Select(); currentSelection = 4; break; default: Debug.LogError("NO ACTION ASSIGNED"); break; } }
public CMessageBox(string message, string caption, CColor.Theme theme, CImage.ImageType image, CMessageBoxButton _buttonType) { InitializeComponent(); this.SizeToContent = SizeToContent.Height; SystemSounds.Beep.Play(); //set image string imagePath = CImage.GetImagePath(image); ImageBrush imgBrush = new ImageBrush { ImageSource = new BitmapImage(new Uri(imagePath, UriKind.Absolute)) }; RCT_image.Fill = imgBrush; //set text / caption TBL_message.Text = message; windowheader.C_HeaderText = caption; //set theme in border and header background GRD_border.Background = CColor.GetColorBrush(theme); windowheader.C_BackgroundTheme = theme; //enable button by given buttontype buttonType = _buttonType; switch (buttonType) { case CMessageBoxButton.OK: B_3.Visibility = Visibility.Hidden; B_2.Visibility = Visibility.Hidden; B_1.Content = "OK"; break; case CMessageBoxButton.OK_Cancel: B_3.Visibility = Visibility.Hidden; B_2.Content = "OK"; B_1.Content = "Abbrechen"; break; case CMessageBoxButton.Yes_No: B_3.Visibility = Visibility.Hidden; B_2.Content = "Ja"; B_1.Content = "Nein"; break; case CMessageBoxButton.Yes_No_Cancel: B_3.Content = "Ja"; B_2.Content = "Nein"; B_1.Content = "Abbrechen"; break; default: break; } B_1.Focus(); }
static void Main(string[] args) { #region 1-е Задание Debug.WriteLine(new string('-', 30)); Debug.WriteLine("1-е Задание:"); Human human = new Human("Ivan", "Yakovich", "Male", 28); Debug.WriteLine($"This is class {human.GetType().Name}"); human.Info(); Employee employee = new Employee("Taras", "Krupko", "Male", 18, "Director", 18785); Debug.WriteLine($"This is class {employee.GetType().Name}"); employee.Info(); Human human1 = (Human)employee; Debug.WriteLine($"This is class {human1.GetType().Name}"); human1.Info(); Employee employee1 = (Employee)human1; Debug.WriteLine($"This is class {employee1.GetType().Name}"); employee1.Info(); Debug.WriteLine(new string('-', 30)); #endregion #region 2-е Задание Debug.WriteLine("2-е Задание:"); A a1 = new A( new B(21, -14, "F"), new B(14.1550, 14, "V"), new B(154, -489, "Q")); a1.GetXY(); A a2 = new A( new B(14, 14.22, "G"), new B(47, 854, "L")); a2.GetXY(); B_1 b_1 = new B_1(154, 44, "ASE"); B_2 b_2 = new B_2(14, 4, "SE"); B_3 b_3 = new B_3(4, 484, "AE"); A a3 = new A(b_1, b_2, b_3); a3.GetXY(); Debug.WriteLine(new string('-', 30)); #endregion #region 3-е Задание Debug.WriteLine("3-е Задание:\n"); Unit unit = new Unit("Dog", "Earth"); unit.ShowInfo(); Hero hero = new Hero("William", "Ship", 1200, "Sword", 15); hero.ShowInfo(); Enemy enemy = new Enemy("Dragon", "Mountain", 20000, "Fire", 50); enemy.ShowInfo(); Debug.WriteLine(new string('-', 30)); #endregion }
static void Main(string[] args) { #region 1 Debug.WriteLine($"{new string('-', 20)} 1st Task: {new string('-', 20)}"); Debug.WriteLine("http://human"); Human human = new Human("Никита", "Пралат", "Мужчина", 18); human.Info(); Debug.WriteLine("http://employee"); Employee employee = new Employee("Андрей", "Ковальчук", "Мужчина", 23, "Дворник", 12344); employee.Info(); Debug.WriteLine("http://human1"); Human human1 = employee; human1.Info(); Debug.WriteLine("http://employee1"); Employee employee1 = (Employee)human1; employee1.Info(); #endregion #region 2 Debug.WriteLine($"{new string('-', 20)} 2nd Task: {new string('-', 20)}"); B_1 b_1 = new B_1(); B_2 b_2 = new B_2(); B_3 b_3 = new B_3(); A a1 = new A(b_1, b_2, b_3); a1.AllInfo(); A a2 = new A(b_1, b_2); a2.AllInfo(); #endregion #region 3 Debug.WriteLine($"{new string('-', 20)} 3nd Task: {new string('-', 20)}"); Unit unit = new Unit("Wolf", "Earth"); unit.ShowInfo(); Hero hero = new Hero("William", "Ship", 1200, "Sword", 15); hero.ShowInfo(); Enemy enemy = new Enemy("Dragon", "Mountain", 20000, "Fire", 50); enemy.ShowInfo(); #endregion }