예제 #1
0
 public Entry(ProxyAccessListType type, ProxyAccessListMode mode, string value)
 {
     Mode = mode;
     Type = type;
     Pattern = null;
     Value = value;
 }
예제 #2
0
        public void Add(ProxyAccessListType type, ProxyAccessListMode mode, string pattern)
        {
            switch (type)
            {
                case ProxyAccessListType.Regex:
                    Regex regex;
                    try
                    {
                        regex = new Regex(pattern, RegexOptions.Compiled);
                    }
                    catch (Exception e)
                    {
                        _logger.LogError("Invalid access list pattern: {0}{1}{2}", pattern, Environment.NewLine, e.ToString());
                        return;
                    }

                    _entries.Add(new Entry(type, mode, regex));
                    break;
                case ProxyAccessListType.Namespace:
                case ProxyAccessListType.NamespaceStart:
                    _entries.Add(new Entry(type, mode, pattern));
                    break;
                default:
                    throw new NotSupportedException("ProxyAccessListType");
            }
        }
예제 #3
0
 public Entry(ProxyAccessListType type, ProxyAccessListMode mode, Regex pattern)
 {
     Mode = mode;
     Type = type;
     Pattern = pattern;
     Value = null;
 }