Пример #1
0
        public string ToJson()
        {
            string str = "";

            for (int i = 0; i < keyDatas.Count; i++)
            {
                str += keyDatas[i].ToJson();
                if (i == keyDatas.Count - 1)
                {
                    continue;
                }
                str += ",";
            }

            string str2 = "";

            for (int i = 0; i < eventDatas.Count; i++)
            {
                str2 += eventDatas[i].ToJson();
                if (i == eventDatas.Count - 1)
                {
                    continue;
                }
                str2 += ",";
            }

            str = string.Format("{0},{1},{2}",
                                StringHelper.KeyValueTojson("name", StringHelper.AddDoubleQuotation(name))
                                , StringHelper.KeyValueTojson("keys", StringHelper.AddBracket(str))
                                , StringHelper.KeyValueTojson("events", StringHelper.AddBracket(str2)));

            return(StringHelper.AddBrace(StringHelper.AddNewLine(str)));
        }