Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Using Undo Blocks with ECO on Winform C# applications

// 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);

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS