コード例 #1
0
        public virtual IEnumerable <string> GetProperties(JsonReader reader, JsonSerializerReader internalReader)
        {
            if (reader.TokenType != JsonToken.PropertyName)
            {
                reader.ReadAndMoveToContent();
            }
            bool finished = false;

            do
            {
                switch (reader.TokenType)
                {
                case JsonToken.PropertyName:
                    string memberName = reader.Value.ToString();
                    if (internalReader.CheckPropertyName(reader, memberName))
                    {
                        continue;
                    }
                    yield return(memberName);

                    break;

                case JsonToken.EndObject:
                    finished = true;
                    break;

                case JsonToken.Comment:
                    // ignore
                    break;

                default:
                    throw JsonSerializationException.Create(reader, "Unexpected token when deserializing object: " + reader.TokenType);
                }
            } while (!finished && reader.Read());
        }