<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: ECO code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Tue, 14 Oct 2008 01:38:59 GMT</pubDate>
    <description>DZone Snippets: ECO code</description>
    <item>
      <title>Using Undo Blocks with ECO on Winform C# applications</title>
      <link>http://snippets.dzone.com/posts/show/2027</link>
      <description>// On WinForms applications using Delphi's ECO environment in C#&lt;br /&gt;//  use the following code on an edit form. It will allow you&lt;br /&gt;//  to cancel or commit changes made during the lifetime of the form&lt;br /&gt;//  to objects in the EcoSpace - it does not change the objects in &lt;br /&gt;//  the database.&lt;br /&gt;&lt;br /&gt;//  Declare the following&lt;br /&gt;    private IUndoService undoService;&lt;br /&gt;    private string undoBlockName;&lt;br /&gt;&lt;br /&gt;//  In the form's constrcutor&lt;br /&gt;    this.EcoSpace = ecoSpace;&lt;br /&gt;    undoService = EcoServiceHelper.GetUndoService(EcoSpace);&lt;br /&gt;&lt;br /&gt;//  On Load&lt;br /&gt;    undoBlockName = undoService.GetUniqueBlockName(this.Name);&lt;br /&gt;    undoService.StartUndoBlock(undoBlockName);&lt;br /&gt;&lt;br /&gt;//  On Cancel&lt;br /&gt;    undoService.UndoLatest();&lt;br /&gt;&lt;br /&gt;//  On OK&lt;br /&gt;    undoService.UndoList.RemoveBlock(undoBlockName);&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 15 May 2006 19:09:24 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2027</guid>
      <author>eskimoman (Mike)</author>
    </item>
  </channel>
</rss>
