Class WeightedCollectionBuilderBase<TBuilder, TCollection, TItem>
Implements a weighted collection builder.
Namespace: Umbraco.Cms.Core.Composing
Assembly: Umbraco.Core.dll
Syntax
public abstract class WeightedCollectionBuilderBase<TBuilder, TCollection, TItem> : CollectionBuilderBase<TBuilder, TCollection, TItem>, ICollectionBuilder<TCollection, TItem>, ICollectionBuilder where TBuilder : WeightedCollectionBuilderBase<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 SourceDefaultWeight
Declaration
public virtual int DefaultWeight { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
This
Declaration
protected abstract TBuilder This { get; }
Property Value
Type | Description |
---|---|
TBuilder |
Methods
View SourceAdd(IEnumerable<Type>)
Adds types to the collection.
Declaration
public TBuilder Add(IEnumerable<Type> types)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Type> | types | The types to add. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Add(Type)
Adds a type to the collection.
Declaration
public TBuilder Add(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to add. |
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Add<T>()
Adds a type to the collection.
Declaration
public TBuilder Add<T>()
where T : TItem
Returns
Type | Description |
---|---|
TBuilder | The builder. |
Type Parameters
Name | Description |
---|---|
T | The type to add. |
Clear()
Clears all types in the collection.
Declaration
public TBuilder Clear()
Returns
Type | Description |
---|---|
TBuilder | The builder. |
GetRegisteringTypes(IEnumerable<Type>)
Declaration
protected override IEnumerable<Type> GetRegisteringTypes(IEnumerable<Type> types)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Type> | types |
Returns
Type | Description |
---|---|
IEnumerable<Type> |
GetWeight(Type)
Declaration
protected virtual int GetWeight(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type |
Returns
Type | Description |
---|---|
System.Int32 |
Remove(Type)
Removes a type from the collection.
Declaration
public TBuilder Remove(Type type)
Parameters
Type | Name | Description |
---|---|---|
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. |
SetWeight<T>(Int32)
Changes the default weight of an item
Declaration
public TBuilder SetWeight<T>(int weight)
where T : TItem
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | weight | The new weight |
Returns
Type | Description |
---|---|
TBuilder |
Type Parameters
Name | Description |
---|---|
T | The type of item |