Exemplo n.º 1
0
        private void okButton_Click(object sender, EventArgs e)
        {
            if (this.BatchEditor == null)
            {
                MessageBox.Show("Please select a Batch Editor.");
                return;
            }

            if (elementTypeComboBox.SelectedIndex < 0)
            {
                MessageBox.Show("Please select an Element Type.");
                return;
            }

            if (valueXPathTextBox.Text.IsNullOrEmpty())
            {
                MessageBox.Show("Please enter the Value XPath.");
                return;
            }

            using (new Wait())
            {
                EnumValue <ElementType> elementType = (elementTypeComboBox.SelectedItem as EnumValue <ElementType>);
                BaseBatchEditor         batchEditor = (BaseBatchEditor)editorComboBox.SelectedItem;

                try
                {
                    BatchEditorManager.Instance.Apply(batchEditor, ProjectContext.Project, elementType.Value, filterXPathTextBox.Text, valueXPathTextBox.Text);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemplo n.º 2
0
 public BatchEdit(BaseBatchEditor batchEditor)
 {
     InitializeComponent();
 }