Exemple #1
0
        void SerializeObject(SLJsonWriter writer)
        {
            writer.BeginObject();

            foreach (string n in Names)
            {
                writer.BeginField(n);
                this[n].Serialize(writer);
            }

            writer.EndObject();
        }
Exemple #2
0
        void SerializeProperty(SLJsonWriter writer, SLJsonMemberAttribute attribute, Type type, object value)
        {
            writer.BeginField(attribute.MemberName);
            switch (attribute.MemberType)
            {
            case SLJsonMemberType.Value: SerializeValue(writer, type, value); break;

            case SLJsonMemberType.Object: SerializeObject(writer, value); break;

            case SLJsonMemberType.ValueArray: SerializeArray(writer, type, value, false); break;

            case SLJsonMemberType.ObjectArray: SerializeArray(writer, type, value, true); break;

            default: throw new NotImplementedException();
            }
        }