Renamed config interfaces properly with Section suffix, re-implemented the For<T> UmbracoConfiguration method to retreive specific settings... might use this entirely instead of the nested access as it might make it easier to mock.

This commit is contained in:
Shannon
2013-09-16 17:39:45 +10:00
parent bd644bc707
commit b043ee577f
85 changed files with 540 additions and 520 deletions
@@ -4,19 +4,12 @@ using System.Configuration;
namespace Umbraco.Core.Configuration.BaseRest
{
[ConfigurationKey("BaseRestExtensions")]
internal class BaseRestSection : UmbracoConfigurationSection, IBaseRest
internal class BaseRestSection : UmbracoConfigurationSection, IBaseRestSection
{
private const string KeyEnabled = "enabled";
private bool? _enabled;
//internal protected override void ResetSection()
//{
// base.ResetSection();
// _enabled = null;
//}
[ConfigurationProperty("", IsKey = false, IsRequired = false, IsDefaultCollection = true)]
public ExtensionElementCollection Items
{
@@ -36,7 +29,7 @@ namespace Umbraco.Core.Configuration.BaseRest
internal set { _enabled = value; }
}
IExtensionsCollection IBaseRest.Items
IExtensionsCollection IBaseRestSection.Items
{
get { return Items; }
}
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration.BaseRest
{
[ConfigurationCollection(typeof(ExtensionElement), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate)]
internal class ExtensionElement : ConfigurationElementCollection, IEnumerable<IMethod>, IExtension
internal class ExtensionElement : ConfigurationElementCollection, IEnumerable<IMethodSection>, IExtension
{
const string KeyAlias = "alias";
const string KeyType = "type";
@@ -59,11 +59,11 @@ namespace Umbraco.Core.Configuration.BaseRest
get { return (MethodElement)BaseGet(index); }
}
IEnumerator<IMethod> IEnumerable<IMethod>.GetEnumerator()
IEnumerator<IMethodSection> IEnumerable<IMethodSection>.GetEnumerator()
{
for (var i = 0; i < Count; i++)
{
yield return BaseGet(i) as IMethod;
yield return BaseGet(i) as IMethodSection;
}
}
@@ -72,7 +72,7 @@ namespace Umbraco.Core.Configuration.BaseRest
return GetEnumerator();
}
IMethod IExtension.this[string index]
IMethodSection IExtension.this[string index]
{
get { return this[index]; }
}
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.BaseRest
{
public interface IBaseRest
public interface IBaseRestSection
{
IExtensionsCollection Items { get; }
@@ -6,6 +6,6 @@
string Type { get; }
IMethod this[string index] { get; }
IMethodSection this[string index] { get; }
}
}
@@ -1,6 +1,6 @@
namespace Umbraco.Core.Configuration.BaseRest
{
public interface IMethod
public interface IMethodSection
{
string Name { get; }
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.BaseRest
{
internal class MethodElement : ConfigurationElement, IMethod
internal class MethodElement : ConfigurationElement, IMethodSection
{
const string KeyName = "name";
const string KeyAllowAll = "allowAll";
@@ -8,7 +8,6 @@ namespace Umbraco.Core.Configuration
{
public class FileSystemProvidersSection : ConfigurationSection
{
private const string PROVIDERS_KEY = "providers";
[ConfigurationProperty("", IsDefaultCollection = true, IsRequired = true)]
public FileSystemProviderElementCollection Providers
@@ -1,6 +1,8 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Threading;
using Umbraco.Core.Configuration.BaseRest;
using Umbraco.Core.Configuration.UmbracoSettings;
@@ -24,57 +26,63 @@ namespace Umbraco.Core.Configuration
#endregion
//#region Extensible settings
#region Extensible settings
//TODO: Need to think about this... it seems nicer to do this than having giant nested access to the configuration
// sections, BUT we don't want to attribute the interfaces. We can make IUmbracoConfigurationSection plugins and then search for the matching
// one based on the specified interface ?
private static readonly ConcurrentDictionary<Type, IUmbracoConfigurationSection> Sections = new ConcurrentDictionary<Type, IUmbracoConfigurationSection>();
//private static readonly ConcurrentDictionary<Type, IUmbracoConfigurationSection> Sections = new ConcurrentDictionary<Type, IUmbracoConfigurationSection>();
/// <summary>
/// Gets the specified UmbracoConfigurationSection.
/// </summary>
/// <typeparam name="T">The type of the UmbracoConfigurationSectiont.</typeparam>
/// <returns>The UmbracoConfigurationSection of the specified type.</returns>
public static T For<T>(System.Configuration.Configuration config = null)
where T : IUmbracoConfigurationSection
{
var sectionType = typeof(T);
return (T)Sections.GetOrAdd(sectionType, type =>
{
//if there is no entry for this type
var configurationSections = PluginManager.Current.ResolveUmbracoConfigurationSections();
var implementationType = configurationSections.FirstOrDefault(TypeHelper.IsTypeAssignableFrom<T>);
if (implementationType == null)
{
throw new InvalidOperationException("Could not find an implementation for " + typeof(T));
}
///// <summary>
///// Gets the specified UmbracoConfigurationSection.
///// </summary>
///// <typeparam name="T">The type of the UmbracoConfigurationSectiont.</typeparam>
///// <returns>The UmbracoConfigurationSection of the specified type.</returns>
//public static T For<T>()
// where T : IUmbracoConfigurationSection
//{
// var sectionType = typeof(T);
// return (T)Sections.GetOrAdd(sectionType, type =>
// {
// var attr = sectionType.GetCustomAttribute<ConfigurationKeyAttribute>(false);
// if (attr == null)
// throw new InvalidOperationException(string.Format("Type \"{0}\" is missing attribute ConfigurationKeyAttribute.", sectionType.FullName));
var attr = implementationType.GetCustomAttribute<ConfigurationKeyAttribute>(false);
if (attr == null)
throw new InvalidOperationException(string.Format("Type \"{0}\" is missing attribute ConfigurationKeyAttribute.", sectionType.FullName));
// var sectionKey = attr.ConfigurationKey;
// if (string.IsNullOrWhiteSpace(sectionKey))
// throw new InvalidOperationException(string.Format("Type \"{0}\" ConfigurationKeyAttribute value is null or empty.", sectionType.FullName));
var sectionKey = attr.ConfigurationKey;
if (string.IsNullOrWhiteSpace(sectionKey))
throw new InvalidOperationException(string.Format("Type \"{0}\" {1} value is null or empty.", sectionType.FullName, typeof(ConfigurationKeyAttribute)));
// var section = GetSection(sectionType, sectionKey);
var section = GetSection(sectionType, sectionKey, config);
// return (T)section;
// });
//}
return (T)section;
});
}
//private static IUmbracoConfigurationSection GetSection(Type sectionType, string key)
//{
// if (TypeHelper.IsTypeAssignableFrom<IUmbracoConfigurationSection>(sectionType) == false)
// {
// throw new ArgumentException(string.Format(
// "Type \"{0}\" does not inherit from UmbracoConfigurationSection.", sectionType.FullName), "sectionType");
// }
private static IUmbracoConfigurationSection GetSection(Type sectionType, string key, System.Configuration.Configuration config = null)
{
var section = config == null
? ConfigurationManager.GetSection(key)
: config.GetSection(key);
// var section = ConfigurationManager.GetSection(key);
if (section == null)
{
throw new KeyNotFoundException("Could not find/load config section: " + key);
}
// if (section != null && section.GetType() != sectionType)
// throw new InvalidCastException(string.Format("Section at key \"{0}\" is of type \"{1}\" and not \"{2}\".",
// key, section.GetType().FullName, sectionType.FullName));
var result = section as IUmbracoConfigurationSection;
if (result == null)
{
throw new InvalidOperationException(string.Format("The section type requested '{0}' does not match the resulting section type '{1}", sectionType, section.GetType()));
}
return result;
}
// return section as IUmbracoConfigurationSection;
//}
//#endregion
#endregion
/// <summary>
/// Default constructor
@@ -83,13 +91,23 @@ namespace Umbraco.Core.Configuration
{
if (UmbracoSettings == null)
{
var umbracoSettings = ConfigurationManager.GetSection("umbracoConfiguration/settings") as IUmbracoSettings;
var umbracoSettings = ConfigurationManager.GetSection("umbracoConfiguration/settings") as IUmbracoSettingsSection;
if (umbracoSettings == null)
{
LogHelper.Warn<UmbracoConfiguration>("Could not load the IUmbracoSettings from config file!");
LogHelper.Warn<UmbracoConfiguration>("Could not load the " + typeof(IUmbracoSettingsSection) + " from config file!");
}
UmbracoSettings = umbracoSettings;
}
if (BaseRestExtensions == null)
{
var baseRestExtensions = ConfigurationManager.GetSection("umbracoConfiguration/BaseRestExtensions") as IBaseRestSection;
if (baseRestExtensions == null)
{
LogHelper.Warn<UmbracoConfiguration>("Could not load the " + typeof(IBaseRestSection) + " from config file!");
}
BaseRestExtensions = baseRestExtensions;
}
}
/// <summary>
@@ -97,7 +115,7 @@ namespace Umbraco.Core.Configuration
/// </summary>
/// <param name="umbracoSettings"></param>
/// <param name="baseRestSettings"></param>
public UmbracoConfiguration(IUmbracoSettings umbracoSettings, IBaseRest baseRestSettings)
public UmbracoConfiguration(IUmbracoSettingsSection umbracoSettings, IBaseRestSection baseRestSettings)
{
UmbracoSettings = umbracoSettings;
BaseRestExtensions = baseRestSettings;
@@ -106,14 +124,14 @@ namespace Umbraco.Core.Configuration
/// <summary>
/// Gets the IUmbracoSettings
/// </summary>
public IUmbracoSettings UmbracoSettings
public IUmbracoSettingsSection UmbracoSettings
{
get;
//This is purely for setting for Unit tests ONLY
internal set;
}
public IBaseRest BaseRestExtensions { get; private set; }
public IBaseRestSection BaseRestExtensions { get; private set; }
//TODO: Add other configurations here !
}
@@ -2,7 +2,9 @@
namespace Umbraco.Core.Configuration
{
/// <summary>
/// Represents an Umbraco configuration section which can be used to pass to UmbracoConfiguration.For{T}
/// </summary>
public interface IUmbracoConfigurationSection
{
@@ -19,7 +21,7 @@ namespace Umbraco.Core.Configuration
/// <para>The <c>UmbracoSettings.For{T}</c> method will return a section, either one that
/// is in the configuration file, or a section that was created with default values.</para>
/// </remarks>
public abstract class UmbracoConfigurationSection : ConfigurationSection
public abstract class UmbracoConfigurationSection : ConfigurationSection, IUmbracoConfigurationSection
{
/// <summary>
/// Gets a value indicating whether the section actually is in the configuration file.
@@ -3,6 +3,7 @@ using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
[ConfigurationKey("umbracoConfiguration/settings/content")]
internal class ContentElement : ConfigurationElement, IContentSection
{
[ConfigurationProperty("imaging")]
@@ -309,7 +310,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return Imaging.ImageTagAllowedAttributes; }
}
IEnumerable<IContentImagingAutoFillUploadField> IContentSection.ImageAutoFillProperties
IEnumerable<IImagingAutoFillUploadField> IContentSection.ImageAutoFillProperties
{
get { return Imaging.ImageAutoFillProperties; }
}
@@ -29,11 +29,11 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
}
}
private ContentImagingAutoFillPropertiesCollection _defaultImageAutoFill;
private ImagingAutoFillPropertiesCollection _defaultImageAutoFill;
[ConfigurationCollection(typeof(ContentImagingAutoFillPropertiesCollection), AddItemName = "uploadField")]
[ConfigurationCollection(typeof(ImagingAutoFillPropertiesCollection), AddItemName = "uploadField")]
[ConfigurationProperty("autoFillImageProperties", IsDefaultCollection = true)]
internal ContentImagingAutoFillPropertiesCollection ImageAutoFillProperties
internal ImagingAutoFillPropertiesCollection ImageAutoFillProperties
{
get
{
@@ -47,9 +47,9 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
var autoFill = this[prop] as ConfigurationElement;
if (autoFill != null && autoFill.ElementInformation.IsPresent == false)
{
_defaultImageAutoFill = new ContentImagingAutoFillPropertiesCollection
_defaultImageAutoFill = new ImagingAutoFillPropertiesCollection
{
new ContentImagingAutoFillUploadFieldElement
new ImagingAutoFillUploadFieldElement
{
Alias = "umbracoFile"
}
@@ -57,7 +57,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
return _defaultImageAutoFill;
}
return (ContentImagingAutoFillPropertiesCollection) base["autoFillImageProperties"];
return (ImagingAutoFillPropertiesCollection) base["autoFillImageProperties"];
}
}
@@ -3,7 +3,7 @@ using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class DeveloperElement : ConfigurationElement, IDeveloper
internal class DeveloperElement : ConfigurationElement, IDeveloperSection
{
private AppCodeFileExtensionsElement _default;
@@ -39,7 +39,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
}
}
IEnumerable<IFileExtension> IDeveloper.AppCodeFileExtensions
IEnumerable<IFileExtension> IDeveloperSection.AppCodeFileExtensions
{
get { return AppCodeFileExtensions.AppCodeFileExtensionsCollection; }
}
@@ -3,7 +3,7 @@ using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class DistributedCallElement : ConfigurationElement, IDistributedCall
internal class DistributedCallElement : ConfigurationElement, IDistributedCallSection
{
[ConfigurationProperty("enable", DefaultValue = false)]
internal bool Enabled
@@ -30,17 +30,17 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return (ServerCollection)base["servers"]; }
}
bool IDistributedCall.Enabled
bool IDistributedCallSection.Enabled
{
get { return Enabled; }
}
int IDistributedCall.UserId
int IDistributedCallSection.UserId
{
get { return UserId; }
}
IEnumerable<IServer> IDistributedCall.Servers
IEnumerable<IServer> IDistributedCallSection.Servers
{
get { return Servers; }
}
@@ -3,7 +3,7 @@ using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class HelpElement : ConfigurationElement, IHelp
internal class HelpElement : ConfigurationElement, IHelpSection
{
[ConfigurationProperty("defaultUrl", DefaultValue = "http://our.umbraco.org/wiki/umbraco-help/{0}/{1}")]
public string DefaultUrl
@@ -18,12 +18,12 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return (LinksCollection) base[""]; }
}
string IHelp.DefaultUrl
string IHelpSection.DefaultUrl
{
get { return DefaultUrl; }
}
IEnumerable<ILink> IHelp.Links
IEnumerable<ILink> IHelpSection.Links
{
get { return Links; }
}
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
IEnumerable<string> ImageTagAllowedAttributes { get; }
IEnumerable<IContentImagingAutoFillUploadField> ImageAutoFillProperties { get; }
IEnumerable<IImagingAutoFillUploadField> ImageAutoFillProperties { get; }
string ScriptFolderPath { get; }
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IDeveloper
public interface IDeveloperSection : IUmbracoConfigurationSection
{
IEnumerable<IFileExtension> AppCodeFileExtensions { get; }
}
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IDistributedCall
public interface IDistributedCallSection : IUmbracoConfigurationSection
{
bool Enabled { get; }
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IHelp
public interface IHelpSection : IUmbracoConfigurationSection
{
string DefaultUrl { get; }
@@ -1,6 +1,6 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IContentImagingAutoFillUploadField
public interface IImagingAutoFillUploadField
{
/// <summary>
/// Allow setting internally so we can create a default
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface ILogging
public interface ILoggingSection : IUmbracoConfigurationSection
{
bool AutoCleanLogs { get; }
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IProviders
public interface IProvidersSection : IUmbracoConfigurationSection
{
string DefaultBackOfficeUserProvider { get; }
}
@@ -3,7 +3,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IRepositories
public interface IRepositoriesSection : IUmbracoConfigurationSection
{
IEnumerable<IRepository> Repositories { get; }
}
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IRequestHandler
public interface IRequestHandlerSection : IUmbracoConfigurationSection
{
bool UseDomainPrefixes { get; }
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IScheduledTasks
public interface IScheduledTasksSection : IUmbracoConfigurationSection
{
IEnumerable<IScheduledTask> Tasks { get; }
}
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IScripting
public interface IScriptingSection : IUmbracoConfigurationSection
{
IEnumerable<INotDynamicXmlDocument> NotDynamicXmlDocumentElements { get; }
@@ -1,6 +1,6 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface ISecurity
public interface ISecuritySection : IUmbracoConfigurationSection
{
bool KeepUserLoggedIn { get; }
@@ -1,6 +1,6 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface ITemplates
public interface ITemplatesSection : IUmbracoConfigurationSection
{
bool UseAspNetMasterPages { get; }
@@ -1,33 +0,0 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IUmbracoSettings
{
IContentSection Content { get; }
ISecurity Security { get; }
IRequestHandler RequestHandler { get; }
ITemplates Templates { get; }
IDeveloper Developer { get; }
IViewstateMoverModule ViewstateMoverModule { get; }
ILogging Logging { get; }
IScheduledTasks ScheduledTasks { get; }
IDistributedCall DistributedCall { get; }
IRepositories PackageRepositories { get; }
IProviders Providers { get; }
IHelp Help { get; }
IWebRouting WebRouting { get; }
IScripting Scripting { get; }
}
}
@@ -0,0 +1,33 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IUmbracoSettingsSection : IUmbracoConfigurationSection
{
IContentSection Content { get; }
ISecuritySection Security { get; }
IRequestHandlerSection RequestHandler { get; }
ITemplatesSection Templates { get; }
IDeveloperSection Developer { get; }
IViewStateMoverModuleSection ViewStateMoverModule { get; }
ILoggingSection Logging { get; }
IScheduledTasksSection ScheduledTasks { get; }
IDistributedCallSection DistributedCall { get; }
IRepositoriesSection PackageRepositories { get; }
IProvidersSection Providers { get; }
IHelpSection Help { get; }
IWebRoutingSection WebRouting { get; }
IScriptingSection Scripting { get; }
}
}
@@ -1,6 +1,6 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IViewstateMoverModule
public interface IViewStateMoverModuleSection : IUmbracoConfigurationSection
{
bool Enable { get; }
}
@@ -1,6 +1,6 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public interface IWebRouting
public interface IWebRoutingSection : IUmbracoConfigurationSection
{
bool TrySkipIisCustomErrors { get; }
@@ -1,37 +1,37 @@
using System.Collections.Generic;
using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class ContentImagingAutoFillPropertiesCollection : ConfigurationElementCollection, IEnumerable<IContentImagingAutoFillUploadField>
{
protected override ConfigurationElement CreateNewElement()
{
return new ContentImagingAutoFillUploadFieldElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((ContentImagingAutoFillUploadFieldElement)element).Alias;
}
internal void Add(ContentImagingAutoFillUploadFieldElement item)
{
BaseAdd(item);
}
IEnumerator<IContentImagingAutoFillUploadField> IEnumerable<IContentImagingAutoFillUploadField>.GetEnumerator()
{
for (var i = 0; i < Count; i++)
{
yield return BaseGet(i) as IContentImagingAutoFillUploadField;
}
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
using System.Collections.Generic;
using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class ImagingAutoFillPropertiesCollection : ConfigurationElementCollection, IEnumerable<IImagingAutoFillUploadField>
{
protected override ConfigurationElement CreateNewElement()
{
return new ImagingAutoFillUploadFieldElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((ImagingAutoFillUploadFieldElement)element).Alias;
}
internal void Add(ImagingAutoFillUploadFieldElement item)
{
BaseAdd(item);
}
IEnumerator<IImagingAutoFillUploadField> IEnumerable<IImagingAutoFillUploadField>.GetEnumerator()
{
for (var i = 0; i < Count; i++)
{
yield return BaseGet(i) as IImagingAutoFillUploadField;
}
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
@@ -1,91 +1,91 @@
using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class ContentImagingAutoFillUploadFieldElement : ConfigurationElement, IContentImagingAutoFillUploadField
{
/// <summary>
/// Allow setting internally so we can create a default
/// </summary>
[ConfigurationProperty("alias", IsKey = true, IsRequired = true)]
public string Alias
{
get { return (string)this["alias"]; }
set { this["alias"] = value; }
}
[ConfigurationProperty("widthFieldAlias")]
internal InnerTextConfigurationElement<string> WidthFieldAlias
{
get
{
return new OptionalInnerTextConfigurationElement<string>(
(InnerTextConfigurationElement<string>)this["widthFieldAlias"],
//set the default
"umbracoWidth");
}
}
[ConfigurationProperty("heightFieldAlias")]
internal InnerTextConfigurationElement<string> HeightFieldAlias
{
get
{
return new OptionalInnerTextConfigurationElement<string>(
(InnerTextConfigurationElement<string>)this["heightFieldAlias"],
//set the default
"umbracoHeight");
}
}
[ConfigurationProperty("lengthFieldAlias")]
internal InnerTextConfigurationElement<string> LengthFieldAlias
{
get
{
return new OptionalInnerTextConfigurationElement<string>(
(InnerTextConfigurationElement<string>)this["lengthFieldAlias"],
//set the default
"umbracoBytes");
}
}
[ConfigurationProperty("extensionFieldAlias")]
internal InnerTextConfigurationElement<string> ExtensionFieldAlias
{
get
{
return new OptionalInnerTextConfigurationElement<string>(
(InnerTextConfigurationElement<string>)this["extensionFieldAlias"],
//set the default
"umbracoExtension");
}
}
string IContentImagingAutoFillUploadField.Alias
{
get { return Alias; }
}
string IContentImagingAutoFillUploadField.WidthFieldAlias
{
get { return WidthFieldAlias; }
}
string IContentImagingAutoFillUploadField.HeightFieldAlias
{
get { return HeightFieldAlias; }
}
string IContentImagingAutoFillUploadField.LengthFieldAlias
{
get { return LengthFieldAlias; }
}
string IContentImagingAutoFillUploadField.ExtensionFieldAlias
{
get { return ExtensionFieldAlias; }
}
}
using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class ImagingAutoFillUploadFieldElement : ConfigurationElement, IImagingAutoFillUploadField
{
/// <summary>
/// Allow setting internally so we can create a default
/// </summary>
[ConfigurationProperty("alias", IsKey = true, IsRequired = true)]
public string Alias
{
get { return (string)this["alias"]; }
set { this["alias"] = value; }
}
[ConfigurationProperty("widthFieldAlias")]
internal InnerTextConfigurationElement<string> WidthFieldAlias
{
get
{
return new OptionalInnerTextConfigurationElement<string>(
(InnerTextConfigurationElement<string>)this["widthFieldAlias"],
//set the default
"umbracoWidth");
}
}
[ConfigurationProperty("heightFieldAlias")]
internal InnerTextConfigurationElement<string> HeightFieldAlias
{
get
{
return new OptionalInnerTextConfigurationElement<string>(
(InnerTextConfigurationElement<string>)this["heightFieldAlias"],
//set the default
"umbracoHeight");
}
}
[ConfigurationProperty("lengthFieldAlias")]
internal InnerTextConfigurationElement<string> LengthFieldAlias
{
get
{
return new OptionalInnerTextConfigurationElement<string>(
(InnerTextConfigurationElement<string>)this["lengthFieldAlias"],
//set the default
"umbracoBytes");
}
}
[ConfigurationProperty("extensionFieldAlias")]
internal InnerTextConfigurationElement<string> ExtensionFieldAlias
{
get
{
return new OptionalInnerTextConfigurationElement<string>(
(InnerTextConfigurationElement<string>)this["extensionFieldAlias"],
//set the default
"umbracoExtension");
}
}
string IImagingAutoFillUploadField.Alias
{
get { return Alias; }
}
string IImagingAutoFillUploadField.WidthFieldAlias
{
get { return WidthFieldAlias; }
}
string IImagingAutoFillUploadField.HeightFieldAlias
{
get { return HeightFieldAlias; }
}
string IImagingAutoFillUploadField.LengthFieldAlias
{
get { return LengthFieldAlias; }
}
string IImagingAutoFillUploadField.ExtensionFieldAlias
{
get { return ExtensionFieldAlias; }
}
}
}
@@ -3,7 +3,7 @@ using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class LoggingElement : ConfigurationElement, ILogging
internal class LoggingElement : ConfigurationElement, ILoggingSection
{
[ConfigurationProperty("autoCleanLogs")]
@@ -93,47 +93,47 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
}
}
string ILogging.ExternalLoggerAssembly
string ILoggingSection.ExternalLoggerAssembly
{
get { return ExternalLogger.Assembly; }
}
string ILogging.ExternalLoggerType
string ILoggingSection.ExternalLoggerType
{
get { return ExternalLogger.Type; }
}
bool ILogging.ExternalLoggerEnableAuditTrail
bool ILoggingSection.ExternalLoggerEnableAuditTrail
{
get { return ExternalLogger.LogAuditTrail; }
}
bool ILogging.AutoCleanLogs
bool ILoggingSection.AutoCleanLogs
{
get { return AutoCleanLogs; }
}
bool ILogging.EnableLogging
bool ILoggingSection.EnableLogging
{
get { return EnableLogging; }
}
bool ILogging.EnableAsyncLogging
bool ILoggingSection.EnableAsyncLogging
{
get { return EnableAsyncLogging; }
}
int ILogging.CleaningMiliseconds
int ILoggingSection.CleaningMiliseconds
{
get { return CleaningMiliseconds; }
}
int ILogging.MaxLogAge
int ILoggingSection.MaxLogAge
{
get { return MaxLogAge; }
}
IEnumerable<ILogType> ILogging.DisabledLogTypes
IEnumerable<ILogType> ILoggingSection.DisabledLogTypes
{
get { return DisabledLogTypes; }
}
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class ProvidersElement : ConfigurationElement, IProviders
internal class ProvidersElement : ConfigurationElement, IProvidersSection
{
[ConfigurationProperty("users")]
public UserProviderElement Users
@@ -4,7 +4,7 @@ using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class RepositoriesElement : ConfigurationElement, IRepositories
internal class RepositoriesElement : ConfigurationElement, IRepositoriesSection
{
[ConfigurationCollection(typeof(RepositoriesCollection), AddItemName = "repository")]
@@ -15,7 +15,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
set { base[""] = value; }
}
IEnumerable<IRepository> IRepositories.Repositories
IEnumerable<IRepository> IRepositoriesSection.Repositories
{
get { return Repositories; }
}
@@ -5,7 +5,7 @@ using System.Collections.Generic;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class RequestHandlerElement : ConfigurationElement, IRequestHandler
internal class RequestHandlerElement : ConfigurationElement, IRequestHandlerSection
{
[ConfigurationProperty("useDomainPrefixes")]
public InnerTextConfigurationElement<bool> UseDomainPrefixes
@@ -101,22 +101,22 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
}
}
bool IRequestHandler.UseDomainPrefixes
bool IRequestHandlerSection.UseDomainPrefixes
{
get { return UseDomainPrefixes; }
}
bool IRequestHandler.AddTrailingSlash
bool IRequestHandlerSection.AddTrailingSlash
{
get { return AddTrailingSlash; }
}
bool IRequestHandler.RemoveDoubleDashes
bool IRequestHandlerSection.RemoveDoubleDashes
{
get { return UrlReplacing.RemoveDoubleDashes; }
}
IEnumerable<IChar> IRequestHandler.CharCollection
IEnumerable<IChar> IRequestHandlerSection.CharCollection
{
get { return UrlReplacing.CharCollection; }
}
@@ -3,7 +3,7 @@ using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class ScheduledTasksElement : ConfigurationElement, IScheduledTasks
internal class ScheduledTasksElement : ConfigurationElement, IScheduledTasksSection
{
[ConfigurationCollection(typeof(ScheduledTasksCollection), AddItemName = "task")]
[ConfigurationProperty("", IsDefaultCollection = true)]
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return (ScheduledTasksCollection)base[""]; }
}
IEnumerable<IScheduledTask> IScheduledTasks.Tasks
IEnumerable<IScheduledTask> IScheduledTasksSection.Tasks
{
get { return Tasks; }
}
@@ -3,7 +3,7 @@ using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class ScriptingElement : ConfigurationElement, IScripting
internal class ScriptingElement : ConfigurationElement, IScriptingSection
{
[ConfigurationProperty("razor")]
internal RazorElement Razor
@@ -11,12 +11,12 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return (RazorElement) base["razor"]; }
}
IEnumerable<INotDynamicXmlDocument> IScripting.NotDynamicXmlDocumentElements
IEnumerable<INotDynamicXmlDocument> IScriptingSection.NotDynamicXmlDocumentElements
{
get { return Razor.NotDynamicXmlDocumentElements; }
}
IEnumerable<IRazorStaticMapping> IScripting.DataTypeModelStaticMappings
IEnumerable<IRazorStaticMapping> IScriptingSection.DataTypeModelStaticMappings
{
get { return Razor.DataTypeModelStaticMappings; }
}
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class SecurityElement : ConfigurationElement, ISecurity
internal class SecurityElement : ConfigurationElement, ISecuritySection
{
[ConfigurationProperty("keepUserLoggedIn")]
internal InnerTextConfigurationElement<bool> KeepUserLoggedIn
@@ -52,22 +52,22 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
}
}
bool ISecurity.KeepUserLoggedIn
bool ISecuritySection.KeepUserLoggedIn
{
get { return KeepUserLoggedIn; }
}
bool ISecurity.HideDisabledUsersInBackoffice
bool ISecuritySection.HideDisabledUsersInBackoffice
{
get { return HideDisabledUsersInBackoffice; }
}
string ISecurity.AuthCookieName
string ISecuritySection.AuthCookieName
{
get { return AuthCookieName; }
}
string ISecurity.AuthCookieDomain
string ISecuritySection.AuthCookieDomain
{
get { return AuthCookieDomain; }
}
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class TemplatesElement : ConfigurationElement, ITemplates
internal class TemplatesElement : ConfigurationElement, ITemplatesSection
{
[ConfigurationProperty("useAspNetMasterPages")]
internal InnerTextConfigurationElement<bool> UseAspNetMasterPages
@@ -52,22 +52,22 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
}
}
bool ITemplates.UseAspNetMasterPages
bool ITemplatesSection.UseAspNetMasterPages
{
get { return UseAspNetMasterPages; }
}
bool ITemplates.EnableSkinSupport
bool ITemplatesSection.EnableSkinSupport
{
get { return EnableSkinSupport; }
}
RenderingEngine ITemplates.DefaultRenderingEngine
RenderingEngine ITemplatesSection.DefaultRenderingEngine
{
get { return DefaultRenderingEngine; }
}
bool ITemplates.EnableTemplateFolders
bool ITemplatesSection.EnableTemplateFolders
{
get { return EnableTemplateFolders; }
}
@@ -3,18 +3,9 @@ using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
public class UmbracoSettingsSection : ConfigurationSection, IUmbracoSettings
[ConfigurationKey("umbracoConfiguration/settings")]
public class UmbracoSettingsSection : ConfigurationSection, IUmbracoSettingsSection
{
///// <summary>
///// Get the current settings
///// </summary>
//public static UmbracoSettings Current
//{
// get { return (UmbracoSettings) ConfigurationManager.GetSection("umbracoConfiguration/settings"); }
//}
[ConfigurationProperty("content")]
internal ContentElement Content
{
@@ -129,72 +120,72 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return (ScriptingElement)this["scripting"]; }
}
IContentSection IUmbracoSettings.Content
IContentSection IUmbracoSettingsSection.Content
{
get { return Content; }
}
ISecurity IUmbracoSettings.Security
ISecuritySection IUmbracoSettingsSection.Security
{
get { return Security; }
}
IRequestHandler IUmbracoSettings.RequestHandler
IRequestHandlerSection IUmbracoSettingsSection.RequestHandler
{
get { return RequestHandler; }
}
ITemplates IUmbracoSettings.Templates
ITemplatesSection IUmbracoSettingsSection.Templates
{
get { return Templates; }
}
IDeveloper IUmbracoSettings.Developer
IDeveloperSection IUmbracoSettingsSection.Developer
{
get { return Developer; }
}
IViewstateMoverModule IUmbracoSettings.ViewstateMoverModule
IViewStateMoverModuleSection IUmbracoSettingsSection.ViewStateMoverModule
{
get { return ViewstateMoverModule; }
}
ILogging IUmbracoSettings.Logging
ILoggingSection IUmbracoSettingsSection.Logging
{
get { return Logging; }
}
IScheduledTasks IUmbracoSettings.ScheduledTasks
IScheduledTasksSection IUmbracoSettingsSection.ScheduledTasks
{
get { return ScheduledTasks; }
}
IDistributedCall IUmbracoSettings.DistributedCall
IDistributedCallSection IUmbracoSettingsSection.DistributedCall
{
get { return DistributedCall; }
}
IRepositories IUmbracoSettings.PackageRepositories
IRepositoriesSection IUmbracoSettingsSection.PackageRepositories
{
get { return PackageRepositories; }
}
IProviders IUmbracoSettings.Providers
IProvidersSection IUmbracoSettingsSection.Providers
{
get { return Providers; }
}
IHelp IUmbracoSettings.Help
IHelpSection IUmbracoSettingsSection.Help
{
get { return Help; }
}
IWebRouting IUmbracoSettings.WebRouting
IWebRoutingSection IUmbracoSettingsSection.WebRouting
{
get { return WebRouting; }
}
IScripting IUmbracoSettings.Scripting
IScriptingSection IUmbracoSettingsSection.Scripting
{
get { return Scripting; }
}
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class ViewstateMoverModuleElement : ConfigurationElement, IViewstateMoverModule
internal class ViewstateMoverModuleElement : ConfigurationElement, IViewStateMoverModuleSection
{
[ConfigurationProperty("enable", DefaultValue = false)]
public bool Enable
@@ -2,7 +2,7 @@
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class WebRoutingElement : ConfigurationElement, IWebRouting
internal class WebRoutingElement : ConfigurationElement, IWebRoutingSection
{
[ConfigurationProperty("trySkipIisCustomErrors", DefaultValue = "false")]
public bool TrySkipIisCustomErrors
@@ -29,7 +29,7 @@ namespace Umbraco.Core.IO
internal FileSystemProviderManager()
{
_config = (FileSystemProvidersSection)ConfigurationManager.GetSection("FileSystemProviders");
_config = (FileSystemProvidersSection)ConfigurationManager.GetSection("umbracoConfiguration/FileSystemProviders");
}
#endregion
+1 -1
View File
@@ -419,7 +419,7 @@ namespace Umbraco.Core.Models
var supportsResizing = UmbracoConfiguration.Current.UmbracoSettings.Content.ImageFileTypes.InvariantContains(extension);
//the config section used to auto-fill properties
IContentImagingAutoFillUploadField uploadFieldConfigNode = null;
IImagingAutoFillUploadField uploadFieldConfigNode = null;
//Check for auto fill of additional properties
if (UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties != null)
@@ -11,9 +11,9 @@ namespace Umbraco.Core.Persistence
/// </summary>
public class RepositoryFactory
{
private readonly IUmbracoSettings _settings;
private readonly IUmbracoSettingsSection _settings;
public RepositoryFactory(IUmbracoSettings settings)
public RepositoryFactory(IUmbracoSettingsSection settings)
{
_settings = settings;
}
+15 -3
View File
@@ -8,6 +8,7 @@ using System.Text;
using System.Threading;
using System.Web.Compilation;
using System.Xml.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
@@ -445,7 +446,18 @@ namespace Umbraco.Core
}
/// <summary>
/// Returns all classes attributed with XsltExtensionAttribute attribute
/// Returns all classes of type IUmbracoConfigurationSection
/// </summary>
/// <returns></returns>
internal IEnumerable<Type> ResolveUmbracoConfigurationSections()
{
//don't cache the result since it's a one time lookup for a type anyways
//ONLY look in the CORE assembly for performance.
return ResolveTypes<IUmbracoConfigurationSection>(false, new[] { typeof(IUmbracoConfigurationSection).Assembly });
}
/// <summary>
/// Returns all classes of type ICacheRefresher
/// </summary>
/// <returns></returns>
internal IEnumerable<Type> ResolveCacheRefreshers()
@@ -729,10 +741,10 @@ namespace Umbraco.Core
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
internal IEnumerable<Type> ResolveTypes<T>(bool cacheResult = true)
internal IEnumerable<Type> ResolveTypes<T>(bool cacheResult = true, IEnumerable<Assembly> specificAssemblies = null)
{
return ResolveTypes<T>(
() => TypeFinder.FindClassesOfType<T>(AssembliesToScan),
() => TypeFinder.FindClassesOfType<T>(specificAssemblies ?? AssembliesToScan),
TypeResolutionKind.FindAllTypes,
cacheResult);
}
+19 -19
View File
@@ -144,9 +144,9 @@
<Compile Include="CodeAnnotations\UmbracoExperimentalFeatureAttribute.cs" />
<Compile Include="CodeAnnotations\UmbracoProposedPublicAttribute.cs" />
<Compile Include="ConcurrentHashSet.cs" />
<Compile Include="Configuration\BaseRest\IBaseRest.cs" />
<Compile Include="Configuration\BaseRest\IBaseRestSection.cs" />
<Compile Include="Configuration\BaseRest\IExtension.cs" />
<Compile Include="Configuration\BaseRest\IMethod.cs" />
<Compile Include="Configuration\BaseRest\IMethodSection.cs" />
<Compile Include="Configuration\CaseInsensitiveEnumConfigConverter.cs" />
<Compile Include="Configuration\ClientDependencyConfiguration.cs" />
<Compile Include="Configuration\ConfigurationKeyAttribute.cs" />
@@ -168,8 +168,8 @@
<Compile Include="Configuration\UmbracoSettings\ContentError404Collection.cs" />
<Compile Include="Configuration\UmbracoSettings\ContentErrorPageElement.cs" />
<Compile Include="Configuration\UmbracoSettings\ContentErrorsElement.cs" />
<Compile Include="Configuration\UmbracoSettings\ContentImagingAutoFillPropertiesCollection.cs" />
<Compile Include="Configuration\UmbracoSettings\ContentImagingAutoFillUploadFieldElement.cs" />
<Compile Include="Configuration\UmbracoSettings\ImagingAutoFillPropertiesCollection.cs" />
<Compile Include="Configuration\UmbracoSettings\ImagingAutoFillUploadFieldElement.cs" />
<Compile Include="Configuration\UmbracoSettings\ContentImagingElement.cs" />
<Compile Include="Configuration\UmbracoSettings\ContentScriptEditorElement.cs" />
<Compile Include="Configuration\UmbracoSettings\CustomBooleanTypeConverter.cs" />
@@ -182,30 +182,30 @@
<Compile Include="Configuration\UmbracoSettings\IChar.cs" />
<Compile Include="Configuration\UmbracoSettings\IContentSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IContentErrorPage.cs" />
<Compile Include="Configuration\UmbracoSettings\IContentImagingAutoFillUploadField.cs" />
<Compile Include="Configuration\UmbracoSettings\IDeveloper.cs" />
<Compile Include="Configuration\UmbracoSettings\IDistributedCall.cs" />
<Compile Include="Configuration\UmbracoSettings\IImagingAutoFillUploadField.cs" />
<Compile Include="Configuration\UmbracoSettings\IDeveloperSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IDistributedCallSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IFileExtension.cs" />
<Compile Include="Configuration\UmbracoSettings\IHelp.cs" />
<Compile Include="Configuration\UmbracoSettings\IHelpSection.cs" />
<Compile Include="Configuration\UmbracoSettings\ILink.cs" />
<Compile Include="Configuration\UmbracoSettings\ILogging.cs" />
<Compile Include="Configuration\UmbracoSettings\ILoggingSection.cs" />
<Compile Include="Configuration\UmbracoSettings\ILogType.cs" />
<Compile Include="Configuration\InnerTextConfigurationElement.cs" />
<Compile Include="Configuration\UmbracoSettings\INotDynamicXmlDocument.cs" />
<Compile Include="Configuration\UmbracoSettings\IProviders.cs" />
<Compile Include="Configuration\UmbracoSettings\IProvidersSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IRazorStaticMapping.cs" />
<Compile Include="Configuration\UmbracoSettings\IRepositories.cs" />
<Compile Include="Configuration\UmbracoSettings\IRepositoriesSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IRepository.cs" />
<Compile Include="Configuration\UmbracoSettings\IRequestHandler.cs" />
<Compile Include="Configuration\UmbracoSettings\IRequestHandlerSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IScheduledTask.cs" />
<Compile Include="Configuration\UmbracoSettings\IScheduledTasks.cs" />
<Compile Include="Configuration\UmbracoSettings\IScripting.cs" />
<Compile Include="Configuration\UmbracoSettings\ISecurity.cs" />
<Compile Include="Configuration\UmbracoSettings\IScheduledTasksSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IScriptingSection.cs" />
<Compile Include="Configuration\UmbracoSettings\ISecuritySection.cs" />
<Compile Include="Configuration\UmbracoSettings\IServer.cs" />
<Compile Include="Configuration\UmbracoSettings\ITemplates.cs" />
<Compile Include="Configuration\UmbracoSettings\IUmbracoSettings.cs" />
<Compile Include="Configuration\UmbracoSettings\IViewstateMoverModule.cs" />
<Compile Include="Configuration\UmbracoSettings\IWebRouting.cs" />
<Compile Include="Configuration\UmbracoSettings\ITemplatesSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IUmbracoSettingsSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IViewStateMoverModuleSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IWebRoutingSection.cs" />
<Compile Include="Configuration\UmbracoSettings\LinkElement.cs" />
<Compile Include="Configuration\UmbracoSettings\LinksCollection.cs" />
<Compile Include="Configuration\UmbracoSettings\LoggingElement.cs" />
@@ -13,36 +13,36 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
public override void DisableHtmlEmail()
{
Assert.IsTrue(Section.Content.DisableHtmlEmail == false);
Assert.IsTrue(SettingsSection.Content.DisableHtmlEmail == false);
}
[Test]
public override void Can_Set_Multiple()
{
Assert.IsTrue(Section.Content.Error404Collection.Count() == 1);
Assert.IsTrue(Section.Content.Error404Collection.ElementAt(0).Culture == null);
Assert.IsTrue(Section.Content.Error404Collection.ElementAt(0).ContentId == 1);
Assert.IsTrue(SettingsSection.Content.Error404Collection.Count() == 1);
Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(0).Culture == null);
Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(0).ContentId == 1);
}
[Test]
public override void ImageAutoFillProperties()
{
Assert.IsTrue(Section.Content.ImageAutoFillProperties.Count() == 1);
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(0).Alias == "umbracoFile");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(0).WidthFieldAlias == "umbracoWidth");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(0).HeightFieldAlias == "umbracoHeight");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(0).LengthFieldAlias == "umbracoBytes");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(0).ExtensionFieldAlias == "umbracoExtension");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.Count() == 1);
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).Alias == "umbracoFile");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).WidthFieldAlias == "umbracoWidth");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).HeightFieldAlias == "umbracoHeight");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).LengthFieldAlias == "umbracoBytes");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).ExtensionFieldAlias == "umbracoExtension");
}
public override void TidyCharEncoding()
{
Assert.IsTrue(Section.Content.TidyCharEncoding == "UTF8");
Assert.IsTrue(SettingsSection.Content.TidyCharEncoding == "UTF8");
}
public override void XmlContentCheckForDiskChanges()
{
Assert.IsTrue(Section.Content.XmlContentCheckForDiskChanges == false);
Assert.IsTrue(SettingsSection.Content.XmlContentCheckForDiskChanges == false);
}
}
}
@@ -1,10 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Net.Configuration;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
namespace Umbraco.Tests.Configurations.UmbracoSettings
{
@@ -14,172 +12,172 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void EmailAddress()
{
Assert.IsTrue(Section.Content.NotificationEmailAddress == "robot@umbraco.dk");
Assert.IsTrue(SettingsSection.Content.NotificationEmailAddress == "robot@umbraco.dk");
}
[Test]
public virtual void DisableHtmlEmail()
{
Assert.IsTrue(Section.Content.DisableHtmlEmail == true);
Assert.IsTrue(SettingsSection.Content.DisableHtmlEmail == true);
}
[Test]
public virtual void Can_Set_Multiple()
{
Assert.IsTrue(Section.Content.Error404Collection.Count() == 3);
Assert.IsTrue(Section.Content.Error404Collection.ElementAt(0).Culture == "default");
Assert.IsTrue(Section.Content.Error404Collection.ElementAt(0).ContentId == 1047);
Assert.IsTrue(Section.Content.Error404Collection.ElementAt(1).Culture == "en-US");
Assert.IsTrue(Section.Content.Error404Collection.ElementAt(1).ContentId == 1048);
Assert.IsTrue(Section.Content.Error404Collection.ElementAt(2).Culture == "en-UK");
Assert.IsTrue(Section.Content.Error404Collection.ElementAt(2).ContentId == 1049);
Assert.IsTrue(SettingsSection.Content.Error404Collection.Count() == 3);
Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(0).Culture == "default");
Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(0).ContentId == 1047);
Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(1).Culture == "en-US");
Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(1).ContentId == 1048);
Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(2).Culture == "en-UK");
Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(2).ContentId == 1049);
}
[Test]
public void ScriptFolderPath()
{
Assert.IsTrue(Section.Content.ScriptFolderPath == "/scripts");
Assert.IsTrue(SettingsSection.Content.ScriptFolderPath == "/scripts");
}
[Test]
public void ScriptFileTypes()
{
Assert.IsTrue(Section.Content.ScriptFileTypes.All(x => "js,xml".Split(',').Contains(x)));
Assert.IsTrue(SettingsSection.Content.ScriptFileTypes.All(x => "js,xml".Split(',').Contains(x)));
}
[Test]
public void DisableScriptEditor()
{
Assert.IsTrue(Section.Content.ScriptEditorDisable == false);
Assert.IsTrue(SettingsSection.Content.ScriptEditorDisable == false);
}
[Test]
public void ImageFileTypes()
{
Assert.IsTrue(Section.Content.ImageFileTypes.All(x => "jpeg,jpg,gif,bmp,png,tiff,tif".Split(',').Contains(x)));
Assert.IsTrue(SettingsSection.Content.ImageFileTypes.All(x => "jpeg,jpg,gif,bmp,png,tiff,tif".Split(',').Contains(x)));
}
[Test]
public void AllowedAttributes()
{
Assert.IsTrue(Section.Content.ImageTagAllowedAttributes.All(x => "src,alt,border,class,style,align,id,name,onclick,usemap".Split(',').Contains(x)));
Assert.IsTrue(SettingsSection.Content.ImageTagAllowedAttributes.All(x => "src,alt,border,class,style,align,id,name,onclick,usemap".Split(',').Contains(x)));
}
[Test]
public virtual void ImageAutoFillProperties()
{
Assert.IsTrue(Section.Content.ImageAutoFillProperties.Count() == 2);
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(0).Alias == "umbracoFile");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(0).WidthFieldAlias == "umbracoWidth");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(0).HeightFieldAlias == "umbracoHeight");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(0).LengthFieldAlias == "umbracoBytes");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(0).ExtensionFieldAlias == "umbracoExtension");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(1).Alias == "umbracoFile2");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(1).WidthFieldAlias == "umbracoWidth2");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(1).HeightFieldAlias == "umbracoHeight2");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(1).LengthFieldAlias == "umbracoBytes2");
Assert.IsTrue(Section.Content.ImageAutoFillProperties.ElementAt(1).ExtensionFieldAlias == "umbracoExtension2");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.Count() == 2);
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).Alias == "umbracoFile");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).WidthFieldAlias == "umbracoWidth");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).HeightFieldAlias == "umbracoHeight");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).LengthFieldAlias == "umbracoBytes");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).ExtensionFieldAlias == "umbracoExtension");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).Alias == "umbracoFile2");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).WidthFieldAlias == "umbracoWidth2");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).HeightFieldAlias == "umbracoHeight2");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).LengthFieldAlias == "umbracoBytes2");
Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).ExtensionFieldAlias == "umbracoExtension2");
}
[Test]
public void UploadAllowDirectories()
{
Assert.IsTrue(Section.Content.UploadAllowDirectories == true);
Assert.IsTrue(SettingsSection.Content.UploadAllowDirectories == true);
}
[Test]
public void DefaultDocumentTypeProperty()
{
Assert.IsTrue(Section.Content.DefaultDocumentTypeProperty == "Textstring");
Assert.IsTrue(SettingsSection.Content.DefaultDocumentTypeProperty == "Textstring");
}
[Test]
public void GlobalPreviewStorageEnabled()
{
Assert.IsTrue(Section.Content.GlobalPreviewStorageEnabled == false);
Assert.IsTrue(SettingsSection.Content.GlobalPreviewStorageEnabled == false);
}
[Test]
public void CloneXmlContent()
{
Assert.IsTrue(Section.Content.CloneXmlContent == true);
Assert.IsTrue(SettingsSection.Content.CloneXmlContent == true);
}
[Test]
public void EnsureUniqueNaming()
{
Assert.IsTrue(Section.Content.EnsureUniqueNaming == true);
Assert.IsTrue(SettingsSection.Content.EnsureUniqueNaming == true);
}
[Test]
public void TidyEditorContent()
{
Assert.IsTrue(Section.Content.TidyEditorContent == false);
Assert.IsTrue(SettingsSection.Content.TidyEditorContent == false);
}
[Test]
public virtual void TidyCharEncoding()
{
Assert.IsTrue(Section.Content.TidyCharEncoding == "Raw");
Assert.IsTrue(SettingsSection.Content.TidyCharEncoding == "Raw");
}
[Test]
public void UseLegacyXmlSchema()
{
Assert.IsTrue(Section.Content.UseLegacyXmlSchema == false);
Assert.IsTrue(SettingsSection.Content.UseLegacyXmlSchema == false);
}
[Test]
public void ForceSafeAliases()
{
Assert.IsTrue(Section.Content.ForceSafeAliases == true);
Assert.IsTrue(SettingsSection.Content.ForceSafeAliases == true);
}
[Test]
public void XmlCacheEnabled()
{
Assert.IsTrue(Section.Content.XmlCacheEnabled == true);
Assert.IsTrue(SettingsSection.Content.XmlCacheEnabled == true);
}
[Test]
public void ContinouslyUpdateXmlDiskCache()
{
Assert.IsTrue(Section.Content.ContinouslyUpdateXmlDiskCache == true);
Assert.IsTrue(SettingsSection.Content.ContinouslyUpdateXmlDiskCache == true);
}
[Test]
public virtual void XmlContentCheckForDiskChanges()
{
Assert.IsTrue(Section.Content.XmlContentCheckForDiskChanges == true);
Assert.IsTrue(SettingsSection.Content.XmlContentCheckForDiskChanges == true);
}
[Test]
public void EnableSplashWhileLoading()
{
Assert.IsTrue(Section.Content.EnableSplashWhileLoading == false);
Assert.IsTrue(SettingsSection.Content.EnableSplashWhileLoading == false);
}
[Test]
public void PropertyContextHelpOption()
{
Assert.IsTrue(Section.Content.PropertyContextHelpOption == "text");
Assert.IsTrue(SettingsSection.Content.PropertyContextHelpOption == "text");
}
[Test]
public void EnableCanvasEditing()
{
Assert.IsTrue(Section.Content.EnableCanvasEditing == false);
Assert.IsTrue(SettingsSection.Content.EnableCanvasEditing == false);
}
[Test]
public void PreviewBadge()
{
Assert.IsTrue(Section.Content.PreviewBadge == @"<a id=""umbracoPreviewBadge"" style=""position: absolute; top: 0; right: 0; border: 0; width: 149px; height: 149px; background: url('{1}/preview/previewModeBadge.png') no-repeat;"" href=""{0}/endPreview.aspx?redir={2}""><span style=""display:none;"">In Preview Mode - click to end</span></a>");
Assert.IsTrue(SettingsSection.Content.PreviewBadge == @"<a id=""umbracoPreviewBadge"" style=""position: absolute; top: 0; right: 0; border: 0; width: 149px; height: 149px; background: url('{1}/preview/previewModeBadge.png') no-repeat;"" href=""{0}/endPreview.aspx?redir={2}""><span style=""display:none;"">In Preview Mode - click to end</span></a>");
}
[Test]
public void UmbracoLibraryCacheDuration()
{
Assert.IsTrue(Section.Content.UmbracoLibraryCacheDuration == 1800);
Assert.IsTrue(SettingsSection.Content.UmbracoLibraryCacheDuration == 1800);
}
[Test]
public void ResolveUrlsFromTextString()
{
Assert.IsTrue(Section.Content.ResolveUrlsFromTextString);
Assert.IsTrue(SettingsSection.Content.ResolveUrlsFromTextString);
}
[Test]
public void MacroErrors()
{
Assert.IsTrue(Section.Content.MacroErrorBehaviour == MacroErrorBehaviour.Inline);
Assert.IsTrue(SettingsSection.Content.MacroErrorBehaviour == MacroErrorBehaviour.Inline);
}
[Test]
public void DocumentTypeIconList()
{
Assert.IsTrue(Section.Content.IconPickerBehaviour == IconPickerBehaviour.HideFileDuplicates);
Assert.IsTrue(SettingsSection.Content.IconPickerBehaviour == IconPickerBehaviour.HideFileDuplicates);
}
[Test]
public void DisallowedUploadFiles()
{
Assert.IsTrue(Section.Content.DisallowedUploadFiles.All(x => "ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd".Split(',').Contains(x)));
Assert.IsTrue(SettingsSection.Content.DisallowedUploadFiles.All(x => "ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd".Split(',').Contains(x)));
}
}
}
@@ -9,8 +9,8 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void AppCodeFileExtensions()
{
Assert.IsTrue(Section.Developer.AppCodeFileExtensions.Count() == 2);
Assert.IsTrue(Section.Developer.AppCodeFileExtensions.All(
Assert.IsTrue(SettingsSection.Developer.AppCodeFileExtensions.Count() == 2);
Assert.IsTrue(SettingsSection.Developer.AppCodeFileExtensions.All(
x => "cs,vb".Split(',').Contains(x.Extension)));
}
}
@@ -14,14 +14,14 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public override void Enabled()
{
Assert.IsTrue(Section.DistributedCall.Enabled == false);
Assert.IsTrue(SettingsSection.DistributedCall.Enabled == false);
}
[Test]
public override void Servers()
{
Assert.IsTrue(Section.DistributedCall.Servers.Count() == 0);
Assert.IsTrue(SettingsSection.DistributedCall.Servers.Count() == 0);
}
}
}
@@ -9,23 +9,23 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public virtual void Enabled()
{
Assert.IsTrue(Section.DistributedCall.Enabled == true);
Assert.IsTrue(SettingsSection.DistributedCall.Enabled == true);
}
[Test]
public void UserId()
{
Assert.IsTrue(Section.DistributedCall.UserId == 0);
Assert.IsTrue(SettingsSection.DistributedCall.UserId == 0);
}
[Test]
public virtual void Servers()
{
Assert.IsTrue(Section.DistributedCall.Servers.Count() == 2);
Assert.IsTrue(Section.DistributedCall.Servers.ElementAt(0).ServerAddress == "127.0.0.1");
Assert.IsTrue(Section.DistributedCall.Servers.ElementAt(1).ServerAddress == "127.0.0.2");
Assert.IsTrue(Section.DistributedCall.Servers.ElementAt(1).ForceProtocol == "https");
Assert.IsTrue(Section.DistributedCall.Servers.ElementAt(1).ForcePortnumber == "443");
Assert.IsTrue(SettingsSection.DistributedCall.Servers.Count() == 2);
Assert.IsTrue(SettingsSection.DistributedCall.Servers.ElementAt(0).ServerAddress == "127.0.0.1");
Assert.IsTrue(SettingsSection.DistributedCall.Servers.ElementAt(1).ServerAddress == "127.0.0.2");
Assert.IsTrue(SettingsSection.DistributedCall.Servers.ElementAt(1).ForceProtocol == "https");
Assert.IsTrue(SettingsSection.DistributedCall.Servers.ElementAt(1).ForcePortnumber == "443");
}
}
@@ -14,7 +14,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public override void Links()
{
Assert.IsTrue(Section.Help.Links.Count() == 0);
Assert.IsTrue(SettingsSection.Help.Links.Count() == 0);
}
}
}
@@ -9,23 +9,23 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void DefaultUrl()
{
Assert.IsTrue(Section.Help.DefaultUrl == "http://our.umbraco.org/wiki/umbraco-help/{0}/{1}");
Assert.IsTrue(SettingsSection.Help.DefaultUrl == "http://our.umbraco.org/wiki/umbraco-help/{0}/{1}");
}
[Test]
public virtual void Links()
{
Assert.IsTrue(Section.Help.Links.Count() == 2);
Assert.IsTrue(Section.Help.Links.ElementAt(0).Application == "content");
Assert.IsTrue(Section.Help.Links.ElementAt(0).ApplicationUrl == "dashboard.aspx");
Assert.IsTrue(Section.Help.Links.ElementAt(0).Language == "en");
Assert.IsTrue(Section.Help.Links.ElementAt(0).UserType == "Administrators");
Assert.IsTrue(Section.Help.Links.ElementAt(0).HelpUrl == "http://www.xyz.no?{0}/{1}/{2}/{3}");
Assert.IsTrue(Section.Help.Links.ElementAt(1).Application == "media");
Assert.IsTrue(Section.Help.Links.ElementAt(1).ApplicationUrl == "dashboard2.aspx");
Assert.IsTrue(Section.Help.Links.ElementAt(1).Language == "ch");
Assert.IsTrue(Section.Help.Links.ElementAt(1).UserType == "Writers");
Assert.IsTrue(Section.Help.Links.ElementAt(1).HelpUrl == "http://www.abc.no?{0}/{1}/{2}/{3}");
Assert.IsTrue(SettingsSection.Help.Links.Count() == 2);
Assert.IsTrue(SettingsSection.Help.Links.ElementAt(0).Application == "content");
Assert.IsTrue(SettingsSection.Help.Links.ElementAt(0).ApplicationUrl == "dashboard.aspx");
Assert.IsTrue(SettingsSection.Help.Links.ElementAt(0).Language == "en");
Assert.IsTrue(SettingsSection.Help.Links.ElementAt(0).UserType == "Administrators");
Assert.IsTrue(SettingsSection.Help.Links.ElementAt(0).HelpUrl == "http://www.xyz.no?{0}/{1}/{2}/{3}");
Assert.IsTrue(SettingsSection.Help.Links.ElementAt(1).Application == "media");
Assert.IsTrue(SettingsSection.Help.Links.ElementAt(1).ApplicationUrl == "dashboard2.aspx");
Assert.IsTrue(SettingsSection.Help.Links.ElementAt(1).Language == "ch");
Assert.IsTrue(SettingsSection.Help.Links.ElementAt(1).UserType == "Writers");
Assert.IsTrue(SettingsSection.Help.Links.ElementAt(1).HelpUrl == "http://www.abc.no?{0}/{1}/{2}/{3}");
}
}
}
@@ -14,37 +14,37 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public override void ExternalLoggerConfigured()
{
Assert.IsTrue(Section.Logging.ExternalLoggerIsConfigured == false);
Assert.IsTrue(SettingsSection.Logging.ExternalLoggerIsConfigured == false);
}
[Test]
public override void ExternalLogger_Assembly()
{
Assert.IsTrue(Section.Logging.ExternalLoggerIsConfigured == false);
Assert.IsTrue(SettingsSection.Logging.ExternalLoggerIsConfigured == false);
}
[Test]
public override void ExternalLogger_LogAuditTrail()
{
Assert.IsTrue(Section.Logging.ExternalLoggerIsConfigured == false);
Assert.IsTrue(SettingsSection.Logging.ExternalLoggerIsConfigured == false);
}
[Test]
public override void ExternalLogger_Type()
{
Assert.IsTrue(Section.Logging.ExternalLoggerIsConfigured == false);
Assert.IsTrue(SettingsSection.Logging.ExternalLoggerIsConfigured == false);
}
[Test]
public override void DisabledLogTypes()
{
Assert.IsTrue(Section.Logging.DisabledLogTypes.Count() == 0);
Assert.IsTrue(SettingsSection.Logging.DisabledLogTypes.Count() == 0);
}
[Test]
public override void CleaningMiliseconds()
{
Assert.IsTrue(Section.Logging.CleaningMiliseconds == -1);
Assert.IsTrue(SettingsSection.Logging.CleaningMiliseconds == -1);
}
[Test]
public override void MaxLogAge()
{
Assert.IsTrue(Section.Logging.MaxLogAge == -1);
Assert.IsTrue(SettingsSection.Logging.MaxLogAge == -1);
}
}
}
@@ -9,57 +9,57 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public virtual void ExternalLoggerConfigured()
{
Assert.IsTrue(Section.Logging.ExternalLoggerIsConfigured == true);
Assert.IsTrue(SettingsSection.Logging.ExternalLoggerIsConfigured == true);
}
[Test]
public void EnableLogging()
{
Assert.IsTrue(Section.Logging.EnableLogging == true);
Assert.IsTrue(SettingsSection.Logging.EnableLogging == true);
}
[Test]
public void EnableAsyncLogging()
{
Assert.IsTrue(Section.Logging.EnableAsyncLogging == true);
Assert.IsTrue(SettingsSection.Logging.EnableAsyncLogging == true);
}
[Test]
public virtual void DisabledLogTypes()
{
Assert.IsTrue(Section.Logging.DisabledLogTypes.Count() == 2);
Assert.IsTrue(Section.Logging.DisabledLogTypes.ElementAt(0).LogTypeAlias == "[alias-of-log-type-in-lowercase]");
Assert.IsTrue(Section.Logging.DisabledLogTypes.ElementAt(1).LogTypeAlias == "anotherlogalias");
Assert.IsTrue(SettingsSection.Logging.DisabledLogTypes.Count() == 2);
Assert.IsTrue(SettingsSection.Logging.DisabledLogTypes.ElementAt(0).LogTypeAlias == "[alias-of-log-type-in-lowercase]");
Assert.IsTrue(SettingsSection.Logging.DisabledLogTypes.ElementAt(1).LogTypeAlias == "anotherlogalias");
}
[Test]
public virtual void ExternalLogger_Assembly()
{
Assert.IsTrue(Section.Logging.ExternalLoggerAssembly == "~/bin/assemblyFileName.dll");
Assert.IsTrue(SettingsSection.Logging.ExternalLoggerAssembly == "~/bin/assemblyFileName.dll");
}
[Test]
public virtual void ExternalLogger_Type()
{
Assert.IsTrue(Section.Logging.ExternalLoggerType == "fully.qualified.namespace.and.type");
Assert.IsTrue(SettingsSection.Logging.ExternalLoggerType == "fully.qualified.namespace.and.type");
}
[Test]
public virtual void ExternalLogger_LogAuditTrail()
{
Assert.IsTrue(Section.Logging.ExternalLoggerEnableAuditTrail == false);
Assert.IsTrue(SettingsSection.Logging.ExternalLoggerEnableAuditTrail == false);
}
[Test]
public void AutoCleanLogs()
{
Assert.IsTrue(Section.Logging.AutoCleanLogs == false);
Assert.IsTrue(SettingsSection.Logging.AutoCleanLogs == false);
}
[Test]
public virtual void CleaningMiliseconds()
{
Assert.IsTrue(Section.Logging.CleaningMiliseconds == 86400);
Assert.IsTrue(SettingsSection.Logging.CleaningMiliseconds == 86400);
}
[Test]
public virtual void MaxLogAge()
{
Assert.IsTrue(Section.Logging.MaxLogAge == 1440);
Assert.IsTrue(SettingsSection.Logging.MaxLogAge == 1440);
}
@@ -15,9 +15,9 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public override void Repositories()
{
Assert.IsTrue(Section.PackageRepositories.Repositories.Count() == 1);
Assert.IsTrue(Section.PackageRepositories.Repositories.ElementAt(0).Id == Guid.Parse("65194810-1f85-11dd-bd0b-0800200c9a66"));
Assert.IsTrue(Section.PackageRepositories.Repositories.ElementAt(0).Name == "Umbraco package Repository");
Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.Count() == 1);
Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).Id == Guid.Parse("65194810-1f85-11dd-bd0b-0800200c9a66"));
Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).Name == "Umbraco package Repository");
}
}
}
@@ -10,11 +10,11 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public virtual void Repositories()
{
Assert.IsTrue(Section.PackageRepositories.Repositories.Count() == 2);
Assert.IsTrue(Section.PackageRepositories.Repositories.ElementAt(0).Id == Guid.Parse("65194810-1f85-11dd-bd0b-0800200c9a66"));
Assert.IsTrue(Section.PackageRepositories.Repositories.ElementAt(0).Name == "Umbraco package Repository");
Assert.IsTrue(Section.PackageRepositories.Repositories.ElementAt(1).Id == Guid.Parse("163245E0-CD22-44B6-841A-1B9B9D2E955F"));
Assert.IsTrue(Section.PackageRepositories.Repositories.ElementAt(1).Name == "Test Repo");
Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.Count() == 2);
Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).Id == Guid.Parse("65194810-1f85-11dd-bd0b-0800200c9a66"));
Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).Name == "Umbraco package Repository");
Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(1).Id == Guid.Parse("163245E0-CD22-44B6-841A-1B9B9D2E955F"));
Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(1).Name == "Test Repo");
}
}
}
@@ -8,7 +8,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void Users()
{
Assert.IsTrue(Section.Providers.DefaultBackOfficeUserProvider == "UsersMembershipProvider");
Assert.IsTrue(SettingsSection.Providers.DefaultBackOfficeUserProvider == "UsersMembershipProvider");
}
}
}
@@ -10,18 +10,18 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void UseDomainPrefixes()
{
Assert.IsTrue(Section.RequestHandler.UseDomainPrefixes == false);
Assert.IsTrue(SettingsSection.RequestHandler.UseDomainPrefixes == false);
}
[Test]
public void AddTrailingSlash()
{
Assert.IsTrue(Section.RequestHandler.AddTrailingSlash == true);
Assert.IsTrue(SettingsSection.RequestHandler.AddTrailingSlash == true);
}
[Test]
public void RemoveDoubleDashes()
{
Assert.IsTrue(Section.RequestHandler.RemoveDoubleDashes == true);
Assert.IsTrue(SettingsSection.RequestHandler.RemoveDoubleDashes == true);
}
[Test]
@@ -29,14 +29,14 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
{
var chars = @" ,"",',%,.,;,/,\,:,#,+,*,&,?,æ,ø,å,ä,ö,ü,ß,Ä,Ö,|,<,>";
var items = chars.Split(',');
Assert.AreEqual(items.Length, Section.RequestHandler.CharCollection.Count());
Assert.IsTrue(Section.RequestHandler.CharCollection
Assert.AreEqual(items.Length, SettingsSection.RequestHandler.CharCollection.Count());
Assert.IsTrue(SettingsSection.RequestHandler.CharCollection
.All(x => items.Contains(x.Char)));
var vals = @"-,plus,star,ae,oe,aa,ae,oe,ue,ss,ae,oe,-";
var splitVals = vals.Split(',');
Assert.AreEqual(splitVals.Length, Section.RequestHandler.CharCollection.Count(x => x.Replacement.IsNullOrWhiteSpace() == false));
Assert.IsTrue(Section.RequestHandler.CharCollection
Assert.AreEqual(splitVals.Length, SettingsSection.RequestHandler.CharCollection.Count(x => x.Replacement.IsNullOrWhiteSpace() == false));
Assert.IsTrue(SettingsSection.RequestHandler.CharCollection
.All(x => string.IsNullOrEmpty(x.Replacement) || vals.Split(',').Contains(x.Replacement)));
}
@@ -14,7 +14,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public override void Tasks()
{
Assert.IsTrue(Section.ScheduledTasks.Tasks.Count() == 0);
Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.Count() == 0);
}
}
}
@@ -9,15 +9,15 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public virtual void Tasks()
{
Assert.IsTrue(Section.ScheduledTasks.Tasks.Count() == 2);
Assert.IsTrue(Section.ScheduledTasks.Tasks.ElementAt(0).Alias == "test60");
Assert.IsTrue(Section.ScheduledTasks.Tasks.ElementAt(0).Log == true);
Assert.IsTrue(Section.ScheduledTasks.Tasks.ElementAt(0).Interval == 60);
Assert.IsTrue(Section.ScheduledTasks.Tasks.ElementAt(0).Url == "http://localhost/umbraco/test.aspx");
Assert.IsTrue(Section.ScheduledTasks.Tasks.ElementAt(1).Alias == "testtest");
Assert.IsTrue(Section.ScheduledTasks.Tasks.ElementAt(1).Log == false);
Assert.IsTrue(Section.ScheduledTasks.Tasks.ElementAt(1).Interval == 61);
Assert.IsTrue(Section.ScheduledTasks.Tasks.ElementAt(1).Url == "http://localhost/umbraco/test1.aspx");
Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.Count() == 2);
Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.ElementAt(0).Alias == "test60");
Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.ElementAt(0).Log == true);
Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.ElementAt(0).Interval == 60);
Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.ElementAt(0).Url == "http://localhost/umbraco/test.aspx");
Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.ElementAt(1).Alias == "testtest");
Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.ElementAt(1).Log == false);
Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.ElementAt(1).Interval == 61);
Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.ElementAt(1).Url == "http://localhost/umbraco/test1.aspx");
}
}
@@ -14,7 +14,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public override void DataTypeModelStaticMappings()
{
Assert.AreEqual(0, Section.Scripting.DataTypeModelStaticMappings.Count());
Assert.AreEqual(0, SettingsSection.Scripting.DataTypeModelStaticMappings.Count());
}
}
@@ -10,14 +10,14 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void NotDynamicXmlDocumentElements()
{
Assert.IsTrue(Section.Scripting.NotDynamicXmlDocumentElements
Assert.IsTrue(SettingsSection.Scripting.NotDynamicXmlDocumentElements
.All(x => "p,div,ul,span".Split(',').Contains(x.Element)));
}
[Test]
public virtual void DataTypeModelStaticMappings()
{
var mappings = Section.Scripting.DataTypeModelStaticMappings.ToArray();
var mappings = SettingsSection.Scripting.DataTypeModelStaticMappings.ToArray();
Assert.IsTrue(mappings[0].DataTypeGuid == Guid.Parse("A3DB4034-BCB0-4E69-B3EE-DD4E6ECA74C2"));
Assert.IsTrue(mappings[0].MappingName == "MyName.1");
@@ -8,22 +8,22 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void KeepUserLoggedIn()
{
Assert.IsTrue(Section.Security.KeepUserLoggedIn == true);
Assert.IsTrue(SettingsSection.Security.KeepUserLoggedIn == true);
}
[Test]
public void HideDisabledUsersInBackoffice()
{
Assert.IsTrue(Section.Security.HideDisabledUsersInBackoffice == false);
Assert.IsTrue(SettingsSection.Security.HideDisabledUsersInBackoffice == false);
}
[Test]
public void AuthCookieDomain()
{
Assert.IsTrue(Section.Security.AuthCookieDomain == null);
Assert.IsTrue(SettingsSection.Security.AuthCookieDomain == null);
}
[Test]
public void AuthCookieName()
{
Assert.IsTrue(Section.Security.AuthCookieName == "UMB_UCONTEXT");
Assert.IsTrue(SettingsSection.Security.AuthCookieName == "UMB_UCONTEXT");
}
}
}
@@ -9,22 +9,22 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void UseAspNetMasterPages()
{
Assert.IsTrue(Section.Templates.UseAspNetMasterPages == true);
Assert.IsTrue(SettingsSection.Templates.UseAspNetMasterPages == true);
}
[Test]
public void EnableSkinSupport()
{
Assert.IsTrue(Section.Templates.EnableSkinSupport);
Assert.IsTrue(SettingsSection.Templates.EnableSkinSupport);
}
[Test]
public void DefaultRenderingEngine()
{
Assert.IsTrue(Section.Templates.DefaultRenderingEngine == RenderingEngine.Mvc);
Assert.IsTrue(SettingsSection.Templates.DefaultRenderingEngine == RenderingEngine.Mvc);
}
[Test]
public void EnableTemplateFolders()
{
Assert.IsTrue(Section.Templates.EnableTemplateFolders == false);
Assert.IsTrue(SettingsSection.Templates.EnableTemplateFolders == false);
}
}
}
@@ -1,6 +1,7 @@
using System.Configuration;
using System.IO;
using NUnit.Framework;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Tests.TestHelpers;
@@ -24,18 +25,19 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
if (TestingDefaults)
{
Section = configuration.GetSection("umbracoConfiguration/defaultSettings") as UmbracoSettingsSection;
SettingsSection = configuration.GetSection("umbracoConfiguration/defaultSettings") as UmbracoSettingsSection;
}
else
{
Section = configuration.GetSection("umbracoConfiguration/settings") as UmbracoSettingsSection;
//Section = configuration.GetSection("umbracoConfiguration/settings") as UmbracoSettingsSection;
SettingsSection = UmbracoConfiguration.For<IUmbracoSettingsSection>(configuration);
}
Assert.IsNotNull(Section);
Assert.IsNotNull(SettingsSection);
}
protected IUmbracoSettings Section { get; private set; }
protected IUmbracoSettingsSection SettingsSection { get; private set; }
}
}
@@ -8,7 +8,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void Enable()
{
Assert.IsTrue(Section.ViewstateMoverModule.Enable == false);
Assert.IsTrue(SettingsSection.ViewStateMoverModule.Enable == false);
}
}
}
@@ -8,19 +8,19 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void TrySkipIisCustomErrors()
{
Assert.IsTrue(Section.WebRouting.TrySkipIisCustomErrors == false);
Assert.IsTrue(SettingsSection.WebRouting.TrySkipIisCustomErrors == false);
}
[Test]
public void InternalRedirectPreservesTemplate()
{
Assert.IsTrue(Section.WebRouting.TrySkipIisCustomErrors == false);
Assert.IsTrue(SettingsSection.WebRouting.TrySkipIisCustomErrors == false);
}
[Test]
public void UrlProviderMode()
{
Assert.IsTrue(Section.WebRouting.UrlProviderMode == "Auto");
Assert.IsTrue(SettingsSection.WebRouting.UrlProviderMode == "Auto");
}
}
}
@@ -81,7 +81,7 @@ namespace Umbraco.Tests.PublishedCache
//ensure the StateHelper is using our custom context
StateHelper.HttpContext = _httpContextFactory.HttpContext;
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.Content.UseLegacyXmlSchema).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -106,7 +106,7 @@ namespace Umbraco.Tests.PublishedCache
private void SetupForLegacy()
{
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.Content.UseLegacyXmlSchema).Return(true);
SettingsForTests.ConfigureSettings(settings);
@@ -19,7 +19,7 @@ namespace Umbraco.Tests.PublishedContent
{
base.TestSetup();
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.Content.ForceSafeAliases).Return(true);
settings.Stub(x => x.Content.UmbracoLibraryCacheDuration).Return(1800);
SettingsForTests.ConfigureSettings(settings);
@@ -33,7 +33,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = false;
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.AddTrailingSlash).Return(false);// (cached routes have none)
SettingsForTests.ConfigureSettings(settings);
@@ -99,7 +99,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = false;
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -125,7 +125,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = true;
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -142,7 +142,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.HideTopLevelNodeFromPath = false;
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -167,7 +167,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.HideTopLevelNodeFromPath = false;
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -206,7 +206,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = false; // ignored w/domains
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -238,7 +238,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = false; // ignored w/domains
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -262,7 +262,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = false; // ignored w/domains
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -292,7 +292,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = false; // ignored w/domains
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -312,7 +312,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = false; // ignored w/domains
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -380,7 +380,7 @@ namespace Umbraco.Tests.Routing
SetDomains4();
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -28,7 +28,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = false; // ignored w/domains
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(true);
SettingsForTests.ConfigureSettings(settings);
@@ -66,7 +66,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = false;
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -87,7 +87,7 @@ namespace Umbraco.Tests.Routing
SettingsForTests.UseDirectoryUrls = true;
SettingsForTests.HideTopLevelNodeFromPath = false;
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.UseDomainPrefixes).Return(false);
SettingsForTests.ConfigureSettings(settings);
@@ -30,12 +30,15 @@ namespace Umbraco.Tests.TestHelpers
TestHelper.SetupLog4NetForTests();
TestHelper.InitializeContentDirectories();
TestHelper.EnsureUmbracoSettingsConfig();
//mock the Umbraco settings that we need
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
//var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = SettingsForTests.GetDefault();
settings.Stub(x => x.Content.UseLegacyXmlSchema).Return(false);
settings.Stub(x => x.Content.ForceSafeAliases).Return(true);
settings.Stub(x => x.Content.UmbracoLibraryCacheDuration).Return(1800);
SettingsForTests.ConfigureSettings(settings);
//Create the legacy prop-eds mapping
LegacyPropertyEditorIdToAliasConverter.CreateMappingsForCoreEditors();
@@ -19,7 +19,7 @@ namespace Umbraco.Tests.TestHelpers
/// Sets the umbraco settings singleton to the object specified
/// </summary>
/// <param name="settings"></param>
public static void ConfigureSettings(IUmbracoSettings settings)
public static void ConfigureSettings(IUmbracoSettingsSection settings)
{
UmbracoConfiguration.Current.UmbracoSettings = settings;
}
@@ -185,7 +185,7 @@ namespace Umbraco.Tests.TestHelpers
ConfigureSettings(GetDefault());
}
internal static IUmbracoSettings GetDefault()
internal static IUmbracoSettingsSection GetDefault()
{
var config = new FileInfo(TestHelper.MapPathForTest("~/Configurations/UmbracoSettings/web.config"));
@@ -113,6 +113,7 @@ namespace Umbraco.Tests.TestHelpers
}
}
//TODO: With the new config updates, I'm pretty sure this isn't needed?
public static void EnsureUmbracoSettingsConfig()
{
var currDir = new DirectoryInfo(CurrentAssemblyDirectory);
+1 -1
View File
@@ -87,7 +87,7 @@ namespace Umbraco.Tests
{
ConfigurationManager.AppSettings.Set("umbracoUseDirectoryUrls", directoryUrls ? "true" : "false");
var settings = MockRepository.GenerateStub<IUmbracoSettings>();
var settings = MockRepository.GenerateStub<IUmbracoSettingsSection>();
settings.Stub(x => x.RequestHandler.AddTrailingSlash).Return(trailingSlash);
SettingsForTests.ConfigureSettings(settings);
@@ -95,7 +95,7 @@ namespace Umbraco.Web.PropertyEditors
}
}
private static void ResetProperties(IContentImagingAutoFillUploadField uploadFieldConfigNode, IContentBase content)
private static void ResetProperties(IImagingAutoFillUploadField uploadFieldConfigNode, IContentBase content)
{
if (content.Properties[uploadFieldConfigNode.WidthFieldAlias] != null)
content.Properties[uploadFieldConfigNode.WidthFieldAlias].Value = string.Empty;
@@ -110,7 +110,7 @@ namespace Umbraco.Web.PropertyEditors
content.Properties[uploadFieldConfigNode.ExtensionFieldAlias].Value = string.Empty;
}
private static void FillProperties(IContentImagingAutoFillUploadField uploadFieldConfigNode, IContentBase content, UmbracoMediaFile um)
private static void FillProperties(IImagingAutoFillUploadField uploadFieldConfigNode, IContentBase content, UmbracoMediaFile um)
{
var size = um.SupportsResizing ? (Size?)um.GetDimensions() : null;
@@ -27,7 +27,7 @@ namespace umbraco.presentation
void IHttpModule.Init(HttpApplication context)
{
if (UmbracoConfiguration.Current.UmbracoSettings.ViewstateMoverModule.Enable)
if (UmbracoConfiguration.Current.UmbracoSettings.ViewStateMoverModule.Enable)
{
context.BeginRequest += new EventHandler(context_BeginRequest);
}
+1 -1
View File
@@ -489,7 +489,7 @@ namespace umbraco
/// </value>
public static bool UseViewstateMoverModule
{
get { return UmbracoConfiguration.Current.UmbracoSettings.ViewstateMoverModule.Enable; }
get { return UmbracoConfiguration.Current.UmbracoSettings.ViewStateMoverModule.Enable; }
}
@@ -168,7 +168,7 @@ namespace umbraco.cms.businesslogic.datatype
}
}
private void FillProperties(IContentImagingAutoFillUploadField uploadFieldConfigNode, Content content, UmbracoFile um)
private void FillProperties(IImagingAutoFillUploadField uploadFieldConfigNode, Content content, UmbracoFile um)
{
var prop = content.getProperty(uploadFieldConfigNode.WidthFieldAlias);
if (prop != null)