private void btnUpdateSlide_Click(object sender, RoutedEventArgs e)
 {
     if (
         CheckNumeric(txtDataX.Text) &&
         CheckNumeric(txtDataY.Text) &&
         CheckNumeric(txtDataZ.Text) &&
         CheckNumeric(txtDataRotateX.Text) &&
         CheckNumeric(txtDataRotateY.Text) &&
         CheckNumeric(txtDataRotateZ.Text) &&
         CheckNumeric(txtDataRotate.Text) &&
         CheckNumeric(txtDataScale.Text))
     {
         ImpressSlide temp = _slides[lstSlides.SelectedIndex];
         UpdateSlide(ref temp);
         _slides[lstSlides.SelectedIndex] = temp;
         MessageBox.Show("Successfully modified step slide", "Success",
                         MessageBoxButton.OK, MessageBoxImage.Information);
     }
     else
     {
         MessageBox.Show("There are some invalid fields",
                         "Check Data Again",
                         MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Exemple #2
0
 private void btnSubmit_Click(object sender, RoutedEventArgs e)
 {
     if (!_isValidData)
     {
         MessageBox.Show("Click Verify Button First",
                         "Verify Slide Contents First",
                         MessageBoxButton.OK, MessageBoxImage.Warning);
         return;
     }
     _slide = new ImpressSlide
     {
         Id          = txtID.Text.Trim(),
         DataX       = Convert.ToInt16(txtDataX.Text.Trim()),
         DataY       = Convert.ToInt16(txtDataY.Text.Trim()),
         DataZ       = Convert.ToInt16(txtDataZ.Text.Trim()),
         DataRotateX = Convert.ToInt16(txtDataRotateX.Text.Trim()),
         DataRotateY = Convert.ToInt16(txtDataRotateY.Text.Trim()),
         DataRotateZ = Convert.ToInt16(txtDataRotateZ.Text.Trim()),
         DataScale   = 1,
         SlideMatter = _rtb.Lines,
         DataRotate  = Convert.ToInt16(DataRotate.Text.Trim()),
         Header      = txtSlideHeader.Text.Trim()
     };
     _slide.Class = (cmbSlideType.Text == "Step Slide") ? "Step Slide" : "Step";
     MessageBox.Show("Successfully created new slide",
                     "Success",
                     MessageBoxButton.OK, MessageBoxImage.Information);
     Close();
 }
 private void UpdateSlide(ref ImpressSlide arg)
 {
     arg.DataRotate  = Convert.ToInt32(txtDataRotate.Text);
     arg.DataRotateX = Convert.ToInt32(txtDataRotateX.Text);
     arg.DataRotateY = Convert.ToInt32(txtDataRotateY.Text);
     arg.DataRotateZ = Convert.ToInt32(txtDataRotateZ.Text);
     arg.DataScale   = Convert.ToInt32(txtDataScale.Text);
     arg.DataX       = Convert.ToInt32(txtDataX.Text);
     arg.DataY       = Convert.ToInt32(txtDataY.Text);
     arg.DataZ       = Convert.ToInt32(txtDataZ.Text);
     arg.Header      = txtSlideHeader.Text;
     arg.SlideMatter = _rtb.Lines;
     arg.Class       = cmbSlideType.Text;
 }
 private void FillSlideData(ImpressSlide arg)
 {
     _rtb.Clear();
     txtID.Text                 = arg.Id;
     txtDataX.Text              = arg.DataX.ToString();
     txtDataY.Text              = arg.DataY.ToString();
     txtDataZ.Text              = arg.DataZ.ToString();
     txtDataRotateX.Text        = arg.DataRotateX.ToString();
     txtDataRotateY.Text        = arg.DataRotateY.ToString();
     txtDataRotateZ.Text        = arg.DataRotateZ.ToString();
     txtDataRotate.Text         = arg.DataRotate.ToString();
     txtDataScale.Text          = arg.DataScale.ToString();
     txtSlideHeader.Text        = arg.Header;
     _rtb.Lines                 = arg.SlideMatter;
     cmbSlideType.SelectedIndex = (arg.Class == "Step Slide") ? 0 : 1;
 }