<?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: How to programmatically determine if editing session in progress for ArcGIS Pro? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-programmatically-determine-if-editing/m-p/1318748#M72129</link>
    <description>&lt;P&gt;The Project class has the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic29086.html" target="_self"&gt;IsEditingEnabled&lt;/A&gt; property. This is the snippet to disable editing.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// if editing
if (Project.Current.IsEditingEnabled)
{
  var res = MessageBox.Show("Do you want to disable editing? Editing tools will be disabled",
                                                         "Disable Editing?", System.Windows.MessageBoxButton.YesNoCancel);
  if (res == System.Windows.MessageBoxResult.No ||
                res == System.Windows.MessageBoxResult.Cancel)
  {
    return;
  }

  //we must check for edits
  if (Project.Current.HasEdits)
  {
    res = MessageBox.Show("Save edits?", "Save Edits?", System.Windows.MessageBoxButton.YesNoCancel);
    if (res == System.Windows.MessageBoxResult.Cancel)
      return;
    else if (res == System.Windows.MessageBoxResult.No)
      Project.Current.DiscardEditsAsync();
    else
    {
      Project.Current.SaveEditsAsync();
    }
  }
  Project.Current.SetIsEditingEnabledAsync(false);
}&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 15 Aug 2023 16:04:40 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2023-08-15T16:04:40Z</dc:date>
    <item>
      <title>How to programmatically determine if editing session in progress for ArcGIS Pro?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-programmatically-determine-if-editing/m-p/1318729#M72128</link>
      <description>&lt;P&gt;In ArcMap, I was able to determine if my users were in an edit session, or no.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I know that an edit session isn't the same / not required in Pro. But many of my users are still new to Pro, so I suggest they follow the instructions in this link, to enable editing from the edit tab.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=nQq3sgFbk8I" target="_blank"&gt;https://www.youtube.com/watch?v=nQq3sgFbk8I&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I have a c# Add-In for ArcGIS pro. I would like my program to be able to determine if my user is in an edit session, or no.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have tried things like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;       private async void CheckEditSession()
        {
            // Check if an edit session is in progress
            bool editInProgress = false;

            await QueuedTask.Run(() =&amp;gt;
            {
                editInProgress = EditingModule.Current.EditState == EditState.Editing;
            });

            // Display appropriate message
            if (editInProgress)
            {
                MessageBox.Show("Edit session in progress.");
            }
            else
            {
                MessageBox.Show("Edit Session NOT in progress.");
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But, as you can see, this syntax isn't really available. I'm having trouble finding any equivalent in the vast work of Pro Snippets.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How can I programmatically determine whether or not my user is in an edit session, or not?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 15:41:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-programmatically-determine-if-editing/m-p/1318729#M72128</guid>
      <dc:creator>LaurenPeckman</dc:creator>
      <dc:date>2023-08-15T15:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically determine if editing session in progress for ArcGIS Pro?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-programmatically-determine-if-editing/m-p/1318748#M72129</link>
      <description>&lt;P&gt;The Project class has the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic29086.html" target="_self"&gt;IsEditingEnabled&lt;/A&gt; property. This is the snippet to disable editing.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// if editing
if (Project.Current.IsEditingEnabled)
{
  var res = MessageBox.Show("Do you want to disable editing? Editing tools will be disabled",
                                                         "Disable Editing?", System.Windows.MessageBoxButton.YesNoCancel);
  if (res == System.Windows.MessageBoxResult.No ||
                res == System.Windows.MessageBoxResult.Cancel)
  {
    return;
  }

  //we must check for edits
  if (Project.Current.HasEdits)
  {
    res = MessageBox.Show("Save edits?", "Save Edits?", System.Windows.MessageBoxButton.YesNoCancel);
    if (res == System.Windows.MessageBoxResult.Cancel)
      return;
    else if (res == System.Windows.MessageBoxResult.No)
      Project.Current.DiscardEditsAsync();
    else
    {
      Project.Current.SaveEditsAsync();
    }
  }
  Project.Current.SetIsEditingEnabledAsync(false);
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Aug 2023 16:04:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-programmatically-determine-if-editing/m-p/1318748#M72129</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-08-15T16:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically determine if editing session in progress for ArcGIS Pro?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-programmatically-determine-if-editing/m-p/1485598#M84211</link>
      <description>&lt;P&gt;How would this work for a CoreHost application, where pro has been configured to require an edit session?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ThomasRea_0-1717613437766.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106287i1496C36122803AD7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ThomasRea_0-1717613437766.png" alt="ThomasRea_0-1717613437766.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When configured this way, the Geodatabase.ApplyEdits method must be passed true, otherwise an exception is thrown. But in a CoreHost application, Project.Current is always null. How can I know when I must set the second parameter as true? Further, doing so get's rid of the exception and things appear to complete successfully, but the edit is not actually written to the attribute table.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 18:52:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-programmatically-determine-if-editing/m-p/1485598#M84211</guid>
      <dc:creator>ThomasRea</dc:creator>
      <dc:date>2024-06-05T18:52:42Z</dc:date>
    </item>
  </channel>
</rss>

