// List of parameters List<GPParameter> gpParameters = new List<GPParameter>(); gpParameters.Add(new GPString(input1, "input1Value")); gpParameters.Add(new GPString(input2, "input2Value")); // Call GP task Geoprocessor gpTask = new Geoprocessor(gpTaskURL); // Event raised if job failed gpTask.Failed += (s1, e1) => { // If failed MessageBox.Show("Task failed"); }; // Event raised if job completed gpTask.JobCompleted += (s2, e2) => { Geoprocessor gp = s2 as Geoprocessor; gp.GetResultDataCompleted += (s3, e3) => { if (e3.Parameter is GPString) { // Do something to show in silverlight } else if (e3.Parameter is GPFeatureRecordSetLayer) { // Do something to show in silverlight GPFeatureRecordSetLayer gpresultLayer = e3.Parameter as GPFeatureRecordSetLayer; foreach (Graphic graphic in gpresultLayer.FeatureSet.Features) { } } }; // Get the result data gp.GetResultDataAsync(e3.JobInfo.JobId, pythonScriptOutputParamterName); }; // Submit GP task gpTask.SubmitJobAsync(gpParameters);
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.