From c8aedb381bef311583b99acc81a33ed307d3e073 Mon Sep 17 00:00:00 2001 From: Stephan Date: Wed, 30 Jan 2013 14:45:08 -0100 Subject: [PATCH] Core.ObjectsResolution - add insert at beginning of list in many resolver --- .../ManyObjectsResolverBase.cs | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/ObjectResolution/ManyObjectsResolverBase.cs b/src/Umbraco.Core/ObjectResolution/ManyObjectsResolverBase.cs index e4727d0489..7c19253ca9 100644 --- a/src/Umbraco.Core/ObjectResolution/ManyObjectsResolverBase.cs +++ b/src/Umbraco.Core/ObjectResolution/ManyObjectsResolverBase.cs @@ -357,7 +357,18 @@ namespace Umbraco.Core.ObjectResolution } } - /// + /// + /// Inserts a type at the beginning of the list. + /// + /// The type to insert. + /// the resolver does not support inserting types, or + /// the type is not a valid type for the resolver, or the type is already in the collection of types. + public virtual void InsertType(Type value) + { + InsertType(0, value); + } + + /// /// Inserts a type at the specified index. /// /// The type to insert. @@ -369,7 +380,17 @@ namespace Umbraco.Core.ObjectResolution InsertType(index, typeof(T)); } - /// + /// + /// Inserts a type at the beginning of the list. + /// + /// The type to insert. + public void InsertType() + where T : TResolved + { + InsertType(0, typeof(T)); + } + + /// /// Inserts a type before a specified, already existing type. /// /// The existing type before which to insert.