Beispiel #1
0
        internal void MapParameters(SQLiteStatement activeStatement)
        {
            int i;
            int num;

            if (!this._unboundFlag || this._parameterList.Count == 0 || this._command._statementList == null)
            {
                return;
            }
            int num1 = 0;
            int num2 = -1;

            foreach (SQLiteParameter sQLiteParameter in this._parameterList)
            {
                num2++;
                string parameterName = sQLiteParameter.ParameterName;
                if (parameterName == null)
                {
                    CultureInfo invariantCulture = CultureInfo.InvariantCulture;
                    object[]    objArray         = new object[] { num1 };
                    parameterName = HelperMethods.StringFormat(invariantCulture, ";{0}", objArray);
                    num1++;
                }
                bool flag = false;
                num = (activeStatement != null ? 1 : this._command._statementList.Count);
                SQLiteStatement item = activeStatement;
                for (i = 0; i < num; i++)
                {
                    flag = false;
                    if (item == null)
                    {
                        item = this._command._statementList[i];
                    }
                    if (item._paramNames != null && item.MapParameter(parameterName, sQLiteParameter))
                    {
                        flag = true;
                    }
                    item = null;
                }
                if (flag)
                {
                    continue;
                }
                CultureInfo cultureInfo = CultureInfo.InvariantCulture;
                object[]    objArray1   = new object[] { num2 };
                parameterName = HelperMethods.StringFormat(cultureInfo, ";{0}", objArray1);
                item          = activeStatement;
                for (i = 0; i < num; i++)
                {
                    if (item == null)
                    {
                        item = this._command._statementList[i];
                    }
                    if (item._paramNames != null && item.MapParameter(parameterName, sQLiteParameter))
                    {
                        flag = true;
                    }
                    item = null;
                }
            }
            if (activeStatement == null)
            {
                this._unboundFlag = false;
            }
        }