Using Undo Blocks with ECO on Winform C# applications
// use the following code on an edit form. It will allow you
// to cancel or commit changes made during the lifetime of the form
// to objects in the EcoSpace - it does not change the objects in
// the database.
// Declare the following
private IUndoService undoService;
private string undoBlockName;
// In the form's constrcutor
this.EcoSpace = ecoSpace;
undoService = EcoServiceHelper.GetUndoService(EcoSpace);
// On Load
undoBlockName = undoService.GetUniqueBlockName(this.Name);
undoService.StartUndoBlock(undoBlockName);
// On Cancel
undoService.UndoLatest();
// On OK
undoService.UndoList.RemoveBlock(undoBlockName);