public static bool FullElementsTemplateNeeded(PSMElement element, EvolutionChangeSet changeSet) { List <NodeElementWrapper> allContent = new List <NodeElementWrapper>(); List <NodeElementWrapper> represenetedContents = element.GetRepresentedElements(); List <NodeElementWrapper> nodeContents = element.GetSubtreeElements(); allContent.AddRange(represenetedContents); allContent.AddRange(nodeContents); return(allContent.Count() > 0 && changeSet.ContentInvalidated(element) /*&& allContent.Inline().Any(e => PSMTreeIterator.GetLowerMultiplicityOfContentElement(e) != 0)*/); }
/// <summary> /// Ridi se podle changesByTargetSignificantNode /// </summary> public bool ContentInvalidated(PSMElement significantNode) { if (GetState(significantNode) == EContentPlacementState.Added && significantNode.EncompassesContentForParentSignificantNode()) { return(true); } { PSMClass psmClass = significantNode as PSMClass; if (psmClass != null) { if (psmClass.IsStructuralRepresentative && FindNewStructuralRepresentatives().Contains(psmClass) && (psmClass.RepresentedPSMClass.EncompassesContentForParentSignificantNode())) { return(true); } if (psmClass.IsStructuralRepresentative && ContentInvalidated(psmClass.RepresentedPSMClass)) { return(true); } } } List <NodeElementWrapper> subtreeElements = significantNode.GetSubtreeElements(); if (subtreeElements.InlineButLeaveSRContent() .OfType <StructuralRepresentativeElements>() .Any(src => ContentInvalidated(src.RepresentedPSMClass))) { return(true); } if (subtreeElements.OfType <ContentGroup>().Any(group => ContentInvalidated(group.ContainingClass))) { return(true); } return(changesByTargetSignificantNode.ContainsKey(significantNode) && changesByTargetSignificantNode[significantNode].Any(c => c.InvalidatesContent)); }