Core.Strings - refactor + new IShortStringHelper

This commit is contained in:
Stephan
2013-02-07 13:30:50 -01:00
parent dced287c1c
commit a0f662c114
18 changed files with 5920 additions and 167 deletions

View File

@@ -0,0 +1,40 @@
using Umbraco.Core.ObjectResolution;
namespace Umbraco.Core.Strings
{
/// <summary>
/// Resolves the IShortStringHelper object
/// </summary>
internal sealed class ShortStringHelperResolver : SingleObjectResolverBase<ShortStringHelperResolver, IShortStringHelper>
{
/// <summary>
/// Initializes a new instance of the <see cref="ShortStringHelperResolver"/> class with an instance of a helper.
/// </summary>
/// <param name="helper">A instance of a helper.</param>
/// <remarks>The resolver is created by the <c>CoreBootManager</c> and thus the constructor remains internal.</remarks>
internal ShortStringHelperResolver(IShortStringHelper helper)
: base(helper)
{
Resolution.Frozen += (sender, args) => helper.Freeze();
}
/// <summary>
/// Sets the helper.
/// </summary>
/// <param name="helper">The helper.</param>
/// <remarks>For developers, at application startup.</remarks>
public void SetHelper(IShortStringHelper helper)
{
Value = helper;
}
/// <summary>
/// Gets the helper.
/// </summary>
public IShortStringHelper Helper
{
get { return Value; }
}
}
}