Using Undo Blocks With ECO On Winform C# Applications
Join the DZone community and get the full member experience.Join For Free
// On WinForms applications using Delphi's ECO environment in C# // 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);
application Blocks Undo
Opinions expressed by DZone contributors are their own.