<?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 ArcGIS Explorer Desktop 1750 SDK:&amp;nbsp; MapItemChangeStatus&amp;nbsp; &amp;amp;amp;quot;Removed&amp;amp;amp;quot; fires early? in ArcGIS Explorer Desktop Questions</title>
    <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/arcgis-explorer-desktop-1750-sdk-nbsp/m-p/395376#M2423</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've written a simple extension to automatically save the current map document whenever the user adds or removes a map item.&amp;nbsp;&amp;nbsp; Whenever I call the SaveDocument() method after a 'MapItemChangeStatus.Removed' event, the item is still present in the map document even though it has been removed from the current map.&amp;nbsp; You can see this by stepping through the code and watching the item still remain on the map until the event fires, and then is removed after save method is called.&amp;nbsp;&amp;nbsp; Also, closing and then reopening the document shows this is the case as the item is still there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any options besides writing a timer to handle this?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C# code snip for extension:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]public override void OnStartup()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ESRI.ArcGISExplorer.Application.Application.MapItemChanged += new EventHandler&amp;lt;MapItemEventArgs&amp;gt;(Application_MapItemChanged);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void Application_MapItemChanged(object sender, MapItemEventArgs e)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (e.Status == MapItemChangeStatus.Added || e.Status == MapItemChangeStatus.Removed)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGISExplorer.Application.Application.SaveDocument();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jul 2012 16:12:56 GMT</pubDate>
    <dc:creator>DanHuber</dc:creator>
    <dc:date>2012-07-09T16:12:56Z</dc:date>
    <item>
      <title>ArcGIS Explorer Desktop 1750 SDK:  MapItemChangeStatus  &amp;amp;quot;Removed&amp;amp;quot; fires early?</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/arcgis-explorer-desktop-1750-sdk-nbsp/m-p/395376#M2423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've written a simple extension to automatically save the current map document whenever the user adds or removes a map item.&amp;nbsp;&amp;nbsp; Whenever I call the SaveDocument() method after a 'MapItemChangeStatus.Removed' event, the item is still present in the map document even though it has been removed from the current map.&amp;nbsp; You can see this by stepping through the code and watching the item still remain on the map until the event fires, and then is removed after save method is called.&amp;nbsp;&amp;nbsp; Also, closing and then reopening the document shows this is the case as the item is still there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any options besides writing a timer to handle this?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C# code snip for extension:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]public override void OnStartup()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ESRI.ArcGISExplorer.Application.Application.MapItemChanged += new EventHandler&amp;lt;MapItemEventArgs&amp;gt;(Application_MapItemChanged);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void Application_MapItemChanged(object sender, MapItemEventArgs e)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if (e.Status == MapItemChangeStatus.Added || e.Status == MapItemChangeStatus.Removed)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGISExplorer.Application.Application.SaveDocument();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 16:12:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/arcgis-explorer-desktop-1750-sdk-nbsp/m-p/395376#M2423</guid>
      <dc:creator>DanHuber</dc:creator>
      <dc:date>2012-07-09T16:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Explorer Desktop 1750 SDK:  MapItemChangeStatus  "Removed" fires early?</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/arcgis-explorer-desktop-1750-sdk-nbsp/m-p/395377#M2424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I noticed the same behavior. It should work by firing the MapItemChanged event with "Removing", remove the item, then fire MapItemChange with "Removed." &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But since it doesn't, you can create a &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.aspx" rel="nofollow" target="_blank"&gt;System.Windows.Forms.Timer&lt;/A&gt;&lt;SPAN&gt; to check &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisexplorer/1750/sdk/componenthelp/index.html#/IsDocumentDirty_Property/0003000011z8000000/" rel="nofollow" target="_blank"&gt;Application.IsDocumentDirty&lt;/A&gt;&lt;SPAN&gt; and call &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisexplorer/1750/sdk/componenthelp/index.html#/SaveDocument_Method/000300000t17000000/" rel="nofollow" target="_blank"&gt;Application.SaveDocument&lt;/A&gt;&lt;SPAN&gt; at a specified Timer interval.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also create a handler for &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisexplorer/1750/sdk/componenthelp/index.html#/DocumentClosed_Event/0003000009z0000000/" rel="nofollow" target="_blank"&gt;Application.DocumentClosed&lt;/A&gt;&lt;SPAN&gt; (which will fire upon document closing and application exiting) check &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisexplorer/1750/sdk/componenthelp/index.html#/IsDocumentDirty_Property/0003000011z8000000/" rel="nofollow" target="_blank"&gt;Application.IsDocumentDirty&lt;/A&gt;&lt;SPAN&gt; and call &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisexplorer/1750/sdk/componenthelp/index.html#/SaveDocument_Method/000300000t17000000/" rel="nofollow" target="_blank"&gt;Application.SaveDocument&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 16:19:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/arcgis-explorer-desktop-1750-sdk-nbsp/m-p/395377#M2424</guid>
      <dc:creator>norie</dc:creator>
      <dc:date>2012-07-30T16:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Explorer Desktop 1750 SDK:  MapItemChangeStatus  "Removed" fires early?</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/arcgis-explorer-desktop-1750-sdk-nbsp/m-p/395378#M2425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I noticed the same behavior. It should work by firing the MapItemChanged event with "Removing", remove the item, then fire MapItemChange with "Removed." &lt;BR /&gt;&lt;BR /&gt;But since it doesn't, you can create a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.aspx"&gt;System.Windows.Forms.Timer&lt;/A&gt; to check &lt;A href="http://help.arcgis.com/en/arcgisexplorer/1750/sdk/componenthelp/index.html#/IsDocumentDirty_Property/0003000011z8000000/"&gt;Application.IsDocumentDirty&lt;/A&gt; and call &lt;A href="http://help.arcgis.com/en/arcgisexplorer/1750/sdk/componenthelp/index.html#/SaveDocument_Method/000300000t17000000/"&gt;Application.SaveDocument&lt;/A&gt; at a specified Timer interval.&lt;BR /&gt;&lt;BR /&gt;You can also create a handler for &lt;A href="http://help.arcgis.com/en/arcgisexplorer/1750/sdk/componenthelp/index.html#/DocumentClosed_Event/0003000009z0000000/"&gt;Application.DocumentClosed&lt;/A&gt; (which will fire upon document closing and application exiting) check &lt;A href="http://help.arcgis.com/en/arcgisexplorer/1750/sdk/componenthelp/index.html#/IsDocumentDirty_Property/0003000011z8000000/"&gt;Application.IsDocumentDirty&lt;/A&gt; and call &lt;A href="http://help.arcgis.com/en/arcgisexplorer/1750/sdk/componenthelp/index.html#/SaveDocument_Method/000300000t17000000/"&gt;Application.SaveDocument&lt;/A&gt;.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the response.&amp;nbsp;&amp;nbsp; I was hoping to avoid using a timer, but it may be my only way to work around this broken feature.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 17:19:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/arcgis-explorer-desktop-1750-sdk-nbsp/m-p/395378#M2425</guid>
      <dc:creator>DanHuber</dc:creator>
      <dc:date>2012-07-30T17:19:44Z</dc:date>
    </item>
  </channel>
</rss>

