示例#1
0
 void gp_JobCompleted(object sender, Client.Tasks.JobInfoEventArgs e)
 {
     if (e.JobInfo.JobStatus == esriJobStatus.esriJobFailed)
     {
         IsExecuting   = false;
         ExecutingText = ESRI.ArcGIS.Mapping.GP.Resources.Strings.JobFailed;
         asyncErrors.AddRange(e.JobInfo.Messages.Where(p => p.MessageType == GPMessageType.Error).Select(p => new Exception(p.Description)));
         fireAsyncCompleteEvent();
     }
     else
     {
         ExecutingText        = ESRI.ArcGIS.Mapping.GP.Resources.Strings.GettingResults;
         asyncResultsExpected = Configuration.OutputParameters.Count;
         JobID = e.JobInfo.JobId;
         foreach (ParameterSupport.ParameterConfig param in Configuration.OutputParameters)
         {
             if (!resultRequestedParams.Contains(param.Name))
             {
                 if (param.Type == GPParameterType.MapServiceLayer)
                 {
                     asyncResultsExpected--;
                     asyncResults.Add(null);
                     if (asyncResultsExpected == 0)
                     {
                         fireAsyncCompleteEvent();
                     }
                 }
                 else
                 {
                     Geoprocessor gp = new Geoprocessor(ServiceEndpoint.AbsoluteUri);
                     gp.Failed += gp_FailedAsync;
                     gp.GetResultDataCompleted += gp2_GetResultDataCompleted;
                     // Initialize proxy
                     gp.ProxyURL = Configuration.UseProxy ? Configuration.ProxyUrl : null;
                     gp.GetResultDataAsync(e.JobInfo.JobId, param.Name);
                 }
             }
         }
     }
 }
示例#2
0
        void gp_StatusUpdated(object sender, Client.Tasks.JobInfoEventArgs e)
        {
            var statusKey = e.JobInfo.JobStatus.ToString().Replace("esriJob", "");

            ExecutingText = StringResourcesManager.Instance.Get(statusKey);
        }