SuperMap.Web.iServerJava6R.ThemeGraphAxes.ToJson C# (CSharp) Méthode

ToJson() static private méthode

static private ToJson ( ThemeGraphAxes graphAxes ) : string
graphAxes ThemeGraphAxes
Résultat string
        internal static string ToJson(ThemeGraphAxes graphAxes)
        {
            string json = "";

            List<string> list = new List<string>();

            if (graphAxes.AxesColor != null)
            {
                list.Add(string.Format("\"axesColor\":{0}", ServerColor.ToJson(graphAxes.AxesColor)));
            }
            else
            {
                list.Add(string.Format("\"axesColor\":{0}", ServerColor.ToJson(new ServerColor())));
            }

            list.Add(string.Format("\"axesDisplayed\":{0}", graphAxes.AxesDisplayed.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLower()));

            list.Add(string.Format("\"axesGridDisplayed\":{0}", graphAxes.AxesGridDisplayed.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLower()));

            list.Add(string.Format("\"axesTextDisplayed\":{0}", graphAxes.AxesTextDisplayed.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLower()));

            if (graphAxes.AxesTextStyle != null)
            {
                list.Add(string.Format("\"axesTextStyle\":{0}", ServerTextStyle.ToJson(graphAxes.AxesTextStyle)));
            }
            else
            {
                list.Add(string.Format("\"axesTextStyle\":{0}", ServerTextStyle.ToJson(new ServerTextStyle())));
            }

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