Class SkeletonCollection<T>
Base class for collections used in a File
Inheritance
Implements
Namespace: Sdl.Core.Bcm.BcmModel.Skeleton
Assembly: Sdl.Core.Bcm.BcmModel.dll
Syntax
public class SkeletonCollection<T> : KeyedCollection<SkeletonCollectionKey, T> where T : SkeletonItem
Type Parameters
Name | Description |
---|---|
T |
Constructors
SkeletonCollection()
Declaration
public SkeletonCollection()
Properties
IdGenerator
Gets the Id
Declaration
public IdGenerator IdGenerator { get; }
Property Value
Type | Description |
---|---|
Id |
The Id |
ParentSkeleton
Gets or sets the parent File
Declaration
public FileSkeleton ParentSkeleton { get; set; }
Property Value
Type | Description |
---|---|
File |
The parent File |
Methods
ClearItems()
Removes all elements from the System.
Declaration
protected override void ClearItems()
Equals(SkeletonCollection<T>)
Performs a deep-equals comparison.
System.
Declaration
public bool Equals(SkeletonCollection<T> other)
Parameters
Type | Name | Description |
---|---|---|
Skeleton |
other |
Returns
Type | Description |
---|---|
System. |
GetById(Int32)
Gets an element by its numerical id.
Declaration
public T GetById(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id. |
Returns
Type | Description |
---|---|
T | If found, returns the element with the Id |
GetKeyForItem(T)
Extracts the key from the specified element.
Declaration
protected override SkeletonCollectionKey GetKeyForItem(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The element from which to extract the key. |
Returns
Type | Description |
---|---|
Skeleton |
The key for the specified element. |
GetOrAdd(T)
Gets the element if it already exists in the collection.
Otherwise, it is added to the collection and gives it the next ID in the Id
Declaration
public T GetOrAdd(T elem)
Parameters
Type | Name | Description |
---|---|---|
T | elem | The element. |
Returns
Type | Description |
---|---|
T | The existing element; or the newly added one with an Id set. |
GetOrAddWithExistingId(T)
Gets the element if it already exists in the collection. Otherwise, it is added to the collection (preserving its existing ID).
Declaration
public T GetOrAddWithExistingId(T elem)
Parameters
Type | Name | Description |
---|---|---|
T | elem | The element. |
Returns
Type | Description |
---|---|
T | The existing element; or the newly added one with an Id set. |
InsertItem(Int32, T)
Inserts an element into the System.
Declaration
protected override void InsertItem(int index, T item)
Parameters
Type | Name | Description |
---|---|---|
System. |
index | The zero-based index at which |
T | item | The object to insert. |
RemoveItem(Int32)
Removes the element at the specified index of the System.
Declaration
protected override void RemoveItem(int index)
Parameters
Type | Name | Description |
---|---|---|
System. |
index | The index of the element to remove. |
SetItem(Int32, T)
Replaces the item at the specified index with the specified item.
Declaration
protected override void SetItem(int index, T item)
Parameters
Type | Name | Description |
---|---|---|
System. |
index | The zero-based index of the item to be replaced. |
T | item | The new item. |