forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTemplateServiceConfigurationElement.cs
More file actions
92 lines (84 loc) · 3.3 KB
/
TemplateServiceConfigurationElement.cs
File metadata and controls
92 lines (84 loc) · 3.3 KB
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
namespace RazorEngine.Configuration
{
using System.Configuration;
/// <summary>
/// Defines the <see cref="ConfigurationElement"/> that represents a template service element.
/// </summary>
public class TemplateServiceConfigurationElement : ConfigurationElement
{
#region Fields
private const string ActivatorAttribute = "activator";
private const string LanguageAttribute = "language";
private const string MarkupParserAttribute = "markupParser";
private const string NameAttribute = "name";
private const string NamespacesAttribute = "namespaces";
private const string StrictModeAttribute = "strictMode";
private const string TemplateBaseAttribute = "templateBase";
#endregion
#region Properties
/// <summary>
/// Gets the activator used for this template service.
/// </summary>
[ConfigurationProperty(ActivatorAttribute, IsRequired = false)]
public string Activator
{
get { return (string)this[ActivatorAttribute]; }
set { this[ActivatorAttribute] = value; }
}
/// <summary>
/// Defines the language supported by the template service.
/// </summary>
[ConfigurationProperty(LanguageAttribute, IsRequired = false, DefaultValue = Language.CSharp)]
public Language Language
{
get { return (Language)this[LanguageAttribute]; }
set { this[LanguageAttribute] = value; }
}
/// <summary>
/// Gets or sets the markup parser.
/// </summary>
[ConfigurationProperty(MarkupParserAttribute)]
public string MarkupParser
{
get { return (string)this[MarkupParserAttribute]; }
set { this[MarkupParserAttribute] = value; }
}
/// <summary>
/// Gets or sets the name of the template service.
/// </summary>
[ConfigurationProperty(NameAttribute, IsRequired = true, IsKey = true)]
public string Name
{
get { return (string)this[NameAttribute]; }
set { this[NameAttribute] = value; }
}
/// <summary>
/// Gets or sets the collection of namespaces.
/// </summary>
[ConfigurationProperty(NamespacesAttribute)]
public NamespaceConfigurationElementCollection Namespaces
{
get { return (NamespaceConfigurationElementCollection)this[NamespacesAttribute]; }
set { this[NamespacesAttribute] = value; }
}
/// <summary>
/// Gets or sets whether the template service should be running in strict mode.
/// </summary>
[ConfigurationProperty(StrictModeAttribute)]
public bool StrictMode
{
get { return (bool)this[StrictModeAttribute]; }
set { this[StrictModeAttribute] = value; }
}
/// <summary>
/// Gets or sets the template base
/// </summary>
[ConfigurationProperty(TemplateBaseAttribute)]
public string TemplateBase
{
get { return (string)this[TemplateBaseAttribute]; }
set { this[TemplateBaseAttribute] = value; }
}
#endregion
}
}