/
JSLintOptions.generated.tt
103 lines (96 loc) · 2.28 KB
/
JSLintOptions.generated.tt
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
<#@ include file="JSLintOptions.t4" #>
// <auto-generated />
namespace JSLintNet
{
using System;
using Newtonsoft.Json;
/// <summary>
/// Provides a simple way to create and manage the options used by JSLint.
/// </summary>
public partial class JSLintOptions: ICloneable
{
<#
var first = true;
foreach (var definition in OptionDefinitions)
{
if (first)
{
first = false;
}
else
{
this.WriteLine(string.Empty);
}
if (definition.PropertyType == "bool")
{
#>
/// <summary>
/// Gets or sets a value indicating whether <#= definition.Description #>.
/// </summary>
/// <value>
/// <c>true</c> if <#= definition.Description #>; otherwise, <c>false</c>.
/// </value>
<#
}
else
{
#>
/// <summary>
/// Gets or sets the <#= definition.Description #>.
/// </summary>
/// <value>
/// The <#= definition.Description #>.
/// </value>
<#
}
#>
/// <remarks>
/// JSLint "<#= definition.Key #>" option.
/// </remarks>
[JsonProperty("<#= definition.Key #>")]
public <#= definition.PropertyType #>? <#= definition.PropertyName #> { get; set; }
<#
}
#>
private void CloneRoot(JSLintOptions clone)
{
<#
foreach (var definition in OptionDefinitions)
{
#>
clone.<#= definition.PropertyName #> = this.<#= definition.PropertyName #>;
<#
}
#>
}
private void MergeRoot(JSLintOptions merge)
{
<#
first = true;
foreach (var definition in OptionDefinitions)
{
if (first)
{
first = false;
}
else
{
this.WriteLine(string.Empty);
}
#>
if (merge.<#= definition.PropertyName #>.HasValue)
{
this.<#= definition.PropertyName #> = merge.<#= definition.PropertyName #>;
}
<#
}
#>
}
}
}