示例#1
0
        public IReadOnlyCollection <Guid> GetInstanceIds([NotNull] AssetCompositeHierarchyPropertyGraph <TAssetPartDesign, TAssetPart> baseAssetPropertyGraph)
        {
            if (baseAssetPropertyGraph == null)
            {
                throw new ArgumentNullException(nameof(baseAssetPropertyGraph));
            }
            HashSet <Guid> instanceIds;

            basePartAssets.TryGetValue(baseAssetPropertyGraph, out instanceIds);
            return((IReadOnlyCollection <Guid>)instanceIds ?? new Guid[0]);
        }
示例#2
0
 /// <summary>
 /// Indicates whether a new part added in a base asset should be also cloned and added to this asset.
 /// </summary>
 /// <param name="baseAssetGraph">The property graph of the base asset.</param>
 /// <param name="newPart">The new part that has been added in the base asset.</param>
 /// <param name="newPartParent">The parent of the new part that has been added in the base asset.</param>
 /// <param name="instanceId">The instance id for which the part might be cloned.</param>
 /// <returns><c>true</c> if the part should be cloned and added to this asset; otherwise, <c>false</c>.</returns>
 protected virtual bool ShouldAddNewPartFromBase(AssetCompositeHierarchyPropertyGraph <TAssetPartDesign, TAssetPart> baseAssetGraph, [NotNull] TAssetPartDesign newPart, TAssetPart newPartParent, Guid instanceId)
 {
     return(!deletedPartsInstanceMapping.Contains(Tuple.Create(newPart.Part.Id, instanceId)));
 }