Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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;
        }