当前位置: 首页>>代码示例>>C#>>正文


C# Geoprocessor.GetServiceInfoAsync方法代码示例

本文整理汇总了C#中Geoprocessor.GetServiceInfoAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Geoprocessor.GetServiceInfoAsync方法的具体用法?C# Geoprocessor.GetServiceInfoAsync怎么用?C# Geoprocessor.GetServiceInfoAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Geoprocessor的用法示例。


在下文中一共展示了Geoprocessor.GetServiceInfoAsync方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExtractData

        public ExtractData()
        {
            InitializeComponent();
            _processingTimer = new System.Windows.Threading.DispatcherTimer();
            _processingTimer.Interval = new TimeSpan(0, 0, 0, 0, 800);
            _processingTimer.Tick += ProcessingTimer_Tick;

            _geoprocessorTask = new Geoprocessor("http://sampleserver4.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/Incident_Data_Extraction/GPServer/Extract%20Data%20Task");
            _geoprocessorTask.GetServiceInfoCompleted += _geoprocessorTask_GetServiceInfoCompleted;
            _geoprocessorTask.Failed += _geoprocessorTask_Failed;
            _geoprocessorTask.UpdateDelay = 5000;
            _geoprocessorTask.JobCompleted += _geoprocessorTask_JobCompleted;
            _geoprocessorTask.GetResultDataCompleted += _geoprocessorTask_GetResultDataCompleted;
            _geoprocessorTask.GetServiceInfoAsync();

            _drawObject = new Draw(MyMap)
            {
                LineSymbol = LayoutRoot.Resources["CustomAnimatedRedLineSymbol"] as LineSymbol,
                FillSymbol = LayoutRoot.Resources["CustomAnimatedRedFillSymbol"] as FillSymbol
            };
            _drawObject.DrawComplete += MyDrawObject_DrawComplete;

            _graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
        }
开发者ID:konglingjie,项目名称:arcgis-samples-silverlight,代码行数:24,代码来源:ExtractData.xaml.cs

示例2: GetServiceInfo

        private async Task GetServiceInfo()
        {
            var t = new Geoprocessor(new Uri(ServiceUri));
            string message = null;
            try
            {
                var result = await t.GetServiceInfoAsync();
                #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();
        }
开发者ID:rlwarford,项目名称:arcgis-runtime-samples-dotnet,代码行数:51,代码来源:ClipFeatures.xaml.cs


注:本文中的Geoprocessor.GetServiceInfoAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。