${IS6_AddEntityParameters_Title}
${IS6_AddEntityParameters_Description}
/// <summary>${IS6_AddEntityService_method_ProcessAsync_D}</summary> /// <param name="parameters">${IS6_AddEntityService_method_ProcessAsync_param_parameters}</param> /// <param name="state">${IS6_AddEntityService_method_ProcessAsync_param_state}</param> public void ProcessAsync(AddEntityParameters parameters, object state) { if (parameters == null) { //TODO:本地化 throw new ArgumentNullException(ExceptionStrings.ArgumentIsNull); //throw new ArgumentNullException("AddParameters is Null"); } if (string.IsNullOrEmpty(base.Url)) { //TODO:本地化 throw new InvalidOperationException(ExceptionStrings.InvalidUrl); //throw new InvalidOperationException("Url is not set"); } base.SubmitRequest(base.Url + "/edit.ashx?", GetParameters(parameters), new EventHandler<RequestEventArgs>(request_Completed), state, false); }
private Dictionary<string, string> GetParameters(AddEntityParameters parameters) { Dictionary<string, string> dictionary = new Dictionary<string, string>(); string method = "AddEntity"; dictionary.Add("method", method); dictionary.Add("map", parameters.MapName); dictionary.Add("layerName",string.Format("\"{0}\"", parameters.LayerName)); string json = "["; List<string> list = new List<string>(); for (int i = 0; i < parameters.Entities.Count; i++) { list.Add(Entity.ToJson(parameters.Entities[i])); } json += string.Join(",", list.ToArray()); json += "]"; dictionary.Add("entities", json); return dictionary; }
/// <summary>${IS6_AddEntityService_method_ProcessAsync_D}</summary> /// <overloads>${IS6_AddEntityService_method_ProcessAsync_overloads_D}</overloads> public void ProcessAsync(AddEntityParameters parameters) { ProcessAsync(parameters, null); }