/// <summary> /// UpdateBindStyleItems /// </summary> /// <param name="item"></param> /// <param name="stepStyleItems"></param> public void UpdateBindStyleItems(StepRepresentationItem item, List <StepRepresentationItem> stepStyleItems) { List <StepRepresentationItem> bindStyleItems = new List <StepRepresentationItem>(); foreach (var obj in item.RefChildItems) { if (obj.Value != null && obj.Value.Count > 0) { foreach (var stepItem in stepStyleItems) { foreach (var objStepItem in stepItem.RefChildItems) { if (objStepItem.Value != null && objStepItem.Value.Count > 0) { foreach (var iStepItem in objStepItem.Value) { if (obj.Value.Find(x => ((StepRepresentationItem)x).Id == ((StepRepresentationItem)iStepItem).Id) != null) { bindStyleItems.Add(stepItem); } } } } } } } if (bindStyleItems.Count > 0) { foreach (var stepItem in bindStyleItems) { item.AddRefObjs(stepItem); } } }
/// <summary> /// SetShapRelationShip /// </summary> /// <param name="inputItem"></param> /// <param name="itemType"></param> public void SetShapRelationShip(StepRepresentationItem inputItem, StepItemType itemType) { foreach (var eachItem in _file.Items) { if (inputItem == eachItem) { continue; } if (eachItem.GetStepItemTypeStr() == itemType.ToString()) { List <StepRepresentationItem> relatedItems = GetItemsRelationShip(inputItem, eachItem); if (relatedItems.Count > 0) { foreach (var refObj in eachItem.RefChildItems) { if (refObj.Value != null && refObj.Value.Count > 0) { foreach (var refItem in refObj.Value) { if (relatedItems.Find(x => x == refItem) == null) { inputItem.AddRefObjs((StepRepresentationItem)refItem); inputItem.ContainCrossRef = true; //Contains cross ref item refItem.IsCrossRef = true; } } } } } } } }