-
Notifications
You must be signed in to change notification settings - Fork 0
/
WordInput.cs
58 lines (53 loc) · 2 KB
/
WordInput.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
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json;
using api = DynamicPDF.Api;
using System.Collections.Generic;
using System.Collections;
namespace DynamicPDF.Api
{
/// <summary>
/// Represents a Word input.
/// </summary>
public class WordInput : ConverterInput
{
private List<TextReplace> textReplace;
/// <summary>
/// Initializes a new instance of the <see cref="WordInput"/> class.
/// </summary>
/// <param name="resource">The resource of type <see cref="WordResource"/>.</param>
/// <param name="size">The page size of the output PDF.</param>
/// <param name="orientation">The page orientation of the output PDF.</param>
/// <param name="margins">The page margins of the output PDF.</param>
public WordInput(WordResource resource, api.PageSize? size = null, api.PageOrientation? orientation = null, float? margins = null) : base(resource, size, orientation, margins)
{ }
[JsonProperty("type")]
[JsonConverter(typeof(StringEnumConverter), converterParameters: typeof(CamelCaseNamingStrategy))]
internal override InputType Type { get { return InputType.Word; } }
[JsonProperty("textReplace", NullValueHandling = NullValueHandling.Ignore)]
internal List<TextReplace> GetTextReplace
{
get
{
if ((textReplace != null && textReplace.Count > 0))
return textReplace;
else
return null;
}
}
/// <summary>
/// Gets or sets the <see cref="TextReplace"/> object List.
/// </summary>
[JsonIgnore]
public List<TextReplace> TextReplace
{
get
{
if (this.textReplace == null)
this.textReplace = new List<TextReplace>();
return this.textReplace;
}
set => textReplace = value;
}
}
}