BelongsToRequirementSet() public method

Indicates whether this paragraphs belongs to the functionam block whose name is provided as parameter
public BelongsToRequirementSet ( RequirementSet requirementSet ) : bool
requirementSet RequirementSet
return bool
Exemplo n.º 1
0
        /// <summary>
        ///     Indicates whether this paragraphs belongs to the functionam block whose name is provided as parameter
        /// </summary>
        /// <param name="requirementSet"></param>
        public bool BelongsToRequirementSet(RequirementSet requirementSet)
        {
            bool retVal = false;

            if (requirementSet != null)
            {
                // Try to find a reference to this requirement set
                foreach (RequirementSetReference reference in RequirementSetReferences)
                {
                    if (reference.Ref == requirementSet)
                    {
                        retVal = true;
                        break;
                    }
                }

                // Maybe a parent paragraph references this requirement set
                // (only if the requirement set specifies that selection is recursive)
                if (!retVal && requirementSet.getRecursiveSelection())
                {
                    Paragraph enclosing = EnclosingParagraph;
                    if (enclosing != null)
                    {
                        retVal = enclosing.BelongsToRequirementSet(requirementSet);
                    }
                }

                // Try if the requirement belong to a sub requirement set
                if (!retVal)
                {
                    foreach (RequirementSet subSet in requirementSet.SubSets)
                    {
                        if (BelongsToRequirementSet(subSet))
                        {
                            retVal = true;
                            break;
                        }
                    }
                }
            }

            return(retVal);
        }
Exemplo n.º 2
0
            public override void visit(Generated.Paragraph obj, bool visitSubNodes)
            {
                Paragraph paragraph = (Paragraph)obj;

                if (paragraph.BelongsToRequirementSet(RequirementSet))
                {
                    Paragraphs.Add(paragraph);

                    if (RequirementSet.getRecursiveSelection())
                    {
                        paragraph.GetParagraphs(Paragraphs);
                    }
                    else
                    {
                        base.visit(obj, visitSubNodes);
                    }
                }
                else
                {
                    base.visit(obj, visitSubNodes);
                }
            }