コード例 #1
0
        public static void ChangeLine(string name, Coordinates coordinatesStart, Coordinates coordinatesEnd)
        {
            Tvary shapes = new Tvary();
            Line  line   = (Line)shapes.returnShape(name);

            line.x1 = coordinatesStart.x;
            line.y1 = coordinatesStart.y;
            line.x2 = coordinatesEnd.x;
            line.y2 = coordinatesEnd.y;
        }
コード例 #2
0
ファイル: dialogKruh.xaml.cs プロジェクト: lukinfx/Shapes
 private void btnDialogOk_Click(object sender, RoutedEventArgs e)
 {
     this.DialogResult = true;
     try
     {
         Tvary       tvary      = new Tvary();
         Coordinates souradnice = new Coordinates()
         {
             x = Convert.ToDouble(txtX.Text), y = Convert.ToDouble(txtY.Text)
         };
         mujKruh.ChangeCircle(souradnice, Convert.ToDouble(txtR.Text));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Chyba", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
コード例 #3
0
ファイル: DialogCara.xaml.cs プロジェクト: lukinfx/Shapes
 private void btnDialogOk_Click(object sender, RoutedEventArgs e)
 {
     this.DialogResult = true;
     try
     {
         Tvary       tvary             = new Tvary();
         Coordinates souradnicePocatek = new Coordinates()
         {
             x = Convert.ToDouble(txtX.Text), y = Convert.ToDouble(txtY.Text)
         };
         Coordinates souradniceKonec = new Coordinates()
         {
             x = Convert.ToDouble(txtHeight.Text), y = Convert.ToDouble(txtWeidth.Text)
         };
         Line.ChangeLine(mojeCara.name, souradnicePocatek, souradniceKonec);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Chyba", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }