private List <BookmarkInfo> MatchUrl(List <BookmarkInfo> bookmarkList, UrlRule rule) { List <BookmarkInfo> matchList = new List <BookmarkInfo>(); for (int i = bookmarkList.Count - 1; i >= 0; i--) { if (Regex.IsMatch(bookmarkList[i].Url, Regex.Escape(rule.Pattern), RegexOptions.IgnoreCase)) { matchList.Add(bookmarkList[i]); addRemoveIndex(i); } } return(matchList); }
private Rule ParseSingleRule(XmlNode item) { Rule rule = null; // Creating a new object for the rule with different type switch (item.ParentNode.Name) { case "url": rule = new UrlRule(item.InnerText); break; case "simple": rule = new SimpleRule(item.InnerText); break; case "rule": rule = new Rule(item.InnerText); break; default: break; } return(rule); }
private Rule ParseSingleRule(XmlNode item) { Rule rule = null; // Creating a new object for the rule with different type switch (item.ParentNode.Name) { case "url": rule = new UrlRule(item.InnerText); break; case "simple": rule = new SimpleRule(item.InnerText); break; case "rule": rule = new Rule(item.InnerText); break; default: break; } return rule; }
private List<BookmarkInfo> MatchUrl(List<BookmarkInfo> bookmarkList, UrlRule rule) { List<BookmarkInfo> matchList = new List<BookmarkInfo>(); for (int i = bookmarkList.Count - 1; i >= 0; i--) { if (Regex.IsMatch(bookmarkList[i].Url, Regex.Escape(rule.Pattern), RegexOptions.IgnoreCase)) { matchList.Add(bookmarkList[i]); addRemoveIndex(i); } } return matchList; }