-
Notifications
You must be signed in to change notification settings - Fork 1
/
QueryRendererSettings.cs
59 lines (50 loc) · 1.93 KB
/
QueryRendererSettings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
namespace Queries.Core.Renderers;
/// <summary>
/// Settings to use when computing string representation of a <see cref="IQuery"/> instance.
/// </summary>
public abstract class QueryRendererSettings
{
/// <summary>
/// Defines how to print queries.
/// </summary>
/// <remarks>
/// Gives a hint to a <see cref="QueryRendererBase"/> implementation on how to display
/// </remarks>
public bool PrettyPrint { get; set; }
/// <summary>
/// Sets how <see cref="System.DateTime"/>/<see cref="System.DateTimeOffset"/> should be printed
/// </summary>
public string DateFormatString { get; set; }
/// <summary>
/// Defines the kind of pagination supported by the renderer
/// </summary>
public PaginationKind PaginationKind { get; }
/// <summary>
/// Indicates that the renderer should not declare variables if any
/// </summary>
/// <remarks>
/// Depending on the renderer implementation, this may or may not be fullfilled
/// </remarks>
public ParametrizationSettings Parametrization { get; set; }
/// <summary>
/// Defines which casing strategy to use when <see cref="Parts.Columns.FieldColumn"/>'s <see cref="Parts.Columns.FieldColumn.Name"/> should be rendered
/// </summary>
public FieldnameCasingStrategy FieldnameCasingStrategy
{
get => _fieldnameCasingStrategy;
set => _fieldnameCasingStrategy = value ?? FieldnameCasingStrategy.Default;
}
private FieldnameCasingStrategy _fieldnameCasingStrategy;
///<inheritdoc/>
public override string ToString() => this.Jsonify();
/// <summary>
/// Builds a new <see cref="QueryRendererSettings"/> instance.
/// </summary>
/// <param name="paginationKind"></param>
protected QueryRendererSettings(PaginationKind paginationKind)
{
PaginationKind = paginationKind;
_fieldnameCasingStrategy = FieldnameCasingStrategy.Default;
}
}