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; } } } }
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); }
/** * 현재는 패턴 체크를 하나만 하도록 되어 있음 * */ 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); }
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; } } } }
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; }