<?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: uncheck concurrent extensions when program closes in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/uncheck-concurrent-extensions-when-program-closes/m-p/1023453#M6119</link>
    <description>&lt;P&gt;Good day Mark,&lt;/P&gt;&lt;P&gt;I am doing something similar. I use the Expiration date to know if it's in use.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the Close Project event instead of the ArcGIS Pro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public static bool IsCheckedOutProDataReviewer()&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;DateTime origin = new DateTime();&lt;BR /&gt;DateTime expire = new DateTime();&lt;BR /&gt;if (LicenseInformation.GetExpirationDate(LicenseCodes.DataReviewer) != null)&lt;BR /&gt;expire = (DateTime)LicenseInformation.GetExpirationDate(LicenseCodes.DataReviewer);&lt;BR /&gt;if (expire.CompareTo(origin) != 0)&lt;BR /&gt;return true;&lt;BR /&gt;else&lt;BR /&gt;return false;&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show(ex.ToString());&lt;BR /&gt;}&lt;BR /&gt;return false;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Module1.cs, I added this code... (Make sure that the&amp;nbsp;autoLoad="true" in the insertModule in your Config.daml)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;protected override bool Initialize()&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;ProjectClosedEvent.Subscribe(OnProjectClose);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show(ex.ToString());&lt;BR /&gt;}&lt;BR /&gt;return base.Initialize();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;private void OnProjectClose(ProjectEventArgs obj)&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;ExecuteShutdownReviewExtension();&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show(ex.ToString());&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;private void ExecuteShutdownReviewExtension()&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;try&lt;BR /&gt;{&lt;BR /&gt;if (ClassHelperReviewer.IsCheckedOutProDataReviewer())&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ClassHelperReviewer.DisableProDataReviewer();&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show(ex.ToString());&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;protected override void Uninitialize()&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;ProjectClosedEvent.Unsubscribe(OnProjectClose); //unsubscribe&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show(ex.ToString());&lt;BR /&gt;}&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Feb 2021 16:05:54 GMT</pubDate>
    <dc:creator>PascalVezina</dc:creator>
    <dc:date>2021-02-04T16:05:54Z</dc:date>
    <item>
      <title>uncheck concurrent extensions when program closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/uncheck-concurrent-extensions-when-program-closes/m-p/796934#M1817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having done in Desktop, using C#&amp;nbsp; I used the ESRI.ArcGIS.esriSystem&amp;nbsp;.dll and there was a protected override void OnStartup() and OnShutdown method I could use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Pro I think the best I can use is ArcGIS.Core.Licensing.LicensingInformation.CheckinLicense(LicenseCodes.'extension') method. I cannot find or think up a way to check if the extensions have been used without the ArcGIS.esriSystem .dll.&amp;nbsp; I also cannot seem to find similar OnStartup() and OnShutdown() methods for the knowing when to run the CheckinLicense() methods.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone come across something similar to this? I am worried that even with the concurrent extensions, many of my co-workers might just check on the extensions and then never close the program, we have many more employees than extensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2020 20:26:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/uncheck-concurrent-extensions-when-program-closes/m-p/796934#M1817</guid>
      <dc:creator>MarkJohnson11</dc:creator>
      <dc:date>2020-10-02T20:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: uncheck concurrent extensions when program closes</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/uncheck-concurrent-extensions-when-program-closes/m-p/1023453#M6119</link>
      <description>&lt;P&gt;Good day Mark,&lt;/P&gt;&lt;P&gt;I am doing something similar. I use the Expiration date to know if it's in use.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the Close Project event instead of the ArcGIS Pro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public static bool IsCheckedOutProDataReviewer()&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;DateTime origin = new DateTime();&lt;BR /&gt;DateTime expire = new DateTime();&lt;BR /&gt;if (LicenseInformation.GetExpirationDate(LicenseCodes.DataReviewer) != null)&lt;BR /&gt;expire = (DateTime)LicenseInformation.GetExpirationDate(LicenseCodes.DataReviewer);&lt;BR /&gt;if (expire.CompareTo(origin) != 0)&lt;BR /&gt;return true;&lt;BR /&gt;else&lt;BR /&gt;return false;&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show(ex.ToString());&lt;BR /&gt;}&lt;BR /&gt;return false;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Module1.cs, I added this code... (Make sure that the&amp;nbsp;autoLoad="true" in the insertModule in your Config.daml)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;protected override bool Initialize()&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;ProjectClosedEvent.Subscribe(OnProjectClose);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show(ex.ToString());&lt;BR /&gt;}&lt;BR /&gt;return base.Initialize();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;private void OnProjectClose(ProjectEventArgs obj)&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;ExecuteShutdownReviewExtension();&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show(ex.ToString());&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;private void ExecuteShutdownReviewExtension()&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;try&lt;BR /&gt;{&lt;BR /&gt;if (ClassHelperReviewer.IsCheckedOutProDataReviewer())&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ClassHelperReviewer.DisableProDataReviewer();&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show(ex.ToString());&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;protected override void Uninitialize()&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;ProjectClosedEvent.Unsubscribe(OnProjectClose); //unsubscribe&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show(ex.ToString());&lt;BR /&gt;}&lt;BR /&gt;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 16:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/uncheck-concurrent-extensions-when-program-closes/m-p/1023453#M6119</guid>
      <dc:creator>PascalVezina</dc:creator>
      <dc:date>2021-02-04T16:05:54Z</dc:date>
    </item>
  </channel>
</rss>

