using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Manifest;
using Umbraco.Core.ObjectResolution;
namespace Umbraco.Core.PropertyEditors
{
///
/// A resolver to resolve all parameter editors
///
///
/// This resolver will contain any property editors defined in manifests as well!
///
internal class ParameterEditorResolver : LazyManyObjectsResolverBase
{
public ParameterEditorResolver(Func> typeListProducerList)
: base(typeListProducerList, ObjectLifetimeScope.Application)
{
}
///
/// Returns the property editors
///
public IEnumerable ParameterEditors
{
get { return Values.Union(ManifestBuilder.ParameterEditors); }
}
///
/// Returns a property editor by alias
///
///
///
public ParameterEditor GetByAlias(string alias)
{
return ParameterEditors.SingleOrDefault(x => x.Alias == alias);
}
}
}