Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of <see cref="MethodDefinition"/> class
 /// </summary>
 /// <param name="accessModifier">Access modifier</param>
 /// <param name="type">Type</param>
 /// <param name="name">Name</param>
 /// <param name="parameters">Parameters</param>
 public MethodDefinition(AccessModifier accessModifier, string type, string name, params ParameterDefinition[] parameters)
 {
     AccessModifier = accessModifier;
     Type           = type;
     Name           = name;
     Parameters.AddRange(parameters);
 }
Esempio n. 2
0
        private DisqusThreadCloseRequest(DisqusThreadLookupType lookupType, params string[] threads)
        {
            var parameters = threads.Select(thread =>
                                            new KeyValuePair <string, string>(lookupType.AsParameterName(), thread));

            Parameters.AddRange(parameters);
        }
 public ASTFunctionDefinition(Token token, ASTType returnType, IEnumerable <ASTParam> parameterList, ASTBlock body)
 {
     ReturnType = returnType;
     Token      = token;
     Body       = body;
     Parameters.AddRange(parameterList);
 }
Esempio n. 4
0
        internal string MakeUrl(string path, Parameters otherParams = null)
        {
            Parameters paramz = new Parameters();

            paramz.Add("app", Constants.AppVersion);

            if (otherParams != null)
            {
                paramz.AddRange(otherParams);
            }

            if (user.LoggedIn)
            {
                paramz.Add(Constants.TokenKey, user.Token.Key);
                paramz.Add(Constants.TokenId, user.Token.ID);
                paramz.Add(Constants.UserId, user.Token.UserID);
            }

            StringBuilder sb = new StringBuilder();

            sb.Append(path);
            sb.Append("?" + paramz.ToQueryString());

            var url = sb.ToString();

            return(url);
        }
Esempio n. 5
0
 public Function(Function function)
     : base(function)
 {
     ReturnType       = function.ReturnType;
     IsReturnIndirect = function.IsReturnIndirect;
     HasThisReturn    = function.HasThisReturn;
     Parameters.AddRange(function.Parameters.Select(p => new Parameter(p)));
     foreach (var parameter in Parameters)
     {
         parameter.Namespace = this;
     }
     InstantiatedFrom  = function.InstantiatedFrom;
     IsVariadic        = function.IsVariadic;
     IsInline          = function.IsInline;
     IsPure            = function.IsPure;
     IsDeleted         = function.IsDeleted;
     IsDefaulted       = function.IsDefaulted;
     IsAmbiguous       = function.IsAmbiguous;
     FriendKind        = function.FriendKind;
     OperatorKind      = function.OperatorKind;
     CallingConvention = function.CallingConvention;
     SynthKind         = function.SynthKind;
     OriginalFunction  = function.OriginalFunction;
     Mangled           = function.Mangled;
     Signature         = function.Signature;
     FunctionType      = function.FunctionType;
     if (function.SpecializationInfo != null)
     {
         SpecializationInfo = new FunctionTemplateSpecialization(function.SpecializationInfo);
         SpecializationInfo.SpecializedFunction = function;
     }
 }
Esempio n. 6
0
        /// <summary>
        /// Creates command
        /// </summary>
        /// <param name="text"></param>
        /// <param name="parameters"></param>
        public EqlCommand(string text, NpgsqlConnection connection, NpgsqlTransaction transaction = null, List <EqlParameter> parameters = null, DbContext currentContext = null)
        {
            if (currentContext != null)
            {
                suppliedContext = currentContext;
            }

            Text = text;

            if (string.IsNullOrWhiteSpace(text))
            {
                throw new ArgumentException("Command text cannot be null or empty.");
            }

            Connection = null;

            NpgConnection  = connection;
            NpgTransaction = transaction;

            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }

            if (parameters != null)
            {
                Parameters.AddRange(parameters);
            }
        }
