Skip to content

Commit

Permalink
ArcGIS Pro 2.6 SDK for .NET
Browse files Browse the repository at this point in the history
  • Loading branch information
arcgisprosdk committed Aug 3, 2020
1 parent 83855bc commit 124b6b2
Show file tree
Hide file tree
Showing 45 changed files with 1,932 additions and 547 deletions.
6 changes: 0 additions & 6 deletions Content/OpenItemDialogBrowseFilter/ItemFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ class ItemFilter : IComparable<ItemFilter>
private string _parent;
private string _id;
private string _caption;
private string _condition;
private bool _hasImage = true;
private string _image;
private string _packURI = "";
private string _content;
private List<string> _filterFlags = new List<string>();
private static string _currentControl;
Expand All @@ -58,8 +54,6 @@ public ItemFilter(string damlFile, string elementName, XElement xElement, string
_damlFileName = damlFile;
_elementName = elementName;

_hasImage = false;

_parent = xElement.Parent.Name.LocalName;
_container = container;
_id = xElement.Attribute("id").Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\Debug\OpenItemDialogBrowseFilter.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\Debug\CreatePointsAlongLine3D.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
Expand Down
1 change: 1 addition & 0 deletions Editing/DemoUseSelection/DemoUseSelection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\Debug\DemoUseSelection.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
Expand Down
1 change: 1 addition & 0 deletions Editing/GeometryControl/GeometryControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\Debug\GeometryControl.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
Expand Down
1 change: 1 addition & 0 deletions Editing/GridScaleCADLayer/GridScaleCADLayer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\Debug\GridScaleCADLayer.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
Expand Down
1 change: 1 addition & 0 deletions Editing/LayerSnapModes/LayerSnapModes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\Debug\LayerSnapModes.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
Expand Down
1 change: 1 addition & 0 deletions Editing/MultipatchBuilder/MultipatchBuilder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\Debug\MultipatchBuilder.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
Expand Down
1 change: 1 addition & 0 deletions Editing/TransferAttributes/TransferAttributes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\Debug\TransferAttributes.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\x64\Debug\ChromiumWebBrowserSample.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
Expand Down
23 changes: 20 additions & 3 deletions Framework/ChromiumWebBrowserSample/Custom/CustomSchemes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ limitations under the License.

/// <summary>
/// Note: Custom scheme names must conform to RFC 3986.
/// <a href="https://tools.ietf.org/pdf/rfc3986.pdf"/>. Namely:
/// &quot;Section 3.1 Scheme:<br/>
/// &lt;a href="https://tools.ietf.org/pdf/rfc3986.pdf"/&gt;. Namely:
/// &quot;Section 3.1 Scheme:&lt;br/&gt;
/// .....Scheme names consist of a sequence of characters beginning with a
///letter and followed by any combination of letters, digits, plus
/// ("+"), period ("."), or hyphen("-"). Although schemes are case-
Expand Down Expand Up @@ -69,10 +69,19 @@ namespace ChromiumWebBrowserSample.Custom
/// <remarks>The custom scheme name is &quot;resource&quot;</remarks>
public class ImageResourceSchemeHandler : ResourceHandler
{
/// <summary>
///
/// </summary>
public ImageResourceSchemeHandler()
{

}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="callback"></param>
/// <returns></returns>
public override CefReturnValue ProcessRequestAsync(IRequest request, ICallback callback)
{
using (callback)
Expand Down Expand Up @@ -119,11 +128,19 @@ public override CefReturnValue ProcessRequestAsync(IRequest request, ICallback c
/// </remarks>
public class EmbeddedResourceSchemeHandler : ResourceHandler
{
/// <summary>
///
/// </summary>
public EmbeddedResourceSchemeHandler()
{

}

/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="callback"></param>
/// <returns></returns>
public override CefReturnValue ProcessRequestAsync(IRequest request, ICallback callback)
{
using (callback)
Expand Down
1 change: 1 addition & 0 deletions Framework/DockpaneWithHelp/DockpaneWithHelp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
<DocumentationFile>bin\Debug\DockpaneWithHelp.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildDefault</PackageAction>
Expand Down
4 changes: 3 additions & 1 deletion Framework/MapControl/ShowOverview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ protected override void OnClick() {
if (_isOpen)
return;
_overview = new OverviewWindow();
var cam = MapView.Active.Camera;
cam.Heading = 90;
_overview.ViewContent = MapControlContentFactory.Create(
MapView.Active.Map, MapView.Active.Extent, MapView.Active.ViewingMode);
MapView.Active.Map, cam, MapView.Active.ViewingMode);
_overview.Closed += (s, e) => {
_isOpen = false;
lock (_lock) {
Expand Down
83 changes: 83 additions & 0 deletions Framework/ProIcons/AllProImagesPane.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!--
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.
-->
<UserControl x:Class="ProIcons.AllProImagesPaneView" x:ClassModifier="internal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
xmlns:ui="clr-namespace:ProIcons"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
d:DataContext="{Binding Path=ui.AllProImagesPaneViewModel}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<Grid Grid.Row="0">
<StackPanel Orientation="Horizontal" Margin="0,10,0,10"
HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBox x:Name="IconText" VerticalContentAlignment="Center" Width="300" Height="30"
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" KeyDown="TextBox_KeyDown"/>
<Button Width="Auto" Height="30" Command="{Binding SearchCmd}"
Style="{StaticResource Esri_SimpleButton}" Margin="2,0,0,0">Search</Button>
<Button Width="Auto" Height="30" Command="{Binding ClearCmd}"
Style="{StaticResource Esri_SimpleButton}" Margin="2,0,0,0">Clear</Button>
<CheckBox x:Name="showPack" Click="showPack_Click" Margin="20,0,0,0" VerticalAlignment="Center">Show Pack URI</CheckBox>
</StackPanel>
</Grid>

<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding ProImages}" Margin="20">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1">
<Border.Style>
<Style TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="Transparent"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{StaticResource Esri_Blue}"/>
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<Image Source="{Binding Source}" Margin="2" Height="32" Width="32" ToolTip=""
ToolTipOpening="Image_ToolTipOpening" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</Grid>
</UserControl>
95 changes: 95 additions & 0 deletions Framework/ProIcons/AllProImagesPane.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
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.
*/
using System.Windows.Controls;
using System.Windows.Input;


namespace ProIcons
{
/// <summary>
/// Interaction logic for AllProImagesPaneView.xaml
/// </summary>
internal partial class AllProImagesPaneView : UserControl
{
private string _currentIconName;

public AllProImagesPaneView()
{
InitializeComponent();
}

private void TextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return)
{
AllProImagesPaneViewModel vm = this.DataContext as AllProImagesPaneViewModel;
vm.InvokeSearchCommand();
}
}

private void Image_ToolTipOpening(object sender, ToolTipEventArgs e)
{
GetImageName(sender as Image);
}

private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
_currentIconName = GetImageName(sender as Image);
System.Windows.Clipboard.SetText(_currentIconName);
if (showPack.IsChecked.HasValue && showPack.IsChecked.Value == true)
{
string pack = @"pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/";
IconText.Text = pack + _currentIconName + ".png";
}
else
{
IconText.Text = _currentIconName;
}

}

private string GetImageName(Image img)
{
if (img == null || img.DataContext == null)
return string.Empty;
ProImage proImage = img.DataContext as ProImage;
img.ToolTip = proImage.Name;
return proImage.Name;
}

private void showPack_Click(object sender, System.Windows.RoutedEventArgs e)
{
if (showPack.IsChecked.HasValue && showPack.IsChecked.Value == true)
{
if (!string.IsNullOrEmpty(IconText.Text))
{
string pack = @"pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/";
IconText.Text = pack + _currentIconName + ".png";
}
IconText.Width = 550;
}
else
{
if (!string.IsNullOrEmpty(IconText.Text))
IconText.Text = _currentIconName;
IconText.Width = 275;
}
}
}
}
Loading

0 comments on commit 124b6b2

Please sign in to comment.