Repository navigation
Expand file tree
/
Copy pathSettings.cs
More file actions
83 lines (72 loc) · 1.86 KB
/
Copy pathSettings.cs
File metadata and controls
83 lines (72 loc) · 1.86 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
using System;
using System.IO;
using System.Web.Configuration;
using uComponents.Core;
using Umbraco.Core.IO;
namespace uComponents.DataTypes
{
/// <summary>
/// Global settings for uComponents.
/// </summary>
public class Settings
{
/// <summary>
/// The base directory for additional uComponents files.
/// </summary>
public static readonly string BaseDirName = string.Concat(SystemDirectories.Umbraco, "/plugins/", Constants.ApplicationName);
/// <summary>
/// The output format for a data-type.
/// </summary>
public enum OutputFormat
{
/// <summary>
/// Outputs as CSV.
/// </summary>
CSV = 0,
/// <summary>
/// Outputs as XML.
/// </summary>
XML = 1
}
/// <summary>
/// Gets the folder that stores additional uComponents files.
/// </summary>
/// <value>The base directory for uComponents files.</value>
public static DirectoryInfo BaseDir
{
get
{
var dir = new DirectoryInfo(IOHelper.MapPath(BaseDirName));
if (!dir.Exists)
{
dir.Create();
}
return dir;
}
}
/// <summary>
/// Private static backing field for <c>RazorModelBindingEnabled</c>.
/// </summary>
private static bool? razorModelBindingEnabled = null;
/// <summary>
/// Gets a value indicating whether [razor model binding enabled].
/// </summary>
/// <value>
/// <c>true</c> if [razor model binding enabled]; otherwise, <c>false</c>.
/// </value>
public static bool RazorModelBindingEnabled
{
get
{
if (!razorModelBindingEnabled.HasValue)
{
var enableRazorModelBinding = true;
var appSettingValue = WebConfigurationManager.AppSettings[Constants.AppKey_RazorModelBinding] ?? bool.TrueString;
bool.TryParse(appSettingValue, out enableRazorModelBinding);
razorModelBindingEnabled = enableRazorModelBinding;
}
return razorModelBindingEnabled.Value;
}
}
}
}