isPattern() public method

public isPattern ( ) : bool
return bool
Exemplo n.º 1
0
        private void setDictionary(ArrayList arr)
        {
            list.Clear();
            titleList.Clear();
            patternList.Clear();

            foreach (string temp in arr)
            {
                if (string.IsNullOrEmpty(temp))
                {
                    break;
                }
                if (temp.Trim().IndexOf(Util.DELIMITER_INFO) == 0)
                {
                    titleList.Add(temp.Trim());
                    continue;
                }

                HostItem it = new HostItem(temp.Trim().Split(','));

                if (it.error == 0)
                {
                    list[it.Before] = it;

                    if (it.isPattern())
                    {
                        patternList[it.Before] = it.After;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public int setHost(HostItem it)
        {
            int ret = 0;

            if (list.ContainsKey(it.Before))
            {
                ret = 1;
            }

            list[it.Before] = it;
            if (it.isPattern())
            {
                patternList[it.Before] = it.After;
            }
            return(ret);
        }
Exemplo n.º 3
0
        /**
         * 현재는 패턴 체크를 하나만 하도록 되어 있음
         *
         */
        public HostCheck checkPattern(string url)
        {
            foreach (KeyValuePair <string, string> it in patternList)
            {
                HostItem item = getHostItem(it.Key);

                if (item.isPattern())
                {
                    // 문자열 매칭
                    if (url.IndexOf(item.Before) > -1)
                    {
                        if (item.Checked)
                        {
                            return(new HostCheck(true, item.type, item.Before, item.After));
                        }
                    }
                }
            }

            return(null);
        }
Exemplo n.º 4
0
        private void setDictionary(ArrayList arr)
        {
            list.Clear();
            titleList.Clear();
            patternList.Clear();

            foreach(string temp in arr) {

                if (string.IsNullOrEmpty(temp)) break;
                if (temp.Trim().IndexOf(Util.DELIMITER_INFO) == 0) {
                    titleList.Add(temp.Trim());
                    continue;
                }

                HostItem it = new HostItem(temp.Trim().Split(','));

                if (it.error == 0) {
                    list[it.Before] = it;

                    if (it.isPattern()) {
                        patternList[it.Before] = it.After;
                    }
                }
            }
        }
Exemplo n.º 5
0
        public int setHost(HostItem it)
        {
            int ret = 0;
            if (list.ContainsKey(it.Before)) {
                ret = 1;
            }

            list[it.Before] = it;
            if (it.isPattern()) {
                patternList[it.Before] = it.After;
            }
            return ret;
        }