<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Remove All From Undo Stack in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-all-from-undo-stack/m-p/1046029#M6429</link>
    <description>&lt;P&gt;Maybe using&amp;nbsp;await Project.Current.SaveAsync(); to force save the project once everything is loaded and rendered the way you want would disable the Undo button so users can't backout the changes your code did.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Apr 2021 18:26:18 GMT</pubDate>
    <dc:creator>DavidButz</dc:creator>
    <dc:date>2021-04-12T18:26:18Z</dc:date>
    <item>
      <title>Remove All From Undo Stack</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-all-from-undo-stack/m-p/780343#M1122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my configuration I have a "Load Map" function that loads all of the Feature Services on the Map and Renders them for the user.&amp;nbsp; With the new Undo/Redo functionality for the Feature Service I am working on getting my users used to it.&amp;nbsp; However, when i load a map, add the Layers, and Render the Layers, the undo button becomes available to the user, even if I save edits and save project in the code.&amp;nbsp; I don't want the user to be able to undo my rendering and layer loading?&amp;nbsp; I want them to start off with no Redo or Undo available.&amp;nbsp; The OperationManager doesn'ts seem to have any entries in it?&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/484039_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;//I don't know how to even find the categories available, but I want to remove all of them anyways and start with blank undo/redo stack&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//Here is my initial attempt (Category??)&lt;/SPAN&gt;

OperationManager _operationManager &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;OperationManager&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;//Nothing&lt;/SPAN&gt;
List&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Operation&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; ops &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; _operationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FindUndoOperations&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;o &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; o&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Category &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Update Map Properties"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;//Nother with != either&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//So it must be empty?&lt;/SPAN&gt;
ops &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; _operationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FindUndoOperations&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;o &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; o&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Category &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Update Map Properties"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;//This will fail/error as ops is empty&lt;/SPAN&gt;
_operationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;RemoveUndoOperation&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ops&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;First&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:48:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-all-from-undo-stack/m-p/780343#M1122</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2021-12-12T08:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Remove All From Undo Stack</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-all-from-undo-stack/m-p/780344#M1123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Most operations via the API are by design un-doable.&amp;nbsp; Same as via the UI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 22:47:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-all-from-undo-stack/m-p/780344#M1123</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2020-03-06T22:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Remove All From Undo Stack</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-all-from-undo-stack/m-p/1046029#M6429</link>
      <description>&lt;P&gt;Maybe using&amp;nbsp;await Project.Current.SaveAsync(); to force save the project once everything is loaded and rendered the way you want would disable the Undo button so users can't backout the changes your code did.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 18:26:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/remove-all-from-undo-stack/m-p/1046029#M6429</guid>
      <dc:creator>DavidButz</dc:creator>
      <dc:date>2021-04-12T18:26:18Z</dc:date>
    </item>
  </channel>
</rss>

