Newtonsoft.Json.Schema.JsonSchemaBuilder.ProcessProperties C# (CSharp) Method

ProcessProperties() private method

private ProcessProperties ( ) : void
return void
    private void ProcessProperties()
    {
      IDictionary<string, JsonSchema> properties = new Dictionary<string, JsonSchema>();

      if (_reader.TokenType != JsonToken.StartObject)
        throw new Exception("Expected StartObject token while parsing schema properties, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType));

      while (_reader.Read() && _reader.TokenType != JsonToken.EndObject)
      {
        string propertyName = Convert.ToString(_reader.Value, CultureInfo.InvariantCulture);
        _reader.Read();

        if (properties.ContainsKey(propertyName))
          throw new Exception("Property {0} has already been defined in schema.".FormatWith(CultureInfo.InvariantCulture, propertyName));

        properties.Add(propertyName, BuildSchema());
      }

      CurrentSchema.Properties = properties;
    }