<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>[Microstation CE Update 17] [C#] | Update buffer | Undo previous change</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/249986/microstation-ce-update-17-c-update-buffer-undo-previous-change</link><description>I have the next code: How can I enable users to reverse actions performed in my custom form using the &amp;quot;undo-redo&amp;quot; function (the arrows that allow you to revert changes)? I&amp;#39;m looking to implement the ability to programmatically undo changes using MicroStation</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: [Microstation CE Update 17] [C#] | Update buffer | Undo previous change</title><link>https://communities.bentley.com/thread/781509?ContentTypeID=1</link><pubDate>Tue, 12 Sep 2023 15:00:01 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:d7fc9c33-e9cf-4fff-bdf2-9c59440a16c3</guid><dc:creator>Jan Šlegr</dc:creator><description>[quote userid="1304677" url="~/products/programming/microstation_programming/f/microstation-programming---forum/249986/microstation-ce-update-17-c-update-buffer-undo-previous-change/781491"]But can we manipulate transactions? This seems to be a more useful approach...[/quote]
&lt;p&gt;There is transaction manager available, but:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is low level, so good knowledge is required.&lt;/li&gt;
&lt;li&gt;I am not sure whether C# TransactionManager offers the same functionality as a group of ITxn* classes in C++.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I recommend to study C++ documentation, important details are described there.&lt;/p&gt;
[quote userid="1304677" url="~/products/programming/microstation_programming/f/microstation-programming---forum/249986/microstation-ce-update-17-c-update-buffer-undo-previous-change/781491"]This seems to be a more useful approach...[/quote]
&lt;p&gt;Why? I do not think so.&lt;/p&gt;
&lt;p&gt;DgnTool encapsulates complex logic into simpler API so as Jon wrote, when element is modified, DgnElementSetTool ensures everything is done in the right way (not only transaction itself, but also proper name to be displayed in GUI etc).&lt;/p&gt;
[quote userid="1304677" url="~/products/programming/microstation_programming/f/microstation-programming---forum/249986/microstation-ce-update-17-c-update-buffer-undo-previous-change"]I have the next code:[/quote]
&lt;p&gt;It does not provide too much information about context, but depending whether you change EC data only or also the element itself, to use scheduling system is necessary.&lt;/p&gt;
&lt;p&gt;With regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [Microstation CE Update 17] [C#] | Update buffer | Undo previous change</title><link>https://communities.bentley.com/thread/781491?ContentTypeID=1</link><pubDate>Tue, 12 Sep 2023 14:03:00 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:f2816f3c-46fe-43fb-9d16-8a98cdc4488c</guid><dc:creator>Ivan Petrov</dc:creator><description>&lt;p&gt;Thank you very much for your answer.&lt;/p&gt;
&lt;p&gt;But can we manipulate transactions? This seems to be a more useful approach...&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [Microstation CE Update 17] [C#] | Update buffer | Undo previous change</title><link>https://communities.bentley.com/thread/781433?ContentTypeID=1</link><pubDate>Tue, 12 Sep 2023 08:08:43 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:74689644-3e49-4c1d-bf97-ab4627f0c45f</guid><dc:creator>Jon Summers</dc:creator><description>[quote userid="1304677" url="~/products/programming/microstation_programming/f/microstation-programming---forum/249986/microstation-ce-update-17-c-update-buffer-undo-previous-change"]How can I enable users to reverse actions performed in my custom form using the &amp;quot;undo-redo&amp;quot; function (the arrows that allow you to revert changes)?[/quote]
&lt;p&gt;MicroStation automatically creates a transaction for primitive commands.&amp;nbsp; The undo/redo logic causes a transaction to be rolled back/forward.&lt;/p&gt;
&lt;p&gt;If your code that modifes an &lt;em&gt;Item&lt;/em&gt; instance is embedded in a primitive command then the transaction logic is applied automatically.&amp;nbsp; Create your own command class, inheriting from &lt;code&gt;DgnElementSetTool&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>