Makes ApplicationContext disposable so that 3rd party devs are able to reset their applications (or unit tests), updated

resolution and created a ResolverCollection to track all resolvers created so it's super easy to reset all of them at once
(which is what happens on ApplicationContext.Dispose. ApplicationContext.Dispose is also implicitly implemented as to not
show in intellisense that the Dispose method exists... must be cast to IDisposable to work.
This commit is contained in:
Shannon Deminick
2013-03-12 01:50:56 +04:00
parent cc50003e3e
commit 164f22aa50
9 changed files with 204 additions and 24 deletions

View File

@@ -6,14 +6,14 @@ using System.Web;
namespace Umbraco.Core.ObjectResolution
{
/// <summary>
/// <summary>
/// The base class for all many-objects resolvers.
/// </summary>
/// <typeparam name="TResolver">The type of the concrete resolver class.</typeparam>
/// <typeparam name="TResolved">The type of the resolved objects.</typeparam>
public abstract class ManyObjectsResolverBase<TResolver, TResolved> : ResolverBase<TResolver>
where TResolved : class
where TResolver : class
where TResolved : class
where TResolver : ResolverBase
{
private IEnumerable<TResolved> _applicationInstances = null;
private readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim();