Makes some massive headway with the real config section, have got all code re-delegated to using it and have migrated the baserest config to the core project, all configs will be shared out of the UmbracoConfiguration singleton, now to get the unit tests all wired up and using mocks for the most part.

This commit is contained in:
Shannon
2013-09-13 18:11:20 +10:00
parent 36d82dc43b
commit f38a6e1561
84 changed files with 841 additions and 2099 deletions

View File

@@ -2,6 +2,7 @@
using System.Linq;
using System.Runtime.Serialization;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.IO;
namespace Umbraco.Core.Models
@@ -13,8 +14,18 @@ namespace Umbraco.Core.Models
[DataContract(IsReference = true)]
public class Script : File
{
public Script(string path) : base(path)
private readonly IContentScriptEditor _scriptEditorConfig;
public Script(string path)
: this(path, UmbracoConfiguration.Current.UmbracoSettings.Content.ScriptEditor)
{
}
public Script(string path, IContentScriptEditor scriptEditorConfig)
: base(path)
{
_scriptEditorConfig = scriptEditorConfig;
base.Path = path;
}
@@ -33,7 +44,7 @@ namespace Umbraco.Core.Models
//into 4 private methods.
//See codeEditorSave.asmx.cs for reference.
var exts = LegacyUmbracoSettings.ScriptFileTypes.Split(',').ToList();
var exts = _scriptEditorConfig.ScriptFileTypes.ToList();
/*if (UmbracoSettings.DefaultRenderingEngine == RenderingEngine.Mvc)
{
exts.Add("cshtml");