예제 #1
0
        internal string Stringify(HashSet <NeoValue> seen)
        {
            if (data.Count == 0)
            {
                return("{}");
            }

            var builder = new StringBuilder();

            builder.Append("{ ");

            var i = 1;

            foreach (var mapping in data)
            {
                builder.Append(NeoValue.StringifyElement(seen, mapping.Key));
                builder.Append(" = ");
                builder.Append(NeoValue.StringifyElement(seen, mapping.Value));

                if (i < data.Count)
                {
                    builder.Append(", ");
                }
                i++;
            }

            builder.Append(" }");

            return(builder.ToString());
        }
예제 #2
0
        internal string Stringify(HashSet <NeoValue> seen)
        {
            if (data.Count == 0)
            {
                return("[]");
            }

            var builder = new StringBuilder();

            builder.Append("[ ");

            for (var i = 0; i < data.Count; i++)
            {
                builder.Append(NeoValue.StringifyElement(seen, data[i]));

                if (i + 1 < data.Count)
                {
                    builder.Append(", ");
                }
            }

            builder.Append(" ]");

            return(builder.ToString());
        }