增加ArcGis工具检查功能
This commit is contained in:
parent
2a80940879
commit
ca807080b6
@ -5,6 +5,7 @@ using System.Collections.ObjectModel;
|
|||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@ -35,6 +36,7 @@ using ModelContextProtocol.Client;
|
|||||||
using ModelContextProtocol.Protocol.Types;
|
using ModelContextProtocol.Protocol.Types;
|
||||||
using ModelContextProtocol.Server;
|
using ModelContextProtocol.Server;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace LinkToolAddin.ui.dockpane
|
namespace LinkToolAddin.ui.dockpane
|
||||||
{
|
{
|
||||||
@ -567,18 +569,49 @@ namespace LinkToolAddin.ui.dockpane
|
|||||||
argsButton.Content = "参数";
|
argsButton.Content = "参数";
|
||||||
argsButton.Tag = msg as ToolMessageItem;
|
argsButton.Tag = msg as ToolMessageItem;
|
||||||
argsButton.Click += ToolArgsButton_OnClick;
|
argsButton.Click += ToolArgsButton_OnClick;
|
||||||
border.Child = grid;
|
|
||||||
Button resButton = new Button();
|
Button resButton = new Button();
|
||||||
resButton.Content = "结果";
|
resButton.Content = "结果";
|
||||||
resButton.Tag = msg as ToolMessageItem;
|
resButton.Tag = msg as ToolMessageItem;
|
||||||
resButton.Click += ToolResButton_OnClick;
|
resButton.Click += ToolResButton_OnClick;
|
||||||
|
|
||||||
grid.Children.Add(argsButton);
|
grid.Children.Add(argsButton);
|
||||||
Grid.SetColumn(argsButton, 2);
|
Grid.SetColumn(argsButton, 2);
|
||||||
grid.Children.Add(resButton);
|
grid.Children.Add(resButton);
|
||||||
Grid.SetColumn(resButton, 3);
|
Grid.SetColumn(resButton, 3);
|
||||||
|
|
||||||
|
if (toolMsg.toolParams.ContainsKey("toolName"))
|
||||||
|
{
|
||||||
|
grid.ColumnDefinitions.Add(new ColumnDefinition(){Width = new GridLength(36, GridUnitType.Pixel)});
|
||||||
|
Button checkButton = new Button();
|
||||||
|
checkButton.Content = "检查";
|
||||||
|
checkButton.Tag = toolMsg;
|
||||||
|
checkButton.Click += ToolCheckButton_OnClick;
|
||||||
|
grid.Children.Add(checkButton);
|
||||||
|
Grid.SetColumn(checkButton, 4);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
border.Child = grid;
|
||||||
return border;
|
return border;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ToolCheckButton_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Button button = sender as Button;
|
||||||
|
ToolMessageItem toolItem = button.Tag as ToolMessageItem;
|
||||||
|
string gisToolName = toolItem.toolParams["toolName"] as string;
|
||||||
|
JArray gisToolParams = toolItem.toolParams["toolParams"] as JArray;
|
||||||
|
List<string> gitToolParamsList = (gisToolParams as JArray).Select(token => token.ToString()).ToList();
|
||||||
|
Geoprocessing.OpenToolDialog(gisToolName,gitToolParamsList);
|
||||||
|
}catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.Error(ex);
|
||||||
|
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(ex.Message,"打开工具失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ToolArgsButton_OnClick(object sender, RoutedEventArgs e)
|
private void ToolArgsButton_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Button button = sender as Button;
|
Button button = sender as Button;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user