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:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user