Exemplo n.º 1
0
        public override void Serialise(JsonSerialisor serialisor)
        {
            const byte comma = 44, bracket = 125;

            writer.Write(serialisor.Serialise(true));
            var innerSerialisors = serialisor.InnerSerialisors;

            if (innerSerialisors != null)
            {
                writer.Write(comma);
                var serialisors = innerSerialisors.ToList();

                for (var i = 0; i < serialisors.Count; i++)
                {
                    var s = serialisors[i];
                    Serialise(s);

                    var isLastItem = i.Equals(serialisors.Count - 1);
                    writer.Write(!isLastItem ? comma : bracket);
                }
            }
            else if (serialisor is JsonPropertiesSerialisor)
            {
                writer.Write(bracket);
            }
        }
        public override void Serialise(JsonSerialisor serialisor) {
            const byte comma = 44, bracket = 125;

            writer.Write(serialisor.Serialise(true));
            var innerSerialisors = serialisor.InnerSerialisors;

            if (innerSerialisors != null) {
                writer.Write(comma);
                var serialisors = innerSerialisors.ToList();

                for (var i = 0; i < serialisors.Count; i++) {
                    var s = serialisors[i];
                    Serialise(s);

                    var isLastItem = i.Equals(serialisors.Count - 1);
                    writer.Write(!isLastItem ? comma : bracket);
                }
            }
            else if (serialisor is JsonPropertiesSerialisor)
                writer.Write(bracket);
        }
 public abstract void Serialise(JsonSerialisor serialisor);
Exemplo n.º 4
0
 public static void Serialise(JsonSerialisationStrategy strategy, JsonSerialisor serialisor)
 {
     strategy.WriteStart();
     strategy.Serialise(serialisor);
     strategy.WriteEnd(serialisor.IsNamed);
 }
Exemplo n.º 5
0
 public abstract void Serialise(JsonSerialisor serialisor);