<?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 get container type from catalog selected item in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1056514#M6568</link>
    <description>&lt;P&gt;Thank for your reply&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9021"&gt;@UmaHarano&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Look like my question is not clear,&amp;nbsp;&lt;/P&gt;&lt;P&gt;For type casting from project item, to find the specific type and casting is ok for me, not an issue.&lt;/P&gt;&lt;P&gt;Refer to below example screenshot. for BrowseProject.sde item, user can choose from Databases or Folders. I have a specific analysis requirement whether user more frequently use this sde connection from Database container or Folders container.&lt;/P&gt;&lt;P&gt;So after user select the item, I need to find out, which container is the origin.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ThanHtetAung_EsriAu_0-1620695690229.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/13008i3AB30CDBFFDD5BC4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ThanHtetAung_EsriAu_0-1620695690229.jpeg" alt="ThanHtetAung_EsriAu_0-1620695690229.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Than&lt;/P&gt;</description>
    <pubDate>Tue, 11 May 2021 01:18:54 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-05-11T01:18:54Z</dc:date>
    <item>
      <title>How to get container type from catalog selected item</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1056104#M6563</link>
      <description>&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a trouble getting container type from selected item (sde connection).&lt;/P&gt;&lt;P&gt;As you know sde connection can be from Folder connection(Folders) or GDB connection (Databases) in Catalog pane.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let say I retrieve selected sde connection with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcGIS.Desktop.Core.IProjectWindow currentProjectWindow = Project.GetCatalogPane(true);&lt;/P&gt;&lt;P&gt;var selectedItem = currentProjectWindow.SelectedItem.First();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How shall I know that selectedItem's parent container is Folders or Databases?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Pro sdk 2.7 at the moment.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9021"&gt;@UmaHarano&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 03:48:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1056104#M6563</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-05-10T03:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get container type from catalog selected item</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1056260#M6565</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You could cast the SelectedItem to the Type you are interested in.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;ArcGIS.Desktop.Core.IProjectWindow currentProjectWindow = Project.GetCatalogPane(true);
var selectedItem = currentProjectWindow.SelectedItems.FirstOrDefault();
var folderConnection = selectedItem as MapProjectItem;  //FolderConnectionProjectItem, etc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 16:12:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1056260#M6565</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2021-05-10T16:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get container type from catalog selected item</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1056514#M6568</link>
      <description>&lt;P&gt;Thank for your reply&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9021"&gt;@UmaHarano&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Look like my question is not clear,&amp;nbsp;&lt;/P&gt;&lt;P&gt;For type casting from project item, to find the specific type and casting is ok for me, not an issue.&lt;/P&gt;&lt;P&gt;Refer to below example screenshot. for BrowseProject.sde item, user can choose from Databases or Folders. I have a specific analysis requirement whether user more frequently use this sde connection from Database container or Folders container.&lt;/P&gt;&lt;P&gt;So after user select the item, I need to find out, which container is the origin.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ThanHtetAung_EsriAu_0-1620695690229.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/13008i3AB30CDBFFDD5BC4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ThanHtetAung_EsriAu_0-1620695690229.jpeg" alt="ThanHtetAung_EsriAu_0-1620695690229.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Than&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 01:18:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1056514#M6568</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-05-11T01:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get container type from catalog selected item</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1056587#M6571</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I hope this will help.&lt;/P&gt;&lt;P&gt;1. create project using MapTool.&lt;/P&gt;&lt;P&gt;2. in the constructor,&lt;/P&gt;&lt;P&gt;public CaptureContainer()&lt;BR /&gt;{&lt;BR /&gt;IsSketchTool = true;&lt;BR /&gt;SketchType = SketchGeometryType.Point; //.Point;&lt;BR /&gt;//UseSnapping = true;&lt;BR /&gt;SketchOutputMode = SketchOutputMode.Screen;&lt;BR /&gt;var systemCursor = System.Windows.Input.Cursors.Arrow;&amp;nbsp;&lt;BR /&gt;Cursor = systemCursor;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;3.&amp;nbsp;&lt;/P&gt;&lt;P&gt;protected async override Task&amp;lt;bool&amp;gt; OnSketchCompleteAsync(Geometry geometry)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;var sourceSelection = ActiveMapView.SelectFeatures(geometry, SelectionCombinationMethod.New);&lt;/P&gt;&lt;P&gt;foreach (KeyValuePair&amp;lt;BasicFeatureLayer, List&amp;lt;long&amp;gt;&amp;gt; eachSel in sourceSelection)&lt;BR /&gt;{&lt;BR /&gt;CIMDataConnection currentDataConnection = eachSel.Key.GetDataConnection();&lt;BR /&gt;var objsting= currentDataConnection.ToJson();&lt;BR /&gt;JObject jsonObject = JObject.Parse(objsting);&lt;BR /&gt;MessageBox.Show("connection string is from : "+(string)jsonObject["workspaceFactory"]);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;return true;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Hope this helps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sreeni.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 08:27:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1056587#M6571</guid>
      <dc:creator>SreenivasaRaoPigili</dc:creator>
      <dc:date>2021-05-11T08:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get container type from catalog selected item</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1063430#M6629</link>
      <description>&lt;P&gt;Thank&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/76130"&gt;@SreenivasaRaoPigili&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;But It is not what I am looking for actually.&lt;/P&gt;&lt;P&gt;Refer to my image: The first project item , it's parent container is databases, and second project item, it's parent container is folder connection (folders). in the catalog pane.&lt;/P&gt;&lt;P&gt;First item parent object should be like&lt;/P&gt;&lt;PRE&gt; &lt;SPAN class="pl-smi"&gt;Project&lt;/SPAN&gt;.&lt;SPAN class="pl-smi"&gt;Current&lt;/SPAN&gt;.&lt;SPAN class="pl-en"&gt;GetProjectItemContainer&lt;/SPAN&gt;(&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;GDB&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;Second item parent object should be like&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="pl-smi"&gt;Project&lt;/SPAN&gt;.&lt;SPAN class="pl-smi"&gt;Current&lt;/SPAN&gt;.&lt;SPAN class="pl-en"&gt;GetProjectItemContainer&lt;/SPAN&gt;(&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;FolderConnection&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;Currently I can't figure out from selected project item (selected item), something like which property to use.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 05:34:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-container-type-from-catalog-selected/m-p/1063430#M6629</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-01T05:34:51Z</dc:date>
    </item>
  </channel>
</rss>

