${IS6_LocationsAllocateParameters_Title}
${IS6_LocationsAllocateParameters_Description}
/// <summary>${IS6_LocationsAllocateService_method_ProcessAsync_D}</summary> /// <param name="parameters">${IS6_LocationsAllocateService_method_ProcessAsync_param_parameters}</param> /// <param name="state">${IS6_LocationsAllocateService_method_ProcessAsync_param_state}</param> public void ProcessAsync(LocationsAllocateParameters parameters, object state) { if (parameters == null) { //TODO:资源 //throw new ArgumentNullException("LocationsAllocateParameters is Null"); throw new ArgumentNullException(ExceptionStrings.ArgumentIsNull); } if (string.IsNullOrEmpty(this.Url)) { //TODO:资源 throw new InvalidOperationException(ExceptionStrings.InvalidUrl); //throw new InvalidOperationException("Url is not set"); } base.SubmitRequest(base.Url + "/path.ashx?", GetParameters(parameters), new EventHandler<RequestEventArgs>(request_Completed), state, false); }
private Dictionary<string, string> GetParameters(LocationsAllocateParameters parameters) { Dictionary<string, string> dictionary = new Dictionary<string, string>(); string method = "LocationsAllocate"; dictionary.Add("map", parameters.MapName); dictionary.Add("method", method); dictionary.Add("locationsAllocateParam",LocationsAllocateParam.ToJson(parameters.LocationsAllocateParam)); return dictionary; }
/// <summary>${IS6_LocationsAllocateService_method_ProcessAsync_D}</summary> /// <overloads>${IS6_LocationsAllocateService_method_ProcessAsync_overloads_D}</overloads> /// <param name="parameters">${IS6_LocationsAllocateService_method_ProcessAsync_param_parameters}</param> public void ProcessAsync(LocationsAllocateParameters parameters) { ProcessAsync(parameters, null); }
private void LocationsAllocateService_Click(object sender, RoutedEventArgs e) { //给选址分析服务设置参数 LocationsAllocateParameters parameters = new LocationsAllocateParameters() { MapName = "changchun", LocationsAllocateParam = new LocationsAllocateParam() { FromCenter = true, LocationAllocateMode = LocationAllocateType.MinDistance, LocationsCount = 0, NetworkParams = new NetworkParams() { NetworkSetting = new NetworkSetting() { NetworkLayerName = "RoadNet@changchun", NodeIDField = "SmNodeID", EdgeIDField = "SmEdgeID", FTWeightField = "SmLength", TFWeightField = "SmLength", }, LocationAllocateSetting = new LocationAllocateSetting() { Centers = centers, NodeDemandField = "SmNodeID", }, Tolerance = 124.615617, }, ResultCenterNodesTableOption = new DataReturnOption() { MaxRecordCount = 10000, OverwriteIfExists = true, ReturnMode = DataReturnMode.AsRecordset }, ResultCenterOption = new DataReturnOption() { MaxRecordCount = 10000, OverwriteIfExists = true, ReturnMode = DataReturnMode.AsRecordset } } }; //执行选址服务 LocationsAllocateService locationsAllocateService = new LocationsAllocateService("http://localhost/IS/AjaxDemo"); locationsAllocateService.ProcessAsync(parameters); locationsAllocateService.ProcessCompleted += new EventHandler<LocationsAllocateEventArgs>(service_ProcessCompleted); locationsAllocateService.Failed += new EventHandler<ServiceFailedEventArgs>(locationsAllocateService_Failed); }