Skip to content

Commit

Permalink
ArcGIS Pro 2.0 SDK for .NET
Browse files Browse the repository at this point in the history
  • Loading branch information
arcgisprosdk committed Jun 23, 2017
1 parent 66c1c0d commit 10f1777
Show file tree
Hide file tree
Showing 1,122 changed files with 27,793 additions and 6,841 deletions.
4 changes: 2 additions & 2 deletions Content/ArcGISOnlineConnect/AgolDockpane.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<RowDefinition Height="Auto" MinHeight="100" ></RowDefinition>
<RowDefinition Height="*" ></RowDefinition>
</Grid.RowDefinitions>
<DataGrid Grid.Row="0" Margin="10,0,10,0" ItemsSource="{Binding CallParams}" AutoGenerateColumns="False" CanUserAddRows="False" HeadersVisibility="Column" Style="{DynamicResource Esri_DataGridStyle}" IsReadOnly="False" >
<DataGrid Grid.Row="0" Margin="10,0,10,0" ItemsSource="{Binding CallParams}" AutoGenerateColumns="False" CanUserAddRows="False" HeadersVisibility="Column" Style="{DynamicResource Esri_DataGrid}" IsReadOnly="False" >
<DataGrid.Resources>
<DataTemplate x:Key="cellTemplate">
<TextBlock Text="{Binding Param}" Style="{DynamicResource ProTextStyle}"/>
Expand All @@ -86,7 +86,7 @@
</DataGrid.Columns>
</DataGrid>
<Button Grid.Row="1" Command="{Binding CommandDoQuery}" Margin="10,5,10,5" Content="{Binding CommandQuery}"
Style="{DynamicResource Esri_SimpleButton}"></Button>
Style="{DynamicResource Esri_Button}"></Button>
</Grid>
<TextBox Grid.Row="4" Text="{Binding QueryResult}" TextWrapping="Wrap" Margin="10,0,10,0" MinHeight="200" VerticalScrollBarVisibility="Auto" ></TextBox>
</Grid>
Expand Down
82 changes: 82 additions & 0 deletions Content/ArcGISOnlineConnect/ArcGISOnlineConnect (C# 6.0).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
## ArcGISOnlineConnect

<!-- TODO: Write a brief abstract explaining this sample -->
ArcGISOnlineConnect exercises a collection of programmatic interactions with ArcGIS Online using EsriHttpClient



<a href="http://pro.arcgis.com/en/pro-app/sdk/" target="_blank">View it live</a>

<!-- TODO: Fill this section below with metadata about this sample-->
```
Language: C# 6.0
Subject: Framework
Contributor: ArcGIS Pro SDK Team <[email protected]>
Organization: Esri, http://www.esri.com
Date: 6/23/2017
ArcGIS Pro: 2.0
Visual Studio: 2015, 2017
.NET Target Framework: 4.6.1
```

## Resources

* [API Reference online](http://pro.arcgis.com/en/pro-app/sdk/api-reference)
* <a href="http://pro.arcgis.com/en/pro-app/sdk/" target="_blank">ArcGIS Pro SDK for .NET (pro.arcgis.com)</a>
* [arcgis-pro-sdk-community-samples](http://github.com/Esri/arcgis-pro-sdk-community-samples)
* [ArcGISPro Registry Keys](http://github.com/Esri/arcgis-pro-sdk/wiki/ArcGIS-Pro-Registry-Keys)
* [FAQ](http://github.com/Esri/arcgis-pro-sdk/wiki/FAQ)
* [ArcGIS Pro SDK icons](https://github.com/Esri/arcgis-pro-sdk/releases/tag/1.4.0.7198)
* [ProConcepts: ArcGIS Pro Add in Samples](https://github.com/Esri/arcgis-pro-sdk-community-samples/wiki/ProConcepts-ArcGIS-Pro-Add-in-Samples)

![ArcGIS Pro SDK for .NET Icons](https://esri.github.io/arcgis-pro-sdk/images/Home/Image-of-icons.png "ArcGIS Pro SDK Icons")

* [ProSnippets: 2.0 Migration](http://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Migrating-to-2.0)
* [ProSnippets: 2.0 Migration Samples](http://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-2.0-Migration-Samples)
* [ProConcepts: 2.0 Migration](http://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-2.0-Migration-Guide)

### Samples Data

* Sample data for ArcGIS Pro SDK Community Samples can be downloaded from the [repo releases](https://github.com/Esri/arcgis-pro-sdk-community-samples/releases) page.

## How to use the sample
<!-- TODO: Explain how this sample can be used. To use images in this section, create the image file in your sample project's screenshots folder. Use relative url to link to this image using this syntax: ![My sample Image](FacePage/SampleImage.png) -->
1. This sample is using the ArcGIS REST API which is published here http://resources.arcgis.com/en/help/arcgis-rest-api
1. In Visual Studio click the Build menu. Then select Build Solution.
1. Click Start button to open ArcGIS Pro.
1. ArcGIS Pro will open.
1. Open any project file. Click on the Add-in tab on the ribbon and then on the Show "AgolDockpane" button.
![UI](Screenshot/AgolInterface.png)

1. On top the AgolDockpane (pane) you find the ArcGIS Online Uri used for the interaction with ArcGIS Online (your portal).
1. Select from the 'AGOL operation' listbox by starting with 'GetRest' (go through the list top to bottom doing the following steps):
1. Verify the Parameter(s) required for the query you just selected (note: default values are filled in by using return values from previous query results so sequence is important)
1. Click on the "Run ... ArcGIS Online Query" button to execute the query.
1. View the results in text box on the bottom of the AgolDockpane.
1. Please note that ArcGIS Online queries return json and various content returned in json is deserialized into the respective c# class.
1. Also note that permissions and content are required for various queries (i.e. content or folder queries)
1. The 'GetSearch' query requires a search string which by default is set to 'Redlands'.
![UI](Screenshot/Query1.png)

1. The 'GetUserContent' query requires a user name, however, if you performed the 'GetSelf' query before the parameter is filled in automatically for you.
![UI](Screenshot/Query2.png)

1. The 'GetUserContentForFolder' query requires a user name and a folder id, however, if you performed the 'GetSelf' and 'GetUserContent' query before, those parameters are filled in automatically for you from previous query results. Also you need to have a folder under you 'My content' tab in ArcGIS Online.
![UI](Screenshot/Query3.png)

1. The 'GetGroupMetadata, and GetGroupContent' queries require a group id, however, if you performed the 'GetSelf' query before, those parameters are filled in automatically for you from previous query results.
![UI](Screenshot/Query4.png)

1. The 'GetAdditemStatus, GetItem, GetItemPkInfo, GetItemData, and GetItemComments' queries require an item id, however, if you performed the 'GetUserContent' query before, those parameters are filled in automatically for you from previous query results.
![UI](Screenshot/Query5.png)

1. The 'GetGroupUsers, and GetUserTags' queries require a group id, however, if you performed the 'GetSelf' query before, those parameters are filled in automatically for you from previous query results.
![UI](Screenshot/Query6.png)



<!-- End -->

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://esri.github.io/arcgis-pro-sdk/images/ArcGISPro.png" alt="ArcGIS Pro SDK for Microsoft .NET Framework" height = "20" width = "20" align="top" >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Home](https://github.com/Esri/arcgis-pro-sdk/wiki) | <a href="http://pro.arcgis.com/en/pro-app/sdk/api-reference" target="_blank">API Reference</a> | [Requirements](https://github.com/Esri/arcgis-pro-sdk/wiki#requirements) | [Download](https://github.com/Esri/arcgis-pro-sdk/wiki#installing-arcgis-pro-sdk-for-net) | <a href="http://github.com/esri/arcgis-pro-sdk-community-samples" target="_blank">Samples</a>
6 changes: 3 additions & 3 deletions Content/ArcGISOnlineConnect/ArcGISOnlineConnect (C#).md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Language: C#
Subject: Framework
Contributor: ArcGIS Pro SDK Team <[email protected]>
Organization: Esri, http://www.esri.com
Date: 5/5/2017
ArcGIS Pro: 1.4
Visual Studio: 2013, 2015
Date: 4/20/2017
ArcGIS Pro: 2.0
Visual Studio: 2015, 2017
.NET Target Framework: 4.6.1
```

Expand Down
10 changes: 7 additions & 3 deletions Content/ArcGISOnlineConnect/ArcGISOnlineConnect.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration><NoWarn>1591</NoWarn>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
Expand All @@ -14,7 +14,7 @@
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "><NoWarn>1591</NoWarn>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand All @@ -27,7 +27,7 @@
<PlatformTarget>x64</PlatformTarget>
<DocumentationFile>ArcGISOnlineConnect.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "><NoWarn>1591</NoWarn>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -39,6 +39,9 @@
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
Expand Down Expand Up @@ -127,6 +130,7 @@
<AddInContent Include="Images\GenericButtonPurple32.png" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="ReadMe.md" />
<None Include="Screenshot\AgolInterface.png" />
<None Include="Screenshot\Query1.png" />
Expand Down
2 changes: 1 addition & 1 deletion Content/ArcGISOnlineConnect/ArcGISOnlineConnect.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArcGISOnlineConnect", "ArcGISOnlineConnect.csproj", "{DEB9DD29-7A64-4434-B111-A5B5FDCD2700}"
Expand Down
10 changes: 3 additions & 7 deletions Content/ArcGISOnlineConnect/Config.daml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>




<ArcGIS defaultAssembly="ArcGISOnlineConnect.dll" defaultNamespace="ArcGISOnlineConnect" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd">
<!--// Copyright 2017 Esri
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,12 +13,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<AddInInfo id="{ef0d3f3a-7faa-4a4a-a800-fff87a824883}" version="1.0" desktopVersion="1.4.7198">
<AddInInfo id="{ef0d3f3a-7faa-4a4a-a800-fff87a824883}" version="1.0" desktopVersion="2.0.0">
<Name>ArcGISOnlineConnect</Name>
<Description>ArcGISOnlineConnect description</Description>
<Image>Images\AddinDesktop32.png</Image>
<Author>Wolfgang</Author>
<Company>Acme</Company>
<Author>ArcGIS Pro SDK Team, [email protected]</Author>
<Company>esri, http://www.esri.com</Company>
<Date>5/26/2015 12:13:44 PM, 2015</Date>
<Subject>Framework</Subject>
<!-- Note subject can be one or more of these topics:
Expand Down
12 changes: 8 additions & 4 deletions Content/ArcGISOnlineConnect/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ ArcGISOnlineConnect exercises a collection of programmatic interactions with Arc

<!-- TODO: Fill this section below with metadata about this sample-->
```
Language: C#
Language: C# 6.0
Subject: Framework
Contributor: ArcGIS Pro SDK Team <[email protected]>
Organization: Esri, http://www.esri.com
Date: 5/5/2017
ArcGIS Pro: 1.4
Visual Studio: 2013, 2015
Date: 6/23/2017
ArcGIS Pro: 2.0
Visual Studio: 2015, 2017
.NET Target Framework: 4.6.1
```

Expand All @@ -31,6 +31,10 @@ Visual Studio: 2013, 2015

![ArcGIS Pro SDK for .NET Icons](https://esri.github.io/arcgis-pro-sdk/images/Home/Image-of-icons.png "ArcGIS Pro SDK Icons")

* [ProSnippets: 2.0 Migration](http://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Migrating-to-2.0)
* [ProSnippets: 2.0 Migration Samples](http://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-2.0-Migration-Samples)
* [ProConcepts: 2.0 Migration](http://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-2.0-Migration-Guide)

### Samples Data

* Sample data for ArcGIS Pro SDK Community Samples can be downloaded from the [repo releases](https://github.com/Esri/arcgis-pro-sdk-community-samples/releases) page.
Expand Down
4 changes: 4 additions & 0 deletions Content/ArcGISOnlineConnect/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net461" />
</packages>
80 changes: 80 additions & 0 deletions Content/CustomCatalogContext/Config.daml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2017 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<ArcGIS defaultAssembly="CustomCatalogContext.dll" defaultNamespace="CustomCatalogContext" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd">
<AddInInfo id="{a4f746a5-555b-4274-9394-266aab8ece04}" version="1.0" desktopVersion="2.0.8533">
<Name>CustomCatalogContext</Name>
<Description>CustomCatalogContext description</Description>
<Image>Images\AddinDesktop32.png</Image>
<Author>ArcGIS Pro SDK Team, [email protected]</Author>
<Company>esri, http://www.esri.com</Company>
<Date>5/30/2017 1:16:14 PM, 2017</Date>
<Subject>Content</Subject>
<!-- Note subject can be one or more of these topics:
Content, Framework, Editing, Geodatabase, Geometry, Geoprocessing, Layouts, Map Authoring, Map Exploration -->
</AddInInfo>
<dependencies>
<dependency name="ADMapping.daml" />
<dependency name="ADGeoDatabase.daml" />
</dependencies>
<modules>
<insertModule id="CustomCatalogContext_Module" className="Module1" autoLoad="false" caption="Module1">
<!-- uncomment to have the control hosted on a separate tab-->
<tabs>
<!--<tab id="CustomCatalogContext_Tab1" caption="New Tab">
<group refID="CustomCatalogContext_Group1"/>
</tab>-->
</tabs>
<groups></groups>
<controls>
<!-- add your controls here -->
<button id="CustomCatalogContext_CustomCatalogButton" caption="CustomCatalogButton" className="CustomCatalogButton" loadOnClick="true" smallImage="Images\GenericButtonBlue16.png" largeImage="Images\GenericButtonBlue32.png">
<tooltip heading="Tooltip Heading">Tooltip text<disabledText /></tooltip>
</button>
</controls>
</insertModule>
<updateModule refID="esri_mapping">
<menus>
<updateMenu refID="esri_mapping_map2DContextMenu">
<insertButton refID="CustomCatalogContext_CustomCatalogButton" insert="after" placeWith="esri_mapping_mapContextMenuConvertToBasemapButton" />
</updateMenu>
<updateMenu refID="esri_mapping_map3DContextMenu">
<insertButton refID="CustomCatalogContext_CustomCatalogButton" insert="after" placeWith="esri_mapping_mapContextMenuConvertToBasemapButton" />
</updateMenu>
<updateMenu refID="esri_mapping_StyleContextMenu">
<insertButton refID="CustomCatalogContext_CustomCatalogButton" />
</updateMenu>
</menus>
</updateModule>
<updateModule refID="esri_geodatabase_module">
<menus>
<updateMenu refID="folderConnectionItemMenu">
<insertButton refID="CustomCatalogContext_CustomCatalogButton" insert="after" placeWith="esri_addProjectItemToNewProjectsButton" />
</updateMenu>
<updateMenu refID="GDBProjectItemMenu">
<insertButton refID="CustomCatalogContext_CustomCatalogButton" insert="after" placeWith="esri_addProjectItemToNewProjectsButton" />
</updateMenu>
<updateMenu refID="EGDBProjectItemMenu">
<insertButton refID="CustomCatalogContext_CustomCatalogButton" insert="after" placeWith="esri_addProjectItemToNewProjectsButton" />
</updateMenu>
</menus>
</updateModule>
</modules>
</ArcGIS>
49 changes: 49 additions & 0 deletions Content/CustomCatalogContext/CustomCatalogButton.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
Copyright 2017 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Framework;
using ArcGIS.Desktop.Framework.Contracts;
using ArcGIS.Desktop.Framework.Dialogs;

namespace CustomCatalogContext
{
/// <summary>
/// Access the Catalog context via the FrameworkApplication.ActiveWindow
/// </summary>
internal class CustomCatalogButton : Button
{
protected override void OnClick() {
//window will be null if the ActiveWindow is not the Catalog dock pane or a Catalog view.
IProjectWindow window = FrameworkApplication.ActiveWindow as ArcGIS.Desktop.Core.IProjectWindow;
if (window?.SelectedItems.Count() > 0) {
var sb = new StringBuilder();
sb.AppendLine("Selection:");
foreach (var item in window.SelectedItems) {
sb.AppendLine($" {item.Name}, {item.TypeID}, {item.GetType().ToString()}");
}
MessageBox.Show(sb.ToString(),"Catalog Selection");
}
}
}
}
Loading

0 comments on commit 10f1777

Please sign in to comment.