[This is preliminary documentation and is subject to change.]

Occurs when the user tries to undo the changed in a row.

Namespace:  Firefly.Box
Assembly:  Firefly.Box (in Firefly.Box.dll) Version: 3.4.23.6473 (3.4.23.6473)

Syntax

C#
public event CancelEventHandler Undoing
Visual Basic (Declaration)
Public Event Undoing As CancelEventHandler
Visual C++
public:
 event CancelEventHandler^ Undoing {
	void add (CancelEventHandler^ value);
	void remove (CancelEventHandler^ value);
}

Remarks

An CancelEventArgs is provided. If the Cancel is set to true, the undo will not be performed.

Examples

using the Undoing event
This example is based on test data. The code for the entities included in this test data can be found in the documentation of Entity
This example uses automatic tools to generate parts of the user interface. Those tools can be found in the example of the documentation of Form
CopyC#
using System.Windows.Forms;
using Firefly.Box;

namespace TestFirefly.Box.Documentation
{
    public class UndoingDemo
    {
        public void Run()
        {
            var jobs = new Pubs.Jobs();
            jobs.InitializeWithTestData();

            var uic = new UIController()
            {
                From = jobs,
                View = UITools.GenerateFormWithGridFor("Undoing demo",
                                                       "Change values in a certain row and click on the \"Undo Changes In Row\" button",
                                                       jobs.Id,
                                                       jobs.Description,
                                                       jobs.MinLevel,
                                                       jobs.MaxLevel)
            };

            var undoButton = new Button
            {
                Text = "Undo Changes In Row"
            };
            undoButton.Click += (a, b) => uic.Raise(Command.UndoChangesInRow);

            UITools.AddControlsToForm(uic.View, undoButton);

            uic.Undoing += (e) =>
            {
                if (MessageBox.Show("Are you sure you want to undo the changes in this row?",
                    "Confirm Undo",
                    MessageBoxButtons.YesNo) != DialogResult.Yes)
                    e.Cancel = true;
            };



            uic.Run();
        }
    }
}

See Also