Пример #1
0
        public override string ToJson()
        {
            string str = string.Format("{0},{1},{2},{3},{4},{5},{6}"
                                       , StringHelper.KeyValueTojson("spriteName", StringHelper.AddDoubleQuotation(spriteName))
                                       , StringHelper.KeyValueTojson("border", border.ToJson())
                                       , StringHelper.KeyValueTojson("width", width)
                                       , StringHelper.KeyValueTojson("height", height)
                                       , StringHelper.KeyValueTojson("color", StringHelper.AddDoubleQuotation("0x" + color))
                                       , StringHelper.KeyValueTojson("alpha", alpha)
                                       , StringHelper.KeyValueTojson("isInteractive", isInteractive.ToString().ToLower())
                                       );

            return(StringHelper.AddBrace(str));
        }
Пример #2
0
        public override string ToJson()
        {
            string str = string.Format("{0},{1},{2},{3},{4}"
                                       , StringHelper.KeyValueTojson("transition", transition)
                                       , StringHelper.KeyValueTojson("normal", StringHelper.AddDoubleQuotation(normal))
                                       , StringHelper.KeyValueTojson("over", StringHelper.AddDoubleQuotation(over))
                                       , StringHelper.KeyValueTojson("push", StringHelper.AddDoubleQuotation(push))
                                       , StringHelper.KeyValueTojson("disabled", StringHelper.AddDoubleQuotation(disabled)));

            if (transition == 1)
            {
                str += "," + StringHelper.KeyValueTojson("spriteName", StringHelper.AddDoubleQuotation(spriteName));
            }

            if (isBorder)
            {
                str += "," + StringHelper.KeyValueTojson("border", border.ToJson());
                str += "," + StringHelper.KeyValueTojson("width", width);
                str += "," + StringHelper.KeyValueTojson("height", height);
            }

            return(StringHelper.AddBrace(str));
        }