Exemplo n.º 1
0
        /// <summary>
        ///     Appends this paragraph to the requirement set if it does not belong to it already
        /// </summary>
        /// <param name="requirementSet"></param>
        public bool AppendToRequirementSet(RequirementSet requirementSet)
        {
            bool retVal = false;

            if (!BelongsToRequirementSet(requirementSet))
            {
                retVal = true;
                RequirementSetReference reference =
                    (RequirementSetReference)acceptor.getFactory().createRequirementSetReference();
                reference.setTarget(requirementSet.Guid);
                appendRequirementSets(reference);
            }

            return(retVal);
        }
Exemplo n.º 2
0
        public bool SubParagraphBelongsToRequirementSet(RequirementSet requirementSet)
        {
            bool retVal = false;

            foreach (Paragraph p in SubParagraphs)
            {
                retVal = p.BelongsToRequirementSet(requirementSet) ||
                         p.SubParagraphBelongsToRequirementSet(requirementSet);
                if (retVal)
                {
                    break;
                }
            }

            return(retVal);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Provides the list of applicable requirement sets
        /// </summary>
        /// <param name="applicableRequirementSets"></param>
        private void FillApplicableRequirementSets(HashSet <RequirementSet> applicableRequirementSets)
        {
            foreach (RequirementSetReference reference in RequirementSetReferences)
            {
                RequirementSet requirementSet = reference.Ref;
                if (requirementSet != null)
                {
                    applicableRequirementSets.Add(reference.Ref);
                }
            }

            Paragraph enclosing = EnclosingParagraph;

            if (enclosing != null)
            {
                enclosing.FillApplicableRequirementSets(applicableRequirementSets);
            }
        }
Exemplo n.º 4
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.º 5
0
        /// <summary>
        ///     Provides the requirement set whose name corresponds to the name provided
        /// </summary>
        /// <param name="name"></param>
        /// <param name="create">Indicates that the requirement set should be created if it does not exists</param>
        /// <returns></returns>
        public RequirementSet findRequirementSet(string name, bool create)
        {
            RequirementSet retVal = null;

            foreach (RequirementSet requirementSet in SubSets)
            {
                if (requirementSet.Name == name)
                {
                    retVal = requirementSet;
                    break;
                }
            }

            if (retVal == null && create)
            {
                retVal      = (RequirementSet)acceptor.getFactory().createRequirementSet();
                retVal.Name = name;
                appendSubSets(retVal);
            }

            return(retVal);
        }
Exemplo n.º 6
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);
                }
            }
Exemplo n.º 7
0
 /// <summary>
 ///     Adds a new requirement set to this list of requirement sets
 /// </summary>
 /// <param name="requirementSet"></param>
 public void AddRequirementSet(RequirementSet requirementSet)
 {
     appendSubSets(requirementSet);
 }
Exemplo n.º 8
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="requirementSet"></param>
 /// <param name="paragraphs"></param>
 public ParagraphForRequirementSet(RequirementSet requirementSet, List <Paragraph> paragraphs)
 {
     RequirementSet = requirementSet;
     Paragraphs     = paragraphs;
 }
Exemplo n.º 9
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="requirementSet"></param>
 /// <param name="belonging">
 ///     Indicates whether the paragraph should belong to the requirement set
 /// </param>
 /// <param name="notImplemented">Indicates that the the elements that should be marked are the not implemented ones</param>
 /// or whether the requirement should not belong to that requirement set
 public RequirementSetMarker(RequirementSet requirementSet, bool belonging, bool notImplemented)
 {
     RequirementSet = requirementSet;
     Belonging = belonging;
     NotImplemented = notImplemented;
 }
Exemplo n.º 10
0
 /// <summary>
 ///     Marks the requirements which relate to the corresponding requirement set
 /// </summary>
 /// <param name="requirementSet"></param>
 public void MarkRequirementsWhichDoNotBelongToRequirementSet(RequirementSet requirementSet)
 {
     MarkingHistory.PerformMark(() =>
     {
         RequirementSetMarker marker = new RequirementSetMarker(requirementSet, false, false);
         foreach (Dictionary dictionary in Dictionaries)
         {
             marker.visit(dictionary);
         }
     });
 }
Exemplo n.º 11
0
 /// <summary>
 ///     Marks the requirements which relate to the corresponding requirement set
 /// </summary>
 /// <param name="requirementSet"></param>
 public void MarkNotImplementedRequirements(RequirementSet requirementSet)
 {
     MarkingHistory.PerformMark(() =>
     {
         RequirementSetMarker marker = new RequirementSetMarker(requirementSet, true, true);
         foreach (Dictionary dictionary in Dictionaries)
         {
             marker.visit(dictionary);
         }
     });
 }
Exemplo n.º 12
0
 /// <summary>
 ///     Adds a new requirement set to this list of requirement sets
 /// </summary>
 /// <param name="requirementSet"></param>
 public void AddRequirementSet(RequirementSet requirementSet)
 {
     appendRequirementSets(requirementSet);
 }