Example #1
0
 public static void PrintTypes()
 {
     for (TypeFigure type = TypeFigure.Round; type <= TypeFigure.Circle; type++)
     {
         Console.WriteLine($"{(int)type}. {type}");
     }
 }
Example #2
0
 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;
 }
Example #3
0
 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;
 }
Example #4
0
        public Poligon(int centreX, int centreY, TypeFigure typeFigure, params AbstractSide[] sides) : this(centreX, centreY)
        {
            _typeFigure = typeFigure;

            foreach (var item in sides)
            {
                _sides.Add(item);
            }
        }
Example #5
0
 /// <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);
 }
Example #6
0
        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;
            }
            }
        }
Example #7
0
 private void button4_Click(object sender, EventArgs e)
 {
     fig = TypeFigure.Triangle;
 }
Example #8
0
 private void button1_Click(object sender, EventArgs e)
 {
     fig = TypeFigure.Line;
 }
Example #9
0
 private void Rec(object sender, EventArgs e)
 {
     fig = TypeFigure.Rectangle;
 }
Example #10
0
 private void button2_Click(object sender, EventArgs e)
 {
     fig = TypeFigure.Circle;
 }
Example #11
0
 /// <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);
 }
Example #12
0
 /// <summary>
 /// Начальная инициализация
 /// </summary>
 public MainWindow()
 {
     InitializeComponent();
     Figure = TypeFigure.None;
     InterfaceSwitch(false, Figure);
 }
Example #13
0
 public Poligon(TypeFigure typeFigure, params AbstractSide[] sides) : this(0, 0, typeFigure, sides)
 {
 }