Skip to content

Commit

Permalink
ArcGIS Pro SDK 2.6 SDK for .NET
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf-K committed Sep 2, 2020
1 parent 124b6b2 commit 88b65bd
Show file tree
Hide file tree
Showing 51 changed files with 2,668 additions and 1 deletion.
65 changes: 65 additions & 0 deletions Layouts/LayoutWithLabels/Config.daml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2020 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="LayoutWithLabels.dll" defaultNamespace="LayoutWithLabels" 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="{d7d66a28-e582-4044-b800-729b5d190114}" version="1.0" desktopVersion="2.5.0">
<Name>LayoutWithLabels</Name>
<Description>LayoutWithLabels description</Description>
<Image>Images\AddinDesktop32.png</Image>
<Author>ArcGIS Pro SDK Team, [email protected]</Author>
<Company>esri, http://www.esri.com</Company>
<Date>7/16/2020 12:21:09 PM, 2020</Date>
<Subject>Layouts</Subject>
<!-- Note subject can be one or more of these topics:
Content, Framework, Editing, Geodatabase, Geometry, Geoprocessing, Layouts, Map Authoring, Map Exploration -->
</AddInInfo>
<modules>
<insertModule id="LayoutWithLabels_Module" className="Module1" autoLoad="false" caption="Module1">
<!-- uncomment to have the control hosted on a separate tab-->
<tabs>
<!--<tab id="LayoutWithLabels_Tab1" caption="New Tab">
<group refID="LayoutWithLabels_Group1"/>
</tab>-->
</tabs>
<groups>
<!-- comment this out if you have no controls on the Addin tab to avoid
an empty group-->
<group id="LayoutWithLabels_Group1" caption="Group 1" keytip="G1" appearsOnAddInTab="true">
<!-- host controls within groups -->
<button refID="LayoutWithLabels_SelectParcelsToLabel_ShowButton" size="large" />
</group>
</groups>
<controls>
<!-- add your controls here -->
<button id="LayoutWithLabels_SelectParcelsToLabel_ShowButton"
caption="Label Selected Parcels" keytip="B1"
className="SelectParcelsToLabel_ShowButton" loadOnClick="true"
smallImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonPurple16.png"
largeImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonPurple32.png">
<tooltip heading="Label Selected Parcels">Loads a CSV with parcel Ids to select, then labels those parcels, and creates a layout.<disabledText /></tooltip>
</button>
</controls>
<dockPanes>
<dockPane id="LayoutWithLabels_SelectParcelsToLabel" caption="SelectParcelsToLabel" className="SelectParcelsToLabelViewModel" dock="group" dockWith="esri_core_contentsDockPane">
<content className="SelectParcelsToLabelView" />
</dockPane>
</dockPanes>
</insertModule>
</modules>
</ArcGIS>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Layouts/LayoutWithLabels/Images/AddInDesktop16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Layouts/LayoutWithLabels/Images/AddInDesktop32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions Layouts/LayoutWithLabels/LayoutWithLabels (C#).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
## LayoutWithLabels

<!-- TODO: Write a brief abstract explaining this sample -->
This sample shows how to create a layout with custom labeling for a selected set of polygon features. In order to do this the sample is using the following functionality:
* A layer file containing a 'labeled' polygon layer is loaded by the add-in and dynamically added to the map
* The add-in then reads a csv file containing some Ids of polygon features that have to be labeled with 'customized' text strings
* The labels (using call-out labels) are placed on the map (using the dynamically loaded 'labeled' polygon layer
* A control can then be used to re-position the labels on the map
* The add-in adds a layout that contains the labeled map and a tabular list of all labeled features.



<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#
Subject: Layouts
Contributor: ArcGIS Pro SDK Team <[email protected]>
Organization: Esri, http://www.esri.com
Date: 7/01/2020
ArcGIS Pro: 2.6
Visual Studio: 2019
.NET Target Framework: 4.8
```

## Resources

* [API Reference online](https://pro.arcgis.com/en/pro-app/sdk/api-reference)
* <a href="https://pro.arcgis.com/en/pro-app/sdk/" target="_blank">ArcGIS Pro SDK for .NET (pro.arcgis.com)</a>
* [arcgis-pro-sdk-community-samples](https://github.com/Esri/arcgis-pro-sdk-community-samples)
* [ArcGIS Pro DAML ID Reference](https://github.com/Esri/arcgis-pro-sdk/wiki/ArcGIS-Pro-DAML-ID-Reference)
* [FAQ](https://github.com/Esri/arcgis-pro-sdk/wiki/FAQ)
* [ArcGIS Pro SDK icons](https://github.com/Esri/arcgis-pro-sdk/releases/tag/2.4.0.19948)

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

### 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. Download the Community Sample data (see under the 'Resources' section for downloading sample data)
1. Make sure that the Sample data is unzipped in c:\data
1. The project used for this sample is 'C:\Data\LocalGovernment\LocalGovernment.aprx'
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, select the LocalGovernment.aprx project
1. Click on the ADD-IN tab and the click the 'Label Selected Parcels' button.
![UI](Screenshots/Screenshot1.png)

1. Click the "load Layer Package" button on the "SelectParcelsToLabel" dockpane. This loads a layer file containing a 'labeled' polygon layer and dynamically adds it to the map
![UI](Screenshots/Screenshot2.png)

1. Now that the "Read from File" button is enabled, click the "Read from File" button in order to load a sample csv file that contains records that are identified by using a unique parcel Id field.
1. The loaded features are displayed in a table on the "SelectParcelsToLabel" dockpane and highlighted and labeled on the map using the 'labeled' polygon layer.
![UI](Screenshots/Screenshot3.png)

1. You can use the "Label leader line length" control on the "SelectParcelsToLabel" dockpane to manipulate the leader line length.
![UI](Screenshots/Screenshot4.png)

1. Finally to generate the layout select a 'Map Layout" and click the "Make Layout" button.
![UI](Screenshots/Screenshot5.png)



<!-- End -->

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://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="https://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="https://github.com/esri/arcgis-pro-sdk-community-samples" target="_blank">Samples</a>
192 changes: 192 additions & 0 deletions Layouts/LayoutWithLabels/LayoutWithLabels.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D7D66A28-E582-4044-B800-729B5D190114}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LayoutWithLabels</RootNamespace>
<AssemblyName>LayoutWithLabels</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe</StartProgram>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe</StartProgram>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<ArcGISFolder>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGISPro', 'InstallDir', null, RegistryView.Registry64))</ArcGISFolder>
<ArcGISFolder Condition="'$(ArcGISFolder)' == ''">$(registry:HKEY_CURRENT_USER\SOFTWARE\ESRI\ArcGISPro@InstallDir)</ArcGISFolder>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsBase" />
<Reference Include="System.Xaml" />
<Reference Include="ArcGIS.Desktop.Framework">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Core">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Core">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Core\ArcGIS.Desktop.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Mapping">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Mapping\ArcGIS.Desktop.Mapping.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Catalog">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Catalog\ArcGIS.Desktop.Catalog.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Editing">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Editing\ArcGIS.Desktop.Editing.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Extensions">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\DesktopExtensions\ArcGIS.Desktop.Extensions.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.GeoProcessing">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\GeoProcessing\ArcGIS.Desktop.GeoProcessing.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Layouts">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\Extensions\Layout\ArcGIS.Desktop.Layouts.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Shared.Wpf">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Shared.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Ribbon.Wpf">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Ribbon.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.DataGrid.Contrib.Wpf">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.DataGrid.Contrib.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Resources">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Resources.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ArcGIS.Desktop.Resources">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Resources.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ESRI.ArcGIS.ItemIndex">
<HintPath>C:\Program Files\ArcGIS\Pro\bin\ESRI.ArcGIS.ItemIndex.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<AddInContent Include="Config.daml" />
<AddInContent Include="Images\AddInDesktop16.png" />
<AddInContent Include="Images\AddInDesktop32.png" />
<AddInContent Include="DarkImages\AddInDesktop16.png" />
<AddInContent Include="DarkImages\AddInDesktop32.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="Module1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SelectParcelsToLabel.xaml.cs">
<DependentUpon>SelectParcelsToLabel.xaml</DependentUpon>
</Compile>
<Compile Include="SelectParcelsToLabelViewModel.cs" />
<Compile Include="SetPage.cs" />
<Compile Include="TypeColor.cs" />
</ItemGroup>
<ItemGroup>
<Page Include="SelectParcelsToLabel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<AddInContent Include="Images\GenericButtonPurple16.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="Images\GenericButtonPurple32.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonPurple16.png" />
</ItemGroup>
<ItemGroup>
<AddInContent Include="DarkImages\GenericButtonPurple32.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="Screenshots\Screenshot1.png" />
<None Include="Screenshots\Screenshot2.png" />
<None Include="Screenshots\Screenshot3.png" />
<None Include="Screenshots\Screenshot4.png" />
<None Include="Screenshots\Screenshot5.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!--
PackageAction can be:
BuildDefault: ArcGIS Pro is required. An esriAddinX package is created and copied to ArcGIS Pro add-in folder.
BuildZipPostProcess: ArcGIS Pro install is NOT required to build the add-in. An esriAddinX package is created in your output folder.
BuildNoPostProcess: ArcGIS Pro install is NOT required to build the add-in. An esriAddinX package is NOT created.
-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\Debug\LayoutWithLabels.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
</PropertyGroup>
<UsingTask AssemblyFile="C:\Program Files\ArcGIS\Pro\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.PackageAddIn" />
<UsingTask AssemblyFile="C:\Program Files\ArcGIS\Pro\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.CleanAddIn" />
<UsingTask AssemblyFile="C:\Program Files\ArcGIS\Pro\bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.ConvertToRelativePath" />
<!--<Import Project="Esri.ArcGISPro.Extensions.targets" Condition="Exists('Esri.ArcGISPro.Extensions.targets')" />-->
<Import Project="C:\Program Files\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets" Condition="Exists('C:\Program Files\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets') AND !Exists('Esri.ArcGISPro.Extensions.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<!--<Target Name="BeforeBuild">
<Error Text="C:\Program Files\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets not found." Condition="!Exists('C:\Program Files\ArcGIS\Pro\bin\Esri.ProApp.SDK.Desktop.targets') AND !Exists('Esri.ArcGISPro.Extensions.targets')" />
</Target>-->
</Project>
25 changes: 25 additions & 0 deletions Layouts/LayoutWithLabels/LayoutWithLabels.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30309.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LayoutWithLabels", "LayoutWithLabels.csproj", "{D7D66A28-E582-4044-B800-729B5D190114}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D7D66A28-E582-4044-B800-729B5D190114}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7D66A28-E582-4044-B800-729B5D190114}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7D66A28-E582-4044-B800-729B5D190114}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7D66A28-E582-4044-B800-729B5D190114}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B050A47F-9C9D-4148-9A12-C2FF0BAB3F8D}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 88b65bd

Please sign in to comment.