SuperMap.Web.iServerJava2.BufferAnalystParam.ToJson C# (CSharp) Method

ToJson() static private method

static private ToJson ( BufferAnalystParam bufferAnalystParam ) : string
bufferAnalystParam BufferAnalystParam
return string
        internal static string ToJson(BufferAnalystParam bufferAnalystParam)
        {
            if (bufferAnalystParam == null)
            {
                return null;
            }

            string json = "{";
            List<string> list = new List<string>();
            list.Add(string.Format("\"leftDistance\":{0}", bufferAnalystParam.LeftDistance));
            list.Add(string.Format("\"rightDistance\":{0}", bufferAnalystParam.RightDistance));
            list.Add(string.Format("\"semicircleLineSegment\":{0}", bufferAnalystParam.SemicircleLineSegment));

            list.Add(string.Format("\"bufferSideType\":\"{0}\"", ((int)bufferAnalystParam.BufferSideType).ToString()));
            list.Add(string.Format("\"bufferEndType\":\"{0}\"", ((int)bufferAnalystParam.BufferEndType)).ToString());

            json += string.Join(",", list.ToArray());
            json += "}";
            return json;
        }