コード例 #1
0
ファイル: DatabaseManager.cs プロジェクト: ioncodes/ProxyDB
        public IEnumerable <Proxy> GetProxies(int?port, string protocol, string anonymity, string country)
        {
            Protocol  _protocol  = Protocol.HTTP;
            Anonymity _anonymity = Anonymity.Anonymous;

            if (protocol != null && !Enum.TryParse(protocol, true, out _protocol))
            {
                return(null);
            }

            if (anonymity != null && !Enum.TryParse(anonymity, true, out _anonymity))
            {
                return(null);
            }

            return(_proxies.Find(
                       i => (port == null || i.Port == port) &&
                       (protocol == null || i.Protocol == _protocol) &&
                       (anonymity == null || i.Anonymity == _anonymity) &&
                       (country == null || i.Country == country)
                       ).ToList());
        }
コード例 #2
0
ファイル: Resolver.cs プロジェクト: dbremner/specsharp
 private Field NewField(Identifier name, TypeNode type, Anonymity anon){
   AttributeList attrs = null;
   if (anon != Anonymity.Unknown && anon != Anonymity.None){
     attrs = new AttributeList(1);
     MemberBinding cons = new MemberBinding(null, SystemTypes.AnonymousAttribute.GetConstructor());
     TypeNode tn = SystemTypes.AnonymityEnum;
     AttributeNode attr = new AttributeNode(cons, new ExpressionList(new NamedArgument(idAnonymity, new Literal(anon, SystemTypes.AnonymityEnum))));
     attrs.Add(attr);
   }
   return new Field(null, attrs, FieldFlags.Public, name, type, null);
 }
コード例 #3
0
ファイル: Proxy.cs プロジェクト: inmovery/ProxyGrabber
 public Proxy(string ipAddress, string port, ProxyType type, Location location, Anonymity anonymity, int speed)
 {
     this.Ip        = ipAddress;
     this.Port      = port;
     this.Type      = type;
     this.Location  = location;
     this.Anonymity = anonymity;
     this.Speed     = speed;
 }