<?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: New Button Condition for API in ArcGIS Explorer Desktop Questions</title>
    <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/new-button-condition-for-api/m-p/535408#M3290</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure of API change for this case, as it is easy to override the method and add your own conditions, if needed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jun 2011 18:20:15 GMT</pubDate>
    <dc:creator>AndreiIvanov</dc:creator>
    <dc:date>2011-06-28T18:20:15Z</dc:date>
    <item>
      <title>New Button Condition for API</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/new-button-condition-for-api/m-p/535405#M3287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm developing an improved version of the Layer Attributes sample using a button control. The new addin will allow users to view, navigate through and export the attributes of any selected item having an underlying table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Two questions for the ESRI AGX development folks:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Is it possible to add a new condition for the API, eg. Single Item with table selected?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At the moment I use the condition: Single Item selected, which leads to my second question:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. In the meanwhile what is the most efficient way to test for this programmatically so I can enable/disable the button state as the user selects different items?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 05:43:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/new-button-condition-for-api/m-p/535405#M3287</guid>
      <dc:creator>DarrylDempsey</dc:creator>
      <dc:date>2011-06-28T05:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: New Button Condition for API</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/new-button-condition-for-api/m-p/535406#M3288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Darryl,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you can check if layer has Table in OnUpdate method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void OnUpdate()
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.OnUpdate();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enabled = false;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //single item check
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Application.SelectedItems.Count &amp;gt; 1 || Application.SelectedItems.Count == 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // check for table
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MapItem mapItem = Application.SelectedItems.GetFirst();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (mapItem is PackageLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PackageLayer pkLayer = mapItem as PackageLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enabled = pkLayer.HasTable;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (mapItem is PackageChildLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PackageChildLayer pkChildLayer = mapItem as PackageChildLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enabled = pkChildLayer.HasTable;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (mapItem is FeatureLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enabled = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:15:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/new-button-condition-for-api/m-p/535406#M3288</guid>
      <dc:creator>AndreiIvanov</dc:creator>
      <dc:date>2021-12-11T23:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: New Button Condition for API</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/new-button-condition-for-api/m-p/535407#M3289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, Andriy. Works like a charm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any chance of seeing a new condition added to the API?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 17:21:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/new-button-condition-for-api/m-p/535407#M3289</guid>
      <dc:creator>DarrylDempsey</dc:creator>
      <dc:date>2011-06-28T17:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: New Button Condition for API</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/new-button-condition-for-api/m-p/535408#M3290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure of API change for this case, as it is easy to override the method and add your own conditions, if needed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 18:20:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/new-button-condition-for-api/m-p/535408#M3290</guid>
      <dc:creator>AndreiIvanov</dc:creator>
      <dc:date>2011-06-28T18:20:15Z</dc:date>
    </item>
  </channel>
</rss>

