using System; using System.Collections.Generic; using Umbraco.Core.Composing; // ReSharper disable once CheckNamespace namespace Umbraco.Core.ObjectResolution { public abstract class ManyObjectsResolverBase where TBuilder : OrderedCollectionBuilderBase where TCollection : IBuilderCollection { private readonly TBuilder _builder; protected ManyObjectsResolverBase(TBuilder builder) { _builder = builder; } public static bool HasCurrent => true; public void RemoveType(Type value) { _builder.Remove(value); } public void RemoveType() where T : TItem { _builder.Remove(); } protected void AddTypes(IEnumerable types) { _builder.Append(types); } public void AddType(Type value) { _builder.Append(value); } public void AddType() where T : TItem { _builder.Append(); } public void Clear() { _builder.Clear(); } public void InsertType(int index, Type value) { _builder.Insert(index, value); } public void InsertType(Type value) { _builder.Insert(value); } public void InsertType(int index) where T : TItem { _builder.Insert(index); } public void InsertType() where T : TItem { _builder.Insert(); } public void InsertTypeBefore(Type existingType, Type value) { _builder.InsertBefore(existingType, value); } public void InsertTypeBefore() where TExisting : TItem where T : TItem { _builder.InsertBefore(); } public bool ContainsType(Type value) { return _builder.Has(value); } public IEnumerable GetTypes() { return _builder.GetTypes(); } public bool ContainsType() where T : TItem { return _builder.Has(); } } }