Esempio n. 7
0
        public string GetSql()
        {
            string sql = "";

            sql += BaseSql;

            if (Filters != null && Filters.Count > 0)
            {
                SqlFilterBuilder filterBuilder = new SqlFilterBuilder(Connection, Entity);
                int subCounter = 0;

                foreach (var filter in Filters)
                {
                    // create a new sub-query for each filter/filter group
                    subCounter++;
                    string filterSql = filterBuilder.GetFilterText(filter);

                    if (string.IsNullOrEmpty(filterSql) == false)
                    {
                        filterSql = string.Format("WHERE ({0})", filterSql);
                    }
                    else
                    {
                        filterSql = "";
                    }

                    sql = String.Format("SELECT sub{0}.* FROM ({1}) AS sub{0} {2}", subCounter, sql, filterSql);
                }

                Parameters.AddRange(filterBuilder.Parameters);
            }

            return(sql);
        }
Esempio n. 8
0
 public QParam(DBTable table, string viewFilter) : this()
 {
     using (var query = new QQuery(viewFilter, table))
     {
         Parameters.AddRange(query.Parameters.ToArray());
     }
 }
Esempio n. 9
0
 public Result(string name, uint bitLength, Type codecType, params uint [] parameters)
 {
     CompressorName      = name;
     CompressedBitLength = bitLength;
     CompressorType      = codecType;
     Parameters.AddRange(parameters);
 }
Esempio n. 10
0
 public CodeMethodInvokeExpression(CodeExpression targetObject,
                                   String methodName,
                                   params CodeExpression[] parameters)
 {
     this.method = new CodeMethodReferenceExpression
                       (targetObject, methodName);
     Parameters.AddRange(parameters);
 }
Esempio n. 11
0
        public DisqusBlacklistRemoveRequest IpAddress(params string[] ipAddresses)
        {
            var parameters = ipAddresses.Select(ipAddress => new KeyValuePair <string, string>("ip", ipAddress));

            Parameters.AddRange(parameters);

            return(this);
        }
Esempio n. 12
0
 public FunctionType(FunctionType type)
     : base(type)
 {
     ReturnType = new QualifiedType((Type)type.ReturnType.Type.Clone(), type.ReturnType.Qualifiers);
     Parameters.AddRange(type.Parameters.Select(p => new Parameter(p)));
     CallingConvention = type.CallingConvention;
     IsDependent       = type.IsDependent;
 }
        public DisqusWhitelistAddRequest User(params int[] users)
        {
            var parameters = users.Select(user => new KeyValuePair <string, string>("user", user.ToString()));

            Parameters.AddRange(parameters);

            return(this);
        }
Esempio n. 14
0
        public DisqusThreadListRequest Author(params string[] authors)
        {
            var parameters = authors.Select(author => new KeyValuePair <string, string>("author:username", author));

            Parameters.AddRange(parameters);

            return(this);
        }
Esempio n. 15
0
        public DisqusThreadListRequest Thread(DisqusThreadLookupType lookupType, params string[] threads)
        {
            var parameters = threads.Select(thread => new KeyValuePair <string, string>(lookupType.AsParameterName(), thread));

            Parameters.AddRange(parameters);

            return(this);
        }
Esempio n. 16
0
        public DisqusThreadListRequest Category(params int[] categories)
        {
            var parameters = categories.Select(id => new KeyValuePair <string, string>("category", id.ToString()));

            Parameters.AddRange(parameters);

            return(this);
        }
Esempio n. 17
0
 public Command(string name, IEnumerable <Parameter> parameters = null) : this()
 {
     Name = name;
     if (parameters != null)
     {
         Parameters.AddRange(parameters);
     }
 }
Esempio n. 18
0
        /// <summary>
        /// Creates a new Event from the string provided.
        /// </summary>
        /// <param name="line">A line from a .psc beatmap that defines an event.</param>
        public Event(string line)
        {
            Queue <string> parts = new Queue <string>(line.Split(','));

            Time = int.Parse(parts.Dequeue());
            Type = (EventType)int.Parse(parts.Dequeue());
            Parameters.AddRange(parts);
        }
