Ejemplo n.º 1
0
 private bool ApplyChanges()
 {
     try {
         CurrentEditorOwner.ApplyChanges(_editingNode, CurrentEditor);
         _errorProvider?.Clear();
         return(true);
     }
     catch (ArgumentException ex) {
         if (_errorProvider == null)
         {
             _errorProvider = new ErrorProvider();
         }
         _errorProvider.SetError(CurrentEditor, ex.Message);
         return(false);
     }
 }
Ejemplo n.º 2
0
        private bool ApplyChanges()
        {
            try
            {
                CurrentEditorOwner.ApplyChanges(_editingNode, CurrentEditor);
                _errorProvider.Clear();
                return(true);
            }
            catch (ArgumentException ex)
            {
                _errorProvider.SetError(CurrentEditor, ex.Message);

                /*CurrentEditor.Validating -= EditorValidating;
                *  MessageBox.Show(this, ex.Message, "Value is not valid", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                *  CurrentEditor.Focus();
                *  CurrentEditor.Validating += EditorValidating;*/
                return(false);
            }
        }