public Int32 AddOpenIssue() { OpenIssue openIssue = new OpenIssue(); Int32 index = this.openIssues.Count; Int32 ret; if(index == 0) { openIssue.ID = 1; } else { openIssue.ID = ((OpenIssue)this.openIssues[index - 1]).ID + 1; } ret = this.openIssues.Add(openIssue); return ret; }
public void RemoveOpenIssue(OpenIssue openIssue) { foreach(OpenIssue tmpOpenIssue in this.openIssues) { if(tmpOpenIssue.ID > openIssue.ID) { tmpOpenIssue.ID -= 1; } } this.openIssues.Remove(openIssue); }
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); } // STEPS for (counter = 0; counter < this.steps.Count; counter++) { Step step = (Step)this.steps[counter]; if (!executeReplaceAll) { foreach (Match match in regex.Matches(step.Description)) { if (!executeReplaceAll) { this.AddBookmark(sbq, "Steps", counter, match.Index, match.Length); } } } else { step.Description = regex.Replace(step.Description, replacedText); } } // OPEN ISSUES for (counter = 0; counter < this.openIssues.Count; counter++) { OpenIssue openIssue = (OpenIssue)this.openIssues[counter]; if (!executeReplaceAll) { foreach (Match match in regex.Matches(openIssue.Description)) { if (!executeReplaceAll) { this.AddBookmark(sbq, "OpenIssues", counter, match.Index, match.Length); } } } else { openIssue.Description = regex.Replace(openIssue.Description, replacedText); } } // PRECONDITIONS if (!executeReplaceAll) { foreach (Match match in regex.Matches(this.preconditions)) { if (!executeReplaceAll) { this.AddBookmark(sbq, "Preconditions", counter, match.Index, match.Length); } } } else { this.preconditions = regex.Replace(this.preconditions, replacedText); } // POSTCONDITIONS if (!executeReplaceAll) { foreach (Match match in regex.Matches(this.postconditions)) { if (!executeReplaceAll) { this.AddBookmark(sbq, "Postconditions", counter, match.Index, match.Length); } } } else { this.postconditions = regex.Replace(this.postconditions, replacedText); } // PROSE if (!executeReplaceAll) { foreach (Match match in regex.Matches(this.prose)) { if (!executeReplaceAll) { this.AddBookmark(sbq, "Prose", counter, match.Index, match.Length); } } } else { this.prose = regex.Replace(this.prose, 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); } }