<?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: Removing an Operation from the OperationsManager Undo/Redo Stack Doesn't Work in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/removing-an-operation-from-the-operationsmanager/m-p/1289314#M9824</link>
    <description>&lt;P&gt;Charlie,&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp; That fixed my problem.&amp;nbsp; I am not sure why or how this worked in 2.9 when it definitely shouldn't have.&amp;nbsp; I had the RemoveRedo... when I just needed RemoveUndo...&amp;nbsp; Silly mistake!&lt;/P&gt;</description>
    <pubDate>Mon, 15 May 2023 19:55:07 GMT</pubDate>
    <dc:creator>DaveLewis73</dc:creator>
    <dc:date>2023-05-15T19:55:07Z</dc:date>
    <item>
      <title>Removing an Operation from the OperationsManager Undo/Redo Stack Doesn't Work</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/removing-an-operation-from-the-operationsmanager/m-p/1288889#M9810</link>
      <description>&lt;P&gt;I have encountered what appears to be a bug in ArcGIS Pro 3.1.1 using the C# Pro SDK.&amp;nbsp; I initially developed a method to remove unwanted operations from the OperationsManager undo/redo stack in version 2.9 of Pro, which worked perfectly.&amp;nbsp; I was able to call the method whenever I wanted to, passing it an operation name, and it would remove it from the undo/redo stack.&amp;nbsp; However, I have since upgraded my code to 3.X (currently 3.1.1) and the method no longer functions.&amp;nbsp; It does not error.&amp;nbsp; It just simply does nothing.&amp;nbsp; Operations that I have requested to be removed are maintained, no matter what I do.&amp;nbsp; Has there been a breaking change from 2.X to 3.X that has caused this behavior.&amp;nbsp; The following is my method that used to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static void RemoveUndoOperations(string opName)
{
    if (MapView.Active?.Map == null) { return; }

    QueuedTask.Run(async () =&amp;gt;
    {
        await Application.Current.Dispatcher.BeginInvoke(new Action(() =&amp;gt;
        {
            OperationManager opManager = MapView.Active.Map.OperationManager;
            List&amp;lt;Operation&amp;gt; ops = opManager.FindUndoOperations(o =&amp;gt; o.Name.Contains(opName));
            ops.ForEach(op =&amp;gt; opManager.RemoveRedoOperation(op));
        }), DispatcherPriority.ApplicationIdle);
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE:&amp;nbsp; Removing the async QueuedTask and the Application.Current.Dispactcher.BeginInvoke does not make a difference.&amp;nbsp; I have tried this, just for testing purposes, and it doesn't change things.&amp;nbsp; The code still does not work.&amp;nbsp; Nothing is removed from the undo/redo stack, no matter what I try.&amp;nbsp; Once again, there are no errors.&amp;nbsp; The code just fails to do anything.&amp;nbsp; Any thoughts?&amp;nbsp; Is this a new bug?&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2023 19:23:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/removing-an-operation-from-the-operationsmanager/m-p/1288889#M9810</guid>
      <dc:creator>DaveLewis73</dc:creator>
      <dc:date>2023-05-13T19:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Removing an Operation from the OperationsManager Undo/Redo Stack Doesn't Work</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/removing-an-operation-from-the-operationsmanager/m-p/1289243#M9821</link>
      <description>&lt;P&gt;Hi Dave, can u try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;FrameworkApplication.Current.Dispatcher.BeginInvoke(() =&amp;gt; {
  OperationManager opManager = MapView.Active.Map.OperationManager;
  List&amp;lt;Operation&amp;gt; ops = opManager.FindUndoOperations(
                             o =&amp;gt; o.Name.Contains(opName));
  ops.ForEach(op =&amp;gt; opManager.RemoveUndoOperation(op));
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think u need to match the FindUndoOperations with a RemoveUndoOperation and vice versa for FindRedo.... and RemoveRedo....&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 17:47:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/removing-an-operation-from-the-operationsmanager/m-p/1289243#M9821</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2023-05-15T17:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Removing an Operation from the OperationsManager Undo/Redo Stack Doesn't Work</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/removing-an-operation-from-the-operationsmanager/m-p/1289314#M9824</link>
      <description>&lt;P&gt;Charlie,&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp; That fixed my problem.&amp;nbsp; I am not sure why or how this worked in 2.9 when it definitely shouldn't have.&amp;nbsp; I had the RemoveRedo... when I just needed RemoveUndo...&amp;nbsp; Silly mistake!&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 19:55:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/removing-an-operation-from-the-operationsmanager/m-p/1289314#M9824</guid>
      <dc:creator>DaveLewis73</dc:creator>
      <dc:date>2023-05-15T19:55:07Z</dc:date>
    </item>
  </channel>
</rss>

