Class AssetCompositeHierarchy<TAssetPartDesign, TAssetPart>
public abstract class AssetCompositeHierarchy<TAssetPartDesign, TAssetPart> : AssetComposite, IAssetComposite where TAssetPartDesign : class, IAssetPartDesign<TAssetPart> where TAssetPart : class, IIdentifiable
Type Parameters
TAssetPartDesign
TAssetPart
- Inheritance
-
AssetCompositeHierarchy<TAssetPartDesign, TAssetPart>
- Implements
- Inherited Members
Properties
Hierarchy
Gets or sets the container of the hierarchy of asset parts.
[DataMember(100)]
[Display(null, null, Browsable = false)]
public AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart> Hierarchy { get; set; }
Property Value
- AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart>
Methods
CollectParts()
Collects the part assets.
[Obsolete("The AssetPart struct might be removed soon")]
public override IEnumerable<AssetPart> CollectParts()
Returns
ContainsPart(Guid)
Checks if this AssetPart container contains the part with the specified id.
public override bool ContainsPart(Guid id)
Parameters
id
GuidUnique identifier of the asset part
Returns
- bool
true
if this asset contains the part with the specified id; otherwisefalse
CreateDerivedAsset(string, out Dictionary<Guid, Guid>)
Creates an asset that inherits from this asset.
public override Asset CreateDerivedAsset(string baseLocation, out Dictionary<Guid, Guid> idRemapping)
Parameters
baseLocation
stringThe location of this asset.
idRemapping
Dictionary<Guid, Guid>A dictionary in which will be stored all the Guid remapping done for the child asset.
Returns
- Asset
An asset that inherits this asset instance
EnumerateChildPartDesigns(TAssetPartDesign, AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart>, bool)
Enumerates design parts that are children of the given design part.
[Pure]
public IEnumerable<TAssetPartDesign> EnumerateChildPartDesigns(TAssetPartDesign partDesign, AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart> hierarchyData, bool isRecursive)
Parameters
partDesign
TAssetPartDesignThe design part for which to enumerate child parts.
hierarchyData
AssetCompositeHierarchyData<TAssetPartDesign, TAssetPart>The hierarchy data object in which the design parts can be retrieved.
isRecursive
boolIf true, child design parts will be enumerated recursively.
Returns
- IEnumerable<TAssetPartDesign>
A sequence containing the child design parts of the given design part.
EnumerateChildParts(TAssetPart, bool)
Enumerates parts that are children of the given part.
[Pure]
public abstract IEnumerable<TAssetPart> EnumerateChildParts(TAssetPart part, bool isRecursive)
Parameters
part
TAssetPartThe part for which to enumerate child parts.
isRecursive
boolIf true, child parts will be enumerated recursively.
Returns
- IEnumerable<TAssetPart>
A sequence containing the child parts of the given part.
Remarks
Implementations of this method should not rely on the Hierarchy property to enumerate.
FindPart(Guid)
public override IIdentifiable FindPart(Guid partId)
Parameters
partId
Guid
Returns
GetChild(TAssetPart, int)
Gets the child of the given part that matches the given index.
[Pure]
public abstract TAssetPart GetChild(TAssetPart part, int index)
Parameters
part
TAssetPartThe part for which to retrieve a child.
index
intThe index of the child to retrieve.
Returns
- TAssetPart
The the child of the given part that matches the given index.
Exceptions
- ArgumentNullException
The given part is null.
- IndexOutOfRangeException
The given index is out of range.
GetChildCount(TAssetPart)
Gets the number of children in the given part.
[Pure]
public abstract int GetChildCount(TAssetPart part)
Parameters
part
TAssetPartThe part for which to retrieve the number of children.
Returns
- int
The number of children in the given part.
Exceptions
- ArgumentNullException
The given part is null.
GetParent(TAssetPart)
Gets the parent of the given part.
public abstract TAssetPart GetParent(TAssetPart part)
Parameters
part
TAssetPart
Returns
- TAssetPart
The part that is the parent of the given part, or null if the given part is at the root level.
Remarks
Implementations of this method should not rely on the Hierarchy property to determine the parent.
Exceptions
- ArgumentNullException
The given part is null.
IndexOf(TAssetPart)
Gets the index of the given part in the child list of its parent, or in the list of root if this part is a root part.
[Pure]
public abstract int IndexOf(TAssetPart part)
Parameters
part
TAssetPartThe part for which to retrieve the index.
Returns
- int
The index of the part, or a negative value if the part is an orphan part that is not a member of this asset.
Exceptions
- ArgumentNullException
The given part is null.