Beispiel #1
0
        public void RemoveGlossaryItem(
            GlossaryItem gi,
            String oldNameStartTag,
            String oldNameEndTag,
            String newNameStartTag,
            String newNameEndTag,
            Boolean dontMarkOccurrences)
        {
            if (!dontMarkOccurrences)
            {
                this.ChangeReferences(
                    gi.Name,
                    oldNameStartTag,
                    oldNameEndTag,
                    gi.Name,
                    newNameStartTag,
                    newNameEndTag,
                    false);
            }

            foreach (GlossaryItem tmpGi in this.glossary)
            {
                if (tmpGi.ID > gi.ID)
                {
                    tmpGi.ID -= 1;
                }
            }
            this.glossary.Remove(gi);
        }
Beispiel #2
0
        public new 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);
            }

            // GLOSSARY
            for (counter = 0; counter < this.glossary.Count; counter++)
            {
                GlossaryItem gi = (GlossaryItem)this.glossary[counter];

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

            // STAKEHOLDERS
            for (counter = 0; counter < this.stakeholders.Count; counter++)
            {
                Stakeholder stakeholder = (Stakeholder)this.stakeholders[counter];

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

            base.TextSearch(sbq,
                            searchedText,
                            replacedText,
                            wholeWordsOnly,
                            caseSensitivity,
                            executeReplaceAll);
        }
Beispiel #3
0
 public void AddGlossaryItem(GlossaryItem gi)
 {
     gi.Owner = this;
     this.glossary.Add(gi);
 }
Beispiel #4
0
        public GlossaryItem NewGlossaryItem(String name, String prefix, Int32 id)
        {
            GlossaryItem gi = new GlossaryItem(name, prefix, id, this);

            return(gi);
        }
Beispiel #5
0
        public void RemoveGlossaryItem(
			GlossaryItem gi,
			String oldNameStartTag,
			String oldNameEndTag,
			String newNameStartTag,
			String newNameEndTag,
			Boolean dontMarkOccurrences)
        {
            if(!dontMarkOccurrences)
            {
                this.ChangeReferences(
                    gi.Name,
                    oldNameStartTag,
                    oldNameEndTag,
                    gi.Name,
                    newNameStartTag,
                    newNameEndTag,
                    false);
            }

            foreach(GlossaryItem tmpGi in this.glossary)
            {
                if(tmpGi.ID > gi.ID)
                {
                    tmpGi.ID -= 1;
                }
            }
            this.glossary.Remove(gi);
        }
Beispiel #6
0
 public GlossaryItem NewGlossaryItem(String name, String prefix, Int32 id)
 {
     GlossaryItem gi = new GlossaryItem(name,prefix,id,this);
     return gi;
 }
Beispiel #7
0
 public void AddGlossaryItem(GlossaryItem gi)
 {
     gi.Owner = this;
     this.glossary.Add(gi);
 }