Beispiel #1
0
        private void menuResetRotate_Click(object sender, RoutedEventArgs e)
        {
            int al = DrawArea.TheLayers.ActiveLayerIndex;

            if (DrawArea.TheLayers[al].Graphics.SelectionCount > 0)
            {
                DrawArea.RotateObject(0);
            }
            else
            {
                DrawArea.RotateDrawing(0);
            }
            menuResetRotate.IsEnabled = false;
            DrawArea.IsRotated        = false;
        }
Beispiel #2
0
 private void btnRotateRight_Click(object sender, RoutedEventArgs e)
 {
     if (txtRotate.Text.Trim() != "")
     {
         int radius = int.Parse(txtRotate.Text);
         if (radius >= 0 && radius <= 360)
         {
             DrawArea.IsRotated = true;
             if (DrawArea.IsRotated == true)
             {
                 menuResetRotate.IsEnabled = true;
             }
             int al = DrawArea.TheLayers.ActiveLayerIndex;
             if (DrawArea.TheLayers[al].Graphics.SelectionCount > 0)
             {
                 DrawArea.RotateObject(radius);
             }
             else
             {
                 DrawArea.RotateDrawing(radius);
             }
         }
         else
         {
             MessageBox.Show("Your input is wrong !", "WARNING", MessageBoxButton.OK, MessageBoxImage.Warning);
             txtRotate.Text = "90";
             return;
         }
     }
     else
     {
         MessageBox.Show("Your input is wrong !", "WARNING", MessageBoxButton.OK, MessageBoxImage.Warning);
         txtRotate.Text = "90";
         return;
     }
 }