public DrawFiguresControl() { InitializeComponent(); FiguresData fd = new FiguresData(); Circle = new Circle(fd); Triangle = new Triangle(fd); Rectangle = new ClassLibrary_CalculateFiguresArea.Rectangle(fd); FiguresList = new List <string>(); FiguresList.Add("Not selected"); FiguresList.AddRange(Enum.GetNames(typeof(Figures))); FigureTypesComboBox.ItemsSource = FiguresList; FigureTypesComboBox.SelectedIndex = 0; }
private void FigureTypesComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { ClearInputFields(); ClearDrawArea(); if (FigureTypesComboBox.SelectedIndex == 0) { SideA_Value.IsEnabled = false; SideB_Value.IsEnabled = false; SideC_Value.IsEnabled = false; SideA_Tip.Content = "Введите длину:"; SideB_Tip.Content = "Введите длину:"; SideC_Tip.Content = "Введите длину:"; DrawButton.IsEnabled = false; } else if (FigureTypesComboBox.SelectedIndex == 1) { SideA_Value.IsEnabled = true; SideB_Value.IsEnabled = false; SideC_Value.IsEnabled = false; SideA_Tip.Content = "Введите радиус круга:"; FiguresData fd = new FiguresData(); Circle = new Circle(fd); DrawButton.IsEnabled = true; } else if (FigureTypesComboBox.SelectedIndex == 2) { SideA_Value.IsEnabled = true; SideB_Value.IsEnabled = true; SideC_Value.IsEnabled = false; SideA_Tip.Content = "Введите длину стороны A:"; SideB_Tip.Content = "Введите длину стороны B:"; SideC_Tip.Content = "Длина стороны C:"; FiguresData fd = new FiguresData(); Triangle = new Triangle(fd); DrawButton.IsEnabled = true; } else if (FigureTypesComboBox.SelectedIndex == 3) { SideA_Value.IsEnabled = true; SideB_Value.IsEnabled = true; SideC_Value.IsEnabled = false; SideA_Tip.Content = "Введите длину стороны A:"; SideB_Tip.Content = "Введите длину стороны B:"; FiguresData fd = new FiguresData(); Rectangle = new ClassLibrary_CalculateFiguresArea.Rectangle(fd); DrawButton.IsEnabled = true; } }
static public void AddCircle() { var figData = new FiguresData { Name = "Circle", Data = new Dictionary <string, int> { { "X", 0 }, { "Y", 0 }, { "Radius", 0 } } }; var fig = FigureFab.Make(figData); fig.drawer = new ConsoleDrawer(); figures.Add(fig); }
static public void AddLine() { var figData = new FiguresData { Name = "Line", Data = new Dictionary <string, int> { { "X1", 0 }, { "Y1", 0 }, { "X2", 100 }, { "Y2", 100 } } }; var fig = FigureFab.Make(figData); fig.drawer = new ConsoleDrawer(); figures.Add(fig); }
// Use this for initialization void Start () { Data = GameObject.Find("FigureDataBase").GetComponent<FiguresData> (); Score.text = Point.ToString (); }