Shell settings updates

- adding missing space after each key name in the serialized file
 - trimming whitespace from deserialized theme names
 - code cleanup for readability

--HG--
branch : 1.x
This commit is contained in:
Piotr Szmyd
2013-05-08 00:08:56 +02:00
parent 65ae6c3400
commit 56a4f0712c
2 changed files with 24 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace Orchard.Environment.Configuration { namespace Orchard.Environment.Configuration {
/// <summary> /// <summary>
@@ -54,7 +55,7 @@ namespace Orchard.Environment.Configuration {
/// </summary> /// </summary>
public string Name { public string Name {
get { return this["Name"] ?? ""; } get { return this["Name"] ?? ""; }
set { _values["Name"] = value; } set { this["Name"] = value; }
} }
/// <summary> /// <summary>
@@ -62,7 +63,7 @@ namespace Orchard.Environment.Configuration {
/// </summary> /// </summary>
public string DataProvider { public string DataProvider {
get { return this["DataProvider"] ?? ""; } get { return this["DataProvider"] ?? ""; }
set { _values["DataProvider"] = value; } set { this["DataProvider"] = value; }
} }
/// <summary> /// <summary>
@@ -70,7 +71,7 @@ namespace Orchard.Environment.Configuration {
/// </summary> /// </summary>
public string DataConnectionString { public string DataConnectionString {
get { return this["DataConnectionString"]; } get { return this["DataConnectionString"]; }
set { _values["DataConnectionString"] = value; } set { this["DataConnectionString"] = value; }
} }
/// <summary> /// <summary>
@@ -78,7 +79,7 @@ namespace Orchard.Environment.Configuration {
/// </summary> /// </summary>
public string DataTablePrefix { public string DataTablePrefix {
get { return this["DataTablePrefix"]; } get { return this["DataTablePrefix"]; }
set { _values["DataTablePrefix"] = value; } set { this["DataTablePrefix"] = value; }
} }
/// <summary> /// <summary>
@@ -86,7 +87,7 @@ namespace Orchard.Environment.Configuration {
/// </summary> /// </summary>
public string RequestUrlHost { public string RequestUrlHost {
get { return this["RequestUrlHost"]; } get { return this["RequestUrlHost"]; }
set { _values["RequestUrlHost"] = value; } set { this["RequestUrlHost"] = value; }
} }
/// <summary> /// <summary>
@@ -102,7 +103,7 @@ namespace Orchard.Environment.Configuration {
/// </summary> /// </summary>
public string EncryptionAlgorithm { public string EncryptionAlgorithm {
get { return this["EncryptionAlgorithm"]; } get { return this["EncryptionAlgorithm"]; }
set { _values["EncryptionAlgorithm"] = value; } set { this["EncryptionAlgorithm"] = value; }
} }
/// <summary> /// <summary>
@@ -118,7 +119,7 @@ namespace Orchard.Environment.Configuration {
/// </summary> /// </summary>
public string HashAlgorithm { public string HashAlgorithm {
get { return this["HashAlgorithm"]; } get { return this["HashAlgorithm"]; }
set { _values["HashAlgorithm"] = value; } set { this["HashAlgorithm"] = value; }
} }
/// <summary> /// <summary>
@@ -126,17 +127,21 @@ namespace Orchard.Environment.Configuration {
/// </summary> /// </summary>
public string HashKey { public string HashKey {
get { return this["HashKey"]; } get { return this["HashKey"]; }
set { _values["HashKey"] = value; } set { this["HashKey"] = value; }
} }
/// <summary> /// <summary>
/// List of available themes for this tenant /// List of available themes for this tenant
/// </summary> /// </summary>
public string[] Themes { public string[] Themes {
get { return _themes ?? (Themes = (_values["Themes"] ?? "").Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); } get {
return _themes ?? (Themes = (_values["Themes"] ?? "").Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
.Select(t => t.Trim())
.ToArray();
}
set { set {
_themes = value; _themes = value;
_values["Themes"] = string.Join(";", value); this["Themes"] = string.Join(";", value);
} }
} }
@@ -147,7 +152,7 @@ namespace Orchard.Environment.Configuration {
get { return _tenantState; } get { return _tenantState; }
set { set {
_tenantState = value; _tenantState = value;
_values["State"] = value.ToString(); this["State"] = value.ToString();
} }
} }
} }