public void LoadMetadata(bool designTime, string proxyUrl = null) { ServiceInfo = null; Error = null; if (designTime) { //Designtime datasource ServiceInfo = new GPMetaData() { DisplayName = "{TITLE}", Parameters = new GPParameter[] { new GPParameter() { DisplayName = "{DisplayName1}", DefaultValue = "{Default value}", Name="Param1", DataType = "GPString", Direction="esriGPParameterDirectionInput", ParameterType="esriGPParameterTypeRequired" }, new GPParameter() { DisplayName = "{DisplayName2}", DefaultValue = "{Default value}", Name="Param2", DataType = "GPString", Direction="esriGPParameterDirectionInput", ParameterType="esriGPParameterTypeRequired" } } }; if (LoadSucceeded != null) LoadSucceeded(this, null); return; } ArcGISWebClient wc = new ArcGISWebClient() { ProxyUrl = proxyUrl }; wc.DownloadStringCompleted += wc_OpenReadCompleted; // Get service endpoint JSON URL string url = ServiceEndpoint.AbsoluteUri + "?f=json"; Uri uri = new Uri(url, UriKind.Absolute); wc.DownloadStringAsync(uri, null, ArcGISWebClient.HttpMethods.Auto, proxyUrl); }
public void LoadMetadata(bool designTime, string proxyUrl = null) { ServiceInfo = null; Error = null; if (designTime) { //Designtime datasource ServiceInfo = new GPMetaData() { DisplayName = "{TITLE}", Parameters = new GPParameter[] { new GPParameter() { DisplayName = "{DisplayName1}", DefaultValue = "{Default value}", Name = "Param1", DataType = "GPString", Direction = "esriGPParameterDirectionInput", ParameterType = "esriGPParameterTypeRequired" }, new GPParameter() { DisplayName = "{DisplayName2}", DefaultValue = "{Default value}", Name = "Param2", DataType = "GPString", Direction = "esriGPParameterDirectionInput", ParameterType = "esriGPParameterTypeRequired" } } }; if (LoadSucceeded != null) { LoadSucceeded(this, null); } return; } ArcGISWebClient wc = new ArcGISWebClient() { ProxyUrl = proxyUrl }; wc.DownloadStringCompleted += wc_OpenReadCompleted; // Get service endpoint JSON URL string url = ServiceEndpoint.AbsoluteUri + "?f=json"; Uri uri = new Uri(url, UriKind.Absolute); wc.DownloadStringAsync(uri, null, ArcGISWebClient.HttpMethods.Auto, proxyUrl); }