public static void PrintTypes() { for (TypeFigure type = TypeFigure.Round; type <= TypeFigure.Circle; type++) { Console.WriteLine($"{(int)type}. {type}"); } }
private void panelTrin_MouseClick(object sender, MouseEventArgs e) { curFig = TypeFigure.Triangle; Triangle_Mode(); panelCircle.BackColor = Color.Transparent; panelLine.BackColor = Color.Transparent; panelRec.BackColor = Color.Transparent; panelTrin.BackColor = Color.WhiteSmoke; }
private void imgCircle_Click(object sender, EventArgs e) { curFig = TypeFigure.Circle; Circle_Mode(); panelCircle.BackColor = Color.WhiteSmoke; panelLine.BackColor = Color.Transparent; panelRec.BackColor = Color.Transparent; panelTrin.BackColor = Color.Transparent; }
public Poligon(int centreX, int centreY, TypeFigure typeFigure, params AbstractSide[] sides) : this(centreX, centreY) { _typeFigure = typeFigure; foreach (var item in sides) { _sides.Add(item); } }
/// <summary> /// Обработчик кнопки Очистить /// </summary> /// <param name="sender">объект, вызвавший событие</param> /// <param name="e">дополнительная информация</param> private void Clear_btn_Click(object sender, RoutedEventArgs e) { if (Figure == TypeFigure.Rectangle) { Rectangle_rbtn.IsChecked = false; } if (Figure == TypeFigure.VolumeRectangle) { Volumectangle_rbtn.IsChecked = false; } Figure = TypeFigure.None; Result_txtb.Text = ""; InterfaceSwitch(false, Figure); }
MyRectangle[] FigureArr; //Массив для хранения экземпляров обоих классов /// <summary> /// Переключает интерфейс в различные состояния. Состояния зависят от типа фигуры. /// </summary> /// <param name="condition">true - включить. false - выключить</param> /// <param name="figure">Тип фигуры</param> public void InterfaceSwitch(bool condition, TypeFigure figure) { if ((figure == TypeFigure.None) || (figure == TypeFigure.VolumeRectangle)) { Height_grid.IsEnabled = condition; } else { Height_grid.IsEnabled = false; } switch (condition) { case true: { Button_grid.IsEnabled = condition; Width_grid.IsEnabled = condition; Length_grid.IsEnabled = condition; Width1_txtb.Text = ""; Length1_txtb.Text = ""; Height1_txtb.Text = ""; Width2_txtb.Text = ""; Length2_txtb.Text = ""; Height2_txtb.Text = ""; break; } case false: { Width1_txtb.Text = ""; Length1_txtb.Text = ""; Height1_txtb.Text = ""; Width2_txtb.Text = ""; Length2_txtb.Text = ""; Height2_txtb.Text = ""; Button_grid.IsEnabled = condition; Width_grid.IsEnabled = condition; Length_grid.IsEnabled = condition; break; } } }
private void button4_Click(object sender, EventArgs e) { fig = TypeFigure.Triangle; }
private void button1_Click(object sender, EventArgs e) { fig = TypeFigure.Line; }
private void Rec(object sender, EventArgs e) { fig = TypeFigure.Rectangle; }
private void button2_Click(object sender, EventArgs e) { fig = TypeFigure.Circle; }
/// <summary> /// Обработчик выбора RadioButton - параллелепипед /// </summary> /// <param name="sender">объект, вызвавший событие</param> /// <param name="e">дополнительная информация</param> private void Volumectangle_rbtn_Checked(object sender, RoutedEventArgs e) { Figure = TypeFigure.VolumeRectangle; InterfaceSwitch(true, Figure); }
/// <summary> /// Начальная инициализация /// </summary> public MainWindow() { InitializeComponent(); Figure = TypeFigure.None; InterfaceSwitch(false, Figure); }
public Poligon(TypeFigure typeFigure, params AbstractSide[] sides) : this(0, 0, typeFigure, sides) { }