Removed old MacroControlFactory - marked as internal FTW ! moved it to new MacroFieldEditorsResolver

using the new framework. Also moved PersistableMacroProperty to new assembly (it was also marked as internal).
Updated unit tests to work with Resolution and resetting resolvers.
This commit is contained in:
shannon@ShandemVaio
2012-08-01 22:46:13 +06:00
parent 646e96ab15
commit 2115146fdb
18 changed files with 192 additions and 454 deletions

View File

@@ -14,7 +14,13 @@ namespace Umbraco.Core.Resolving
{
public static event EventHandler Frozen;
public static bool IsFrozen { get; private set; }
/// <summary>
/// Gets a value indicating that resolution is frozen
/// </summary>
/// <remarks>
/// The internal setter is normally used for unit tests
/// </remarks>
public static bool IsFrozen { get; internal set; }
public static void EnsureNotFrozen()
{

View File

@@ -11,9 +11,14 @@ namespace Umbraco.Core.Resolving
where TResolver : class
{
static TResolver _resolver;
//TODO: This is not correct, this will be the same lock for all ResolverBase classes!!
// this will work i suppose but not really ideal
/// <summary>
/// The lock for the singleton
/// </summary>
/// <remarks>
/// Though resharper says this is in error, it is actually correct. We want a different lock object for each generic type.
/// See this for details: http://confluence.jetbrains.net/display/ReSharper/Static+field+in+generic+type
/// </remarks>
static readonly ReaderWriterLockSlim ResolversLock = new ReaderWriterLockSlim();
public static TResolver Current
@@ -40,5 +45,13 @@ namespace Umbraco.Core.Resolving
}
}
}
/// <summary>
/// used in unit tests to reset current to null
/// </summary>
internal static void Reset()
{
_resolver = null;
}
}
}