Пример #1
0
        public static bool FullAttributeTemplateNeeded(PSMElement element, EvolutionChangeSet changeSet)
        {
            List <NodeAttributeWrapper>        allAttributes          = new List <NodeAttributeWrapper>();
            List <NodeAttributeWrapper>        represenetedAttributes = element.GetRepresentedAttributes();
            IEnumerable <NodeAttributeWrapper> nodeContents           = element.GetAttributesUnderNode();

            allAttributes.AddRange(represenetedAttributes);
            allAttributes.AddRange(nodeContents);
            return(allAttributes.Count() > 0 && changeSet.AttributesInvalidated(element)
                   /*&& allAttributes.Inline().Any(e => PSMTreeIterator.GetLowerMultiplicityOfContentElement(e) != 0)*/);
        }
Пример #2
0
        /// <summary>
        /// Ridi se podle changesByTargetSignificantNode
        /// </summary>
        public bool AttributesInvalidated(PSMElement significantNode)
        {
            if (GetState(significantNode) == EContentPlacementState.Added &&
                significantNode.EncompassesAttributesForParentSignificantNode())
            {
                return(true);
            }

            {
                PSMClass psmClass = significantNode as PSMClass;
                if (psmClass != null)
                {
                    if (psmClass.IsStructuralRepresentative &&
                        FindNewStructuralRepresentatives().Contains(psmClass) &&
                        (psmClass.RepresentedPSMClass.EncompassesAttributesForParentSignificantNode() || psmClass.RepresentedPSMClass.Attributes.Count > 0))
                    {
                        return(true);
                    }

                    if (psmClass.IsStructuralRepresentative && AttributesInvalidated(psmClass.RepresentedPSMClass))
                    {
                        return(true);
                    }
                }
            }

            IEnumerable <NodeAttributeWrapper> attributesUnderNode = significantNode.GetAttributesUnderNode();

            if (attributesUnderNode.OfType <StructuralRepresentativeAttributes>()
                .Any(sra => AttributesInvalidated(sra.RepresentedPSMClass)))
            {
                return(true);
            }

            return(changesByTargetSignificantNode.ContainsKey(significantNode) &&
                   changesByTargetSignificantNode[significantNode].Any(c => c.InvalidatesAttributes));
        }