/// <summary>${iServerJava6R_GetFeaturesByBufferService_method_ProcessAsync_D}</summary>
        /// <param name="parameters">${iServerJava6R_GetFeaturesByBufferService_method_ProcessAsync_param_Parameters}</param>
        /// <param name="state">${iServerJava6R_GetFeaturesByBufferService_method_ProcessAsync_param_state}</param>
        public void ProcessAsync(GetFeaturesByBufferParameters parameters, object state)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(ExceptionStrings.ArgumentIsNull);
            }
            if (string.IsNullOrEmpty(this.Url))
            {
                throw new InvalidOperationException(ExceptionStrings.InvalidUrl);
            }
            //base.Url += ".json?returnContent=true";
            base.Url += string.Format(System.Globalization.CultureInfo.InvariantCulture, ".json?returnContent=true&debug=true&fromIndex={0}&toIndex={1}", parameters.FromIndex, parameters.ToIndex);

            base.SubmitRequest(base.Url, GetParameters(parameters), new EventHandler<RequestEventArgs>(request_Completed), state, true);
        }
 void dp_DrawCompleted(object sender , DrawEventArgs e)
 {
     if (e.Geometry == null)
     {
         return;
     }
     GetFeaturesByBufferParameters param = new GetFeaturesByBufferParameters
     {
         DatasetNames = new List<string> { "World:Countries" } ,
         BufferDistance = 10 ,
         Geometry = e.Geometry ,
     };
     GetFeaturesByBufferService ser = new GetFeaturesByBufferService(url);
     ser.ProcessCompleted += new EventHandler<GetFeaturesEventArgs>(ser_ProcessCompleted);
     ser.ProcessAsync(param);
 }
        private Dictionary<string, string> GetParameters(GetFeaturesByBufferParameters parameters)
        {
            Dictionary<string, string> dictionary = new Dictionary<string, string>();

            if (string.IsNullOrEmpty(parameters.AttributeFilter))
            {
                dictionary.Add("getFeatureMode", "\"BUFFER\"");
            }
            else
            {
                dictionary.Add("getFeatureMode", "\"BUFFER_ATTRIBUTEFILTER\"");
                dictionary.Add("attributeFilter", parameters.AttributeFilter);
            }
            if (parameters.DatasetNames != null && parameters.DatasetNames.Count > 0)
            {
                string jsonDatasetNames = "[";
                List<string> list = new List<string>();
                for (int i = 0; i < parameters.DatasetNames.Count; i++)
                {
                    list.Add(string.Format(System.Globalization.CultureInfo.InvariantCulture, "\"{0}\"", parameters.DatasetNames[i]));
                }
                jsonDatasetNames += string.Join(",", list.ToArray());
                jsonDatasetNames += "]";

                dictionary.Add("datasetNames", jsonDatasetNames);
            }

            if (parameters.Geometry != null)
            {
                dictionary.Add("geometry", ServerGeometry.ToJson(Bridge.ToServerGeometry(parameters.Geometry)));
            }
            else
            {
                throw new ArgumentNullException(ExceptionStrings.ArgumentIsNull);
            }
            dictionary.Add("bufferDistance", parameters.BufferDistance.ToString(System.Globalization.CultureInfo.InvariantCulture));

            if (parameters.Fields != null && parameters.Fields.Count > 0)
            {
                FilterParameter fp = new FilterParameter();
                fp.Fields = parameters.Fields;
                dictionary.Add("queryParameter", FilterParameter.ToJson(fp));
            }

            return dictionary;
        }
 /// <summary>${iServerJava6R_GetFeaturesByBufferService_method_ProcessAsync_D}</summary>
 /// <overloads>${iServerJava6R_GetFeaturesByBufferService_method_ProcessAsync_overloads_D}</overloads>
 public void ProcessAsync(GetFeaturesByBufferParameters parameters)
 {
     ProcessAsync(parameters, null);
 }