Class OrderedCollectionBuilderBase<TBuilder, TCollection, TItem>
Implements an ordered collection builder.
Namespace: Umbraco.Core.Composing
Assembly: Umbraco.Core.dll
Syntax
public abstract class OrderedCollectionBuilderBase<TBuilder, TCollection, TItem> : CollectionBuilderBase<TBuilder, TCollection, TItem>, ICollectionBuilder<TCollection, TItem>, ICollectionBuilder where TBuilder : OrderedCollectionBuilderBase<TBuilder, TCollection, TItem> where TCollection : class, IBuilderCollection<TItem>
Type Parameters
Name | Description |
---|---|
TBuilder | The type of the builder. |
TCollection | The type of the collection. |
TItem | The type of the items. |
Properties
View SourceThis
Declaration
protected abstract TBuilder This { get; }
Property Value
Type | Description |
---|---|
TBuilder |
Methods
View SourceAppend(IEnumerable<Type>)
Appends types to the collections.
Declaration
public TBuilder Append(IEnumerable<Type> types)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Type> | types | The types to append. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Append(Type)
Appends a type to the collection.
Declaration
public TBuilder Append(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to append. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Append<T>()
Appends a type to the collection.
Declaration
public TBuilder Append<T>()
where T : TItem
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Type Parameters
Name | Description |
---|---|
T | The type to append. |
Clear()
Clears all types in the collection.
Declaration
public TBuilder Clear()
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Insert(Int32, Type)
Inserts a type into the collection.
Declaration
public TBuilder Insert(int index, Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
System.Type | type | The type to insert. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Remarks
Throws if the index is out of range.
Insert(Type)
Inserts a type into the collection.
Declaration
public TBuilder Insert(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to insert. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Remarks
Throws if the index is out of range.
Insert<T>(Int32)
Inserts a type into the collection.
Declaration
public TBuilder Insert<T>(int index = 0)
where T : TItem
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The optional index. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Type Parameters
Name | Description |
---|---|
T | The type to insert. |
Remarks
Throws if the index is out of range.
InsertAfter(Type, Type)
Inserts a type after another type.
Declaration
public TBuilder InsertAfter(Type typeAfter, Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeAfter | The other type. |
System.Type | type | The type to insert. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Remarks
Throws if both types are identical, or if the other type does not already belong to the collection.
InsertAfter<TAfter, T>()
Inserts a type after another type.
Declaration
public TBuilder InsertAfter<TAfter, T>()
where TAfter : TItem where T : TItem
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Type Parameters
Name | Description |
---|---|
TAfter | The other type. |
T | The type to append. |
Remarks
Throws if both types are identical, or if the other type does not already belong to the collection.
InsertBefore(Type, Type)
Inserts a type before another type.
Declaration
public TBuilder InsertBefore(Type typeBefore, Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeBefore | The other type. |
System.Type | type | The type to insert. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Remarks
Throws if both types are identical, or if the other type does not already belong to the collection.
InsertBefore<TBefore, T>()
Inserts a type before another type.
Declaration
public TBuilder InsertBefore<TBefore, T>()
where TBefore : TItem where T : TItem
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Type Parameters
Name | Description |
---|---|
TBefore | The other type. |
T | The type to insert. |
Remarks
Throws if both types are identical, or if the other type does not already belong to the collection.
Remove(Type)
Removes a type from the collection.
Declaration
public TBuilder Remove(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to remove. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Remove<T>()
Removes a type from the collection.
Declaration
public TBuilder Remove<T>()
where T : TItem
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Type Parameters
Name | Description |
---|---|
T | The type to remove. |
Replace(Type, Type)
Replaces a type in the collection.
Declaration
public TBuilder Replace(Type typeReplaced, Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeReplaced | The type to replace. |
System.Type | type | The type to insert. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Remarks
Throws if the type to replace does not already belong to the collection.
Replace<TReplaced, T>()
Replaces a type in the collection.
Declaration
public TBuilder Replace<TReplaced, T>()
where TReplaced : TItem where T : TItem
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Type Parameters
Name | Description |
---|---|
TReplaced | The type to replace. |
T | The type to insert. |
Remarks
Throws if the type to replace does not already belong to the collection.