Esempio n. 19
0
        public DisqusThreadListRequest Author(params int[] authors)
        {
            var parameters = authors.Select(author => new KeyValuePair <string, string>("author", author.ToString()));

            Parameters.AddRange(parameters);

            return(this);
        }
        public DisqusWhitelistAddRequest Email(params string[] emails)
        {
            var parameters = emails.Select(email => new KeyValuePair <string, string>("email", email));

            Parameters.AddRange(parameters);

            return(this);
        }
        /// <summary>
        ///     Looks up a thread by ID
        /// </summary>
        /// <param name="forums"></param>
        /// <returns></returns>
        public DisqusPostListPopularRequest Forum(params string[] forums)
        {
            var parameters = forums.Select(forum => new KeyValuePair <string, string>("forum", forum));

            Parameters.AddRange(parameters);

            return(this);
        }
        public DisqusWhitelistAddRequest User(params string[] usernames)
        {
            var parameters = usernames.Select(username => new KeyValuePair <string, string>("user:username", username));

            Parameters.AddRange(parameters);

            return(this);
        }
        /// <summary>
        ///     Looks up a thread by link
        /// </summary>
        /// <param name="threadLinks"></param>
        /// <returns></returns>
        public DisqusPostListPopularRequest Thread(params string[] threadLinks)
        {
            var parameters = threadLinks.Select(thread => new KeyValuePair <string, string>("thread:link", thread));

            Parameters.AddRange(parameters);

            return(this);
        }
Esempio n. 24
0
        public DisqusBlacklistRemoveRequest Domain(params string[] domains)
        {
            var parameters = domains.Select(domain => new KeyValuePair <string, string>("domain", domain));

            Parameters.AddRange(parameters);

            return(this);
        }
Esempio n. 25
0
 public void BuildQuery(Parameters parameters)
 {
     foreach (var query in queriesChain)
     {
         query.BuildQuery(parameters);
     }
     parameters.AddRange(additionalProperties);
 }
        /// <summary>
        ///     Looks up a thread by ID
        /// </summary>
        /// <param name="threads"></param>
        /// <returns></returns>
        public DisqusPostListPopularRequest Thread(params int[] threads)
        {
            var parameters = threads.Select(thread => new KeyValuePair <string, string>("thread", thread.ToString()));

            Parameters.AddRange(parameters);

            return(this);
        }
Esempio n. 27
0
        public DisqusBlacklistRemoveRequest Word(params string[] words)
        {
            var parameters = words.Select(word => new KeyValuePair <string, string>("word", word));

            Parameters.AddRange(parameters);

            return(this);
        }
Esempio n. 28
0
        public UMLMethod(string name, UMLDataType type, UMLVisibility visibility, params UMLParameter[] parameters)
        {
            Name       = name;
            ReturnType = type;

            Parameters.AddRange(parameters);
            Visibility = visibility;
        }
Esempio n. 29
0
        public JoinQuery Where <T1, T2, T3>(Expression <Func <T1, T2, T3, bool> > where) where T1 : class, new() where T2 : class, new() where T3 : class, new()
        {
            SqlVisitor visitor = new SqlVisitor(DbContext.DataBase.DBType, callIndex++, WithAlias);

            visitor.Translate(where);
            WhereClause.AppendFormat("{0} AND ", visitor.SqlBuilder.ToString());;
            Parameters.AddRange(visitor.Parameters);
            return(this);
        }
        /// <summary>
        /// To reset current settings of statistics.
        /// </summary>
        public void Reset()
        {
            Parameters.Clear();

            if (StatisticManager != null)
            {
                Parameters.AddRange(StatisticManager.Parameters);
            }
        }
Esempio n. 31
0
        /// <summary>
        /// Parses the specified args.
        /// </summary>
        /// <param name="args">The args.</param>
        /// <param name="switches">The switches.</param>
        /// <returns></returns>
        public Parameters Parse(IEnumerable<string> args, IEnumerable<string> switches = null)
        {
            var parameters = new Parameters();

            parameters.AddRange(args);

            if (switches != null)
            {
                parameters.Switches.Clear();

                foreach (var @switch in switches)
                {
                    if (string.IsNullOrWhiteSpace(@switch)) continue;

                    parameters.Switches.Add(@switch);
                }
            }

            return parameters;
        }