本文整理汇总了C#中Geoprocessor.GetTaskInfoAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Geoprocessor.GetTaskInfoAsync方法的具体用法?C# Geoprocessor.GetTaskInfoAsync怎么用?C# Geoprocessor.GetTaskInfoAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geoprocessor
的用法示例。
在下文中一共展示了Geoprocessor.GetTaskInfoAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetServiceInfo
private async Task GetServiceInfo()
{
var t = new Geoprocessor(new Uri(ServiceUri));
string message = null;
try
{
var result = await t.GetTaskInfoAsync();
#region Display Service Info
var sb = new StringBuilder();
if (result != null)
{
sb.Append("{");
sb.AppendLine(string.Format("\t\"name\" : \"{0}\",", result.Name));
sb.AppendLine(string.Format("\t\"displayName\" : \"{0}\",", result.DisplayName));
sb.AppendLine(string.Format("\t\"category\" : \"{0}\",", result.Category));
sb.AppendLine(string.Format("\t\"helpUrl\" : \"{0}\",", result.HelpUrl));
sb.AppendLine(string.Format("\t\"executionType\" : \"esriExecutionType{0}\",", result.ExecutionType));
sb.AppendLine("\t\"parameters\" : [");
foreach (var p in result.Parameters)
{
sb.AppendLine("\t{");
sb.AppendLine(string.Format("\t\t\"name\" : \"{0}\",", p.Name));
sb.AppendLine(string.Format("\t\t\"dataType\" : \"{0}\",", p.DataType));
sb.AppendLine(string.Format("\t\t\"displayName\" : \"{0}\",", p.DisplayName));
sb.AppendLine(string.Format("\t\t\"direction\" : \"esriGPParameterDirection{0}\",", p.Direction));
sb.AppendLine(string.Format("\t\t\"defaultValue\" : \"{0}\",", p.DefaultValue));
sb.AppendLine(string.Format("\t\t\"parameterType\" : \"esriGPParameterType{0}\",", p.ParameterType));
sb.AppendLine(string.Format("\t\t\"category\" : \"{0}\"", p.Category));
if (p.ChoiceList != null)
{
sb.AppendLine("\t\t\"choiceList\" : [");
foreach (var c in p.ChoiceList)
sb.AppendLine(string.Format("\t\t\t\"{0}\"", c));
sb.AppendLine("\t\t\"]");
}
sb.AppendLine("\t},");
}
sb.AppendLine("\t]");
sb.Append("}");
message = sb.ToString();
}
#endregion
}
catch (Exception ex)
{
message = ex.Message;
}
if (message != null)
await new MessageDialog(message, "Service Info").ShowAsync();
}