예제 #1
0
        public String toJson()
        {
            _JsonWriter jw = new _JsonWriter();

            buildJson(jw);

            return(jw.toJson());
        }
예제 #2
0
        public String toJson()
        {
            _JsonWriter jw = new _JsonWriter();

            jw.WriteArrayStart();

            foreach (DataItem r in rows)
            {
                r.buildJson(jw);
            }

            jw.WriteArrayEnd();

            return(jw.toJson());
        }
예제 #3
0
        internal void buildJson(_JsonWriter jw)
        {
            jw.WriteObjectStart();
            foreach (string key in keys())
            {
                Object val = get(key);

                jw.WritePropertyName(key);

                if (val == null)
                {
                    jw.WriteNull();
                }

                if (val is String)
                {
                    jw.WriteValue((String)val);
                }

                if (val is DateTime)
                {
                    jw.WriteValue((DateTime)val);
                }

                if (val is Boolean)
                {
                    jw.WriteValue((Boolean)val);
                }

                if (val is Int32)
                {
                    jw.WriteValue((Int32)val);
                }

                if (val is Int64)
                {
                    jw.WriteValue((Int64)val);
                }

                jw.WriteValue(new Variate(null, val).doubleValue(0));
            }
            jw.WriteObjectEnd();
        }