Ejemplo n.º 1
0
        public static void WriteTo(
            IObjectWriter writer,
            EmptyObject emptyObject)
        {
            if (null == emptyObject)
            {
                writer.WriteNullValue();
                return;
            }

            writer.WriteStartObject();

            writer.WriteEndObject();
        }
Ejemplo n.º 2
0
        public static EmptyObject ReadFrom(
            IObjectReader reader)
        {
            EmptyObject emptyObject = null;

            if (reader.ReadStartObject())
            {
                emptyObject = new EmptyObject();

                int memberKey;

                while (reader.ReadNextMemberKey())
                {
                    memberKey = reader.MemberKey;

                    Debug.WriteLine("Skipping member key {0}", memberKey);
                }

                // TODO: Should ReadEndObject skip any remaining members?
                reader.ReadEndObject();
            }

            return emptyObject;
        }