${iServer2_DeleteEntityParameters_Title}
${iServer2_DeleteEntityParameters_Description}
//删除选中地物 private void DeleteEntity_Click(object sender, RoutedEventArgs e) { DeleteEntityParameters parameters = new DeleteEntityParameters { MapName = "Changchun", LayerName = "Vegetable@changchun", IDs = ids }; DeleteEntityService deleteEntityService = new DeleteEntityService("http://localhost:7080/demo"); deleteEntityService.ProcessAsync(parameters); deleteEntityService.Failed += new EventHandler<ServiceFailedEventArgs>(Service_Failed); deleteEntityService.ProcessCompleted += new EventHandler<EditEventArgs>(deleteService_ProcessCompleted); }
/// <overloads>${iServer2_DeleteEntityService_method_ProcessAsync_overloads_D}</overloads> /// <summary>${iServer2_DeleteEntityService_method_ProcessAsync_D}</summary> /// <param name="parameters">${iServer2_DeleteEntityService_method_ProcessAsync_param_parameters}</param> public void ProcessAsync(DeleteEntityParameters parameters) { ProcessAsync(parameters, null); }
/// <summary>${iServer2_DeleteEntityService_method_ProcessAsync_D}</summary> /// <param name="parameters">${iServer2_DeleteEntityService_method_ProcessAsync_param_parameters}</param> /// <param name="state">${iServer2_DeleteEntityService_method_ProcessAsync_param_state}</param> public void ProcessAsync(DeleteEntityParameters parameters, object state) { if (parameters == null) { throw new ArgumentNullException(ExceptionStrings.ArgumentIsNull); } if (string.IsNullOrEmpty(base.Url)) { throw new InvalidOperationException(ExceptionStrings.InvalidUrl); } if (!base.Url.EndsWith("/")) { base.Url += '/'; } base.SubmitRequest(base.Url + "commonhandler?", GetParameters(parameters), new EventHandler<RequestEventArgs>(request_Completed), state, false); }
private Dictionary<string, string> GetParameters(DeleteEntityParameters parameters) { Dictionary<string, string> dictionary = new Dictionary<string, string>(); string method = "DeleteEntity"; dictionary.Add("method", method); dictionary.Add("mapName", parameters.MapName); Dictionary<string, string> dict = new Dictionary<string, string>(); dict.Add("mapName", parameters.MapName); dict.Add("layerName", parameters.LayerName); string json = "["; List<string> list = new List<string>(); if (parameters.IDs != null && parameters.IDs.Count > 0) { for (int i = 0; i < parameters.IDs.Count; i++) { list.Add(string.Format("\"{0}\"", parameters.IDs[i])); } json += string.Join(",", list.ToArray()); } json += "]"; dict.Add("ids", json); dict.Add("lockID", DateTime.Now.Ticks.ToString()); dictionary.Add("params", Bridge.CreateParams(method, dict)); return dictionary; }