public frmRequirementEditor(Requirement requirement, Model model, Localizer localizer)
        {
            InitializeComponent();

            this.requirement = requirement;
            this.model = model;
            this.localizer = localizer;

            this.localizer.LocalizeControls(this);

            this.lockModified = true;

            // Details page
            foreach(ReferencedObject refobj in this.requirement.Proponents)
            {
                Stakeholder stakeholder = this.model.GetStakeholder(refobj.UniqueID);
                if(stakeholder != null)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.Text = stakeholder.Name;
                    this.lvPBStakeholders.Items.Add(lvi);
                }
            }

            foreach(ReferencedObject refobj in this.requirement.Beneficiaries)
            {
                Stakeholder stakeholder = this.model.GetStakeholder(refobj.UniqueID);
                if(stakeholder != null)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.Text = stakeholder.Name;
                    this.lvBTStakeholders.Items.Add(lvi);
                }
            }

            foreach(ReferencedObject refobj in this.requirement.MappedUseCases)
            {
                UseCase useCase = (UseCase)this.model.FindElementByUniqueID(refobj.UniqueID);
                if(useCase != null)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.Text = useCase.Name;
                    this.lvMappedOntoUCs.Items.Add(lvi);
                }
            }

            cmbCategory.SelectedIndex = (Int32)this.requirement.Category;
            cmbImportance.SelectedIndex = (Int32)this.requirement.Importance;
            cmbStatus.SelectedIndex = (Int32)this.requirement.Status;
            cmbAcceptanceStatus.SelectedIndex = (Int32)this.requirement.AcceptanceStatus;

            this.UpdateHistoryView();

            this.SetButtons();

            this.lockModified = false;

            this.ImeMode = ImeMode.On;
        }
Пример #2
0
        public Int32 AddRequrement()
        {
            Requirement requirement = new Requirement();
            Int32       index       = this.requirements.Count;
            Int32       ret;

            if (index == 0)
            {
                requirement.ID = 1;
            }
            else
            {
                requirement.ID = ((Requirement)this.requirements[index - 1]).ID + 1;
            }

            ret = this.requirements.Add(requirement);

            return(ret);
        }
Пример #3
0
        public Int32 AddRequrement()
        {
            Requirement requirement = new Requirement();
            Int32 index = this.requirements.Count;
            Int32 ret;

            if(index == 0)
            {
                requirement.ID = 1;
            }
            else
            {
                requirement.ID = ((Requirement)this.requirements[index - 1]).ID + 1;
            }

            ret = this.requirements.Add(requirement);

            return ret;
        }
Пример #4
0
 public void RemoveRequirement(Requirement requirement)
 {
     foreach(Requirement tmpRequirement in this.requirements)
     {
         if(tmpRequirement.ID > requirement.ID)
         {
             tmpRequirement.ID -= 1;
         }
     }
     this.requirements.Remove(requirement);
 }
Пример #5
0
        public void TextSearch(
            SearchBookmarkQueue sbq,
            String searchedText,
            String replacedText,
            Boolean wholeWordsOnly,
            Boolean caseSensitivity,
            Boolean executeReplaceAll)
        {
            Int32  counter;
            String expr;
            Regex  regex;

            if (wholeWordsOnly)
            {
                expr = @"\b" + searchedText + @"\b";
            }
            else
            {
                expr = searchedText;
            }

            if (caseSensitivity)
            {
                regex = new Regex(expr, RegexOptions.None);
            }
            else
            {
                regex = new Regex(expr, RegexOptions.IgnoreCase);
            }

            // REQUIREMENTS
            for (counter = 0; counter < this.Requirements.Count; counter++)
            {
                Requirement requirement = (Requirement)this.Requirements[counter];

                if (!executeReplaceAll)
                {
                    foreach (Match match in regex.Matches(requirement.Description))
                    {
                        if (!executeReplaceAll)
                        {
                            this.AddBookmark(sbq, "Requirements", counter, match.Index, match.Length);
                        }
                    }
                }
                else
                {
                    requirement.Description = regex.Replace(requirement.Description, replacedText);
                }
            }

            // ATTRIBUTES -> DESCRIPTION
            if (!executeReplaceAll)
            {
                foreach (Match match in regex.Matches(this.Attributes.Description))
                {
                    if (!executeReplaceAll)
                    {
                        this.AddBookmark(sbq, "Attributes.Description", counter, match.Index, match.Length);
                    }
                }
            }
            else
            {
                this.Attributes.Description = regex.Replace(this.Attributes.Description, replacedText);
            }

            // ATTRIBUTES -> NOTES
            if (!executeReplaceAll)
            {
                foreach (Match match in regex.Matches(this.Attributes.Notes))
                {
                    if (!executeReplaceAll)
                    {
                        this.AddBookmark(sbq, "Attributes.Notes", counter, match.Index, match.Length);
                    }
                }
            }
            else
            {
                this.Attributes.Notes = regex.Replace(this.Attributes.Notes, replacedText);
            }


            foreach (Actor actor in this.Actors)
            {
                actor.TextSearch(
                    sbq,
                    searchedText,
                    replacedText,
                    wholeWordsOnly,
                    caseSensitivity,
                    executeReplaceAll);
            }

            foreach (UseCase useCase in this.UseCases)
            {
                useCase.TextSearch(
                    sbq,
                    searchedText,
                    replacedText,
                    wholeWordsOnly,
                    caseSensitivity,
                    executeReplaceAll);
            }

            foreach (Package package in this.Packages)
            {
                package.TextSearch(
                    sbq,
                    searchedText,
                    replacedText,
                    wholeWordsOnly,
                    caseSensitivity,
                    executeReplaceAll);
            }
        }