Пример #1
0
        private void applyButton_Click(object sender, EventArgs e)
        {
            var transformations = Content.CheckedTransformationList.CheckedItems.Select(x => x.Value);

            if (transformations.Any(x => ((Transformation)x).ColumnParameter.Value == null))
            {
                MessageBox.Show(this, "Parameter \"Column\" of a selected Transformation is not set.", "Applying Transformations...", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            var    transformator = new PreprocessingTransformator(Content.PreprocessingData);
            bool   preserve      = preserveColumnsCheckbox.CheckState == CheckState.Checked;
            string errorMsg;
            bool   success = transformator.ApplyTransformations(transformations, preserve, out errorMsg);

            if (success)
            {
                Content.CheckedTransformationList.Clear();
                MessageBox.Show(this, "Transformations applied.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show(this,
                                "Error in Transformation.\nValue is copied when transformion of cell failed.\n" + errorMsg,
                                "Transformation failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Пример #2
0
    private void applyButton_Click(object sender, EventArgs e) {
      var transformations = Content.CheckedTransformationList.CheckedItems.Select(x => x.Value);

      if (transformations.Any(x => ((Transformation)x).ColumnParameter.Value == null)) {
        MessageBox.Show(this, "Parameter \"Column\" of a selected Transformation is not set.", "Applying Transformations...", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        return;
      }

      var transformator = new PreprocessingTransformator(Content.Data);
      bool preserve = preserveColumnsCheckbox.CheckState == CheckState.Checked;
      string errorMsg;
      bool success = transformator.ApplyTransformations(transformations, preserve, out errorMsg);
      if (success) {
        Content.CheckedTransformationList.Clear();
        MessageBox.Show(this, "Transformations applied.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
      } else {
        MessageBox.Show(this,
          "Error in Transformation.\nValue is copied when transformion of cell failed.\n" + errorMsg,
          "Transformation failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
      }
    }